]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: use ${nonarch_base_libdir} for kernel modules installation.
authorAmarnath Valluri <amarnath.valluri@intel.com>
Wed, 4 Jan 2017 11:58:23 +0000 (13:58 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Mar 2017 22:43:01 +0000 (22:43 +0000)
Replace hardcoded '/lib' in kernel modules installation path with
${nonarch_base_libdir}, which is meant exactly for this.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
meta/classes/kernel-module-split.bbclass
meta/classes/kernel.bbclass
meta/classes/module.bbclass

index ba9cc1517e5df643f5d5e3ec5dc0a20f4113e876..5e10dcf735ce271a751d8f49cd96c355e663a0f7 100644 (file)
@@ -138,7 +138,7 @@ python split_kernel_module_packages () {
     postinst = d.getVar('pkg_postinst_modules')
     postrm = d.getVar('pkg_postrm_modules')
 
-    modules = 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")))
+    modules = do_split_packages(d, root='${nonarch_base_libdir}/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")))
     if modules:
         metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
index 1e0646a437d4e892f1afadc1cc415ec8bf0f4a76..244087a59ded0c4c0e22d60b042f60f43e61a23f 100644 (file)
@@ -299,11 +299,11 @@ kernel_do_install() {
        #
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
        if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-               oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-               rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-               rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+               oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+               rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+               rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
                # If the kernel/ directory is empty remove it to prevent QA issues
-               rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+               rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
        else
                bbnote "no modules to install"
        fi
@@ -485,9 +485,9 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 # kernel-image becomes kernel-image-${KERNEL_VERSION}
 PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
 FILES_${PN} = ""
-FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = ""
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -518,7 +518,7 @@ pkg_postinst_kernel-base () {
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 # Many scripts want to look in arch/$arch/boot for the bootable
index 99b7ebc060901471683341ec31b9fd44c52729a7..802476bc7a44564f1e1e2d1b0ba549188063278d 100644 (file)
@@ -31,7 +31,7 @@ module_do_compile() {
 
 module_do_install() {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-       oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+       oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
                   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
                   O=${STAGING_KERNEL_BUILDDIR} \
                   ${MODULES_INSTALL_TARGET}