summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-06-22 17:44:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-04 17:40:33 +0100
commit68a8caa738caa25f313a0bccfd8179cc5584afa5 (patch)
tree61e879746eb9da9b17eadc49845f8f192f430547 /meta/classes
parenta0bbbdfdc8b67b80b0a207da3b8ad511c7f5aa7a (diff)
downloadpoky-68a8caa738caa25f313a0bccfd8179cc5584afa5.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: 6125ea40d4483965f793bd847b3ce14b668a5b1e) 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.bbclass27
1 files changed, 12 insertions, 15 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 31e633b812..44461bccbb 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 #
@@ -183,23 +187,18 @@ kernel_do_install() {
183 cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o 187 cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
184 fi 188 fi
185 189
186 # Remove the following binaries which cause strip errors 190 # Remove the following binaries which cause strip or arch QA errors
187 # during do_package for cross-compiled platforms 191 # during do_package for cross-compiled platforms
188 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ 192 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
189 arch/powerpc/boot/mktree" 193 arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
194 scripts/kconfig/conf.o"
190 for entry in $bin_files; do 195 for entry in $bin_files; do
191 rm -f $kerneldir/$entry 196 rm -f $kerneldir/$entry
192 done 197 done
193} 198}
194 199
195PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
196
197kernel_package_preprocess () {
198 rm -rf ${PKGD}/kernel
199}
200
201sysroot_stage_all_append() { 200sysroot_stage_all_append() {
202 sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel 201 sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
203} 202}
204 203
205kernel_do_configure() { 204kernel_do_configure() {
@@ -247,13 +246,11 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
247 246
248# kernel-base becomes kernel-${KERNEL_VERSION} 247# kernel-base becomes kernel-${KERNEL_VERSION}
249# kernel-image becomes kernel-image-${KERNEL_VERISON} 248# kernel-image becomes kernel-image-${KERNEL_VERISON}
250PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc" 249PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
251FILES = "" 250FILES = ""
252FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" 251FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
253FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*" 252FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
254FILES_kernel-vmlinux = "/boot/vmlinux*" 253FILES_kernel-vmlinux = "/boot/vmlinux*"
255# misc is a package to contain files we need in staging
256FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
257RDEPENDS_kernel = "kernel-base" 254RDEPENDS_kernel = "kernel-base"
258# Allow machines to override this dependency if kernel image files are 255# Allow machines to override this dependency if kernel image files are
259# not wanted in images as standard 256# not wanted in images as standard
@@ -469,7 +466,7 @@ python populate_packages_prepend () {
469 metapkg = "kernel-modules" 466 metapkg = "kernel-modules"
470 d.setVar('ALLOW_EMPTY_' + metapkg, "1") 467 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
471 d.setVar('FILES_' + metapkg, "") 468 d.setVar('FILES_' + metapkg, "")
472 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'kernel-misc' ] 469 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
473 for l in module_deps.values(): 470 for l in module_deps.values():
474 for i in l: 471 for i in l:
475 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) 472 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))