mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
2e24eb2cb7
commit
e281bb3e35
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
|
||||
|
||||
inherit allarch
|
||||
|
||||
PR = "r6"
|
||||
PR = "r7"
|
||||
|
||||
SRC_URI = " \
|
||||
file://automount.rules \
|
||||
|
||||
Reference in New Issue
Block a user