Commit 16a21ae
committed
fix(armbian-leds): don't persist brightness for any active trigger
armbian-led-state-save.sh wrote brightness for every LED with a
writable brightness file. For LEDs whose trigger is active (e.g.
disk-activity, heartbeat, phy0tpt, eth0:link, mmc0, cpu, timer,
pattern, usb-*, nand-disk) brightness is the trigger's
instantaneous output (a momentary blink-state captured at
shutdown), not configuration. Persisting it produced ghost-LED
bugs on restore (cable-up while unplugged, rtw88 wifi flapping
0/1) and constant noise in /etc/armbian-leds.conf on every
shutdown — visible to anyone with etckeeper / etc-diff alerts.
Fix: strip brightness whenever trigger != none. The previous
workaround stripped only \`*:link\` triggers (commit 2960ffa)
and is now subsumed. trigger=none preserves brightness as before
(it is genuine config there).
Token-safe filter (whole-word match, not substring): the original
substitution \${PARAMS//brightness/} would corrupt sibling files
like \`max_brightness\` -> \`max_\`, breaking the read loop under
set -e. Bash-only loop because store_led() reassigns PATH to the
sysfs led path, so external commands wouldn't be found here.
Forum thread: https://forum.armbian.com/topic/57284-
Restore-script's brightness=0 skip guard becomes redundant for
active triggers but harmless.
Assisted-by: Claude:claude-opus-4.71 parent 3ceb3be commit 16a21ae
1 file changed
Lines changed: 23 additions & 4 deletions
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
| |||
0 commit comments