diff options
author | Dave Young <dyoung@redhat.com> | 2014-05-30 11:24:52 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2014-05-30 14:24:49 +0900 |
commit | 0c41d96cbed0ae895fd7da425f755a8684558e1c (patch) | |
tree | eeb323e45a49fc398d88e104ebb35b7be9d9d1d2 | |
parent | 3c9c3b1c4688178f328f3924eed96c308e0e611c (diff) | |
download | kexec-tools-0c41d96cbed0ae895fd7da425f755a8684558e1c.tar.gz |
kdump: pass acpi_rsdp to 2nd kernel if kernel does not export efi runtime maps
If kernel does not export efi runtime maps it means 1:1 mapping does not
work or user explictly boot with efi=old_map. In this case efi setup code
will failback to noefi boot, but for kdump case we still need pass extra
acpi_rsdp cmdline.
Thus adding a check in kdump path.
Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/i386/crashdump-x86.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 8ef0c8b..77bdad5 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -34,6 +34,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include <dirent.h> #include "../../kexec.h" #include "../../kexec-elf.h" #include "../../kexec-syscall.h" @@ -780,6 +781,18 @@ static enum coretype get_core_type(struct crash_elf_info *elf_info, } } +static int sysfs_efi_runtime_map_exist(void) +{ + DIR *dir; + + dir = opendir("/sys/firmware/efi/runtime-map"); + if (!dir) + return 0; + + closedir(dir); + return 1; +} + /* Appends 'acpi_rsdp=' commandline for efi boot crash dump */ static void cmdline_add_efi(char *cmdline) { @@ -974,7 +987,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, dbgprintf("Created elf header segment at 0x%lx\n", elfcorehdr); if (delete_memmap(memmap_p, &nr_memmap, elfcorehdr, memsz) < 0) return -1; - if (!bzImage_support_efi_boot || arch_options.noefi) + if (!bzImage_support_efi_boot || arch_options.noefi || + !sysfs_efi_runtime_map_exist()) cmdline_add_efi(mod_cmdline); cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr); |