From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by mail.openembedded.org (Postfix) with ESMTP id B346D70A21 for ; Thu, 7 Aug 2014 15:26:21 +0000 (UTC) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3hTYSt6Nq0z3hhj9; Thu, 7 Aug 2014 17:26:22 +0200 (CEST) X-Auth-Info: YL9ZzbbWEpQfNwEn0mD7NhdmWCFOAn9vvquCQHMCrxE= Received: from chi.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3hTYSt5h3Lz7S6QJ; Thu, 7 Aug 2014 17:26:22 +0200 (CEST) From: Marek Vasut To: openembedded-core@lists.openembedded.org Date: Thu, 7 Aug 2014 17:26:11 +0200 Message-Id: <1407425175-2828-2-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1407425175-2828-1-git-send-email-marex@denx.de> References: <1407425175-2828-1-git-send-email-marex@denx.de> Cc: Marek Vasut Subject: [PATCH 1/5] Yocto: kernel: Rework do_uboot_mkimage X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 15:26:21 -0000 Rework the function so part it's internals can be re-used by fitImage image type. The name of the temporary file , linux.bin , is recycled a little more as it's now used for both the case where it is gzip compressed and where it is not. This should be fine, since the file is temporary and removed after the uImage was created anyway. There is no functional change here. Signed-off-by: Marek Vasut --- meta/classes/kernel.bbclass | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 6ed1cb7..2e2b1fe 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -447,22 +447,32 @@ MODULE_TARBALL_DEPLOY ?= "1" do_uboot_mkimage() { if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then if test "x${KEEPUIMAGE}" != "xyes" ; then + if test -e arch/${ARCH}/boot/compressed/vmlinux ; then + vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux" + linux_suffix="" + linux_comp="none" + else + vmlinux_path="vmlinux" + linux_suffix=".gz" + linux_comp="gzip" + fi + + ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin + + if [ "${linux_comp}" != "none" ] ; then + rm -f linux.bin + gzip -9 linux.bin + mv -f "linux.bin${linux_suffix}" linux.bin + fi + ENTRYPOINT=${UBOOT_ENTRYPOINT} if test -n "${UBOOT_ENTRYSYMBOL}"; then ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'` fi - if test -e arch/${ARCH}/boot/compressed/vmlinux ; then - ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin - uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage - rm -f linux.bin - else - ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin - rm -f linux.bin.gz - gzip -9 linux.bin - uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage - rm -f linux.bin.gz - fi + + uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage + rm -f linux.bin fi fi } -- 2.0.1