aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-10-20 20:40:20 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:13:55 +0000
commitd5279c49c881a9a8991fda67a70cd49756ac3a92 (patch)
tree9610087515efe9fe51722ad17ee0db7b1adc9d44
parent3fd05ce1f709cbbd8fdeb1dbfdffbd39922eca6e (diff)
downloadopenembedded-core-contrib-d5279c49c881a9a8991fda67a70cd49756ac3a92.tar.gz
busybox: Fix mdev block device automounting
The directory ${MDEV_AUTOMOUNT_ROOT}/ which is '/run/media' may not exist yet when the device is found, so lets use -p switch to mkdir cmd so it create preceding parent dirs if needed. Remove some bash specific constructs Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-core/busybox/files/mdev-mount.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/recipes-core/busybox/files/mdev-mount.sh b/meta/recipes-core/busybox/files/mdev-mount.sh
index d5d66d66fb..b4385a157f 100644
--- a/meta/recipes-core/busybox/files/mdev-mount.sh
+++ b/meta/recipes-core/busybox/files/mdev-mount.sh
@@ -15,7 +15,7 @@ case "$ACTION" in
exit 0
fi
DEVBASE=`expr substr $MDEV 1 3`
- if [ "${DEVBASE}" == "mmc" ] ; then
+ if [ "${DEVBASE}" = "mmc" ] ; then
DEVBASE=`expr substr $MDEV 1 7`
fi
# check for "please don't mount it" file
@@ -24,7 +24,7 @@ case "$ACTION" in
exit 0
fi
# check for full-disk partition
- if [ "${DEVBASE}" == "${MDEV}" ] ; then
+ if [ "${DEVBASE}" = "${MDEV}" ] ; then
if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then
# Partition detected, just quit
exit 0
@@ -33,7 +33,7 @@ case "$ACTION" in
# No size at all
exit 0
fi
- if [ `cat /sys/block/${DEVBASE}/size` == 0 ] ; then
+ if [ "`cat /sys/block/${DEVBASE}/size`" = "0" ] ; then
# empty device, bail out
exit 0
fi
@@ -42,7 +42,7 @@ case "$ACTION" in
if ! mount /dev/$MDEV > /dev/null 2>&1
then
MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
- mkdir "$MOUNTPOINT"
+ mkdir -p "$MOUNTPOINT"
mount -t auto /dev/$MDEV "$MOUNTPOINT"
fi
;;