diff options
author | Koen Kooi <k-kooi@ti.com> | 2010-02-10 12:29:19 +0100 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2010-04-12 19:43:18 +0200 |
commit | ed96816ca4fabad01928206381328e82dba5485f (patch) | |
tree | c77025f6518c70401bcdf6f2cd7b2632b45eef2a /recipes/linux | |
parent | 3aa2b62bb50f2c6f6790c9dfdcb8924c43250ca4 (diff) |
multi-kernel: Allow inclusion in regular kernel build flow, deploy improvements
* user proper name for *Image in deploy
* Moved from do_compile to seperate task, pre-configure step
* Context save/restore the regular defconfig, so we don't break the normal flow
* Install binaries and .configs + create symlinks
* Add deploy_append step to install normal flow .config in same fashion
* When there are no additional configs defined the do_compileconfigs() method changes to a NOOP
Signed-off-by: Roger Monk <r-monk@ti.com>
Signed-off-by: Koen Kooi <k-kooi@ti.com>
Diffstat (limited to 'recipes/linux')
-rw-r--r-- | recipes/linux/files/configs/.empty | 0 | ||||
-rw-r--r-- | recipes/linux/multi-kernel.inc | 89 |
2 files changed, 68 insertions, 21 deletions
diff --git a/recipes/linux/files/configs/.empty b/recipes/linux/files/configs/.empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/recipes/linux/files/configs/.empty diff --git a/recipes/linux/multi-kernel.inc b/recipes/linux/multi-kernel.inc index f8fd950a85..a85bf2a8cd 100644 --- a/recipes/linux/multi-kernel.inc +++ b/recipes/linux/multi-kernel.inc @@ -1,9 +1,9 @@ # This .inc file allows you to build and deploy multiple sets of kernel + modules with different defconfigs # -# Note that this include will NOT stage anything nor create packages, since that is virtuall impossible +# 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 has mutually exclusive drivers due to e.g. pinmuxing issues. +# 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 # @@ -12,31 +12,78 @@ require linux.inc -SRC_URI = " \ - file://configs/" +SRC_URI_append = " \ + file://configs/ " +do_compileconfigs () { -do_compile() { - for config in ${WORKDIR}/configs/* ; do - cp $config ${WORKDIR}/defconfig - echo "CONFIG_IKCONFIG=y" >> ${WORKDIR}/defconfig - echo "CONFIG_IKCONFIG_PROC=y" >> ${WORKDIR}/defconfig - - do_configure - kernel_do_compile - kernel_do_install + # Compile and Install additional kernel configs if found + 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" - cp arch/${ARCH}/boot/uImage ${DEPLOY_DIR_IMAGE}/uImage.multi-config-$(basename $config) + # Context Save the regular 'defconfig' + cp ${WORKDIR}/defconfig ${WORKDIR}/defconfig.save - if [ -d "${D}/lib" ]; then - fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.multi-config-$(basename $config).tgz -C ${D} lib - fi - done -} + for config in ${WORKDIR}/configs/* ; do + + # Copy in alternative config + cd ${S} + cp $config ${WORKDIR}/defconfig + + # Enable config to be viewed on the target + echo "CONFIG_IKCONFIG=y" >> ${WORKDIR}/defconfig + echo "CONFIG_IKCONFIG_PROC=y" >> ${WORKDIR}/defconfig + + # Build and Install this alternative kernel + do_configure + kernel_do_compile + kernel_do_install + + # Drop the resulting images in the deploy dir + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.multi-config-$(basename $config).bin + + if [ -d "${D}/lib" ]; then + fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.multi-config-$(basename $config).tgz -C ${D} lib + fi + + # Install the final config alongside the images + cp .config ${DEPLOY_DIR_IMAGE}/config-${PV}-${PR}-${MACHINE}.multi-config-$(basename $config).config + + # Create symlinks + cd ${DEPLOY_DIR_IMAGE} + rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.multi-config-$(basename $config).bin + ln -sf ${KERNEL_IMAGE_BASE_NAME}.multi-config-$(basename $config).bin ${KERNEL_IMAGE_SYMLINK_NAME}.multi-config-$(basename $config).bin + rm -f modules-${MACHINE}.multi-config-$(basename $config).tgz + ln -sf ${MODULES_IMAGE_BASE_NAME}.multi-config-$(basename $config).tgz modules-${MACHINE}.multi-config-$(basename $config).tgz + rm -f config-${MACHINE}.multi-config-$(basename $config).config + ln -sf config-${PV}-${PR}-${MACHINE}.multi-config-$(basename $config).config config-${MACHINE}.multi-config-$(basename $config).config -do_install() { - : + done + + # Restore the regular 'defconfig' + cp ${WORKDIR}/defconfig.save ${WORKDIR}/defconfig + fi } +# For reference, copy .config to deploy image +do_deploy_append () { + + # Drop the regular defconfig along side the others for consistency + cd ${S} + cp .config ${DEPLOY_DIR_IMAGE}/config-${PV}-${PR}-${MACHINE}.config + + # add symlink + cd ${DEPLOY_DIR_IMAGE} + rm -f ${DEPLOY_DIR_IMAGE}/config-${MACHINE}.config + ln -s ${DEPLOY_DIR_IMAGE}/config-${PV}-${PR}-${MACHINE}.config ${DEPLOY_DIR_IMAGE}/config-${MACHINE}.config + + rm -f modules-${MACHINE}.tgz + ln -sf ${MODULES_IMAGE_BASE_NAME}.tgz modules-${MACHINE}.tgz + +} +addtask compileconfigs after do_patch before do_configure |