Skip to contentSkip to conversation

Remove obsolete update-modules

PATCH Applied Laurentiu Palcu 4 participants 12 messages Jan 17, 2013 – Jan 23, 2013

lore
Share & tools
lore
#0 lore raw

cover Remove obsolete update-modules

All,

Working on the postinstall improvements I stumbled over update-modules script which postponed postinstalls for all the kernel or kernel module packages for first boot. However, after some investigations I saw that this script is pretty much obsolete. So, this patchset will remove it from all recipes and bbclasses it was referenced.

Here's why it's useless now:

update-modules was used mainly to create the /etc/modules.conf file, out of files in /etc/modutils, and /etc/modules file from /etc/modules-load.d/*.conf files. Then it just ran depmod -A.

* depmod can be run in the postinst/postrm on its own, no need to run through update-modules;
* /etc/modules.conf is not used anymore by modprobe. modprobe now looks in /etc/modprobe.d/ directory for *.conf files;
* /etc/modules was used by /etc/init.d/modutils.sh to automatically load modules at boot. However, I improved the script in order to also look into /etc/modules-load.d/ directory and load all the modules listed there that were not already loaded (in case /etc/modules existed);

I know this is a major change and will affect a lot of people. But, in order to support RO rootfs and run all the postinstalls on host, this change was kind of necessary. Note, though, that the update-modules recipe was not removed yet. It will be removed eventually but, for now, I decided to leave it in place in case some people are nostalgic and want to still use it for a while.

Feel free to review and comment on the change.

Thanks,
Laurentiu

The following changes since commit 9f263a60e3521b800121a6f527a7b30dc9b62432:

oprofile: add AArch64 support (2013-01-16 16:10:39 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib lpalcu/update-modules
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/update-modules

Laurentiu Palcu (6):
modutils-initscripts: improve modutils.sh
orinoco-conf: remove dependencies of update-modules
hostap-conf: remove dependencies of update-modules module.bbclass: do not use update-modules anymore kernel.bbclass: remove references to update-modules bitbake.conf: remove update-modules from DISTRO_FEATURES

 meta/classes/kernel.bbclass                        |   36 +++++++++-----------
 meta/classes/module.bbclass                        |   13 ++++---
 meta/conf/bitbake.conf                             |    2 +-
 meta/recipes-bsp/hostap/files/hostap_cs.modalias   |   34 +++++++++---------
 meta/recipes-bsp/hostap/hostap-conf_1.0.bb         |   17 ++-------
 meta/recipes-bsp/orinoco/orinoco-conf_1.0.bb       |   17 ++-------
 .../modutils-initscripts/files/modutils.sh         |   34 +++++++++++++-----
 7 files changed, 75 insertions(+), 78 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/6 modutils-initscripts: improve modutils.sh

modutils.sh reads /etc/modules to load the listed modules at boot time. /etc/modules is generated by update-modules which scans /etc/modules-load.d directory. However, update-modules became obsolete because the files it generates are not used by modprobe anymore.

Hence, change modutils.sh to scan also /etc/modules-load.d/*.conf and load the modules listed there.

Basically, the behavior is this:
* if /etc/modules exists, load those modules;
* if the directory /etc/modules-load.d exists, load the modules listed in the .conf files but ignore those already loaded (from /etc/modules);

[YOCTO #3598]

---
 .../modutils-initscripts/files/modutils.sh         |   34 ++++++++++++++------
 1 file changed, 25 insertions(+), 9 deletions(-)
meta/recipes-kernel/modutils-initscripts/files/modutils.sh +25 -9
index 9049bbb..a78adf5 100755
@@ -13,7 +13,7 @@
 
 LOAD_MODULE=modprobe
 [ -f /proc/modules ] || exit 0
-[ -f /etc/modules ] || exit 0
+[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
 [ -e /sbin/modprobe ] || LOAD_MODULE=insmod
 
 if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
@@ -21,15 +21,31 @@ if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
 	depmod -Ae
 fi
 
+loaded_modules=" "
+
+process_file() {
+	file=$1
+
+	(cat $file; echo; ) |
+	while read module args
+	do
+		case "$module" in
+			\#*|"") continue ;;
+		esac
+		[ -n "$(echo $loaded_modules | grep " $module ")" ] && continue
+		[ "$VERBOSE" != no ] && echo -n "$module "
+		eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
+		loaded_modules="${loaded_modules}${module} "
+	done
+}
+
 [ "$VERBOSE" != no ] && echo -n "Loading modules: "
-(cat /etc/modules; echo; ) |
-while read module args
-do
-	case "$module" in
-		\#*|"") continue ;;
-	esac
-	[ "$VERBOSE" != no ] && echo -n "$module "
-	eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
+[ -f /etc/modules ] && process_file /etc/modules
+
+[ -d /etc/modules-load.d ] || exit 0
+
+for f in /etc/modules-load.d/*.conf; do
+	process_file $f
 done
 [ "$VERBOSE" != no ] && echo
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/6 orinoco-conf: remove dependencies of update-modules

In reply to Laurentiu Palcu

Since update-modules became obsolete, no need for these dependencies. Also:
* install the conf files in the modprobe.d directory. /etc/modutils is also obsolete;
* remove postinst/postrm scriptlets since they ran update-modules and this is just an alias file;

[YOCTO #3598]

---
 meta/recipes-bsp/orinoco/orinoco-conf_1.0.bb |   17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
meta/recipes-bsp/orinoco/orinoco-conf_1.0.bb +3 -14
index 57e746b..4be9277 100644
@@ -2,8 +2,7 @@ DESCRIPTION = "PCMCIA-cs configuration files for Hermes (Orinoco) wireless LAN c
 SECTION = "kernel/modules"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
-RDEPENDS_${PN} = "update-modules"
-PR = "r7"
+PR = "r8"
 
 SRC_URI = "file://orinoco_cs.conf \
            file://COPYING.patch"
@@ -11,17 +10,7 @@ SRC_URI = "file://orinoco_cs.conf \
 inherit allarch
 
 do_install() {
-        install -d ${D}${sysconfdir}/modutils
-        install -m 0644 ${WORKDIR}/orinoco_cs.conf ${D}${sysconfdir}/modutils/
+        install -d ${D}${sysconfdir}/modprobe.d
+        install -m 0644 ${WORKDIR}/orinoco_cs.conf ${D}${sysconfdir}/modprobe.d/
 }
 
-pkg_postinst_${PN} () {
-	if [ -n "$D" ]; then
-		exit 1
-	fi
-	update-modules || true
-}
-
-pkg_postrm_${PN} () {
-	update-modules || true
-}
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/6 hostap-conf: remove dependencies of update-modules

In reply to Laurentiu Palcu

Also:
* install the alias file in the correct /etc/modprobe.d directory since this is the directory used by modprobe now;
* rewrite the alias file to be up-to-date with modprobe's syntax;
* remove the postinst/postrm scriptlets because this is just an alias file;

[YOCTO #3598]

---
 meta/recipes-bsp/hostap/files/hostap_cs.modalias |   34 +++++++++++-----------
 meta/recipes-bsp/hostap/hostap-conf_1.0.bb       |   17 ++---------
 2 files changed, 20 insertions(+), 31 deletions(-)
meta/recipes-bsp/hostap/files/hostap_cs.modalias +17 -17
index cb9efab..2848351 100644
@@ -1,28 +1,28 @@
 # product info: "Pretec", "CompactWLAN Card 802.11b", "2.5"
-pcmcia:m0156c0002f06fn00pfn00pa1CADD3E5pbE697636Cpc7A5BFCF1pd00000000 hostap_cs
+alias pcmcia:m0156c0002f06fn00pfn00pa1CADD3E5pbE697636Cpc7A5BFCF1pd00000000 hostap_cs
 
 # manufacturer ID which exist in orinoco_cs AND in hostap_cs
-pcmcia:m000Bc7100f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m000Bc7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m0126c8000f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m0138c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m0250c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m0274c1612f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m0274c1613f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m028Ac0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m02AAc0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:m50C2c7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:mD601c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
-pcmcia:mD601c0005f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m000Bc7100f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m000Bc7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0126c8000f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0138c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0250c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1612f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1613f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m028Ac0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m02AAc0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m50C2c7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0005f06fn00pfn00pa*pb*pc*pd* hostap_cs
 
 # product info: "Linksys", "Wireless CompactFlash Card", "", ""
-pcmcia:m028Ac0673f06fn00pfn00pa0733CC81pb0C52F395pc00000000pd00000000 hostap_cs
+alias pcmcia:m028Ac0673f06fn00pfn00pa0733CC81pb0C52F395pc00000000pd00000000 hostap_cs
 
 # product info:"PLANEX COMMUNICATION INC","PLANEX GW-CF11X Wireless CF Card", "", ""
-pcmcia:mD601c0010f06fn00pfn00pa4703CF68pbFAD7318Dpc00000000pd00000000 hostap_cs
+alias pcmcia:mD601c0010f06fn00pfn00pa4703CF68pbFAD7318Dpc00000000pd00000000 hostap_cs
 
 # 0x0156, 0x0002 and "Version 01.02" only appear for Prism based cards.
-pcmcia:m0156c0002f06fn00pfn00pa*pb*pc4B74BAA0pd00000000 hostap_cs
+alias pcmcia:m0156c0002f06fn00pfn00pa*pb*pc4B74BAA0pd00000000 hostap_cs
 
 # "BUFFALO", "WLI-CF-S11G", "", ""
-pcmcia:m026Fc030Bf06fn00pfn00pa2DECECE3pb82067C18pc00000000pd00000000 hostap_cs
+alias pcmcia:m026Fc030Bf06fn00pfn00pa2DECECE3pb82067C18pc00000000pd00000000 hostap_cs
meta/recipes-bsp/hostap/hostap-conf_1.0.bb +3 -14
index f8b2102..466c073 100644
@@ -2,8 +2,7 @@ DESCRIPTION = "PCMCIA-cs configuration files for wireless LAN cards based on Int
 SECTION = "kernel/modules"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
-RDEPENDS_${PN} = "update-modules"
-PR = "r14"
+PR = "r15"
 
 SRC_URI = "file://hostap_cs.modalias \
            file://COPYING.patch"
@@ -14,18 +13,8 @@ do_compile() {
 }
 
 do_install() {
-        install -d ${D}${sysconfdir}/modutils
+	install -d ${D}${sysconfdir}/modprobe.d
 
-	install -m 0644 ${WORKDIR}/hostap_cs.modalias ${D}${sysconfdir}/modutils/hostap_cs.conf
+	install -m 0644 ${WORKDIR}/hostap_cs.modalias ${D}${sysconfdir}/modprobe.d/hostap_cs.conf
 }
 
-pkg_postinst_${PN} () {
-	if [ -n "$D" ]; then
-		exit 1
-	fi
-	update-modules || true
-}
-
-pkg_postrm_${PN} () {
-	update-modules || true
-}
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/6 module.bbclass: do not use update-modules anymore

In reply to Laurentiu Palcu

update-modules is obsolete. The bbclass was updated not to use it anymore.

[YOCTO #3598]

---
 meta/classes/module.bbclass |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
meta/classes/module.bbclass +9 -4
index ebb0880..d477caa 100644
@@ -1,4 +1,4 @@
-RDEPENDS_${PN} += "kernel-image ${@oe.utils.contains('DISTRO_FEATURES', 'update-modules', 'update-modules', '', d)}"
+RDEPENDS_${PN} += "kernel-image"
 DEPENDS += "virtual/kernel"
 
 inherit module-base
@@ -27,13 +27,18 @@ module_do_install() {
 
 pkg_postinst_append () {
 if [ -z "$D" ]; then
-	depmod -a
-	update-modules || true
+	depmod -a ${KERNEL_VERSION}
+else
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
 fi
 }
 
 pkg_postrm_append () {
-update-modules || true
+if [ -z "$D" ]; then
+	depmod -a ${KERNEL_VERSION}
+else
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+fi
 }
 
 EXPORT_FUNCTIONS do_compile do_install
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/6 kernel.bbclass: remove references to update-modules

In reply to Laurentiu Palcu

Since update-modules is now obsolete, remove it from the bbclass.

[YOCTO #3598]

---
 meta/classes/kernel.bbclass |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
meta/classes/kernel.bbclass +17 -19
index 46ba55f..4893cf2 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base module_strip
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
+DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}"
 
 # we include gcc above, we dont need virtual/libc
 INHIBIT_DEFAULT_DEPS = "1"
@@ -293,12 +293,17 @@ fi
 pkg_postinst_modules () {
 if [ -z "$D" ]; then
 	depmod -a ${KERNEL_VERSION}
-	update-modules || true
+else
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
 fi
 }
 
 pkg_postrm_modules () {
-update-modules || true
+if [ -z "$D" ]; then
+	depmod -a ${KERNEL_VERSION}
+else
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+fi
 }
 
 autoload_postinst_fragment() {
@@ -403,12 +408,10 @@ python populate_packages_prepend () {
 
         dvar = d.getVar('PKGD', True)
 
-        use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d)
-
         # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
         # appropriate modprobe commands to the postinst
         autoload = d.getVar('module_autoload_%s' % basename, True)
-        if autoload and use_update_modules:
+        if autoload:
             name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
             for m in autoload.split():
@@ -422,16 +425,15 @@ python populate_packages_prepend () {
 
         # Write out any modconf fragment
         modconf = d.getVar('module_conf_%s' % basename, True)
-        if modconf and use_update_modules:
+        if modconf:
             name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
             f.write("%s\n" % modconf)
             f.close()
 
-        if use_update_modules:
-            files = d.getVar('FILES_%s' % pkg, True)
-            files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
-            d.setVar('FILES_%s' % pkg, files)
+        files = d.getVar('FILES_%s' % pkg, True)
+        files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
+        d.setVar('FILES_%s' % pkg, files)
 
         if vals.has_key("description"):
             old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
@@ -447,17 +449,13 @@ python populate_packages_prepend () {
     module_regex = '^(.*)\.k?o$'
     module_pattern = 'kernel-module-%s'
 
-    use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d)
-    if use_update_modules:
-        postinst = d.getVar('pkg_postinst_modules', True)
-        postrm = d.getVar('pkg_postrm_modules', True)
-    else:
-        postinst = None
-        postrm = None
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)
+
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
-    do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%skernel-%s' % (['', 'update-modules '][use_update_modules], d.getVar("KERNEL_VERSION", True)))
+    do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION", True)))
 
     # If modules-load.d and modprobe.d are empty at this point, remove them to
     # avoid warnings. removedirs only raises an OSError if an empty
Signature · 1 line
1.7.9.5
Acked-by on v1 5/6
#6 lore raw

Re: [PATCH 5/6] kernel.bbclass: remove references to update-modules

Quoted 3 lines · Laurentiu Palcu

Since update-modules is now obsolete, remove it from the bbclass.

This seems to capture all the concerns that I had about removing update-modules.

Quoted 129 lines

[YOCTO #3598]

---
 meta/classes/kernel.bbclass |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
meta/classes/kernel.bbclass +0 -1
index 46ba55f..4893cf2 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base module_strip
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native

virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules" +DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}"

 # we include gcc above, we dont need virtual/libc
 INHIBIT_DEFAULT_DEPS = "1"
meta/classes/kernel.bbclass +7 -2
@@ -293,12 +293,17 @@ fi
 pkg_postinst_modules () {
 if [ -z "$D" ]; then
        depmod -a ${KERNEL_VERSION}
-       update-modules || true
+else
+       depmod -a -b $D -F
 ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
 fi
 }
 
 pkg_postrm_modules () {
-update-modules || true
+if [ -z "$D" ]; then
+       depmod -a ${KERNEL_VERSION}
+else
+       depmod -a -b $D -F
 ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+fi
 }

autoload_postinst_fragment() {

meta/classes/kernel.bbclass +0 -2
@@ -403,12 +408,10 @@ python populate_packages_prepend () {
 
         dvar = d.getVar('PKGD', True)
 
-        use_update_modules = oe.utils.contains('DISTRO_FEATURES',
 'update-modules', True, False, d)
-
         # If autoloading is requested, output

/etc/modules-load.d/<name>.conf and append

         # appropriate modprobe commands to the postinst
         autoload = d.getVar('module_autoload_%s' % basename, True)
meta/classes/kernel.bbclass +5 -6
-        if autoload and use_update_modules:
+        if autoload:
             name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
             for m in autoload.split():
@@ -422,16 +425,15 @@ python populate_packages_prepend () {
 
         # Write out any modconf fragment
         modconf = d.getVar('module_conf_%s' % basename, True)
-        if modconf and use_update_modules:
+        if modconf:
             name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
             f.write("%s\n" % modconf)
             f.close()
 
-        if use_update_modules:
-            files = d.getVar('FILES_%s' % pkg, True)
-            files = "%s /etc/modules-load.d/%s.conf
 /etc/modprobe.d/%s.conf" % (files, basename, basename)
-            d.setVar('FILES_%s' % pkg, files)
+        files = d.getVar('FILES_%s' % pkg, True)
+        files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf"
 % (files, basename, basename)
+        d.setVar('FILES_%s' % pkg, files)
 

if vals.has_key("description"):
old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""

meta/classes/kernel.bbclass +3 -7
@@ -447,17 +449,13 @@ python populate_packages_prepend () {
     module_regex = '^(.*)\.k?o$'
     module_pattern = 'kernel-module-%s'
 
-    use_update_modules = oe.utils.contains('DISTRO_FEATURES',
 'update-modules', True, False, d)
-    if use_update_modules:
-        postinst = d.getVar('pkg_postinst_modules', True)
-        postrm = d.getVar('pkg_postrm_modules', True)
-    else:
-        postinst = None
-        postrm = None
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)
+
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$',
 output_pattern='kernel-firmware-%s', description='Firmware for %s',
 recursive=True, extra_depends='')
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$',
 output_pattern='kernel-firmware-%s', description='Firmware for %s',
 recursive=True, extra_depends='')
     do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$',

output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
- do_split_packages(d, root='/lib/modules', file_regex=module_regex,
output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%skernel-%s' % (['', 'update-modules '][use_update_modules], d.getVar("KERNEL_VERSION", True)))
+ do_split_packages(d, root='/lib/modules', file_regex=module_regex,
output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION", True)))

# If modules-load.d and modprobe.d are empty at this point, remove
them to

     # avoid warnings. removedirs only raises an OSError if an empty
--
1.7.9.5

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#7 lore raw

Re: [PATCH 5/6] kernel.bbclass: remove references to update-modules

In reply to Laurentiu Palcu
Quoted 20 lines · Laurentiu Palcu

Since update-modules is now obsolete, remove it from the bbclass.

[YOCTO #3598]

---
 meta/classes/kernel.bbclass |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
meta/classes/kernel.bbclass +1 -1
index 46ba55f..4893cf2 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base module_strip
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
+DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}"
 

...

meta/classes/kernel.bbclass python populate_packages_prepend () { · line 453

Quoted 9 lines
meta/classes/kernel.bbclass +2 -7
-    use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d)
-    if use_update_modules:
-        postinst = d.getVar('pkg_postinst_modules', True)
-        postrm = d.getVar('pkg_postrm_modules', True)
-    else:
-        postinst = None
-        postrm = None
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)

This seems to be inverted logic from the original. If update-modules is removed, then use_update_modules should be false right? Which would have previously set postinst and postrm to None.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
#8 lore raw

Re: [PATCH 5/6] kernel.bbclass: remove references to update-modules

Quoted 9 lines · Darren Hart
Quoted 9 lines

- use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d)

Quoted 8 lines
meta/classes/kernel.bbclass +2 -6
-    if use_update_modules:
-        postinst = d.getVar('pkg_postinst_modules', True)
-        postrm = d.getVar('pkg_postrm_modules', True)
-    else:
-        postinst = None
-        postrm = None
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)
Quoted 3 lines

This seems to be inverted logic from the original. If update-modules is removed, then use_update_modules should be false right? Which would have previously set postinst and postrm to None.

I believe both the previous and current logic are right:
* Before, the update-modules script was called in the postinst/postrm.
So, when the update-modules package was not part of the build, the postinst/postrm could not call update-modules anymore. As a consequence, they were set to none.
* After update-modules has been removed, we are not constrained by
calling update-modules anymore in postinst/postrm but we can safely call depmod to have the dependencies computed.

So, is there anything wrong with the current logic?

Thanks,
Laurentiu

#9 lore raw

Re: [PATCH 5/6] kernel.bbclass: remove references to update-modules

Quoted 24 lines · Laurentiu Palcu
Quoted 9 lines · Darren Hart
Quoted 9 lines

- use_update_modules = oe.utils.contains('DISTRO_FEATURES', 'update-modules', True, False, d)

Quoted 8 lines
meta/classes/kernel.bbclass +2 -6
-    if use_update_modules:
-        postinst = d.getVar('pkg_postinst_modules', True)
-        postrm = d.getVar('pkg_postrm_modules', True)
-    else:
-        postinst = None
-        postrm = None
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)
Quoted 3 lines

This seems to be inverted logic from the original. If update-modules is removed, then use_update_modules should be false right? Which would have previously set postinst and postrm to None.

I believe both the previous and current logic are right:
* Before, the update-modules script was called in the postinst/postrm.
So, when the update-modules package was not part of the build, the postinst/postrm could not call update-modules anymore. As a consequence, they were set to none.
* After update-modules has been removed, we are not constrained by
calling update-modules anymore in postinst/postrm but we can safely call depmod to have the dependencies computed.

Quoted 1 line

So, is there anything wrong with the current logic?

Ah, I see. That makes sense to me.

Thanks,

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
#10 lore raw

PATCH 6/6 bitbake.conf: remove update-modules from DISTRO_FEATURES

In reply to Laurentiu Palcu

Since update-modules is obsolete, remove it from DISTRO_FEATURES.

[YOCTO #3598]

---
 meta/conf/bitbake.conf |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 9ae11ad..2dc50ca 100644
@@ -738,7 +738,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
 IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 
-DISTRO_FEATURES_BACKFILL = "pulseaudio update-modules"
+DISTRO_FEATURES_BACKFILL = "pulseaudio"
 DISTRO_FEATURES_append = "${@oe.utils.features_backfill("DISTRO_FEATURES",d)}"
 
 MACHINE_FEATURES_BACKFILL = "rtc"
Signature · 1 line
1.7.9.5
#11 lore raw
In reply to Laurentiu Palcu
Quoted 22 lines · Laurentiu Palcu

All,

Working on the postinstall improvements I stumbled over update-modules script which postponed postinstalls for all the kernel or kernel module packages for first boot. However, after some investigations I saw that this script is pretty much obsolete. So, this patchset will remove it from all recipes and bbclasses it was referenced.

Here's why it's useless now:

update-modules was used mainly to create the /etc/modules.conf file, out of files in /etc/modutils, and /etc/modules file from /etc/modules-load.d/*.conf files. Then it just ran depmod -A.

* depmod can be run in the postinst/postrm on its own, no need to run through update-modules;
* /etc/modules.conf is not used anymore by modprobe. modprobe now looks in /etc/modprobe.d/ directory for *.conf files;
* /etc/modules was used by /etc/init.d/modutils.sh to automatically load modules at boot. However, I improved the script in order to also look into /etc/modules-load.d/ directory and load all the modules listed there that were not already loaded (in case /etc/modules existed);

Quoted 5 lines

I know this is a major change and will affect a lot of people. But, in order to support RO rootfs and run all the postinstalls on host, this change was kind of necessary. Note, though, that the update-modules recipe was not removed yet. It will be removed eventually but, for now, I decided to leave it in place in case some people are nostalgic and want to still use it for a while.

I've merged these, I'll also take a patch to remove update-modules itself.

Cheers,

Richard