All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] udev-extraconf: Split automount and autonet into seperate packages
@ 2025-11-25  9:07 Vivek Puar
  2025-11-25 10:31 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Puar @ 2025-11-25  9:07 UTC (permalink / raw)
  To: openembedded-core; +Cc: Vivek Puar

Created two subpackages (${PN}-automount and ${PN}-autonet) to separate
udev rules and scripts for automount and autonet functionality.

If the image only needs storage devices to be auto-mounted or just needs
network hotplug handling, splitting the packages let us choose automount or
autonet package without having to care about other rules. This change does not
save much space but helps avoid installing unnecessary scripts and rules.

Signed-off-by: Vivek Puar <vpuar@qti.qualcomm.com>
---
 meta/recipes-core/udev/udev-extraconf_1.1.bb | 25 ++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/udev/udev-extraconf_1.1.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb
index 2ba6606c05..1353d35de2 100644
--- a/meta/recipes-core/udev/udev-extraconf_1.1.bb
+++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -40,22 +40,39 @@ do_install() {
     install -m 0755 ${S}/network.sh ${D}${sysconfdir}/udev/scripts
 }
 
-pkg_postinst:${PN} () {
+PACKAGES =+ "${PN}-automount ${PN}-autonet"
+
+FILES:${PN}-automount = " \
+    ${sysconfdir}/udev/rules.d/automount.rules \
+    ${sysconfdir}/udev/scripts/mount.sh \
+    ${sysconfdir}/udev/mount.ignorelist \
+"
+
+RDEPENDS:${PN}-automount = "udev util-linux-blkid ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'util-linux-lsblk', '', d)}"
+CONFFILES:${PN}-automount = "${sysconfdir}/udev/mount.ignorelist"
+
+pkg_postinst:${PN}-automount () {
 	if [ -e $D${systemd_unitdir}/system/systemd-udevd.service ]; then
 		sed -i "/\[Service\]/aMountFlags=shared" $D${systemd_unitdir}/system/systemd-udevd.service
 	fi
 }
 
-pkg_postrm:${PN} () {
+pkg_postrm:${PN}-automount () {
 	if [ -e $D${systemd_unitdir}/system/systemd-udevd.service ]; then
 		sed -i "/MountFlags=shared/d" $D${systemd_unitdir}/system/systemd-udevd.service
 	fi
 }
 
-RDEPENDS:${PN} = "udev util-linux-blkid ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'util-linux-lsblk', '', d)}"
-CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist"
+FILES:${PN}-autonet = " \
+    ${sysconfdir}/udev/rules.d/autonet.rules \
+    ${sysconfdir}/udev/scripts/network.sh \
+"
+
+RDEPENDS:${PN}-autonet = "udev"
 
 # to replace udev-extra-rules from meta-oe
 RPROVIDES:${PN} = "udev-extra-rules"
 RREPLACES:${PN} = "udev-extra-rules"
 RCONFLICTS:${PN} = "udev-extra-rules"
+
+RDEPENDS:${PN} = "${PN}-automount ${PN}-autonet"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-25 11:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25  9:07 [PATCH v4] udev-extraconf: Split automount and autonet into seperate packages Vivek Puar
2025-11-25 10:31 ` [OE-core] " Alexander Kanavin
2025-11-25 11:13   ` Vivek Puar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.