Explorar el Código

mkefidisk.sh: fix hanging on non-writeable device

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.

(From OE-Core master rev: cf4a18eec2a65d840352d1a2862242d116e8a409)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Eggleton hace 9 años
padre
commit
f8b8fbeee3
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      scripts/contrib/mkefidisk.sh

+ 3 - 0
scripts/contrib/mkefidisk.sh

@@ -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"