aboutsummaryrefslogtreecommitdiff
path: root/src/usr/autoboot.c
diff options
context:
space:
mode:
authorDave Hansen <dave@sr71.net>2010-10-21 15:03:42 -0700
committerMichael Brown <mcb30@ipxe.org>2010-10-21 23:49:03 +0100
commit053d28688c3bd8f5c4948528a05b8d4a13d726cc (patch)
treec6fc640068cc7584bc5577649a8f45dde33821a7 /src/usr/autoboot.c
parent246624cdb8959a68730521d8a9a488e429c3a0db (diff)
downloadipxe-053d28688c3bd8f5c4948528a05b8d4a13d726cc.zip
ipxe-053d28688c3bd8f5c4948528a05b8d4a13d726cc.tar.gz
ipxe-053d28688c3bd8f5c4948528a05b8d4a13d726cc.tar.bz2
[autoboot] Introduce "skip-san-boot" option
For some install-to-SAN scenarios, the OS needs to be able to reboot to reread the partition table. On this second boot attempt, the SAN disk will not be empty and so iPXE will attempt to boot from it, rather than falling back to the OS' installation media. Work around this problem by introducing the "skip-san-boot" option, similar in spirit to "keep-san". Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/autoboot.c')
-rw-r--r--src/usr/autoboot.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 3d44116..4e8db60 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -136,6 +136,14 @@ struct setting keep_san_setting __setting = {
.type = &setting_type_int8,
};
+/** The "skip-san-boot" setting */
+struct setting skip_san_boot_setting __setting = {
+ .name = "skip-san-boot",
+ .description = "Do not boot the SAN drive after connecting",
+ .tag = DHCP_EB_SKIP_SAN_BOOT,
+ .type = &setting_type_int8,
+};
+
/**
* Boot using root path
*
@@ -171,10 +179,15 @@ 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 ) );
+ /* Boot from SAN device */
+ if ( fetch_intz_setting ( NULL, &skip_san_boot_setting) != 0 ) {
+ printf ( "Skipping boot from SAN device %#02x\n", drive );
+ } 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 ) {