From ecf68d582580c2582ad7b2fe1c03b8b529abc788 Mon Sep 17 00:00:00 2001 From: "Milton D. Miller II" Date: Mon, 29 Feb 2016 23:11:27 -0600 Subject: 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 --- .../obmc-phosphor-initfs/files/obmc-update.sh | 19 ++++++++++++++++--- 1 file 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 060073b58f..dff23d50d7 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/ -- cgit v1.2.3