]> code.ossystems Code Review - openembedded-core.git/commitdiff
mkefidisk.sh: fix hanging on non-writeable device
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 21 Apr 2015 13:01:55 +0000 (14:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Apr 2015 14:16:28 +0000 (15:16 +0100)
If cleanup() is called early on, as happens when the device isn't
writeable, then none of the mount point variables are set; thus the
script was calling grep with only one argument and appeared to hang
since it was waiting for input on stdin.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/mkefidisk.sh

index 74cf40d551cfae7f208eb7882bf93a481ea1fe09..d6bc965137f507b4d45b4456520642c89416db73 100755 (executable)
@@ -136,6 +136,9 @@ unmount_device() {
 }
 
 unmount() {
+       if [ "$1" = "" ] ; then
+               return 0
+       fi
        grep -q $1 /proc/mounts
        if [ $? -eq 0 ]; then
                debug "Unmounting $1"