|
| 1 | +# ffmuc-leds-off |
| 2 | + |
| 3 | +This package lets node operators turn off **all LEDs** during normal operation, |
| 4 | +for nodes deployed in dark environments or where the LEDs would expose the |
| 5 | +device to onlookers. |
| 6 | + |
| 7 | +Errors and warnings remain visible because their existing LED behaviour is |
| 8 | +untouched: |
| 9 | + |
| 10 | +- **Setup / config mode** — the device still blinks its status LED so users |
| 11 | + can find a misconfigured node. |
| 12 | +- **Sysupgrade in progress** — the OpenWrt diagnostic LED pattern fires |
| 13 | + normally, so users see the upgrade is running and won't power-off the |
| 14 | + device mid-flash. |
| 15 | +- **Boot in progress (preinit)** — LEDs run their normal patterns until the |
| 16 | + device finishes booting. Only after `set_state done` (S95) does this package |
| 17 | + darken them (S99). |
| 18 | + |
| 19 | +## Configuration |
| 20 | + |
| 21 | +The package is **disabled by default** after install. To darken the LEDs on |
| 22 | +a node: |
| 23 | + |
| 24 | +```sh |
| 25 | +uci set leds-off.settings.enabled='1' |
| 26 | +uci commit leds-off |
| 27 | +gluon-reconfigure # registers the S99 init.d service |
| 28 | +/etc/init.d/leds-off restart # apply immediately (or reboot) |
| 29 | +``` |
| 30 | + |
| 31 | +To restore default LED behaviour: |
| 32 | + |
| 33 | +```sh |
| 34 | +uci set leds-off.settings.enabled='0' |
| 35 | +uci commit leds-off |
| 36 | +gluon-reconfigure # unregisters the S99 init.d service |
| 37 | +/etc/init.d/leds-off stop # best-effort restore now (or reboot) |
| 38 | +``` |
| 39 | + |
| 40 | +A reboot is the safest way to restore LEDs whose default triggers come from |
| 41 | +kernel device tree (DTS) and aren't tracked in `/etc/config/system`. |
| 42 | + |
| 43 | +## How it works |
| 44 | + |
| 45 | +When `enabled='1'`, an init script at `/etc/init.d/leds-off` (START=99, |
| 46 | +i.e. *after* OpenWrt's `set_state done` at S95) iterates every entry under |
| 47 | +`/sys/class/leds/` and sets: |
| 48 | + |
| 49 | +- `trigger` → `none` |
| 50 | +- `brightness` → `0` |
| 51 | + |
| 52 | +This affects only software-controllable LEDs. LEDs wired directly to PHY |
| 53 | +chips (some RJ45 link/activity indicators) cannot be turned off in software |
| 54 | +and are unaffected by this package. |
| 55 | + |
| 56 | +If the device is in setup mode (`gluon-setup-mode.@setup_mode[0].configured` |
| 57 | +is not `1`), the darkening step is skipped so the setup-mode blink pattern |
| 58 | +remains visible. In practice, setup mode runs a different init path |
| 59 | +(`/lib/gluon/setup-mode/init.d/`) entirely, so the standard `/etc/init.d/leds-off` |
| 60 | +wouldn't fire there anyway — the check is defence-in-depth. |
0 commit comments