mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 17:12:54 +03:00
[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>
This commit is contained in:
committed by
Michael Brown
parent
246624cdb8
commit
053d28688c
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user