summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
diff options
context:
space:
mode:
authorMichael Brown2017-04-12 16:03:25 +0200
committerMichael Brown2017-04-12 16:58:05 +0200
commit84d406ccf48c8808b0bb30d526b758e4b58cacc8 (patch)
treee0d262d87136fcaf8f202ab7d6e51760a387fe78 /src/hci/commands
parent[efi] Add efi_sprintf() and efi_vsprintf() (diff)
downloadipxe-84d406ccf48c8808b0bb30d526b758e4b58cacc8.tar.gz
ipxe-84d406ccf48c8808b0bb30d526b758e4b58cacc8.tar.xz
ipxe-84d406ccf48c8808b0bb30d526b758e4b58cacc8.zip
[block] Allow use of a non-default EFI SAN boot filename
Some older operating systems (e.g. RHEL6) use a non-default filename on the root disk and rely on setting an EFI variable to point to the bootloader. This does not work when performing a SAN boot on a machine where the EFI variable is not present. Fix by allowing a non-default filename to be specified via the "sanboot --filename" option or the "san-filename" setting. For example: sanboot --filename \efi\redhat\grub.efi \ iscsi:192.168.0.1::::iqn.2010-04.org.ipxe.demo:rhel6 or option ipxe.san-filename code 188 = string; option ipxe.san-filename "\\efi\\redhat\\grub.efi"; option root-path "iscsi:192.168.0.1::::iqn.2010-04.org.ipxe.demo:rhel6"; Originally-implemented-by: Vishvananda Ishaya Abrams <vish.ishaya@oracle.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/commands')
-rw-r--r--src/hci/commands/sanboot_cmd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/hci/commands/sanboot_cmd.c b/src/hci/commands/sanboot_cmd.c
index 9965ec15..3907276a 100644
--- a/src/hci/commands/sanboot_cmd.c
+++ b/src/hci/commands/sanboot_cmd.c
@@ -47,12 +47,14 @@ struct sanboot_options {
int no_describe;
/** Keep SAN device */
int keep;
+ /** Filename */
+ char *filename;
};
/** "sanboot" option list */
static union {
- /* "sanboot" takes all three options */
- struct option_descriptor sanboot[3];
+ /* "sanboot" takes all four options */
+ struct option_descriptor sanboot[4];
/* "sanhook" takes only --drive and --no-describe */
struct option_descriptor sanhook[2];
/* "sanunhook" takes only --drive */
@@ -65,6 +67,8 @@ static union {
struct sanboot_options, no_describe, parse_flag ),
OPTION_DESC ( "keep", 'k', no_argument,
struct sanboot_options, keep, parse_flag ),
+ OPTION_DESC ( "filename", 'f', required_argument,
+ struct sanboot_options, filename, parse_string ),
},
};
@@ -130,7 +134,8 @@ static int sanboot_core_exec ( int argc, char **argv,
flags |= no_root_path_flags;
/* Boot from root path */
- if ( ( rc = uriboot ( NULL, uris, count, opts.drive, flags ) ) != 0 )
+ if ( ( rc = uriboot ( NULL, uris, count, opts.drive, opts.filename,
+ flags ) ) != 0 )
goto err_uriboot;
err_uriboot: