summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-08-28 06:41:46 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-28 15:53:09 (GMT)
commit91714ea8ae0c75b33cca0e8259e3410779129150 (patch)
treed73645fa9dc93683fa005faa600f2d56888576c4 /meta/classes
parentfbb459aab9f5000dc998a3acce2ad211c2229e5e (diff)
downloadpoky-91714ea8ae0c75b33cca0e8259e3410779129150.tar.gz
kernel: Add kernel headers to kernel-dev package
[YOCTO #1614] Add the kernel headers to the kernel-dev package. This packages what was already built and kept in sysroots for building modules with bitbake. Making this available on the target requires removing some additional host binaries. Move the location to /usr/src/kernel Before use on the target, the user will need to: # cd /usr/src/kernel # make scripts This renders the kernel-misc recipe empty, so remove it. As we use /usr/src/kernel in several places (and I missed one in the previous version), add a KERNEL_SRC_DIR variable and use that throughout the class to avoid update errors in the future. Now that we package the kernel headers, drop the kernel_package_preprocess function which removed them from PKGD. All *-sdk image recipes include dev-pkgs, so the kernel-dev package will be installed by default on all such images. (From OE-Core rev: 0e3e88f9f87d1083ddd7dcaa526b3cd7a1cd53ff) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Bruce Ashfield <bruce.ashfield@windriver.com> CC: Tom Zanussi <tom.zanussi@intel.com> CC: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel.bbclass25
1 files changed, 11 insertions, 14 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3ccd753..d79ba9f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
77 77
78KERNEL_ALT_IMAGETYPE ??= "" 78KERNEL_ALT_IMAGETYPE ??= ""
79 79
80# Define where the kernel headers are installed on the target as well as where
81# they are staged.
82KERNEL_SRC_PATH = "/usr/src/kernel"
83
80KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}" 84KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
81 85
82kernel_do_compile() { 86kernel_do_compile() {
@@ -130,7 +134,7 @@ kernel_do_install() {
130 # Support for external module building - create a minimal copy of the 134 # Support for external module building - create a minimal copy of the
131 # kernel source tree. 135 # kernel source tree.
132 # 136 #
133 kerneldir=${D}/kernel 137 kerneldir=${D}${KERNEL_SRC_PATH}
134 install -d $kerneldir 138 install -d $kerneldir
135 139
136 # 140 #
@@ -191,20 +195,15 @@ kernel_do_install() {
191 # Remove the following binaries which cause strip errors 195 # Remove the following binaries which cause strip errors
192 # during do_package for cross-compiled platforms 196 # during do_package for cross-compiled platforms
193 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ 197 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
194 arch/powerpc/boot/mktree" 198 arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
199 scripts/kconfig/conf.o"
195 for entry in $bin_files; do 200 for entry in $bin_files; do
196 rm -f $kerneldir/$entry 201 rm -f $kerneldir/$entry
197 done 202 done
198} 203}
199 204
200PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
201
202kernel_package_preprocess () {
203 rm -rf ${PKGD}/kernel
204}
205
206sysroot_stage_all_append() { 205sysroot_stage_all_append() {
207 sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel 206 sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
208} 207}
209 208
210kernel_do_configure() { 209kernel_do_configure() {
@@ -252,13 +251,11 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
252 251
253# kernel-base becomes kernel-${KERNEL_VERSION} 252# kernel-base becomes kernel-${KERNEL_VERSION}
254# kernel-image becomes kernel-image-${KERNEL_VERISON} 253# kernel-image becomes kernel-image-${KERNEL_VERISON}
255PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux kernel-misc" 254PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
256FILES = "" 255FILES = ""
257FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" 256FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
258FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*" 257FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
259FILES_kernel-vmlinux = "/boot/vmlinux*" 258FILES_kernel-vmlinux = "/boot/vmlinux*"
260# misc is a package to contain files we need in staging
261FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
262RDEPENDS_kernel = "kernel-base" 259RDEPENDS_kernel = "kernel-base"
263# Allow machines to override this dependency if kernel image files are 260# Allow machines to override this dependency if kernel image files are
264# not wanted in images as standard 261# not wanted in images as standard
@@ -475,7 +472,7 @@ python populate_packages_prepend () {
475 metapkg = "kernel-modules" 472 metapkg = "kernel-modules"
476 d.setVar('ALLOW_EMPTY_' + metapkg, "1") 473 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
477 d.setVar('FILES_' + metapkg, "") 474 d.setVar('FILES_' + metapkg, "")
478 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ] 475 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg' ]
479 for l in module_deps.values(): 476 for l in module_deps.values():
480 for i in l: 477 for i in l:
481 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) 478 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))