[ipxe-devel] [PATCH] introduce 'skip-san-boot' option

Dave Hansen dave at sr71.net
Thu Oct 21 22:03:42 UTC 2010


I've had a problem with some Windows SAN installs.  The Windows
installer needs for ipxe to boot, register the SAN device, then
fall back to the CD-ROM (or USB drive) to start the install.

If you start with a completely blank SAN disk, this works fine.
The sanboot fails.  But, with some devices, Windows can't update
its partition table during the install.  It writes it, then
does a reboot so it can re-read it.  That's where the problem
starts.

I evidently have a dumb BIOS, or something.  After Windows writes
just about any old gunk to the partition table, my BIOS tries to
boot it.  So, instead of sanboot failing (like it should), it
boots the disk and freezes instead of reloading the installer.

The only way I've seen around this is to hack the san booting out
of ipxe.  This provides a mechanism for me to actually perform
the installs without hacking my copy of ipxe every time.
---
 src/usr/autoboot.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 0421dc4..a31cb04 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -118,6 +118,12 @@ struct setting keep_san_setting __setting = {
 	.type = &setting_type_int8,
 };
 
+struct setting skip_san_boot_setting __setting = {
+	.name = "skip-san-boot",
+	.description = "Do not boot the SAN drive after connecting",
+	.type = &setting_type_int8,
+};
+
 /**
  * Boot using root path
  *
@@ -153,10 +159,14 @@ int boot_root_path ( const char *root_path ) {
 		goto err_describe;
 	}
 
-	printf ( "Booting from SAN device %#02x\n", drive );
-	rc = san_boot ( drive );
-	printf ( "Boot from SAN device %#02x failed: %s\n",
-		 drive, strerror ( rc ) );
+	if ( fetch_intz_setting ( NULL, &skip_san_boot_setting) != 0 ) {
+		printf ( "Skipping boot of SAN devices\n");
+	} else {
+		printf ( "Booting from SAN device %#02x\n", drive );
+		rc = san_boot ( drive );
+		printf ( "Boot from SAN device %#02x failed: %s\n",
+			 drive, strerror ( rc ) );
+	}
 
 	/* Leave drive registered, if instructed to do so */
 	if ( fetch_intz_setting ( NULL, &keep_san_setting ) != 0 ) {
-- 
1.7.1.rc2




More information about the ipxe-devel mailing list