the onboard leds reset their function to default upon a reboot

Hi !
I have been using dietpi on orange pi zero for about 8 months now. Just yesterday, I installed a fresh image of armbian and then changed over to dietpi. I selected the green LED for showing CPU status and red one for MMC0 status which works fine. But as soon as I perform a reboot, both LEDs go to their default state. Is there a known workaround??

For the time being, I added these lines to the postboot script. Works well.

echo "cpu" | sudo tee /sys/class/leds/orangepi:green:pwr/trigger
echo "mmc0" | sudo tee /sys/class/leds/orangepi:red:status/trigger

Hi,

many thanks for sharing your solution. Unfortunately I’m not able to test/investigate as I don’t have such a board at hand :wink:

Many thanks for your report. LED triggers should be applied via udev rules on early boot once those are recognised. Can you please do the following after a reboot with LEDs back to default:

cat /etc/udev/rules.d/dietpi-led_control.rules
cat /sys/class/leds/led{0,1}/trigger
udevadm trigger -c add /sys/class/leds/led0
udevadm trigger -c add /sys/class/leds/led1
cat /sys/class/leds/led{0,1}/trigger

A fix will implemented with coming DietPi version v6.31

https://github.com/MichaIng/DietPi/issues/3636#issuecomment-652509568