summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel.bbclass29
1 files changed, 25 insertions, 4 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index c9e1c363e8..5cabc2ce1c 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -3,9 +3,10 @@ inherit linux-kernel-base kernel-module-split
3PROVIDES += "virtual/kernel" 3PROVIDES += "virtual/kernel"
4DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native" 4DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
5 5
6S = "${STAGING_DIR_TARGET}/${KERNEL_SRC_PATH}" 6S = "${STAGING_KERNEL_DIR}"
7 7B = "${WORKDIR}/build"
8do_unpack[cleandirs] = "${S}" 8KBUILD_OUTPUT = "${B}"
9OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
9 10
10# we include gcc above, we dont need virtual/libc 11# we include gcc above, we dont need virtual/libc
11INHIBIT_DEFAULT_DEPS = "1" 12INHIBIT_DEFAULT_DEPS = "1"
@@ -35,6 +36,22 @@ python __anonymous () {
35 d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}') 36 d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
36} 37}
37 38
39# Old style kernels may set ${S} = ${WORKDIR}/git for example
40# We need to move these over to STAGING_KERNEL_DIR. We can't just
41# create the symlink in advance as the git fetcher can't cope with
42# the symlink.
43do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B}"
44base_do_unpack_append () {
45 s = d.getVar("S", True)
46 kernsrc = d.getVar("STAGING_KERNEL_DIR", True)
47 if s != kernsrc:
48 bb.utils.mkdirhier(kernsrc)
49 bb.utils.remove(kernsrc, recurse=True)
50 import subprocess
51 subprocess.call(d.expand("mv ${S} ${STAGING_KERNEL_DIR}"), shell=True)
52 os.symlink(kernsrc, s)
53}
54
38inherit kernel-arch deploy 55inherit kernel-arch deploy
39 56
40PACKAGES_DYNAMIC += "^kernel-module-.*" 57PACKAGES_DYNAMIC += "^kernel-module-.*"
@@ -255,7 +272,7 @@ python sysroot_stage_all () {
255 oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}")) 272 oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}"))
256} 273}
257 274
258KERNEL_CONFIG_COMMAND ?= "oe_runmake_call oldnoconfig || yes '' | oe_runmake oldconfig" 275KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
259 276
260kernel_do_configure() { 277kernel_do_configure() {
261 # fixes extra + in /lib/modules/2.6.37+ 278 # fixes extra + in /lib/modules/2.6.37+
@@ -264,6 +281,10 @@ kernel_do_configure() {
264 # $ make kernelrelease => 2.6.37+ 281 # $ make kernelrelease => 2.6.37+
265 touch ${B}/.scmversion ${S}/.scmversion 282 touch ${B}/.scmversion ${S}/.scmversion
266 283
284 if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
285 mv "${S}/.config" "${B}/.config"
286 fi
287
267 # Copy defconfig to .config if .config does not exist. This allows 288 # Copy defconfig to .config if .config does not exist. This allows
268 # recipes to manage the .config themselves in do_configure_prepend(). 289 # recipes to manage the .config themselves in do_configure_prepend().
269 if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then 290 if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then