summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
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