aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/classes/kernel.bbclass43
1 files changed, 20 insertions, 23 deletions
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index ce82351f8..7b80e9a79 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -82,6 +82,10 @@ EXTRA_OEMAKE = ""
KERNEL_ALT_IMAGETYPE ??= ""
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+
KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
kernel_do_compile() {
@@ -135,7 +139,7 @@ kernel_do_install() {
# Support for external module building - create a minimal copy of the
# kernel source tree.
#
- kerneldir=${D}/kernel
+ kerneldir=${D}${KERNEL_SRC_PATH}
install -d $kerneldir
#
@@ -178,7 +182,7 @@ kernel_do_install() {
#
oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
make -C $kerneldir _mrproper_scripts
- find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
+ find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
# As of Linux kernel version 3.0.1, the clean target removes
@@ -188,23 +192,21 @@ kernel_do_install() {
cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
fi
- # Remove the following binaries which cause strip errors
+ # Necessary for building modules like compat-wireless.
+ cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
+
+ # Remove the following binaries which cause strip or arch QA errors
# during do_package for cross-compiled platforms
bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
- arch/powerpc/boot/mktree"
+ arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
+ scripts/kconfig/conf.o scripts/kconfig/kxgettext.o"
for entry in $bin_files; do
rm -f $kerneldir/$entry
done
}
-PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
-
-kernel_package_preprocess () {
- rm -rf ${PKGD}/kernel
-}
-
sysroot_stage_all_append() {
- sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
+ sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
}
kernel_do_configure() {
@@ -252,19 +254,18 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
# kernel-base becomes kernel-${KERNEL_VERSION}
# kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
FILES = ""
FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
FILES_kernel-vmlinux = "/boot/vmlinux*"
-# misc is a package to contain files we need in staging
-FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
RDEPENDS_kernel = "kernel-base"
# Allow machines to override this dependency if kernel image files are
# not wanted in images as standard
RDEPENDS_kernel-base ?= "kernel-image"
PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"
ALLOW_EMPTY_kernel = "1"
ALLOW_EMPTY_kernel-base = "1"
ALLOW_EMPTY_kernel-image = "1"
@@ -318,12 +319,12 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
python populate_packages_prepend () {
def extract_modinfo(file):
- import tempfile, re
+ import tempfile, re, subprocess
tempfile.tempdir = d.getVar("WORKDIR", True)
tf = tempfile.mkstemp()
tmpfile = tf[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
- os.system(cmd)
+ subprocess.call(cmd, shell=True)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
@@ -475,7 +476,7 @@ python populate_packages_prepend () {
metapkg = "kernel-modules"
d.setVar('ALLOW_EMPTY_' + metapkg, "1")
d.setVar('FILES_' + metapkg, "")
- blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ]
+ blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
for l in module_deps.values():
for i in l:
pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
@@ -544,6 +545,7 @@ kernel_do_deploy() {
cd ${DEPLOYDIR}
rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
+ ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGETYPE}
cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
}
@@ -553,8 +555,3 @@ addtask deploy before do_build after do_install
EXPORT_FUNCTIONS do_deploy
-# perf must be enabled in individual kernel recipes
-PACKAGES =+ "perf-dbg perf"
-FILES_perf = "${bindir}/* \
- ${libexecdir}"
-FILES_perf-dbg = "${FILES_${PN}-dbg}"