Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Nathan Rossi <nathan@nathanrossi.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks
Date: Fri, 21 Oct 2016 22:07:27 +1000	[thread overview]
Message-ID: <20161021120728.22639-2-nathan@nathanrossi.com> (raw)
In-Reply-To: <20161021120728.22639-1-nathan@nathanrossi.com>

Allow the load and entry addresses to remain unset if the UBOOT_RD_*
variables are also unset for ramdisk entries in the image tree. This
allows for U-Boot to decide dynamically where to load the ramdisk.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
---
 meta/classes/kernel-fitimage.bbclass | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 3bbf91f65a..5c9e76b9ac 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -178,6 +178,15 @@ EOF
 fitimage_emit_section_ramdisk() {
 
 	ramdisk_csum="sha1"
+	ramdisk_loadline=""
+	ramdisk_entryline=""
+
+	if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
+		ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
+	fi
+	if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
+		ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
+	fi
 
 	cat << EOF >> ${1}
                 ramdisk@${2} {
@@ -187,8 +196,8 @@ fitimage_emit_section_ramdisk() {
                         arch = "${UBOOT_ARCH}";
                         os = "linux";
                         compression = "none";
-                        load = <${UBOOT_RD_LOADADDRESS}>;
-                        entry = <${UBOOT_RD_ENTRYPOINT}>;
+                        ${ramdisk_loadline}
+                        ${ramdisk_entryline}
                         hash@1 {
                                 algo = "${ramdisk_csum}";
                         };
-- 
2.9.3


  reply	other threads:[~2016-10-21 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 12:07 [PATCH] kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE Nathan Rossi
2016-10-21 12:07 ` Nathan Rossi [this message]
2016-11-23  5:29   ` [PATCH] kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks Nathan Rossi
2017-01-12  3:27     ` Nathan Rossi
2016-10-21 12:07 ` [PATCH] kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImage Nathan Rossi
2016-11-23  5:28   ` Nathan Rossi
2016-11-23  5:29 ` [PATCH] kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE Nathan Rossi

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=20161021120728.22639-2-nathan@nathanrossi.com \
    --to=nathan@nathanrossi.com \
    --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