booting kernel(s)

Baruch Siach baruch at
Wed Feb 23 04:16:52 EST 2011

Hi Sascha, Vanalme,

On Wed, Feb 23, 2011 at 10:03:10AM +0100, Sascha Hauer wrote:
> On Tue, Feb 22, 2011 at 02:15:46PM +0100, Vanalme Filip wrote:
> > I guess, when
> > the first bootm command fails (due to corrupt image), it will execute
> > the second one. If the first command is successful, the Linux kernel
> > takes over and the second command gets never executed. Am I right ?  I
> > think I can do the same thing in my Barebox's boot script, can I ? Or
> > are there other/better solutions to handle this ?
> This fails when the first kernel has a valid checksum but fails to start
> maybe because of a corrupt rootfs. But there are currently no general
> solutions for this.

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

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


                                                     ~. .~   Tk Open Systems
   - baruch at - tel: +972.2.679.5364, -

More information about the barebox mailing list