udev: Don't remount root filesystem under /media
PATCH 1/1 udev: Don't remount root filesystem under /media
The existing logic to avoid mounting already-mounted filesystems breaks for a kernel-mounted root, which appears as /dev/root in /proc/mounts. The effect is that an image booted with e.g. "root=/dev/mmcblk0p1" will find its root filesystem remount rw under /media/mmcblk0p1 at boot.
Signed-off-by Andy Ross <[email protected]>
--- meta/recipes-core/udev/udev/mount.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
meta/recipes-core/udev/udev/mount.sh +9 -3
@@ -49,9 +49,15 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then elif [ -x $MOUNT ]; 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 shows up as + # /dev/root in /proc/mounts, so parse the command line for + # that case) + root=`sed 's/\(^\|.* \)root=\([^ ]*\).*/\2/' /proc/cmdline` + if [ "$root" != "$DEVNAME" ]; then + grep -q "^$DEVNAME " /proc/mounts || automount + fi fi
Signature · 1 line
1.7.11.2