Join GitHub today
Add a maximum-attention hook to help with debugging boot issues #1238
Hmm it doesn't seem to work with the notification led on my hammerhead, but that led has a slightly more complicated sysfs interface. To turn that one do:
cat max_brightness > brightness echo 100 0 > on_off_ms # You have to write a different value to rgb_start for every change echo 1 > rgb_start
You can also make the kernel blink the led instead of the script by setting on_off_ms to the blinking times
echo 2000 2000 > on_off_ms
I guess you can just check if the current led has a rgb_start file to do this procedure before entering the blinking loop.
For reference my ssh session:
Thanks a lot for your review, @MartijnBraam. THere are a few things there (hence why I called it a first approach):
I didn't really understand the purpose of
The backlight goes to full brightness and then turns of, that is probably a sideeffect of some fbdev code in the kernel but the led does get controlled once.
Also the rgb led is slightly weird but the
I think this hook should support as many leds as possible since it is for debugging booting issues.
Tested and here are the results:
So for me it's a good feedback
Code looks good to me! I think it's good that you loop forever when the hook is enabled.
@MayeulC: should we merge this as initial version, or would you like to add support for more exotic devices first? In my opinion it makes sense to support as many devices as possible, but in the current version it is useful already (chances are high that either the LEDs will blink or the vibrator will work).
Thanks for making this, and thanks for the extensive testing everyone! \o/
@ollieparanoid, I fixed the formatting issue (thanks for noticing! I have C-style formatting hardcoded in my fingers).
I think this should get merged, I will (maybe with some others) think about a way to add more device in a way that's as generic as possible, but will probably be busy for a few days.