summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton D. Miller II <miltonm@us.ibm.com>2016-02-27 17:31:39 -0600
committerMilton D. Miller II <miltonm@us.ibm.com>2016-03-07 15:20:02 -0600
commit9ecec17136be5662cf92046ece5c235e370eb57e (patch)
tree4941e1eb5bad31b80a2374564f611a540b04c99c
parent5d772b03fa5d6db36fe08eac65bab82ea6c35200 (diff)
downloadtalos-openbmc-9ecec17136be5662cf92046ece5c235e370eb57e.tar.gz
talos-openbmc-9ecec17136be5662cf92046ece5c235e370eb57e.zip
init: Add option to copy base read-only filesystem into RAM
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@us.ibm.com>
-rw-r--r--meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh12
1 files changed, 12 insertions, 0 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 2e8467cfa..f6a6b7b61 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
OpenPOWER on IntegriCloud