booting kernel(s)

Peter Korsgaard jacmet at
Wed Feb 23 04:56:50 EST 2011

>>>>> "Baruch" == Baruch Siach <baruch at> writes:

 Baruch> A partial solution is to use initramfs (see the kernel
 Baruch> Documentation/filesystems/ramfs-rootfs-initramfs.txt). You can
 Baruch> mount your rootfs from the /init script of the initramfs. Then,
 Baruch> if mount fails because of a corrupt rootfs, you can mount your
 Baruch> rescue rootfs instead, or just run whatever rescue application
 Baruch> you want directly from initramfs.

This only works if mount does a complete rootfs check, which isn't the
case. In the typical situation of a power loss in the middle of an
update, the superblock will normally be valid and you will only discover
the corruption when you start accessing files.

 Baruch> Another partial solution is a to use a hardware watchdog, and a
 Baruch> userspace watchdog ping process. Then, upon boot you may check
 Baruch> whether this is a normal power-on reset or a watchdog reset,
 Baruch> and load the appropriate kernel.

That's imho a better solution, and pretty simply to implement without
any adverse affects on the startup time, whereas the CRC checks do add
to the startup time.

Bye, Peter Korsgaard

More information about the barebox mailing list