diff options
author | Suzuki K. Poulose <suzuki@in.ibm.com> | 2013-09-24 10:52:54 +0530 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-09-25 16:01:38 +0900 |
commit | d8b0fa06634e7dd4402d994a820775f6c9243143 (patch) | |
tree | d180f893eb4753dd35e001f92195cb6e51473b88 | |
parent | 7b332edcf6f2fcaeb3edefb994731a3f527b51cf (diff) |
kexec/ppc: Add nodes for initrd in dtb
If the primary kernel doesn't use an initrd,
we may not have linux,initrd-* entries in the
device-tree, and hence the initial flat tree
may not contain them.
Make sure we add the entries in the dtb if the
second kernel needs an initrd.
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
Signed-off-by: Athira Rajeev<atrajeev@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc/fs2dt.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c index a49f85e..4121c7d 100644 --- a/kexec/arch/ppc/fs2dt.c +++ b/kexec/arch/ppc/fs2dt.c @@ -342,8 +342,17 @@ static void putnode(void) putprops(dn, namelist, numlist); - /* Add initrd entries to the second kernel */ - if (initrd_base && !strcmp(basename, "chosen/")) { + /* + * Add initrd entries to the second kernel + * if + * a) a ramdisk is specified in cmdline + * OR + * b) reuseinitrd is specified and a initrd is + * used by the kernel. + * + */ + if ((ramdisk || (initrd_base && reuse_initrd)) + && !strcmp(basename, "chosen/")) { int len = 8; unsigned long long initrd_end; *dt++ = 3; @@ -362,8 +371,9 @@ static void putnode(void) memcpy(dt, &initrd_end, len); dt += (len + 3)/4; - - reserve(initrd_base, initrd_size); + /* reserve the existing initrd image in case of reuse_initrd */ + if (initrd_base && initrd_size && reuse_initrd) + reserve(initrd_base, initrd_size); } for (i = 0; i < numlist; i++) { |