summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton D. Miller II <miltonm@us.ibm.com>2016-02-28 16:53:53 -0600
committerMilton D. Miller II <miltonm@us.ibm.com>2016-03-04 10:51:48 -0600
commit5d187bfa2a79fbf217e5145b7345adc6fe9351eb (patch)
tree4f8f2d7ab3fe102228d2b475392d42ac9fa56912
parentec10f89d2fd6504b5ccbd98ef44b420b2a5f8cc1 (diff)
downloadtalos-openbmc-5d187bfa2a79fbf217e5145b7345adc6fe9351eb.tar.gz
talos-openbmc-5d187bfa2a79fbf217e5145b7345adc6fe9351eb.zip
update: Skip calling flashcp for empty files
Note explicitly when an empty image is provided that will not alter a flash partition. While using flashcp on an empty file succeeds and does not alter the flash, it may be confusing to see 0/0 messages for the erase, write, and verify phases. These empty files are used to trigger the save and restore phases and may also be used by developers to cause the update to fail and break into a shell at shutdown for maintence. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
-rwxr-xr-xmeta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh6
1 files changed, 6 insertions, 0 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 edaf195b2..aa8fd8934 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
@@ -136,6 +136,12 @@ 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
OpenPOWER on IntegriCloud