[PATCH openbmc 23/32] init: Always move images from root
OpenBMC Patches
openbmc-patches at stwcx.xyz
Sat Mar 5 23:30:14 AEDT 2016
From: "Milton D. Miller II" <miltonm at us.ibm.com>
If images are to be updated before init continue to move them
to /run/initramfs. However, if they are not to be flashed before
init instead move them to /run.
This will result in the image-rofs being loop mounted for this run,
and all images will be available at runtime for flash update at
runtime.
Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
.../obmc-phosphor-initfs/files/obmc-init.sh | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
index 89e4538..7953176 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -115,13 +115,18 @@ then
debug_takeover "Debug initial shell requested by command line."
fi
-# If there are images in root move them to run/initramfs/ now.
+# If there are images in root move them to /run/initramfs/ or /run/ now.
imagebasename=${image##*/}
-if test -n "${imagebasename}" -a "x$flash_images_before_init" = xy &&
- ls /${imagebasename}* > /dev/null 2>&1
+if test -n "${imagebasename}" && ls /${imagebasename}* > /dev/null 2>&1
then
- echo "Pending flash updates found."
- mv /${imagebasename}* ${image%$imagebasename}
+ if test "x$flash_images_before_init" = xy
+ then
+ echo "Flash images found, will update before starting init."
+ mv /${imagebasename}* ${image%$imagebasename}
+ else
+ echo "Flash images found, will use but deferring flash update."
+ mv /${imagebasename}* /run/
+ fi
fi
if grep -w clean-rwfs-filesystem $optfile
--
2.7.1
More information about the openbmc
mailing list