diff options
author | Milton Miller <miltonm@us.ibm.com> | 2016-05-23 17:41:34 -0500 |
---|---|---|
committer | Milton Miller <miltonm@us.ibm.com> | 2016-06-30 14:46:43 -0500 |
commit | 694e44e047a6272f75d29171c9be847b0fbce659 (patch) | |
tree | 2d09247d24fb36f263a19a3308a1184e60fe6ea7 | |
parent | 6343f09de92af8211d4152ca283104cb0a8f204c (diff) | |
download | talos-openbmc-694e44e047a6272f75d29171c9be847b0fbce659.tar.gz talos-openbmc-694e44e047a6272f75d29171c9be847b0fbce659.zip |
initfs: update: add option to perform checks but skip actual update
Provide a way to check if update is likely to succeed without
attempting actual updates.
This will check the image names correspond to mtd partition names,
and will be enhanced with additional checking for file size and
individual partition mounts.
This is not called --dry-run because it will still do file save
and restore if those are enabled.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
-rwxr-xr-x | meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh | 31 |
1 files changed, 19 insertions, 12 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 e51dbf879..9f5bede43 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 @@ -61,6 +61,7 @@ upper=$rwdir/cow save=/run/save/${upper##*/} mounted= +doflash=y doclean= dosave=y dorestore=y @@ -90,6 +91,9 @@ do --restore-files) dorestore=y shift ;; + --no-flash) + doflash= + shift ;; --copy-files) toram=y shift ;; @@ -135,18 +139,21 @@ do fi done -for f in $image* -do - if test ! -s $f - then - echo "Skipping empty update of ${f#$image}." - rm $f - continue - fi - m=$(findmtd ${f#$image}) - echo "Updating ${f#$image}..." - flashcp -v $f /dev/$m && rm $f -done +if test -n "$doflash" +then + for f in $image* + do + if test ! -s $f + then + echo "Skipping empty update of ${f#$image}." + rm $f + continue + fi + m=$(findmtd ${f#$image}) + echo "Updating ${f#$image}..." + flashcp -v $f /dev/$m && rm $f + done +fi if test -d $save -a "x$toram" = xy then |