]> xenbits.xensource.com Git - seabios.git/commitdiff
boot: Support "halt" in the boot order to prevent default boot attempts.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 12 Jan 2013 21:36:11 +0000 (16:36 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 12 Jan 2013 21:36:11 +0000 (16:36 -0500)
Current seabios will attempt to boot from both configured devices and
a list of default devices.  Sometimes it is desirable to only attempt
to boot from the configured devices and not from any of the default
devices.  This patch adds support for a "HALT" item in the "bootorder"
file - its presence will prevent SeaBIOS from attempting any default
boot actions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Amos Kong <akong@redhat.com>
src/boot.c

index c67cc7f36311e3ba0cb3738eed2c6b9cc27d317b..56843e3584a79c567bfeb4274c1a6cb0bbe4b2c1 100644 (file)
@@ -291,6 +291,7 @@ static struct bootentry_s *BootList;
 #define IPL_TYPE_CBFS        0x20
 #define IPL_TYPE_BEV         0x80
 #define IPL_TYPE_BCV         0x81
+#define IPL_TYPE_HALT        0xf0
 
 static void
 bootentry_add(int type, int prio, u32 data, const char *desc)
@@ -488,6 +489,10 @@ boot_prep(void)
     interactive_bootmenu();
     wait_threads();
 
+    int haltprio = find_prio("HALT");
+    if (haltprio >= 0)
+        bootentry_add(IPL_TYPE_HALT, haltprio, 0, "HALT");
+
     // Map drives and populate BEV list
     struct bootentry_s *pos = BootList;
     while (pos) {
@@ -672,6 +677,9 @@ do_boot(int seq_nr)
     case IPL_TYPE_BEV:
         boot_rom(ie->vector);
         break;
+    case IPL_TYPE_HALT:
+        boot_fail();
+        break;
     }
 
     // Boot failed: invoke the boot recovery function