diff options
author | Matthew McClintock <msm@freescale.com> | 2010-08-18 23:56:51 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-08-20 17:26:46 +0900 |
commit | 3f2012bd7947ec327dc942ab91f115388630cc36 (patch) | |
tree | 7a2b773ca98f0b00b18945f4ed95d9c8b0011f75 | |
parent | 5265793bd259c0fe0522df88eb6f20139188887a (diff) |
Prevent initrd-start and initrd-end from appearing multiple times
We always remove the old entry, and add it back if it is needed
on for the kexec'ed kernel
Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc/fixup_dtb.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kexec/arch/ppc/fixup_dtb.c b/kexec/arch/ppc/fixup_dtb.c index 910a3f0..205fd77 100644 --- a/kexec/arch/ppc/fixup_dtb.c +++ b/kexec/arch/ppc/fixup_dtb.c @@ -160,7 +160,7 @@ static void fixup_reserve_regions(struct kexec_info *info, char *blob_buf, off_t goto out; } } - } else { + } else if (ramdisk || reuse_initrd) { /* Otherwise we just add back the ramdisk and the device tree * is already in the list */ ret = fdt_add_mem_rsv(blob_buf, ramdisk_base, ramdisk_size); @@ -300,13 +300,16 @@ static void fixup_initrd(char *blob_buf) nodeoffset = fdt_path_offset(blob_buf, "/chosen"); - if ((reuse_initrd || ramdisk) && - ((ramdisk_base != 0) && (ramdisk_size != 0))) { - if (nodeoffset < 0) { - printf("fdt_initrd: %s\n", fdt_strerror(nodeoffset)); - return; - } + if (nodeoffset < 0) { + printf("fdt_initrd: %s\n", fdt_strerror(nodeoffset)); + return; + } + + fdt_delprop(blob_buf, nodeoffset, "linux,initrd-start"); + fdt_delprop(blob_buf, nodeoffset, "linux,initrd-end"); + if ((reuse_initrd || ramdisk) && + ((ramdisk_base != 0) && (ramdisk_size != 0))) { tmp = ramdisk_base; err = fdt_setprop(blob_buf, nodeoffset, "linux,initrd-start", &tmp, sizeof(tmp)); @@ -325,9 +328,6 @@ static void fixup_initrd(char *blob_buf) fdt_strerror(err)); return; } - } else { - fdt_delprop(blob_buf, nodeoffset, "linux,initrd-start"); - fdt_delprop(blob_buf, nodeoffset, "linux,initrd-end"); } } |