update: Add option to copy files to runtime cow directory
Add an option to copy files to the runtime copy-on-write upper
directory from the saved directory to allow init to request the
files for use without knowing the saved files directory.
This will be used to initialize the cow directory from the
persistent rwfs file system when choosing to run in RAM.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
diff --git a/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index 6f26550..6b0d7a0 100755
--- a/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -63,6 +63,7 @@
doclean=
dosave=y
dorestore=y
+toram=
whitelist=/run/initramfs/whitelist
image=/run/initramfs/image-
@@ -88,6 +89,9 @@
--restore-files)
dorestore=y
shift ;;
+ --copy-files)
+ toram=y
+ shift ;;
*)
echo 2>&1 "Unknown option $1"
exit 1 ;;
@@ -138,6 +142,12 @@
flashcp -v $f /dev/$m
done
+if test "x$toram" = xy
+then
+ mkdir -p $upper
+ cp -rp $save/. $upper/
+fi
+
if test -d $save -a "x$dorestore" = xy
then
odir=$rwdir