]> code.ossystems Code Review - openembedded-core.git/commitdiff
udev-extraconf: Don't mount root filesystem under /media
authorAndy Ross <andy.ross@windriver.com>
Tue, 18 Sep 2012 21:38:45 +0000 (14:38 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 27 Oct 2012 08:46:57 +0000 (09:46 +0100)
The mount.sh handler attempts to prevent already-mounted filesystems
from being mounted as dynamic/removable "/media".  But it misses the
case where the kernel has mounted the root filesystem (e.g. with
"root=/dev/sda1").  In that situation, /proc/mounts has a device name
of "/dev/root" instead of the proper $DEVNAME string exposed by udev.
So we must also test the root filesystem device number vs. the
$MAJOR/$MINOR udev tells us.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/udev/udev-extraconf/mount.sh
meta/recipes-core/udev/udev-extraconf_1.0.bb

index 2eb9affcc804fe7d04cb8ad3b3c5bdd271ec8ae5..99c76b25307421f09b44d254f09fc3ba10584840 100644 (file)
@@ -49,8 +49,12 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
                $MOUNT $DEVNAME 2> /dev/null
        fi
        
-       # If the device isn't mounted at this point, it isn't configured in fstab
-       grep -q "^$DEVNAME " /proc/mounts || automount
+       # If the device isn't mounted at this point, it isn't
+       # configured in fstab (note the root filesystem can show up as
+       # /dev/root in /proc/mounts, so check the device number too)
+       if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
+               grep -q "^$DEVNAME " /proc/mounts || automount
+       fi
 fi
 
 
index 9995899f9e737dbbf0a8c58698e4d80bf2537a0d..2c4a4f1976c431c21baf7c8087421c5ed4b68a51 100644 (file)
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
 
 inherit allarch
 
-PR = "r6"
+PR = "r7"
 
 SRC_URI = " \
        file://automount.rules \