summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorMike Looijmans <mike.looijmans@topic.nl>2018-08-24 09:21:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-27 12:17:45 +0100
commit6af1b257ed52582aa5d455e9f23f966d6e219068 (patch)
tree6f433689ea765e95cbcc27792734b40543ff6033 /meta/recipes-core
parent7da5ae79272eb34dfb0b1a9f4730ac0c96b518a2 (diff)
downloadpoky-6af1b257ed52582aa5d455e9f23f966d6e219068.tar.gz
busybox/mdev-mount.sh: Fix partition detect and cleanup mountpoint on fail
This fixes issues mainly seen when mounting eMMC devices: The wildcard /sys/block/${DEVBASE}/${DEVBASE}*1 matches both "mmcblk0p1" and "mmcblk0boot1" for example, and this results in syntax errors. Fix this by searching for a "partition" file instead, which only exists for real partitions and not 'fakes' like the eMMC extra's. When mount fails, the mountpoint file is left behind, causing later attempts at auto-mounting it to fail. If mount fails, remove the mountpoint, leaving the system in the state as it was before the mount attempt. (From OE-Core rev: 8645c0419456c1bd3ae15a9a7dd2b2e9a960eaf4) (From OE-Core rev: 38f1648f1472f70a3e747f270cc3230b5993d94b) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/busybox/files/mdev-mount.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-core/busybox/files/mdev-mount.sh b/meta/recipes-core/busybox/files/mdev-mount.sh
index b4385a157f..130e9472f3 100644
--- a/meta/recipes-core/busybox/files/mdev-mount.sh
+++ b/meta/recipes-core/busybox/files/mdev-mount.sh
@@ -25,7 +25,7 @@ case "$ACTION" in
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 [ -f /sys/block/${DEVBASE}/${DEVBASE}*1/partition ] ; then
29 # Partition detected, just quit 29 # Partition detected, just quit
30 exit 0 30 exit 0
31 fi 31 fi
@@ -43,7 +43,7 @@ case "$ACTION" in
43 then 43 then
44 MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV" 44 MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
45 mkdir -p "$MOUNTPOINT" 45 mkdir -p "$MOUNTPOINT"
46 mount -t auto /dev/$MDEV "$MOUNTPOINT" 46 mount -t auto /dev/$MDEV "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
47 fi 47 fi
48 ;; 48 ;;
49 remove) 49 remove)