[SeaBIOS] [coreboot] seabios feature request : reboot VM or retry boot devices when no valid boot disk is found
Gleb Natapov
gleb at redhat.com
Sun May 13 12:02:10 CEST 2012
On Sat, May 12, 2012 at 10:01:49AM -0400, Kevin O'Connor wrote:
> On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
> > Kevin O'Connor wrote:
> > > +// Unable to find bootable device - warn user and eventually retry.
> > > +static void
> > > +boot_fail(void)
> > > +{
> > > + printf("No bootable device.\n");
> > > + // Wait for 60 seconds and then reboot.
> > > + u32 end = calc_future_timer(60*1000);
> >
> > I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n");
> > and lowering the timeout.
>
> I'd only do this if the timeout was large - indeed I think 60 seconds
> is a little on the low side. (Not being able to boot is almost always
> an error - it should be fixed not covered up.)
>
Agree. For VM use it's better to notify management about it.
> That said, making it a config option is trivial.
>
The patch below does not allow to disable the behaviour (short of setting
ridiculously long timeout). Lets make 0 timeout to mean never timeout
and make it a default.
> -Kevin
>
>
> diff --git a/src/boot.c b/src/boot.c
> index 8cc94b0..b5b3360 100644
> --- a/src/boot.c
> +++ b/src/boot.c
> @@ -617,6 +617,26 @@ boot_rom(u32 vector)
> call_boot_entry(so, 0);
> }
>
> +// Unable to find bootable device - warn user and eventually retry.
> +static void
> +boot_fail(void)
> +{
> + u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000);
> + printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000);
> + // Wait for 'retrytime' milliseconds and then reboot.
> + u32 end = calc_future_timer(retrytime);
> + for (;;) {
> + if (check_timer(end))
> + break;
> + wait_irq();
> + }
> + printf("Rebooting.\n");
> + struct bregs br;
> + memset(&br, 0, sizeof(br));
> + br.code = SEGOFF(SEG_BIOS, (u32)reset_vector);
> + call16big(&br);
> +}
> +
> // Determine next boot method and attempt a boot using it.
> static void
> do_boot(u16 seq_nr)
> @@ -625,10 +645,7 @@ do_boot(u16 seq_nr)
> panic("Boot support not compiled in.\n");
>
> if (seq_nr >= BEVCount) {
> - printf("No bootable device.\n");
> - // Loop with irqs enabled - this allows ctrl+alt+delete to work.
> - for (;;)
> - wait_irq();
> + boot_fail();
> }
>
> // Boot the given BEV type.
>
> _______________________________________________
> SeaBIOS mailing list
> SeaBIOS at seabios.org
> http://www.seabios.org/mailman/listinfo/seabios
--
Gleb.
More information about the SeaBIOS
mailing list