summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2018-10-22 19:58:40 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-25 14:36:34 +0100
commit6104109ceba1a1323e42d67a632921fb91184ab6 (patch)
treefe5ed4b9e2bce31fc5d36e7c1084d30fa1cc8243 /meta/recipes-core/udev
parentfcf6a4d629c05048cbb7298e285d84ff73a320d2 (diff)
downloadopenembedded-core-contrib-6104109ceba1a1323e42d67a632921fb91184ab6.tar.gz
udev-extraconf: Skip the entry in /etc/fstab when using the systemd-mount
When using systemd, the systemd-fstab-generator would parse the /etc/fstab and create the corresponding unit dynamically. So we don't need to handle the ADD action for the partitions in /etc/fstab. Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index afb368dd67..3ee67b1318 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -38,6 +38,15 @@ done
automount_systemd() {
name="`basename "$DEVNAME"`"
+ # Skip the partition which are already in /etc/fstab
+ grep "^[[:space:]]*$DEVNAME" /etc/fstab && return
+ for n in LABEL PARTLABEL UUID PARTUUID; do
+ tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')"
+ test -z "$tmp" && continue
+ tmp="$n=$tmp"
+ grep "^[[:space:]]*$tmp" /etc/fstab && return
+ done
+
[ -d "/run/media/$name" ] || mkdir -p "/run/media/$name"
MOUNT="$MOUNT -o silent"