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....@windriver.com>
Signed-off-by: Hongzhi.Song <hongzhi.s...@windriver.com>
---
 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 816d975e5e..9796cd7b90 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -36,6 +36,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
+
         ! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
         # Silent util-linux's version of mounting auto
         MOUNT="$MOUNT -o silent"
-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to