[oe-commits] [openembedded-core] 05/29: busybox/mdev-mount.sh: Fix partition detect and cleanup mountpoint on fail

git at git.openembedded.org git at git.openembedded.org
Thu Sep 27 11:18:10 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch sumo
in repository openembedded-core.

commit 38f1648f1472f70a3e747f270cc3230b5993d94b
Author: Mike Looijmans <mike.looijmans at topic.nl>
AuthorDate: Fri Aug 24 09:21:44 2018 +0200

    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)
    
    Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/recipes-core/busybox/files/mdev-mount.sh | 4 ++--
 1 file 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 b4385a1..130e947 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
 		fi
 		# check for full-disk partition
 		if [ "${DEVBASE}" = "${MDEV}" ] ; then
-			if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then
+			if [ -f /sys/block/${DEVBASE}/${DEVBASE}*1/partition ] ; then
 				# Partition detected, just quit
 				exit 0
 			fi
@@ -43,7 +43,7 @@ case "$ACTION" in
 		then
 			MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
 			mkdir -p "$MOUNTPOINT"
-			mount -t auto /dev/$MDEV "$MOUNTPOINT"
+			mount -t auto /dev/$MDEV "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
 		fi
 		;;
 	remove)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list