Thorsten von Eicken
2004-Oct-07 20:55 UTC
[syslinux] fail-safe boot - how can this be done?
I'm installing syslinux on an embedded board that will only be reachable via boat+hike or helicopter. This will be a somewhat experimental platform, so I can't make a read-only filesystem on CF. What I'd like is to have two root filesystems on a CF card, one that is a read-only "fail-safe", and a 2nd that is the "normal" system I experiment with. What I'm looking for is a fail-safe where anytime the system does not shut down cleanly the fail-safe boot is invoked. Is there support for this in syslinux? One scheme that would work is to list the fail-safe system as default in syslinux.cfg, and the normal one with a label. A file on the boot partition (say 'syslinux.ptr') would contain the name of the kernel to invoke and would be deleted by syslinux just before invoking the kernel. The 'normal' kernel would create this file with contents 'normal' during the shutdown procedure. The net effect is that anytime syslinux boots it will invoke the default kernel unless the normal kernel shut down cleanly, or someone created the file manually. (All this would be augmented with a hardware watchdog that resets the board if the system locks up.) Thanks for any suggestions, Thorsten - Santa Barbara Amateur Radio Club
On Thu, 2004-10-07 at 13:55, Thorsten von Eicken wrote:> I'm installing syslinux on an embedded board that will only be reachable via boat+hike or helicopter. This will be a somewhat experimental platform, so I can't make a read-only filesystem on CF. What I'd like is to have two root filesystems on a CF card, one that is a read-only "fail-safe", and a 2nd that is the "normal" system I experiment with. What I'm looking for is a fail-safe where anytime the system does not shut down cleanly the fail-safe boot is invoked. Is there support for this in syslinux? > > One scheme that would work is to list the fail-safe system as default in syslinux.cfg, and the normal one with a label. A file on the boot partition (say 'syslinux.ptr') would contain the name of the kernel to invoke and would be deleted by syslinux just before invoking the kernel. The 'normal' kernel would create this file with contents 'normal' during the shutdown procedure. The net effect is that anytime syslinux boots it will invoke the default kernel unless the normal kernel shut down cleanly, or someone created the file manually. (All this would be augmented with a hardware watchdog that resets the board if the system locks up.) > > Thanks for any suggestions, > Thorsten - Santa Barbara Amateur Radio ClubDon't know about syslinux support for this. But Lilo supports an option (-R) to specify what image to boot on the next reboot. So you boot up with your 'production' kernel and run 'lilo -R fail-safe'. Now if your machine reboots uncleanly it will come up with the 'fail-safe' kernel. In the shutdown sequence you could add another line 'lilo -R production'. So if the machine shuts down cleanly, it will come up with the 'production' kernel. HTH. ciao, A --
ganapathy murali krishnan
2004-Oct-07 22:33 UTC
[syslinux] fail-safe boot - how can this be done?
I had a similar problem, which I solved as follows: Make the default kernel a "COMBOOT image". The comboot image, looks around and decides which kernel to boot, and calls SYSLINUX with the right argument. If the COMBOOT image does not find anything, it boots a user specified kernel (either fail-safe or the normal kernel). In my case, I was working with read only media (CD), so I would write this auxillary information to an unused sector of the hard disk. This approach has worked for me, but your mileage may vary. In any case, this "autoboot" COMBOOT image and its partner "writeker" linux utility (which writes to the hard disk) are both available at http://gui.mahamurali.net (will redirect to the longer address). Hope this helps. - Murali Thorsten von Eicken wrote:>I'm installing syslinux on an embedded board that will only be reachable via boat+hike or helicopter. This will be a somewhat experimental platform, so I can't make a read-only filesystem on CF. What I'd like is to have two root filesystems on a CF card, one that is a read-only "fail-safe", and a 2nd that is the "normal" system I experiment with. What I'm looking for is a fail-safe where anytime the system does not shut down cleanly the fail-safe boot is invoked. Is there support for this in syslinux? > >One scheme that would work is to list the fail-safe system as default in syslinux.cfg, and the normal one with a label. A file on the boot partition (say 'syslinux.ptr') would contain the name of the kernel to invoke and would be deleted by syslinux just before invoking the kernel. The 'normal' kernel would create this file with contents 'normal' during the shutdown procedure. The net effect is that anytime syslinux boots it will invoke the default kernel unless the normal kernel shut down cleanly, or someone created the file manually. (All this would be augmented with a hardware watchdog that resets the board if the system locks up.) > >Thanks for any suggestions, > Thorsten - Santa Barbara Amateur Radio Club > >_______________________________________________ >SYSLINUX mailing list >Submissions to SYSLINUX at zytor.com >Unsubscribe or set options at: >http://www.zytor.com/mailman/listinfo/syslinux >Please do not send private replies to mailing list traffic. > > > >
Thorsten von Eicken
2004-Oct-07 23:19 UTC
[syslinux] fail-safe boot - how can this be done?
Thanks for the suggestion! Dunno whether syslinux supports something like this, gotta check. The only problem is that if the boot fails before the 'production' kernel can do the 'lilo -R fail-safe' I'm stuck. So, for example, if I update the kernel itself and it doesn't boot I'm dead. Thorsten At 02:13 PM 10/7/2004 -0700, you wrote:>Don't know about syslinux support for this. But Lilo supports an option >(-R) to specify what image to boot on the next reboot. > >So you boot up with your 'production' kernel and run 'lilo -R >fail-safe'. Now if your machine reboots uncleanly it will come up with >the 'fail-safe' kernel. > >In the shutdown sequence you could add another line 'lilo -R >production'. So if the machine shuts down cleanly, it will come up with >the 'production' kernel. > >HTH. > >ciao, >A >--