In questing, I’m intending to change the way we boot the Raspberry Pi rather substantially. Specifically, we’ll be moving to a system that will “test” new boot assets and automatically fall back to a “known good” configuration in the event the test fails.
I won’t go through all the gory details in this post (if you want those, please see the blog post here), this is simply a call for testing. If you have a supported model of Raspberry Pi, and a spare SD card, please consider trying out the new mechanism. Flash one of the questing dailies to your SD card:
Once booted (and configured, if you’re using the desktop daily), add my flash-kernel
PPA and install the new flash-kernel-piboot
package:
sudo add-apt-repository ppa:waveform/flash-kernel
sudo apt install flash-kernel-piboot
This will upgrade flash-kernel
as well and, in the process, will migrate the content of the boot partition (mounted under /boot/firmware
) to the new layout. The currently booted “known good” boot assets will be placed under /boot/firmware/current
, untested new boot assets go in /boot/firmware/new
, and older known good boot assets live under /boot/firmware/old
.
The old/
directory is implicitly removed to make space when new/
assets are written (by flash-kernel
). When untested new/
assets are present, the next boot (whether warm reboot or cold boot) will be a “double boot”. The second boot places the Pi in “tryboot” mode where the new/
assets are booted. If this succeeds, the new piboot-try-validate
service will shuffle the directories around (current/
becomes old/
, new/
becomes current/
). If the boot fails, the next boot will implicitly use the “known good” assets under current/
and those under new/
will be marked “bad” (until they’re overwritten by the next run of flash-kernel
).
Questions
If you have any questions about the new system, please feel free to ask them here (or read the associated blog post, if the size of the scroll bar doesn’t put you off!)
Bugs
If you find any issues, please file a bug against flash-kernel
and tag it raspi-image
to bring it to my attention.
By the way: be brutal! This is meant to save you from bad boot setups after all. My one caveat here: if you do break it, I want to know precisely what you did! Keep notes, and try and keep the SD card in the broken state so I can ask you questions about it to try and figure out what went wrong.
Known issues
None yet.
I have an inkling this may cause (more) issues for “flaky” SD cards: the process does involve writing to the SD card, then immediately rebooting in the expectation those writes will be preserved.
Anecdotally: I did try this out on a (supposed) SanDisk card in my possession which I know to be flaky, and it worked happily on two occasions, but on another the boot partition wound up horribly corrupted half-way between the pre-migration and migrated state (this despite being after a reboot of the migrated state – in other words it appeared to lose a whole load of supposedly committed writes). However, I’m not considering that a bug: if your card is flaky and this breaks it, the solution is (and always has been) “buy a better card”.