summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
authorAndy Ross <andy.ross@windriver.com>2012-09-18 14:38:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-27 09:47:08 +0100
commite281bb3e35ca7ffabaa6742c126fd6f6079c000f (patch)
tree3a7b0827df24ebdd71db504b4a11e95d8726ef95 /meta/recipes-core/udev
parent2e24eb2cb733f6b96c51b99de4b3194d701dd4c5 (diff)
downloadpoky-e281bb3e35ca7ffabaa6742c126fd6f6079c000f.tar.gz
udev-extraconf: Don't mount root filesystem under /media
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. (From OE-Core rev: 3543d0db691e82098c1da7bf12f43e0c57551a3d) Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh8
-rw-r--r--meta/recipes-core/udev/udev-extraconf_1.0.bb2
2 files changed, 7 insertions, 3 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 2eb9affcc8..99c76b2530 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -49,8 +49,12 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
49 $MOUNT $DEVNAME 2> /dev/null 49 $MOUNT $DEVNAME 2> /dev/null
50 fi 50 fi
51 51
52 # If the device isn't mounted at this point, it isn't configured in fstab 52 # If the device isn't mounted at this point, it isn't
53 grep -q "^$DEVNAME " /proc/mounts || automount 53 # configured in fstab (note the root filesystem can show up as
54 # /dev/root in /proc/mounts, so check the device number too)
55 if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
56 grep -q "^$DEVNAME " /proc/mounts || automount
57 fi
54fi 58fi
55 59
56 60
diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.0.bb
index 9995899f9e..2c4a4f1976 100644
--- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
+++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
6 6
7inherit allarch 7inherit allarch
8 8
9PR = "r6" 9PR = "r7"
10 10
11SRC_URI = " \ 11SRC_URI = " \
12 file://automount.rules \ 12 file://automount.rules \