[oe-commits] [openembedded-core] 04/12: udev-extraconf: Skip the entry in /etc/fstab when using the systemd-mount

git at git.openembedded.org git at git.openembedded.org
Tue Oct 23 21:56:11 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 8b5408a6f3d21c119d411f5622be7944c063f378
Author: Kevin Hao <kexin.hao at windriver.com>
AuthorDate: Mon Oct 22 19:58:40 2018 +0800

    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 at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-core/udev/udev-extraconf/mount.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index afb368d..3ee67b1 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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list