Nerves uses the Raspberry Pi’s bootloader. It’s closed source, so I haven’t found one definitive place to go for all of its features. Here are some references:
- Raspberry Pi Documentation - The config.txt file - This has all of the main options, but it won’t help with this
-
firmware: raspberrypi: Add support for tryonce reboot flag · raspberrypi/linux@7576667 · GitHub - Part of the
tryboot
feature implementation and some docs - rpi-eeprom/release-notes.md at master · raspberrypi/rpi-eeprom · GitHub - Docs for the Raspberry Pi 4 bootloader. It’s not the Raspberry Pi Zero, but is use it to find keywords to search for.
There are two other ways to support automatically failing back on the Raspberry Pi. They have issues which is one of the reasons why they’re not in Nerves. They might be ok for you:
- Include U-Boot. It’s possible to have the Raspberry Pi’s bootloader load U-Boot and then have U-Boot load Linux, etc. just like boards running U-Boot. We decided against this option just because it felt like too many pieces and would be hard for us to support.
- Use an initramfs that has the logic to automatically fail back. I made an attempt at this at GitHub - nerves-project/nerves_initramfs: An initramfs for early boot handling of Nerves devices (Work in progress!). A while back, @jjcarstens made a branch of the Nerves Raspberry Pi systems that used it. It “works”, but has a couple disadvantages. First, it’s not possible to revert if the Linux kernel or initramfs are messed up. Since these are updated on every software update, this strategy has a serious flaw even though it probably would handle 90+% of the failed updates that I encounter. The other problem is that the initramfs program got too complicated and I no longer feel good about it being reliable. This could be fixed, but once I learned about
tryboot
, I felt like investigating that would be a better use of time.