summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 14:35:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 15:36:52 +0000
commit3f15d8a807edb02825e32c4d8c924b4465ca5098 (patch)
tree15091a4b06f91f76a73f266ee4248124c20973ed /meta
parent36bd248463291919f2a2fa343db88c99953c18c6 (diff)
downloadpoky-3f15d8a807edb02825e32c4d8c924b4465ca5098.tar.gz
kernel: Fix depmod for multilib
Using populate_sysroot for this data was a nice idea but flawed as it doesn't work in multilib builds. Instead we can use PKGDATA_DIR since this is consistent over multilib builds. It also turns out to be slightly neater code too. Hopefully this resolves the problem once and for all. (From OE-Core rev: 6cccae3ca54c1177a1d91d23c3e151d74e735ee9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/kernel.bbclass26
-rw-r--r--meta/lib/oe/rootfs.py2
-rw-r--r--meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb12
3 files changed, 18 insertions, 22 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 29498b4faf..125ed88406 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -231,16 +231,20 @@ kernel_do_install() {
231 [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} 231 [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
232 install -d ${D}${sysconfdir}/modules-load.d 232 install -d ${D}${sysconfdir}/modules-load.d
233 install -d ${D}${sysconfdir}/modprobe.d 233 install -d ${D}${sysconfdir}/modprobe.d
234
235 # Stash data for depmod
236 install -d ${D}${datadir}/kernel-depmod/
237 echo "${KERNEL_VERSION}" > ${D}${datadir}/kernel-depmod/kernel-abiversion
238 cp System.map ${D}${datadir}/kernel-depmod/System.map-${KERNEL_VERSION}
239} 234}
240do_install[prefuncs] += "package_get_auto_pr" 235do_install[prefuncs] += "package_get_auto_pr"
241 236
242addtask shared_workdir after do_compile before do_install 237addtask shared_workdir after do_compile before do_install
243 238
239emit_depmod_pkgdata() {
240 # Stash data for depmod
241 install -d ${PKGDESTWORK}/kernel-depmod/
242 echo "${KERNEL_VERSION}" > ${PKGDESTWORK}/kernel-depmod/kernel-abiversion
243 cp System.map ${PKGDESTWORK}/kernel-depmod/System.map-${KERNEL_VERSION}
244}
245
246PACKAGEFUNCS += "emit_depmod_pkgdata"
247
244do_shared_workdir () { 248do_shared_workdir () {
245 cd ${B} 249 cd ${B}
246 250
@@ -285,21 +289,13 @@ do_shared_workdir () {
285 fi 289 fi
286} 290}
287 291
288# Only stage the files we need for depmod, not the modules/firmware 292# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
289sysroot_stage_all () { 293sysroot_stage_all () {
290 sysroot_stage_dir ${D}${datadir}/kernel-depmod ${SYSROOT_DESTDIR}${datadir}/kernel-depmod 294 :
291} 295}
292 296
293KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig" 297KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
294 298
295PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
296
297kernel_package_preprocess () {
298 rm -rf ${PKGD}${datadir}/kernel-depmod
299 rmdir ${PKGD}${datadir}
300 rmdir ${PKGD}${exec_prefix}
301}
302
303kernel_do_configure() { 299kernel_do_configure() {
304 # fixes extra + in /lib/modules/2.6.37+ 300 # fixes extra + in /lib/modules/2.6.37+
305 # $ scripts/setlocalversion . => + 301 # $ scripts/setlocalversion . => +
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 72d32f7899..420c0b9623 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -209,7 +209,7 @@ class Rootfs(object):
209 'new', '-v']) 209 'new', '-v'])
210 210
211 def _generate_kernel_module_deps(self): 211 def _generate_kernel_module_deps(self):
212 kernel_abi_ver_file = oe.path.join(self.d.getVar('STAGING_DIR_TARGET', True), self.d.getVar('datadir', True), "kernel-depmod", 212 kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod",
213 'kernel-abiversion') 213 'kernel-abiversion')
214 if not os.path.exists(kernel_abi_ver_file): 214 if not os.path.exists(kernel_abi_ver_file):
215 bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file) 215 bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file)
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 83a382a2cd..44b7650e4e 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -19,21 +19,21 @@ if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
19 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 19 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
20 exit 1 20 exit 1
21fi 21fi
22if [ ! -r ${STAGING_DIR_TARGET}${datadir}/kernel-depmod/kernel-abiversion ]; then 22if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then
23 echo "Unable to read: ${STAGING_DIR_TARGET}${datadir}/kernel-depmod/kernel-abiversion" >&2 23 echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2
24else 24else
25 kernelabi=\$(cat ${STAGING_DIR_TARGET}${datadir}/kernel-depmod/kernel-abiversion) 25 kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion)
26 if [ "\$kernelabi" != "\$4" ]; then 26 if [ "\$kernelabi" != "\$4" ]; then
27 echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2 27 echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
28 exit 1 28 exit 1
29 fi 29 fi
30fi 30fi
31 31
32if [ ! -r ${STAGING_DIR_TARHET}${datadir}/kernel-depmod/System.map-\$4 ]; then 32if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ]; then
33 echo "Unable to read: ${STAGING_DIR_TARGET}${datadir}/kernel-depmod/System.map-\$4" >&2 33 echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
34 exec env depmod "\$1" "\$2" "\$3" "\$4" 34 exec env depmod "\$1" "\$2" "\$3" "\$4"
35else 35else
36 exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_DIR_TARGET}${datadir}/kernel-depmod/System.map-\$4" "\$4" 36 exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
37fi 37fi
38EOF 38EOF
39 chmod +x ${D}${bindir_crossscripts}/depmodwrapper 39 chmod +x ${D}${bindir_crossscripts}/depmodwrapper