kernel.bbclass updates
cover kernel.bbclass updates
The following changes since commit 5de06b564a949d0d9ec254817feacf9ad18d098c:
Revert "bitbake.conf/sstate.bbclass: Change PATH when installing sstate files to avoid issues" (2012-03-23 12:29:21 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib jansa/kernel
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/kernel
Martin Jansa (6):
kernel.bbclass: populate /etc/modules-load.d/ with module_autoload
entries too
kernel.bbclass: use symlinks for modutils files kernel.bbclass: use better number for KERNEL_PRIORITY kernel.bbclass: fix extra + in kernelrelease
update-modules: update script to read /etc/modules-load.d/ directory kernel.bbclass: don't create /etc/modutils/*
meta/classes/kernel.bbclass | 22 +++++++++++++------ .../update-modules-1.0/update-modules | 14 ++++++++++- .../update-modules/update-modules_1.0.bb | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-)
Signature · 1 line
1.7.8.5
PATCH 1/6 kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
* /etc/modules-load.d/foo.conf is used by systemd like /etc/modutils/foo was with sysvinit
--- meta/classes/kernel.bbclass | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
meta/classes/kernel.bbclass +8 -2
@@ -122,6 +122,7 @@ kernel_do_install() { install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils + install -d ${D}/etc/modules-load.d install -d ${D}/etc/modprobe.d #
@@ -411,6 +412,11 @@ python populate_packages_prepend () { for m in autoload.split(): f.write('%s\n' % m) f.close() + name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) + f = open(name, 'w') + for m in autoload.split(): + f.write('%s\n' % m) + f.close() postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)
@@ -426,7 +432,7 @@ python populate_packages_prepend () { f.close() files = d.getVar('FILES_%s' % pkg, True) - files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) + files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename, basename) d.setVar('FILES_%s' % pkg, files) if vals.has_key("description"):
@@ -456,7 +462,7 @@ python populate_packages_prepend () { # avoid warnings. removedirs only raises an OSError if an empty # directory cannot be removed. dvar = d.getVar('PKGD', True) - for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar)]: + for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: if len(os.listdir(dir)) == 0: os.rmdir(dir)
Signature · 1 line
1.7.8.5
PATCH 2/6 kernel.bbclass: use symlinks for modutils files
--- meta/classes/kernel.bbclass | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
meta/classes/kernel.bbclass +3 -5
@@ -407,16 +407,14 @@ python populate_packages_prepend () { # appropriate modprobe commands to the postinst autoload = d.getVar('module_autoload_%s' % basename, True) if autoload: - name = '%s/etc/modutils/%s' % (dvar, basename) - f = open(name, 'w') - for m in autoload.split(): - f.write('%s\n' % m) - f.close() name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) f = open(name, 'w') for m in autoload.split(): f.write('%s\n' % m) f.close() + modutils_name = '%s/etc/modutils/%s' % (dvar, basename) + modutils_target = '../modules-load.d/%s.conf' % (basename) + os.symlink(modutils_target, modutils_name) postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)
Signature · 1 line
1.7.8.5
Re: [PATCH 2/6] kernel.bbclass: use symlinks for modutils files
What is the motivation?
Quoted 16 lines · Martin Jansa
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)meta/classes/kernel.bbclass +0
-3@@ -407,16 +407,14 @@ python populate_packages_prepend () { # appropriate modprobe commands to the postinst autoload = d.getVar('module_autoload_%s' % basename, True) if autoload: - name = '%s/etc/modutils/%s' % (dvar, basename) - f = open(name, 'w') - for m in autoload.split():
meta/classes/kernel.bbclass python populate_packages_prepend () { · line 417
Quoted 10 lines
meta/classes/kernel.bbclass +3
-2- f.write('%s\n' % m) - f.close() name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) f = open(name, 'w') for m in autoload.split(): f.write('%s\n' % m) f.close() + modutils_name = '%s/etc/modutils/%s' % (dvar, basename) + modutils_target = '../modules-load.d/%s.conf' % (basename) + os.symlink(modutils_target, modutils_name)
This basically undoes what was added in 1/2 and replaces it with symblinks right?
If so, just do it as symlinks in the first place.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [PATCH 2/6] kernel.bbclass: use symlinks for modutils files
Quoted 1 line · Darren Hart
What is the motivation?
RP's review comment.
Quoted 31 lines · Martin Jansa
Quoted 16 lines
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)meta/classes/kernel.bbclass +0
-3@@ -407,16 +407,14 @@ python populate_packages_prepend () { # appropriate modprobe commands to the postinst autoload = d.getVar('module_autoload_%s' % basename, True) if autoload: - name = '%s/etc/modutils/%s' % (dvar, basename) - f = open(name, 'w') - for m in autoload.split():meta/classes/kernel.bbclass python populate_packages_prepend () { · line 417
Quoted 10 lines
meta/classes/kernel.bbclass +3
-2- f.write('%s\n' % m) - f.close() name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) f = open(name, 'w') for m in autoload.split(): f.write('%s\n' % m) f.close() + modutils_name = '%s/etc/modutils/%s' % (dvar, basename) + modutils_target = '../modules-load.d/%s.conf' % (basename) + os.symlink(modutils_target, modutils_name)This basically undoes what was added in 1/2 and replaces it with symblinks right?
Quoted 1 line
If so, just do it as symlinks in the first place.
I have't squashed them because
[PATCH 1/6] kernel.bbclass: populate /etc/modules-load.d/ with module_autoload was already applied to meta-oe's kernel.bbclass copy, before I got RP's review this patchset here, so I wanted to keep those patches 1to1.
Cheers,
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 2/6] kernel.bbclass: use symlinks for modutils files
In reply to Darren HartQuoted 33 lines · Darren Hart
What is the motivation?
Quoted 16 lines · Martin Jansa
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)meta/classes/kernel.bbclass +0
-3@@ -407,16 +407,14 @@ python populate_packages_prepend () { # appropriate modprobe commands to the postinst autoload = d.getVar('module_autoload_%s' % basename, True) if autoload: - name = '%s/etc/modutils/%s' % (dvar, basename) - f = open(name, 'w') - for m in autoload.split():meta/classes/kernel.bbclass python populate_packages_prepend () { · line 417
Quoted 10 lines
meta/classes/kernel.bbclass +3
-2- f.write('%s\n' % m) - f.close() name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) f = open(name, 'w') for m in autoload.split(): f.write('%s\n' % m) f.close() + modutils_name = '%s/etc/modutils/%s' % (dvar, basename) + modutils_target = '../modules-load.d/%s.conf' % (basename) + os.symlink(modutils_target, modutils_name)This basically undoes what was added in 1/2 and replaces it with symblinks right?
Quoted 1 line
If so, just do it as symlinks in the first place.
This is one patch set its best to read in totality as the symlinks get removed later. I thought about squashing the series but decided to leave it for history.
Cheers,
Richard
PATCH 3/6 kernel.bbclass: use better number for KERNEL_PRIORITY
In reply to Martin Jansa* there is no upgrade from 2.6.X to 3.X.Y
last part of PV is used as kernel priority for u-a, but X is usually higher then Y in 3.x.x so use all 3 parts in one bigger number
* and make it weak assignment if this scheme doesn't work for some recipe
* if there are just 2 numbers in PV then last one is repeated twice (see linux-openmoko_3.2 example) but that should work fine too
OE qemux86-64@ ~/oe-core $ grep ^KERNEL_PRIO linux-yocto_* linux-yocto_2.6.37.e:KERNEL_PRIORITY="20637"
linux-yocto_3.0.e:KERNEL_PRIORITY="30024"
linux-yocto_3.2.e:KERNEL_PRIORITY="30211"
OE qemux86-64@ ~/oe-core $ grep ^PV linux-yocto_* linux-yocto_2.6.37.e:PV="2.6.37+git1+aeea99683c7283f1f3320bf2ee7085ee252d4e7e_1+af2bfbe5f757361b5b027a24d67a93bfdfaaf33c" linux-yocto_3.0.e:PV="3.0.24+git2+a4ac64fe873f08ef718e2849b88914725dc99c1c_2+aac580659dc0ce083f250fb05abf82e58d7f4531" linux-yocto_3.2.e:PV="3.2.11+git2+514847185c78c07f52e02750fbe0a03ca3a31d8f_2+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8"
OE qemux86-64@ ~/shr-core $ grep ^KERNEL_PRIO linux-openmoko_* linux-openmoko_2.6.39.e:KERNEL_PRIORITY="20639" linux-openmoko_3.2.e:KERNEL_PRIORITY="30202" linux-openmoko_git.e:KERNEL_PRIORITY="30299"
OE qemux86-64@ ~/shr-core $ grep ^PV linux-openmoko_* linux-openmoko_2.6.39.e:PV="2.6.39"
linux-openmoko_3.2.e:PV="3.2" linux-openmoko_git.e:PV="3.2.99+3.3.0-rc0+gitr1+7089727d63b17615fb0a652374d79cb7df0835ad"
--- meta/classes/kernel.bbclass | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
meta/classes/kernel.bbclass +3 -1
@@ -31,7 +31,9 @@ PACKAGES_DYNAMIC += "kernel-firmware-*" export OS = "${TARGET_OS}" export CROSS_COMPILE = "${TARGET_PREFIX}" -KERNEL_PRIORITY = "${@d.getVar('PV',1).split('-')[0].split('.')[-1]}" +KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \ + int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[1]) * 100 + \ + int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[-1])}" KERNEL_RELEASE ?= "${KERNEL_VERSION}"
Signature · 1 line
1.7.8.5
PATCH 4/6 kernel.bbclass: fix extra + in kernelrelease
In reply to Martin Jansa* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +6 -0
@@ -204,6 +204,12 @@ sysroot_stage_all_append() { } kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
Signature · 1 line
1.7.8.5
Re: [PATCH 4/6] kernel.bbclass: fix extra + in kernelrelease
Quoted 1 line · Martin Jansa
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
I was just looking at this in the past day or so and was wondering where it had gone. Saved me the effort!
Quoted 23 lines
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)meta/classes/kernel.bbclass +6
-0@@ -204,6 +204,12 @@ sysroot_stage_all_append() { } kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ]&& [ ! -f "${B}/.config" ]; then
Re: [PATCH 4/6] kernel.bbclass: fix extra + in kernelrelease
Quoted 6 lines · Bruce Ashfield
Quoted 1 line · Martin Jansa
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
I was just looking at this in the past day or so and was wondering where it had gone. Saved me the effort!
Please bump PR in kernel recipes you care about (I did for mine.. )
Quoted 26 lines
Acked-by Bruce Ashfield <[email protected]>Quoted 23 lines
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)meta/classes/kernel.bbclass +6
-0@@ -204,6 +204,12 @@ sysroot_stage_all_append() { } kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ]&& [ ! -f "${B}/.config" ]; then
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 4/6] kernel.bbclass: fix extra + in kernelrelease
Quoted 9 lines · Martin Jansa
Quoted 6 lines · Bruce Ashfield
Quoted 1 line · Martin Jansa
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
I was just looking at this in the past day or so and was wondering where it had gone. Saved me the effort!
Please bump PR in kernel recipes you care about (I did for mine.. )
I was testing your patch
"linux-yocto: common-pc: Add PCNET32 to the config"
to see if this patch fixes + also in linux-yocto recipes and somehow it seems still keeping +
OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
$ ../linux/scripts/setlocalversion . -yocto-standard
seems ok, but
root@qemux86-64:/lib/modules# opkg files kernel-module-uvesafb Package kernel-module-uvesafb (3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1) is installed on root and has the following files: /lib/modules/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/uvesafb.ko
and also:
OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
$ make kernelrelease GEN /OE/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build/Makefile scripts/kconfig/conf --silentoldconfig Kconfig 3.2.11-yocto-standard+
Any idea why it doesn't work with linux-yocto layout and works with other kernels from git (tested on kernels from meta-smartphone).
Cheers,
Quoted 30 lines
Quoted 27 lines
Acked-by Bruce Ashfield <[email protected]>Quoted 23 lines
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)meta/classes/kernel.bbclass +6
-0@@ -204,6 +204,12 @@ sysroot_stage_all_append() { } kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ]&& [ ! -f "${B}/.config" ]; thenSignature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 4/6] kernel.bbclass: fix extra + in kernelrelease
Quoted 31 lines · Martin Jansa
Quoted 9 lines · Martin Jansa
Quoted 6 lines · Bruce Ashfield
Quoted 1 line · Martin Jansa
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
I was just looking at this in the past day or so and was wondering where it had gone. Saved me the effort!
Please bump PR in kernel recipes you care about (I did for mine.. )
I was testing your patch
"linux-yocto: common-pc: Add PCNET32 to the config"
to see if this patch fixes + also in linux-yocto recipes and somehow it seems still keeping +OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
$ ../linux/scripts/setlocalversion . -yocto-standardseems ok, but
root@qemux86-64:/lib/modules# opkg files kernel-module-uvesafb Package kernel-module-uvesafb (3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1) is installed on root and has the following files: /lib/modules/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/uvesafb.koand also:
OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
Quoted 8 lines
$ make kernelrelease GEN /OE/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build/Makefile scripts/kconfig/conf --silentoldconfig Kconfig 3.2.11-yocto-standard+Any idea why it doesn't work with linux-yocto layout and works with other kernels from git (tested on kernels from meta-smartphone).
Just one more note to this
OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
$ ../linux/scripts/setlocalversion ../linux -yocto-standard+
so if it calls setlocalversion against in ../linux tree we can touch .scmversion also in that directory instead of ${B}.
Cheers,
Quoted 38 lines
Cheers,
Quoted 30 lines
Quoted 27 lines
Acked-by Bruce Ashfield <[email protected]>Quoted 23 lines
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)meta/classes/kernel.bbclass +6
-0@@ -204,6 +204,12 @@ sysroot_stage_all_append() { } kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ]&& [ ! -f "${B}/.config" ]; thenSignature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 4/6] kernel.bbclass: fix extra + in kernelrelease
In reply to Martin JansaQuoted 31 lines · Martin Jansa
Quoted 9 lines · Martin Jansa
Quoted 6 lines · Bruce Ashfield
Quoted 1 line · Martin Jansa
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html
I was just looking at this in the past day or so and was wondering where it had gone. Saved me the effort!
Please bump PR in kernel recipes you care about (I did for mine.. )
I was testing your patch
"linux-yocto: common-pc: Add PCNET32 to the config"
to see if this patch fixes + also in linux-yocto recipes and somehow it seems still keeping +OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
$ ../linux/scripts/setlocalversion . -yocto-standardseems ok, but
root@qemux86-64:/lib/modules# opkg files kernel-module-uvesafb Package kernel-module-uvesafb (3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1) is installed on root and has the following files: /lib/modules/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/ /lib/modules/3.2.11-yocto-standard+/kernel/drivers/video/uvesafb.koand also:
OE @ ~/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build
Quoted 8 lines
$ make kernelrelease GEN /OE/shr-core/tmp-eglibc/work/qemux86_64-oe-linux/linux-yocto/linux-yocto-3.2.11+git6+867fc7a19f2ea74253d1f20c3d61b7829635175b_4+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8-r1/linux-qemux86-64-standard-build/Makefile scripts/kconfig/conf --silentoldconfig Kconfig 3.2.11-yocto-standard+Any idea why it doesn't work with linux-yocto layout and works with other kernels from git (tested on kernels from meta-smartphone).
I haven't had a chance to poke much at this yet, since I've been tied up working with some repository tweaks.
But I can have a look shortly. There are some old(ish) patches that deal with local version, both in the tree, and in some infrastructure that could be interacting here. I'll spawn some builds (and actually let the packaging run), and have a look.
Cheers,
Bruce
Quoted 36 lines
Cheers,
Quoted 30 lines
Quoted 16 lines
Acked-by Bruce Ashfield<[email protected]>Quoted 13 lines
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)meta/classes/kernel.bbclass +0
-0@@ -204,6 +204,12 @@ sysroot_stage_all_append() { }Quoted 11 lines
meta/classes/kernel.bbclass sysroot_stage_all_append() {
Quoted 10 lines
meta/classes/kernel.bbclass +6
-0kernel_do_configure() { + # fixes extra + in /lib/modules/2.6.37+ + # $ scripts/setlocalversion . => + + # $ make kernelversion => 2.6.37 + # $ make kernelrelease => 2.6.37+ + touch ${B}/.scmversion + # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend(). if [ -f "${WORKDIR}/defconfig" ]&& [ ! -f "${B}/.config" ]; then--
Martin 'JaMa' Jansa jabber: [email protected]
PATCH 1/1 kernel.bbclass: touch .scmversion also in ${S}
--- meta/classes/kernel.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
meta/classes/kernel.bbclass +1 -1
@@ -207,7 +207,7 @@ kernel_do_configure() { # $ scripts/setlocalversion . => + # $ make kernelversion => 2.6.37 # $ make kernelrelease => 2.6.37+ - touch ${B}/.scmversion + touch ${B}/.scmversion ${S}/.scmversion # Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend().
Signature · 1 line
1.7.8.5
Re: [PATCH] kernel.bbclass: touch .scmversion also in ${S}
Quoted 10 lines · Martin Jansa
Signed-off-by Martin Jansa<[email protected]>--- meta/classes/kernel.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)meta/classes/kernel.bbclass +0
-0
meta/classes/kernel.bbclass kernel_do_configure() { · line 210
Quoted 5 lines
meta/classes/kernel.bbclass +1
-1@@ -207,7 +207,7 @@ kernel_do_configure() { # $ scripts/setlocalversion . => + # $ make kernelversion => 2.6.37 # $ make kernelrelease => 2.6.37+ - touch ${B}/.scmversion + touch ${B}/.scmversion ${S}/.scmversion
I had the same patch here, and was about to send it. I blame my slow builder :P
Cheers,
Bruce
Quoted 3 lines
meta/classes/kernel.bbclass +0
-0# Copy defconfig to .config if .config does not exist. This allows # recipes to manage the .config themselves in do_configure_prepend().
PATCH 5/6 update-modules: update script to read /etc/modules-load.d/ directory
In reply to Martin Jansa* show warning for old /etc/modutils/* files without .conf extension
--- .../update-modules-1.0/update-modules | 14 ++++++++++++-- .../update-modules/update-modules_1.0.bb | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-)
meta/recipes-kernel/update-modules/update-modules-1.0/update-modules +12 -2
@@ -103,8 +103,8 @@ createfile() { $HEADER" # # Please do not edit this file directly. If you want to change or add -# anything please take a look at the files in /etc/modutils and read -# the manpage for update-modules. +# anything please take a look at the files in /etc/modutils, /etc/modules-load.d +# and read the manpage for update-modules. # EOF }
@@ -161,6 +161,7 @@ fi createfile "$MODCONFTMPFILE" createfile "$MODULESTMPFILE" +# well we're using /etc/modprobe.d/*.conf instead of /etc/modutils/*.conf anyway.. for cfg in /etc/modutils/* $CONF ; do if [ -f "$cfg" ]; then # this check is necesarry to skip /etc/modutils/archs if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then
@@ -168,6 +169,15 @@ for cfg in /etc/modutils/* $CONF ; do elif echo $cfg | grep -q '\.conf$' ; then addfile "$cfg" "$MODCONFTMPFILE" else + echo "Please migrate your $cfg file to /etc/modules-load.d/*.conf" + fi + fi +done +for cfg in /etc/modules-load.d/*.conf; do + if [ -f "$cfg" ]; then # this check is necesarry to skip weird entries + if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then + true + else addfile "$cfg" "$MODULESTMPFILE" fi fi
meta/recipes-kernel/update-modules/update-modules_1.0.bb +1 -1
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa RDEPENDS_${PN} = "module-init-tools-depmod" -PR = "r12" +PR = "r13" SRC_URI = "file://update-modules \ file://COPYING.GPL"
Signature · 1 line
1.7.8.5
PATCH v2 5/6 update-modules: update script to read /etc/modules-load.d/ directory
* show warning for old /etc/modutils/* files without .conf extension
* v2: keep adding modules also from old /etc/modutils/* after showing warning, this way update-modules will be backward compatible also on images without kernel upgrade
--- .../update-modules-1.0/update-modules | 15 +++++++++++++-- .../update-modules/update-modules_1.0.bb | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-)
meta/recipes-kernel/update-modules/update-modules-1.0/update-modules +13 -2
@@ -103,8 +103,8 @@ createfile() { $HEADER" # # Please do not edit this file directly. If you want to change or add -# anything please take a look at the files in /etc/modutils and read -# the manpage for update-modules. +# anything please take a look at the files in /etc/modutils, /etc/modules-load.d +# and read the manpage for update-modules. # EOF }
@@ -161,6 +161,7 @@ fi createfile "$MODCONFTMPFILE" createfile "$MODULESTMPFILE" +# well we're using /etc/modprobe.d/*.conf instead of /etc/modutils/*.conf anyway.. for cfg in /etc/modutils/* $CONF ; do if [ -f "$cfg" ]; then # this check is necesarry to skip /etc/modutils/archs if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then
@@ -168,6 +169,16 @@ for cfg in /etc/modutils/* $CONF ; do elif echo $cfg | grep -q '\.conf$' ; then addfile "$cfg" "$MODCONFTMPFILE" else + echo "Please migrate your $cfg file to /etc/modules-load.d/*.conf" + addfile "$cfg" "$MODULESTMPFILE" + fi + fi +done +for cfg in /etc/modules-load.d/*.conf; do + if [ -f "$cfg" ]; then # this check is necesarry to skip weird entries + if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then + true + else addfile "$cfg" "$MODULESTMPFILE" fi fi
meta/recipes-kernel/update-modules/update-modules_1.0.bb +1 -1
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa RDEPENDS_${PN} = "module-init-tools-depmod" -PR = "r12" +PR = "r13" SRC_URI = "file://update-modules \ file://COPYING.GPL"
Signature · 1 line
1.7.8.5
PATCH 6/6 kernel.bbclass: don't create /etc/modutils/*
In reply to Martin Jansa* update-modules was updated to read /etc/modules-load.d/*.conf
--- meta/classes/kernel.bbclass | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
meta/classes/kernel.bbclass +4 -8
@@ -123,7 +123,6 @@ kernel_do_install() { install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} - install -d ${D}/etc/modutils install -d ${D}/etc/modules-load.d install -d ${D}/etc/modprobe.d
@@ -411,7 +410,7 @@ python populate_packages_prepend () { dvar = d.getVar('PKGD', True) - # If autoloading is requested, output /etc/modutils/<name> and append + # 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:
@@ -420,9 +419,6 @@ python populate_packages_prepend () { for m in autoload.split(): f.write('%s\n' % m) f.close() - modutils_name = '%s/etc/modutils/%s' % (dvar, basename) - modutils_target = '../modules-load.d/%s.conf' % (basename) - os.symlink(modutils_target, modutils_name) postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)
@@ -438,7 +434,7 @@ python populate_packages_prepend () { f.close() files = d.getVar('FILES_%s' % pkg, True) - files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename, basename) + 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"):
@@ -464,11 +460,11 @@ python populate_packages_prepend () { 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='update-modules kernel-%s' % d.getVar("KERNEL_VERSION", True)) - # If modutils and modprobe.d are empty at this point, remove them to + # 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 # directory cannot be removed. dvar = d.getVar('PKGD', True) - for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: + for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: if len(os.listdir(dir)) == 0: os.rmdir(dir)
Signature · 1 line
1.7.8.5
Re: [PATCH 1/6] kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
In reply to Martin JansaQuoted 1 line · Martin Jansa
*
/etc/modules-load.d/foo.confis used by systemd like/etc/modutils/foowas with sysvinit
Martin,
the man-page[1] for modules-load.d says that packages should install .conf files to /usr/lib/modules-load.d, because /etc/modules-load.d is reserved for the system administrator. Did you take this into account when you decided to support /etc/modules-load.d?
Regards,
Andreas
[1] http://0pointer.de/public/systemd-man/modules-load.d.html
Quoted 48 lines
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)meta/classes/kernel.bbclass +8
-2@@ -122,6 +122,7 @@ kernel_do_install() { install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils + install -d ${D}/etc/modules-load.d install -d ${D}/etc/modprobe.d #@@ -411,6 +412,11 @@ python populate_packages_prepend () { for m in autoload.split(): f.write('%s\n' % m) f.close() + name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) + f = open(name, 'w') + for m in autoload.split(): + f.write('%s\n' % m) + f.close() postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)@@ -426,7 +432,7 @@ python populate_packages_prepend () { f.close() files = d.getVar('FILES_%s' % pkg, True) - files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) + files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename, basename) d.setVar('FILES_%s' % pkg, files) if vals.has_key("description"):@@ -456,7 +462,7 @@ python populate_packages_prepend () { # avoid warnings. removedirs only raises an OSError if an empty # directory cannot be removed. dvar = d.getVar('PKGD', True) - for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar)]: + for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: if len(os.listdir(dir)) == 0: os.rmdir(dir)
Re: [PATCH 1/6] kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
Quoted 9 lines · Andreas Oberritter
Quoted 1 line · Martin Jansa
*
/etc/modules-load.d/foo.confis used by systemd like/etc/modutils/foowas with sysvinitMartin,
the man-page[1] for modules-load.d says that packages should install .conf files to
/usr/lib/modules-load.d, because/etc/modules-load.dis reserved for the system administrator. Did you take this into account when you decided to support/etc/modules-load.d?
You're right, /usr/lib/modules-load.d could be possibly better option. I've used /etc mostly because I was using it since my first systemd image (so I was sure it works) and I don't remember seeing /usr/lib in man page when I was reading it back then (probably overlooked or forgot).
Is it worth updating update-modules (maybe teaching update-modules to look into all possible systemd directories too)?
Cheers,
Quoted 54 lines
Regards,
Andreas[1] http://0pointer.de/public/systemd-man/modules-load.d.html
Quoted 48 lines
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)meta/classes/kernel.bbclass +8
-2@@ -122,6 +122,7 @@ kernel_do_install() { install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils + install -d ${D}/etc/modules-load.d install -d ${D}/etc/modprobe.d #@@ -411,6 +412,11 @@ python populate_packages_prepend () { for m in autoload.split(): f.write('%s\n' % m) f.close() + name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) + f = open(name, 'w') + for m in autoload.split(): + f.write('%s\n' % m) + f.close() postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)@@ -426,7 +432,7 @@ python populate_packages_prepend () { f.close() files = d.getVar('FILES_%s' % pkg, True) - files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) + files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename, basename) d.setVar('FILES_%s' % pkg, files) if vals.has_key("description"):@@ -456,7 +462,7 @@ python populate_packages_prepend () { # avoid warnings. removedirs only raises an OSError if an empty # directory cannot be removed. dvar = d.getVar('PKGD', True) - for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar)]: + for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: if len(os.listdir(dir)) == 0: os.rmdir(dir)
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Re: [PATCH 1/6] kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
Quoted 11 lines · Martin Jansa
Quoted 9 lines · Andreas Oberritter
Quoted 1 line · Martin Jansa
*
/etc/modules-load.d/foo.confis used by systemd like/etc/modutils/foowas with sysvinitMartin,
the man-page[1] for modules-load.d says that packages should install .conf files to
/usr/lib/modules-load.d, because/etc/modules-load.dis reserved for the system administrator. Did you take this into account when you decided to support/etc/modules-load.d?
Quoted 8 lines
You're right,
/usr/lib/modules-load.dcould be possibly better option. I've used /etc mostly because I was using it since my first systemd image (so I was sure it works) and I don't remember seeing/usr/libin man page when I was reading it back then (probably overlooked or forgot).Is it worth updating update-modules (maybe teaching update-modules to look into all possible systemd directories too)?
I think in our case, we'd need to have /lib/modules-load.d and /usr/lib/modules-load.d depending on whether the module was meant to load without /usr being mounted. Using /etc for now seems to make most sense although it probably wouldn't hurt for the script to look at the other locations.
Cheers,
Richard
Re: [PATCH 1/6] kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
In reply to Martin JansaQuoted 20 lines · Martin Jansa
*
/etc/modules-load.d/foo.confis used by systemd like/etc/modutils/foowas with sysvinitSigned-off-by Martin Jansa <[email protected]>--- meta/classes/kernel.bbclass | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)meta/classes/kernel.bbclass +1
-0@@ -122,6 +122,7 @@ kernel_do_install() { install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils + install -d ${D}/etc/modules-load.d install -d ${D}/etc/modprobe.d #
meta/classes/kernel.bbclass python populate_packages_prepend () { · line 419
Quoted 8 lines
meta/classes/kernel.bbclass +5
-0@@ -411,6 +412,11 @@ python populate_packages_prepend () { for m in autoload.split(): f.write('%s\n' % m) f.close() + name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename) + f = open(name, 'w') + for m in autoload.split(): + f.write('%s\n' % m) + f.close()
Seems to me we should do either or, depending on if systemd is supported in the image. Is there a way to check here?
Also, we have variables for system paths like "etc", any reason we aren't using those here?
Quoted 21 lines
meta/classes/kernel.bbclass +2
-2postinst = d.getVar('pkg_postinst_%s' % pkg, True) if not postinst: bb.fatal("pkg_postinst_%s not defined" % pkg)@@ -426,7 +432,7 @@ python populate_packages_prepend () { f.close() files = d.getVar('FILES_%s' % pkg, True) - files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) + files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename, basename) d.setVar('FILES_%s' % pkg, files) if vals.has_key("description"):@@ -456,7 +462,7 @@ python populate_packages_prepend () { # avoid warnings. removedirs only raises an OSError if an empty # directory cannot be removed. dvar = d.getVar('PKGD', True) - for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar)]: + for dir in ["%s/etc/modutils" % (dvar), "%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar)]: if len(os.listdir(dir)) == 0: os.rmdir(dir)
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel