[PATCH openbmc 25/32] init: Add option to copy base read-only filesystem into RAM
OpenBMC Patches
openbmc-patches at stwcx.xyz
Sat Mar 5 23:30:16 AEDT 2016
From: "Milton D. Miller II" <miltonm at us.ibm.com>
If copy-base-filesystem-to-ram is found copy the read-only
filesystem source device to /run/image-rofs. If the copy fails
then remove the partial copy and invoke debug takeover.
This will allow a new image to be downloaded and flashed while
running from the existing copy for the duration of this boot.
Alternatively with the overlay also in RAM pflash could be used
to update the flash from the host as the BMC would no longer need
the flash or flash controller.
Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
.../recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
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 2e8467c..82cc77e 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
@@ -169,6 +169,18 @@ then
rwfst=none
fi
+if grep -w copy-base-filesystem-to-ram $optfile &&
+ test ! -e /run/image-rofs && ! cp $rodev /run/image-rofs
+then
+ # Remove any partial copy to avoid attempted usage later
+ if test -e /run/image-rofs
+ then
+ ls -l /run/image-rofs
+ rm -f /run/image-rofs
+ fi
+ debug_takeover "Copying $rodev to /run/image-rofs failed."
+fi
+
if test -s /run/image-rofs
then
rodev=/run/image-rofs
--
2.7.1
More information about the openbmc
mailing list