summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2018-10-22 19:58:39 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-25 14:53:44 +0100
commita9bf8397ab6740ef8e3e56125a7de7bf839d8e67 (patch)
tree17dbcf1c6352762183d2cbbe082379af9446a022 /meta/recipes-core
parent654d57985a3652fc39f3e0f46df64cee2f7007db (diff)
downloadpoky-a9bf8397ab6740ef8e3e56125a7de7bf839d8e67.tar.gz
udev-extraconf: Fix the recursively dependency for the systemd-mount
The commit 4ca9402c3720 ("udev-extraconf: Add systemd-mount to udev-extraconf/mount.sh") uses the systemd-mount to mount the new added disk partitions if systemd is used. But it forgot to move the codes which tries to mount the partition by using the configuration in /etc/fstab to the non-systemd function. And it will cause the systemd-mount try to mount the partition synchronously and trigger a recursively dependency like the following: dev-sda1.device -> run-media-sda1.mount -> dev-sda1.device (From OE-Core rev: fcf6a4d629c05048cbb7298e285d84ff73a320d2) Signed-off-by: Kevin Hao <kexin.hao@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.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 34ef98a6a8..afb368dd67 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -66,6 +66,16 @@ automount_systemd() {
66automount() { 66automount() {
67 name="`basename "$DEVNAME"`" 67 name="`basename "$DEVNAME"`"
68 68
69 if [ -x "$PMOUNT" ]; then
70 $PMOUNT $DEVNAME 2> /dev/null
71 elif [ -x $MOUNT ]; then
72 $MOUNT $DEVNAME 2> /dev/null
73 fi
74
75 # If the device isn't mounted at this point, it isn't
76 # configured in fstab
77 grep -q "^$DEVNAME " /proc/mounts && return
78
69 ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" 79 ! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
70 # Silent util-linux's version of mounting auto 80 # Silent util-linux's version of mounting auto
71 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; 81 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
@@ -109,20 +119,13 @@ name="`basename "$DEVNAME"`"
109[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media` 119[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
110 120
111if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then 121if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
112 if [ -x "$PMOUNT" ]; then 122 # Note the root filesystem can show up as /dev/root in /proc/mounts,
113 $PMOUNT $DEVNAME 2> /dev/null 123 # so check the device number too
114 elif [ -x $MOUNT ]; then
115 $MOUNT $DEVNAME 2> /dev/null
116 fi
117
118 # If the device isn't mounted at this point, it isn't
119 # configured in fstab (note the root filesystem can show up as
120 # /dev/root in /proc/mounts, so check the device number too)
121 if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then 124 if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
122 if [ "`basename $MOUNT`" = "systemd-mount" ];then 125 if [ "`basename $MOUNT`" = "systemd-mount" ];then
123 grep -q "^$DEVNAME " /proc/mounts || automount_systemd 126 automount_systemd
124 else 127 else
125 grep -q "^$DEVNAME " /proc/mounts || automount 128 automount
126 fi 129 fi
127 fi 130 fi
128fi 131fi