summaryrefslogtreecommitdiffstats
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:39:27 +0000
commit13ce7c2ae102b394942a751308027d0ab5e84b40 (patch)
tree3a6f7d1e2b8145a89574ec3b769611e7b3b6592f
parentb09f0f2665745b756cb93092501ffe9094918163 (diff)
downloadpoky-13ce7c2ae102b394942a751308027d0ab5e84b40.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 (From OE-Core rev: d5279c49c881a9a8991fda67a70cd49756ac3a92) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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
15 exit 0 15 exit 0
16 fi 16 fi
17 DEVBASE=`expr substr $MDEV 1 3` 17 DEVBASE=`expr substr $MDEV 1 3`
18 if [ "${DEVBASE}" == "mmc" ] ; then 18 if [ "${DEVBASE}" = "mmc" ] ; then
19 DEVBASE=`expr substr $MDEV 1 7` 19 DEVBASE=`expr substr $MDEV 1 7`
20 fi 20 fi
21 # check for "please don't mount it" file 21 # check for "please don't mount it" file
@@ -24,7 +24,7 @@ case "$ACTION" in
24 exit 0 24 exit 0
25 fi 25 fi
26 # check for full-disk partition 26 # check for full-disk partition
27 if [ "${DEVBASE}" == "${MDEV}" ] ; then 27 if [ "${DEVBASE}" = "${MDEV}" ] ; then
28 if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then 28 if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then
29 # Partition detected, just quit 29 # Partition detected, just quit
30 exit 0 30 exit 0
@@ -33,7 +33,7 @@ case "$ACTION" in
33 # No size at all 33 # No size at all
34 exit 0 34 exit 0
35 fi 35 fi
36 if [ `cat /sys/block/${DEVBASE}/size` == 0 ] ; then 36 if [ "`cat /sys/block/${DEVBASE}/size`" = "0" ] ; then
37 # empty device, bail out 37 # empty device, bail out
38 exit 0 38 exit 0
39 fi 39 fi
@@ -42,7 +42,7 @@ case "$ACTION" in
42 if ! mount /dev/$MDEV > /dev/null 2>&1 42 if ! mount /dev/$MDEV > /dev/null 2>&1
43 then 43 then
44 MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV" 44 MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
45 mkdir "$MOUNTPOINT" 45 mkdir -p "$MOUNTPOINT"
46 mount -t auto /dev/$MDEV "$MOUNTPOINT" 46 mount -t auto /dev/$MDEV "$MOUNTPOINT"
47 fi 47 fi
48 ;; 48 ;;