diff --git a/src/include/ipxe/dhcp.h b/src/include/ipxe/dhcp.h index d07da378..aac79b29 100644 --- a/src/include/ipxe/dhcp.h +++ b/src/include/ipxe/dhcp.h @@ -293,11 +293,19 @@ struct dhcp_client_uuid { * * If set to a non-zero value, iPXE will not detach any SAN drive * after failing to boot from it. (This option is required in order - * to perform a Windows Server 2008 installation direct to an iSCSI - * target.) + * to perform an installation direct to an iSCSI target.) */ #define DHCP_EB_KEEP_SAN DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x08 ) +/** Skip booting from SAN drive + * + * If set to a non-zero value, iPXE will skip booting from any SAN + * drive. (This option is sometimes required in conjunction with @c + * DHCP_EB_KEEP_SAN in order to perform an installation direct to an + * iSCSI target.) + */ +#define DHCP_EB_SKIP_SAN_BOOT DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 0x09 ) + /* * Tags in the range 0x10-0x7f are reserved for feature markers * diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c index 3d441167..4e8db60e 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 ) {