diff options
author | Andy Ross <andy.ross@windriver.com> | 2012-09-18 14:38:45 -0700 |
---|---|---|
committer | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2012-11-29 12:00:25 +0100 |
commit | e54b83a61624ddfefdd2b0951a5b2d3e4259c1ce (patch) | |
tree | 4dbc85c8877c6418bf8ea7cb92b15c11a4faa805 /meta/recipes-core | |
parent | 0c8cc0a20ceae347269627e9ad23e7d08f6e6210 (diff) | |
download | openembedded-core-contrib-e54b83a61624ddfefdd2b0951a5b2d3e4259c1ce.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.
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/udev/udev-extraconf/mount.sh | 8 | ||||
-rw-r--r-- | meta/recipes-core/udev/udev-extraconf_1.0.bb | 2 |
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 $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 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 inherit allarch -PR = "r6" +PR = "r7" SRC_URI = " \ file://automount.rules \ |