]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks
authorNathan Rossi <nathan@nathanrossi.com>
Fri, 21 Oct 2016 12:07:27 +0000 (22:07 +1000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 22:45:41 +0000 (22:45 +0000)
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>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/kernel-fitimage.bbclass

index 2934b3a31a00a6b569b6a093e56d41b798b67c64..706beed82ca327204d0819e82f69a9d0cbd50364 100644 (file)
@@ -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}";
                         };