]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blobdiff - recipes-kernel/linux/multi-kernel.inc
multi-kernel.inc: drop use of KERNEL_CCSUFFIX to match oe-core
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / multi-kernel.inc
index 27994867c4585e11fea7775fa3ce87aee48c691e..9a0c090b122dc69d4295717b83e8f629d9a9606d 100644 (file)
@@ -1,39 +1,53 @@
-# This .inc file allows you to build and deploy multiple sets of kernel + modules with different defconfigs
+# This .inc file allows building and deploying multiple sets of kernel + modules
+# with different defconfigs
 #
-# Note that this include will NOT stage anything nor create packages, since that is virtually impossible
-# Userspace should be built against the 'regular' kernel
+# Note that this include will NOT stage anything nor create packages, since that
+# is virtually impossible. Userspace should be built against the 'regular' kernel
 #
-# The intended usecase is for machines that have mutually exclusive drivers due to e.g. pinmuxing issues.
-# For example the LogicPD omap-l138 experimenter board can have multiple mutually exclusive expansion boards
-# like lcd, ethernet, sound, 20x2 character LCD, etc. To be able to easily test all of those you can use this .inc
+# The intended usecase is for machines that have mutually exclusive drivers due
+# to e.g. pinmuxing issues. For example the LogicPD omap-l138 experimenter board
+# can have multiple mutually exclusive expansion boards like lcd, ethernet,
+# sound, 20x2 character LCD, etc. To be able to easily test all of those you can
+# use this .inc
 #
-# To make it easier finding the original defconfig from a running kernel, this also forcefully turns on 
-# CONFIG_IKCONFIG_PROC so people can do 'zcat /proc/config.gz' on the target.
+# To make it easier finding the original defconfig from a running kernel, this
+# also forcefully turns on CONFIG_IKCONFIG_PROC so people can do
+# 'zcat /proc/config.gz' on the target.
+#
+# The function get_kernelversion uses generated header files to extract the
+# version number. But those files are not available until do_compile, and
+# do_compileconfigs is injected before that, hence the version becomes None
+# and breaks in several places. Introduce a task do_preparekernel that calls
+# "make prepare" in the kernel tree to generate all the necessary files.
 
 require linux.inc
 
 SRC_URI += " \
-           file://configs/* "
+           file://configs "
 
 MULTI_CONFIG_BASE_SUFFIX = "multi-config-"
+MODULES_IMAGE_BASE_NAME = "modules-${PV}-${PR}-${MACHINE}"
+
+do_preparekernel () {
+       unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+       oe_runmake prepare CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+}
 
-# bitbake.conf only prepends PARALLEL make in tasks called do_compile, which isn't the case for multiconfig
-# So explicitly enable it for compileconfigs in here
-EXTRA_OEMAKE = "${PARALLEL_MAKE} "
+addtask preparekernel after do_configure before do_compile
 
 do_compileconfigs () {
 
   # fixup for fetcher change
   if [ -e ${WORKDIR}/configs/configs ] ; then
-      if [ -e ${WORKDIR}/configs/configs/.empty ] ; then
-          mv ${WORKDIR}/configs/configs/.empty ${WORKDIR}/configs/
+      if [ -e ${WORKDIR}/configs/configs/empty ] ; then
+          mv ${WORKDIR}/configs/configs/empty ${WORKDIR}/configs/
       fi
       mv ${WORKDIR}/configs/configs/* ${WORKDIR}/configs/
       rm -rf ${WORKDIR}/configs/configs
   fi
 
   # Compile and Install additional kernel configs if found
-  if [ -e ${WORKDIR}/configs/.empty ] ; then
+  if [ -e ${WORKDIR}/configs/empty ] ; then
        echo "No configs found in configs/ directory, skipping to regular build"
   else
       echo "Multiple configs found, building those first"
@@ -81,6 +95,8 @@ do_compileconfigs () {
 
       # Restore the regular 'defconfig'
       cp ${WORKDIR}/defconfig.save ${WORKDIR}/defconfig
+      cd ${S}
+      do_configure
     fi
 }
 
@@ -103,6 +119,5 @@ do_deploy_append () {
 
 }
 
-do_compileconfigs[depends] += "u-boot-mkimage-native:do_populate_sysroot virtual/${TARGET_PREFIX}gcc:do_populate_sysroot virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}:do_populate_sysroot"
-addtask compileconfigs after do_patch before do_configure
-
+do_compileconfigs[depends] += "u-boot-mkimage-native:do_populate_sysroot virtual/${TARGET_PREFIX}gcc:do_populate_sysroot"
+addtask compileconfigs after do_preparekernel before do_compile