Skip to contentSkip to conversation

udev-extraconf: Split automount and autonet into seperate packages

PATCH In review Vivek Puar 2 participants 3 messages Nov 25, 2025

lore
Share & tools
lore

Vivek Puar

author
#0 lore raw

PATCH v4 1/1 udev-extraconf: Split automount and autonet into seperate packages

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.

---
 meta/recipes-core/udev/udev-extraconf_1.1.bb | 25 ++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
meta/recipes-core/udev/udev-extraconf_1.1.bb +21 -4
index 2ba6606c05..1353d35de2 100644
@@ -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"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Vivek Puar via lists.openembedded.org

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.

This still needs an answer to the question asked previously: how was this patch tested? Given that previous iterations of the patch made serious runtime dependency omissions, I'm somewhat nervous that the patch hasn't been actually verified on the target.

Alex

author
#2 lore raw
Quoted 7 lines · Alexander Kanavin

This still needs an answer to the question asked previously: how was this patch tested? Given that previous iterations of the patch made serious runtime dependency omissions, I'm somewhat nervous that the patch hasn't been actually verified on the target.

Alex

With this latest change, I've verified on the target that it meets all the dependencies when we install packages individually and also verified that all the dependencies are met when udev-extraconf is added to the image. So I've covered all the possibilities and verified on the target.

Vivek