diff options
author | Milton Miller <miltonm@us.ibm.com> | 2016-06-17 00:44:12 +0300 |
---|---|---|
committer | Milton Miller <miltonm@us.ibm.com> | 2016-06-30 22:46:44 +0300 |
commit | f1cad11499f331d7822ee48f104959111ed2757a (patch) | |
tree | b38de242747bc3f922635838140a723bd4109641 | |
parent | 61fba335a99b33f17c1c190043b7d5d980c59181 (diff) | |
download | openbmc-f1cad11499f331d7822ee48f104959111ed2757a.tar.xz |
initfs: update: handle no images to update
Notify the user if image wildcard expansion fails instead of printing
message about failing to find partition to flash.
The update script errors with the message that it can't figure out what
partition to flash for /run/initramfs/image-* if there are no images
pending.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
-rwxr-xr-x | meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh | 13 |
1 files changed, 11 insertions, 2 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 268c6ad0e7..97d4402ee8 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 @@ -102,6 +102,7 @@ checkmount=y whitelist=/run/initramfs/whitelist image=/run/initramfs/image- +imglist= while test "$1" != "${1#-}" do @@ -187,7 +188,15 @@ then fi fi -for f in $image* +imglist=$(echo $image*) +if test "$imglist" = "$image*" -a ! -e "$imglist" +then + # shell didn't expand the wildcard, so no files exist + echo "No images found to update." + imglist= +fi + +for f in $imglist do m=$(findmtd ${f#$image}) if test -z "$m" @@ -212,7 +221,7 @@ done if test -n "$doflash" then - for f in $image* + for f in $imglist do if test ! -s $f then |