summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-07-17 12:37:56 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2012-07-18 09:23:07 +0200
commit8c724c4ab8e946763c813e5174dbfd5ac8a5ddda (patch)
treee87692c4dbc24bdd5d4d7490aeba28456862a457 /meta-oe/classes
parent9ab875fbead52684c881d0105578328bfbf9084e (diff)
downloadmeta-openembedded-8c724c4ab8e946763c813e5174dbfd5ac8a5ddda.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. 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: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/kernel.bbclass27
1 files changed, 12 insertions, 15 deletions
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 722c9286c..4a6f66061 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -82,6 +82,10 @@ EXTRA_OEMAKE = ""
82 82
83KERNEL_ALT_IMAGETYPE ??= "" 83KERNEL_ALT_IMAGETYPE ??= ""
84 84
85# Define where the kernel headers are installed on the target as well as where
86# they are staged.
87KERNEL_SRC_PATH = "/usr/src/kernel"
88
85KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}" 89KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
86 90
87kernel_do_compile() { 91kernel_do_compile() {
@@ -135,7 +139,7 @@ kernel_do_install() {
135 # Support for external module building - create a minimal copy of the 139 # Support for external module building - create a minimal copy of the
136 # kernel source tree. 140 # kernel source tree.
137 # 141 #
138 kerneldir=${D}/kernel 142 kerneldir=${D}${KERNEL_SRC_PATH}
139 install -d $kerneldir 143 install -d $kerneldir
140 144
141 # 145 #
@@ -188,23 +192,18 @@ kernel_do_install() {
188 cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o 192 cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
189 fi 193 fi
190 194
191 # Remove the following binaries which cause strip errors 195 # Remove the following binaries which cause strip or arch QA 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-vmlinux kernel-image kernel-dev 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
@@ -474,7 +471,7 @@ python populate_packages_prepend () {
474 metapkg = "kernel-modules" 471 metapkg = "kernel-modules"
475 d.setVar('ALLOW_EMPTY_' + metapkg, "1") 472 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
476 d.setVar('FILES_' + metapkg, "") 473 d.setVar('FILES_' + metapkg, "")
477 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'kernel-misc' ] 474 blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
478 for l in module_deps.values(): 475 for l in module_deps.values():
479 for i in l: 476 for i in l:
480 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) 477 pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))