When createing fdt from /proc/device-tree, if there's local --command-line option provided but there's no root= specified, kexec-tools will copy the root= param from 1st kernel cmdline by default. In case one want kexec boot without root= it will be impossible. Thus add the new option so that one can provide --dt-no-old-root for above mentioned case. Reported-by: Jan Stodola Signed-off-by: Dave Young --- kexec/arch/ppc64/include/arch/options.h | 4 +++- kexec/arch/ppc64/kexec-ppc64.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) --- kexec-tools.orig/kexec/arch/ppc64/include/arch/options.h +++ kexec-tools/kexec/arch/ppc64/include/arch/options.h @@ -2,7 +2,8 @@ #define KEXEC_ARCH_PPC64_OPTIONS_H #define OPT_ELF64_CORE (OPT_MAX+0) -#define OPT_ARCH_MAX (OPT_MAX+1) +#define OPT_DT_NO_OLD_ROOT (OPT_MAX+1) +#define OPT_ARCH_MAX (OPT_MAX+2) /* All 'local' loader options: */ #define OPT_APPEND (OPT_ARCH_MAX+0) @@ -14,6 +15,7 @@ #define KEXEC_ARCH_OPTIONS \ KEXEC_OPTIONS \ { "elf64-core-headers", 0, 0, OPT_ELF64_CORE }, \ + { "dt-no-old-root", 0, 0, OPT_DT_NO_OLD_ROOT }, \ #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" --- kexec-tools.orig/kexec/arch/ppc64/kexec-ppc64.c +++ kexec-tools/kexec/arch/ppc64/kexec-ppc64.c @@ -869,6 +869,8 @@ int file_types = sizeof(file_type) / siz void arch_usage(void) { fprintf(stderr, " --elf64-core-headers Prepare core headers in ELF64 format\n"); + fprintf(stderr, " --dt-no-old-root Do not reuse old kernel root= param.\n" \ + " while creating flatten device tree.\n"); } struct arch_options_t arch_options = { @@ -895,6 +897,9 @@ int arch_process_options(int argc, char case OPT_ELF64_CORE: arch_options.core_header_type = CORE_TYPE_ELF64; break; + case OPT_DT_NO_OLD_ROOT: + dt_no_old_root = 1; + break; } } /* Reset getopt for the next pass; called in other source modules */