aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/init.d/led
Commit message (Collapse)AuthorAgeFilesLines
* base-files: disable LEDs if default state is undefinedDavid Bauer2020-09-111-1/+1
| | | | | | | | | | | | | | | Set the default state for LEDs to off. When a trigger is set, the trigger will turn the LED automatically on. Currently LEDs might stay on, e.g. when the LED trigger is set to a netdev trigger and the interface is never activated or the 'none' trigger is selected without setting the 'default' option to 0 and it's set for the LED indicating the system running state. Using off as a default value is also consistent with the documentation in the OpenWrt wiki. Signed-off-by: David Bauer <mail@david-bauer.net>
* base-files: Fix netdev led triggerHauke Mehrtens2018-12-161-1/+4
| | | | | | | | | | In the upstream netdev led trigger the one mode file was replaced by 3 files named rx, tx and link. Fix the netdev trigger configuration code to use the modified API. Fixes: aa3b6a08c56 ("kernel: Replace ledtrig-netdev with upstream backport") Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* base-files: make it possible to specify switch led modeChristian Lamparter2018-09-291-2/+4
| | | | | | | | | | | | | | | | | The swconfig switch led driver has the ability to switch between a "link, rx and/or tx" mode. However, this feature was not implemented in uci, the led init script and config_generate. This patch adds a seventh parameter to the ucidef_set_led_switch() function. The accepted values for this parameter are: link, rx and tx. Any permutations of these three values are supported, as long as they are properly encased with quotes. If the parameter is not specified it will default to "all" (link rx tx). Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* base-files: add interval option to netdev LED trigger configurationEdmunt Pienkowsky2017-11-031-0/+1
| | | | | | Add an uci option to set the interval parameter of the netdev trigger. Signed-off-by: Edmunt Pienkowsky <roed@onet.eu>
* base-files: add ucidef_set_led_usbport for full usbport supportRafał Miłecki2016-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | This helper allows using usbport trigger directly. It requires usbport compatible syntax and supports specifying multiple USB ports, e.g.: ucidef_set_led_usbport "usb" "USB" "devicename:colour:function" "usb1-port1" "usb2-port1" This adds a proper object to the board.json, e.g. "usb": { "name": "USB", "type": "usbport", "sysfs": "devicename:colour:function", "ports": [ "usb1-port1", "usb2-port1" ] } and supports translating it into uci section. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* switch to the new usbport LED triggerRafał Miłecki2016-10-191-5/+16
| | | | | | | This makes init.d script handle existing UCI entries using the new trigger. It also switches all targets to use its package. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: support oneshot leds properly.Karl Palsson2016-09-051-1/+1
| | | | | | | | | | oneshot trigger configurations for LEDs are created, but the on/off timing configurations are ignored. generate_config is correctly creating oneshot configs, but the later led script doesn't recognise the trigger details. Fixes: c0c3f2d4c917 leds: support oneshot as well as timer triggers Signed-off-by: Karl Palsson <karlp@etactica.com>
* kernel: remove unused morse led trigger driverFelix Fietkau2016-08-041-5/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: maintain LED config stateJo-Philipp Wich2016-06-081-5/+17
| | | | | | | | Record the state of any hardware LED configured through UCI and use that information to revert the state when applying updated settings while maintaining default behaviour of system LEDs. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: reset LED stateJo-Philipp Wich2016-06-071-0/+6
| | | | | | | | Attempt to reset all LED states before applying the UCI configuration to avoid leaving disabled LEDs behind in lingering glowing state, e.g. when changing the sysfs entry in the config from one hardware LED to another. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: add support for speed mask to switch config init scriptsFelix Fietkau2016-02-251-1/+4
| | | | | | | | | | | This patch adds extra parameter to switch LED trigger initialization functions. New functionality maintains backward compatibility, so calling functions without setting new speed_mask parameter works as expected. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> SVN-Revision: 48776
* base-files: use max_brightness to set LEDJohn Crispin2015-12-111-1/+1
| | | | | | | | | | LEDs which are controlled by a PWM need to use the supplied max_brightness instead. Otherwise they might appear to be very dim / broken. Signed-off-by: Chris R Blake <chrisrblake93@gmail.com> SVN-Revision: 47854
* base-files: added option to configure the gpio led trigger in uci-defaultsJohn Crispin2015-07-141-0/+7
| | | | | | Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de> SVN-Revision: 46341
* base-files: fix logic error in led default handling (patch from #19593)Felix Fietkau2015-05-031-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45600
* base-files: reorder led trigger/brightness writesFelix Fietkau2015-04-161-7/+10
| | | | | | | | | Depending on configuration, disable the LED before writing the trigger and enable it after writing it. Fixes LEDs where the value defaults to 1 Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45463
* base-files: fix led script to skip missing triggersJohn Crispin2015-01-231-1/+5
| | | | | | | | this is based on http://patchwork.ozlabs.org/patch/424451/ Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 44087
* base-files: update copyright headersLuka Perkov2014-06-241-1/+1
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 41334
* base-files: add support for the morse LED triggerGabor Juhos2012-11-251-0/+7
| | | | | | | | | | | | Write "delay" and "message" options to their respective files, allowing Morse code message configuration through UCI. The delay (dit length) defaults to 150ms (about 8 words per minute, suitable for beginners). Signed-off-by: Petr Viktorin <encukou@gmail.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34380
* base-files: skip LEDs handled by rssileds in led init-scriptFlorian Fainelli2012-10-111-0/+5
| | | | | | | | | | | | | | | Without this, /etc/init.d/led will try to set the non-existing 'rssi' trigger. This doesn't harm as the kernel will refuse this setting, but it outputs some ugly log-lines: Jun 24 10:15:19 OpenWrt user.info sysinit: setting up led RSSILOW Jun 24 10:15:19 OpenWrt user.info sysinit: sh: write error: Invalid argument ... In order to avoid this, skip LEDs with trigger = "rssi" in /etc/init.d/led Signed-off-by: Daniel Golle <dgolle@allnet.de> SVN-Revision: 33717
* package/base-files: add support for the switch LED triggerGabor Juhos2011-12-311-0/+8
| | | | SVN-Revision: 29629
* package/base-files: use case statement in led init scriptGabor Juhos2011-12-311-15/+27
| | | | SVN-Revision: 29628
* base-files: support port_state in led config (#6763)Florian Fainelli2011-01-271-0/+4
| | | | | | Signed-off-by: Alexey Torkhov <atorkhov@gmail.com> SVN-Revision: 25172
* base-files: add support for the usbdev LED triggerGabor Juhos2010-12-171-4/+10
| | | | SVN-Revision: 24647
* run led init after /etc/init.d/done to keep the configured led settings ↵Felix Fietkau2010-01-061-1/+1
| | | | | | active after the system has finished booting Signed-off-by: Nuno Goncalves <nunojpg@gmail.com> SVN-Revision: 19050
* base-files: port init.d/led to new config_getFelix Fietkau2009-08-071-8/+6
| | | | | | | | ... and don't call logger directly, rcS takes care of the correct redirection Signed-off-by: Malte S. Stretz <mss@apache.org> SVN-Revision: 17158
* make option name optionalTravis Kemen2008-09-131-2/+2
| | | | SVN-Revision: 12585
* fixes broken if-then in led init scriptJohn Crispin2008-08-271-2/+3
| | | | SVN-Revision: 12411
* remove /etc/functions.sh call from led hotplug scriptJohn Crispin2008-08-141-2/+0
| | | | SVN-Revision: 12312
* added support for the timer-trigger to uci LED supportSteven Barth2008-08-071-0/+8
| | | | SVN-Revision: 12236
* add uci led support - /etc/config/system can hold led info which is applied ↵John Crispin2008-08-041-0/+45
at boot - adds /sbin/led.sh to set/clear leds via a name defined in /etc/config/system SVN-Revision: 12104