diff options
-rw-r--r-- | docs/misc/efi.markdown | 7 | ||||
-rw-r--r-- | xen/arch/x86/efi/boot.c | 21 |
2 files changed, 27 insertions, 1 deletions
diff --git a/docs/misc/efi.markdown b/docs/misc/efi.markdown index d697bc23c8..19b987a848 100644 --- a/docs/misc/efi.markdown +++ b/docs/misc/efi.markdown @@ -75,6 +75,13 @@ Specifies an XSM module to load. Specifies a CPU microcode blob to load. +###`chain=<filename>` + +Specifies an alternate configuration file to use in case the specified section +(and in particular its `kernel=` setting) can't be found in the default (or +specified) configuration file. This is only meaningful in the [global] section +and really not meant to be used together with the `-cfg=` command line option. + Filenames must be specified relative to the location of the EFI binary. Extra options to be passed to Xen can also be specified on the command line, diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c index 7f725e0046..851057e563 100644 --- a/xen/arch/x86/efi/boot.c +++ b/xen/arch/x86/efi/boot.c @@ -809,7 +809,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) else section.s = get_value(&cfg, "global", "default"); - name.s = get_value(&cfg, section.s, "kernel"); + for ( ; ; ) + { + name.s = get_value(&cfg, section.s, "kernel"); + if ( name.s ) + break; + name.s = get_value(&cfg, "global", "chain"); + if ( !name.s ) + break; + efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size)); + cfg.addr = 0; + if ( !read_file(dir_handle, s2w(&name), &cfg) ) + { + PrintStr(L"Chained configuration file '"); + PrintStr(name.w); + efi_bs->FreePool(name.w); + blexit(L"'not found\r\n"); + } + pre_parse(&cfg); + efi_bs->FreePool(name.w); + } if ( !name.s ) blexit(L"No Dom0 kernel image specified\r\n"); split_value(name.s); |