Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: openembedded-core@lists.openembedded.org
Subject: [pyro][PATCH 10/17] kernel-uimage.bbclass: Fix up generation of uImage from vmlinux
Date: Fri,  6 Oct 2017 13:12:52 +0100	[thread overview]
Message-ID: <20171006121259.5817-11-git@andred.net> (raw)
In-Reply-To: <20171006121259.5817-1-git@andred.net>

From: Nathan Rossi <nathan@nathanrossi.com>

Fix up the generation of uImage from vmlinux when KEEPUIMAGE != 'yes'.
This fixes up the working directory that do_uboot_mkimage is run from,
such that it is run from the ${B} directory to access built artefacts.

Simplify the logic in the task so that the parse step either adds the
task or not if the conditions are met. This reduces the need for the
task to run in cases when it is not used. The task is also changed to
depend on the kernel_link_images task as arch/<arch>/boot/* is not
available until after kernel_link_images in certain cases (e.g.
vmlinux/uImage only KERNEL_IMAGETYPES).

Fix up the use of ${S}/vmlinux when pulling the entry symbols
address so that it accesses the vmlinux in ${B}.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>

(cherry picked from commit e0b4f018d1c2a65e66c81e5be1da8894e9a6c132)
Signed-off-by: André Draszik <adraszik@tycoint.com>
---
 meta/classes/kernel-uimage.bbclass | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
index 19c6ade507..7c026abf0b 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -15,23 +15,21 @@ python __anonymous () {
             typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
             if "uImage" in typeformake.split():
                 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('uImage', 'vmlinux'))
+
+            # Enable building of uImage with mkimage
+            bb.build.addtask('do_uboot_mkimage', 'do_install', 'do_kernel_link_images', d)
 }
 
+do_uboot_mkimage[dirs] += "${B}"
 do_uboot_mkimage() {
-	if echo "${KERNEL_IMAGETYPES}" | grep -wq "uImage"; then
-		if test "x${KEEPUIMAGE}" != "xyes" ; then
-			uboot_prep_kimage
-
-			ENTRYPOINT=${UBOOT_ENTRYPOINT}
-			if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
-				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
-					awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
-			fi
+	uboot_prep_kimage
 
-			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 ${B}/arch/${ARCH}/boot/uImage
-			rm -f linux.bin
-		fi
+	ENTRYPOINT=${UBOOT_ENTRYPOINT}
+	if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+		ENTRYPOINT=`${HOST_PREFIX}nm ${B}/vmlinux | \
+			awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
 	fi
-}
 
-addtask uboot_mkimage before do_install after do_compile
+	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 ${B}/arch/${ARCH}/boot/uImage
+	rm -f linux.bin
+}
-- 
2.14.2



  parent reply	other threads:[~2017-10-06 12:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 12:12 [pyro] some backported patches André Draszik
2017-10-06 12:12 ` [pyro][PATCH 01/17] gdb: fix gdbserver not working in musl/mips context André Draszik
2017-10-06 12:12 ` [pyro][PATCH 02/17] busybox: fix a linking issue André Draszik
2017-10-06 12:12 ` [pyro][PATCH 03/17] busybox: add backported patch to support iproute 'scope' André Draszik
2017-10-06 12:12 ` [pyro][PATCH 04/17] openssh: allow to override OpenSSL HostKeys when read-only-rootfs André Draszik
2017-10-06 13:38   ` Joshua Watt
2017-10-06 12:12 ` [pyro][PATCH 05/17] selftest/archiver: add tests for recipe type filtering André Draszik
2017-10-06 12:12 ` [pyro][PATCH 06/17] selftest/archiver: only execute deploy_archives task André Draszik
2017-10-06 12:12 ` [pyro][PATCH 07/17] copyleft_filter.bbclass: restore possiblity to filter on type André Draszik
2017-10-06 12:12 ` [pyro][PATCH 08/17] debianutils: Add a native version (for run-parts) André Draszik
2017-10-06 12:12 ` [pyro][PATCH 09/17] ca-certificates: Fix postinst dependency issues André Draszik
2017-10-06 12:12 ` André Draszik [this message]
2017-10-06 12:12 ` [pyro][PATCH 11/17] kernel-fitimage: sanitize dtb section name (unbreak MIPS) André Draszik
2017-10-06 12:12 ` [pyro][PATCH 12/17] kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support André Draszik
2017-10-06 12:12 ` [pyro][PATCH 13/17] kernel-uimage: optimise " André Draszik
2017-10-06 12:12 ` [pyro][PATCH 14/17] kernel-uboot: support compressed kernel on MIPS André Draszik
2017-10-06 12:12 ` [pyro][PATCH 15/17] kernel-fitimage: support MIPS (compressed) André Draszik
2017-10-06 12:12 ` [pyro][PATCH 16/17] curl: enable threaded resolver André Draszik
2017-10-06 12:12 ` [pyro][PATCH 17/17] useradd-staticids: don't create username-group if gid is specified André Draszik
2017-10-10 14:58 ` [pyro] some backported patches akuster808
2017-10-18  7:05   ` André Draszik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171006121259.5817-11-git@andred.net \
    --to=git@andred.net \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox