summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/udev')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh18
-rw-r--r--meta/recipes-core/udev/udev-extraconf_1.1.bb2
2 files changed, 19 insertions, 1 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index c8b773bc07..40910be8bd 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -54,6 +54,9 @@ automount_systemd() {
54 grep "^[[:space:]]*$tmp" /etc/fstab && return 54 grep "^[[:space:]]*$tmp" /etc/fstab && return
55 done 55 done
56 56
57 # Get the unique name for mount point
58 get_label_name "${DEVNAME}"
59
57 [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name" 60 [ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name"
58 61
59 MOUNT="$MOUNT -o silent" 62 MOUNT="$MOUNT -o silent"
@@ -94,6 +97,9 @@ automount() {
94 # configured in fstab 97 # configured in fstab
95 grep -q "^$DEVNAME " /proc/mounts && return 98 grep -q "^$DEVNAME " /proc/mounts && return
96 99
100 # Get the unique name for mount point
101 get_label_name "${DEVNAME}"
102
97 ! test -d "$MOUNT_BASE/$name" && mkdir -p "$MOUNT_BASE/$name" 103 ! test -d "$MOUNT_BASE/$name" && mkdir -p "$MOUNT_BASE/$name"
98 # Silent util-linux's version of mounting auto 104 # Silent util-linux's version of mounting auto
99 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; 105 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
@@ -134,6 +140,18 @@ rm_dir() {
134 fi 140 fi
135} 141}
136 142
143get_label_name() {
144 # Get the LABEL or PARTLABEL
145 LABEL=`/sbin/blkid | grep "$1:" | grep -o 'LABEL=".*"' | cut -d '"' -f2`
146 # If the $DEVNAME has a LABEL or a PARTLABEL
147 if [ -n "$LABEL" ]; then
148 # Set the mount location dir name to LABEL appended
149 # with $name e.g. label-sda. That would avoid overlapping
150 # mounts in case two devices have same LABEL
151 name="${LABEL}-${name}"
152 fi
153}
154
137# No ID_FS_TYPE for cdrom device, yet it should be mounted 155# No ID_FS_TYPE for cdrom device, yet it should be mounted
138name="`basename "$DEVNAME"`" 156name="`basename "$DEVNAME"`"
139[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media` 157[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
diff --git a/meta/recipes-core/udev/udev-extraconf_1.1.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb
index 2b908ac05b..8213c1a930 100644
--- a/meta/recipes-core/udev/udev-extraconf_1.1.bb
+++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -38,7 +38,7 @@ do_install() {
38} 38}
39 39
40FILES:${PN} = "${sysconfdir}/udev" 40FILES:${PN} = "${sysconfdir}/udev"
41RDEPENDS:${PN} = "udev" 41RDEPENDS:${PN} = "udev util-linux-blkid"
42CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist" 42CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist"
43 43
44# to replace udev-extra-rules from meta-oe 44# to replace udev-extra-rules from meta-oe