The dtb and initrd restriction is now applied only when performing a
kdump.

Signed-off-by: Shivang Upadhyay <[email protected]>
---
 kexec/arch/ppc64/kexec-elf-ppc64.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c 
b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 2084356..288ca41 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -566,15 +566,16 @@ int elf_ppc64_load(int argc, char **argv, const char 
*buf, off_t len,
        elf_rel_build_load(info, &info->rhdr, purgatory,
                                purgatory_size, 0, max_addr, 1, 0);
 
+       if (ramdisk && devicetreeblob && (info->kexec_flags & KEXEC_ON_CRASH)) {
+               fprintf(stderr,
+               "Can't use ramdisk with device tree blob input in kdump\n");
+               return -1;
+       }
+
        /* Add a ram-disk to the current image
         * Note: Add the ramdisk after elf_rel_build_load
         */
        if (ramdisk) {
-               if (devicetreeblob) {
-                       fprintf(stderr,
-                       "Can't use ramdisk with device tree blob input\n");
-                       return -1;
-               }
                seg_buf = slurp_file(ramdisk, &seg_size);
                hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
                        0, 0, max_addr, 1);
-- 
2.51.0


Reply via email to