summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev
diff options
context:
space:
mode:
authorMuhammad Hamza <Muhammad_Hamza@mentor.com>2022-07-17 14:56:45 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-25 15:11:46 +0100
commitc993a88c3fa704dddc95d82559cb62e6c25d53e5 (patch)
tree8e3431ca1765f2abef11c900d790c7f1443fabe8 /meta/recipes-core/udev
parent8eafba72be116632d73b6439f55f3fb7804c2c75 (diff)
downloadpoky-c993a88c3fa704dddc95d82559cb62e6c25d53e5.tar.gz
udev-extraconf: force systemd-udevd to use shared MountFlags
Automounting does not work cleanly in case systemd as well as udev rules are being used simultaneously and in most cases race conditions and unknown behavior can come up. In case we're running on top of systemd we need to make sure that systemd-udevd knows that udev is in play as well and mounting should be done using shared flags. Also as we're using mount from sources other than systemd-mount in current scripts this is the most manageable fix to automounting problems. (From OE-Core rev: 00ea4314feb51d82f9027bf53ff627541180daca) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit 1e770416b4c9a0468404fb64d55114d93e84763b) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.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/systemd-udevd.service3
-rw-r--r--meta/recipes-core/udev/udev-extraconf_1.1.bb9
2 files changed, 11 insertions, 1 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/systemd-udevd.service b/meta/recipes-core/udev/udev-extraconf/systemd-udevd.service
new file mode 100644
index 0000000000..a9b86eb6e4
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/systemd-udevd.service
@@ -0,0 +1,3 @@
1.include @systemd_unitdir@/system/systemd-udevd.service
2[Service]
3MountFlags=shared
diff --git a/meta/recipes-core/udev/udev-extraconf_1.1.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb
index 8213c1a930..ef6019259e 100644
--- a/meta/recipes-core/udev/udev-extraconf_1.1.bb
+++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -11,6 +11,7 @@ SRC_URI = " \
11 file://autonet.rules \ 11 file://autonet.rules \
12 file://network.sh \ 12 file://network.sh \
13 file://localextra.rules \ 13 file://localextra.rules \
14 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://systemd-udevd.service', '', d)} \
14" 15"
15 16
16S = "${WORKDIR}" 17S = "${WORKDIR}"
@@ -35,9 +36,15 @@ do_install() {
35 sed -i 's|@MOUNT_BASE@|${MOUNT_BASE}|g' ${D}${sysconfdir}/udev/scripts/mount.sh 36 sed -i 's|@MOUNT_BASE@|${MOUNT_BASE}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
36 37
37 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts 38 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
39
40 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
41 install -d ${D}${sysconfdir}/systemd/system
42 install ${WORKDIR}/systemd-udevd.service ${D}${sysconfdir}/systemd/system/systemd-udevd.service
43 sed -i 's|@systemd_unitdir@|${systemd_unitdir}|g' ${D}${sysconfdir}/systemd/system/systemd-udevd.service
44 fi
38} 45}
39 46
40FILES:${PN} = "${sysconfdir}/udev" 47FILES:${PN} = "${sysconfdir}/udev ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${sysconfdir}/systemd/system/systemd-udevd.service', '', d)}"
41RDEPENDS:${PN} = "udev util-linux-blkid" 48RDEPENDS:${PN} = "udev util-linux-blkid"
42CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist" 49CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist"
43 50