From ed96816ca4fabad01928206381328e82dba5485f Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 10 Feb 2010 12:29:19 +0100 Subject: 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 Signed-off-by: Koen Kooi --- recipes/linux/files/configs/.empty | 0 recipes/linux/multi-kernel.inc | 89 +++++++++++++++++++++++++++++--------- 2 files changed, 68 insertions(+), 21 deletions(-) create mode 100644 recipes/linux/files/configs/.empty (limited to 'recipes') diff --git a/recipes/linux/files/configs/.empty b/recipes/linux/files/configs/.empty new file mode 100644 index 0000000000..e69de29bb2 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 -- cgit v1.2.3