summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton D. Miller II <miltonm@us.ibm.com>2016-02-29 23:11:27 -0600
committerMilton D. Miller II <miltonm@us.ibm.com>2016-03-04 10:50:12 -0600
commitecf68d582580c2582ad7b2fe1c03b8b529abc788 (patch)
tree346b1093db948a07c51099f8ff2924c020cc6f75
parentd0b0c6abafa250d5afb5a8df217bd3bd312b16f7 (diff)
downloadtalos-openbmc-ecf68d582580c2582ad7b2fe1c03b8b529abc788.tar.gz
talos-openbmc-ecf68d582580c2582ad7b2fe1c03b8b529abc788.zip
update: Add options to skip the save and restore phases
Allow the save and/or restore of whitelisted files to be suppressed. This reduces the noise and possible problems trying to mount the read-write filesystem read-write when its dirty. The filesystem may be cleaned or repaired between the backup and restore. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
-rwxr-xr-xmeta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index 060073b58..dff23d50d 100755
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -60,6 +60,8 @@ upper=$rwdir/cow
save=save/${upper##*/}
doclean=
+dosave=y
+dorestore=y
while test "$1" != "${1#-}"
do
@@ -70,15 +72,26 @@ do
--clean-saved-files)
doclean=y
shift ;;
+ --no-save-files)
+ dosave=
+ shift ;;
+ --save-files)
+ dosave=y
+ shift ;;
+ --no-restore-files)
+ dorestore=
+ shift ;;
+ --restore-files)
+ dorestore=y
+ shift ;;
*)
echo 2>&1 "Unknown option $1"
exit 1 ;;
esac
done
-if test -n "$rwfs" && test -s whitelist
+if test "x$dosave" = xy -a -n "$rwfs" -a -s whitelist
then
-
mkdir -p $rwdir
mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rorwopts
@@ -115,7 +128,7 @@ do
flashcp -v $f /dev/$m
done
-if test -d $save
+if test -d $save -a "x$dorestore" = xy
then
mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rwopts
cp -rp $save/. $upper/
OpenPOWER on IntegriCloud