Patchwork [2/8] mkefidisk.sh: Add mount error checking

login
register
mail settings
Submitter Darren Hart
Date July 16, 2014, 2:15 p.m.
Message ID <c2eb45f71b32d7e1e53eda60e6ca2ae0d857f28c.1405520111.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/75837/
State New
Headers show

Comments

Darren Hart - July 16, 2014, 2:15 p.m.
Provide reasonable feedabck if the mount commands fail.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 scripts/contrib/mkefidisk.sh | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 959307a..0d0674b 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -241,7 +241,11 @@  mkdir $ROOTFS_MNT
 mkdir $BOOTFS_MNT
 
 mount -o loop $HDDIMG $HDDIMG_MNT
+if [ $? -ne 0 ]; then echo "ERROR: Failed to mount $HDDIMG"; fi
+
 mount -o loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT
+if [ $? -ne 0 ]; then echo "ERROR: Failed to mount rootfs.img"; fi
+
 mount $ROOTFS $ROOTFS_MNT
 mount $BOOTFS $BOOTFS_MNT