diff options
author | Milton D. Miller II <miltonm@us.ibm.com> | 2016-03-01 08:11:27 +0300 |
---|---|---|
committer | Milton D. Miller II <miltonm@us.ibm.com> | 2016-03-04 19:50:12 +0300 |
commit | ecf68d582580c2582ad7b2fe1c03b8b529abc788 (patch) | |
tree | 346b1093db948a07c51099f8ff2924c020cc6f75 | |
parent | d0b0c6abafa250d5afb5a8df217bd3bd312b16f7 (diff) | |
download | openbmc-ecf68d582580c2582ad7b2fe1c03b8b529abc788.tar.xz |
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-x | meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh | 19 |
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 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/ |