]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel-fitimage: Add DTBO support for configurations
authorAlex Kiernan <alex.kiernan@gmail.com>
Sat, 16 Jun 2018 09:28:53 +0000 (09:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 Jun 2018 09:59:33 +0000 (10:59 +0100)
When generating overlay DTB configuration sections, U-Boot doesn't want
the kernel specified again as we already have that in our base DTB. Add
support for this to allow bootm to process overlay configuration sections.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel-fitimage.bbclass

index f3c2ff0a300492f003f9256de36e7e6a86815bed..f84be44bb9e4ea5098044a4e8bc9ff87ef2503a9 100644 (file)
@@ -258,25 +258,34 @@ fitimage_emit_section_config() {
        fi
 
        # Test if we have any DTBs at all
-       conf_desc="Linux kernel"
-       kernel_line="kernel = \"kernel@${2}\";"
+       sep=""
+       conf_desc=""
+       kernel_line=""
        fdt_line=""
        ramdisk_line=""
        setup_line=""
        default_line=""
 
+       if [ -n "${2}" ]; then
+               conf_desc="Linux kernel"
+               sep=", "
+               kernel_line="kernel = \"kernel@${2}\";"
+       fi
+
        if [ -n "${3}" ]; then
-               conf_desc="${conf_desc}, FDT blob"
+               conf_desc="${conf_desc}${sep}FDT blob"
+               sep=", "
                fdt_line="fdt = \"fdt@${3}\";"
        fi
 
        if [ -n "${4}" ]; then
-               conf_desc="${conf_desc}, ramdisk"
+               conf_desc="${conf_desc}${sep}ramdisk"
+               sep=", "
                ramdisk_line="ramdisk = \"ramdisk@${4}\";"
        fi
 
        if [ -n "${5}" ]; then
-               conf_desc="${conf_desc}setup"
+               conf_desc="${conf_desc}${sep}setup"
                setup_line="setup = \"setup@${5}\";"
        fi
 
@@ -299,18 +308,26 @@ EOF
 
        if [ ! -z "${conf_sign_keyname}" ] ; then
 
-               sign_line="sign-images = \"kernel\""
+               sign_line="sign-images = "
+               sep=""
+
+               if [ -n "${2}" ]; then
+                       sign_line="${sign_line}${sep}\"kernel\""
+                       sep=", "
+               fi
 
                if [ -n "${3}" ]; then
-                       sign_line="${sign_line}, \"fdt\""
+                       sign_line="${sign_line}${sep}\"fdt\""
+                       sep=", "
                fi
 
                if [ -n "${4}" ]; then
-                       sign_line="${sign_line}, \"ramdisk\""
+                       sign_line="${sign_line}${sep}\"ramdisk\""
+                       sep=", "
                fi
 
                if [ -n "${5}" ]; then
-                       sign_line="${sign_line}\"setup\""
+                       sign_line="${sign_line}${sep}\"setup\""
                fi
 
                sign_line="${sign_line};"
@@ -413,7 +430,12 @@ fitimage_assemble() {
        if [ -n "${DTBS}" ]; then
                i=1
                for DTB in ${DTBS}; do
-                       fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
+                       dtb_ext=${DTB##*.}
+                       if [ "${dtb_ext}" = "dtbo" ]; then
+                               fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`"
+                       else
+                               fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
+                       fi
                        i=`expr ${i} + 1`
                done
        fi