diff options
author | Florian Wickert <fw@javox-solutions.com> | 2017-03-17 16:33:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-22 11:35:21 +0000 |
commit | 1ec405ef5df82884c8997878bbe6c66d924b5127 (patch) | |
tree | 1c50b417e41fd0c55e605d3fb0580e480aa1d505 /meta/classes | |
parent | 938d077ca535ce3731bdbeed73a88118c957c289 (diff) | |
download | poky-1ec405ef5df82884c8997878bbe6c66d924b5127.tar.gz |
kernel-fitimage: dtb sections named by their filenames and one config section for each dtb
Before this, dtb sections were named by their position index in KERNEL_DEVICETREE. Also there was only one item in the config section, so only the first dtb was seen by the bootloader.
This patch adds a config section for each dtb named by the dtb filename. This is what bootloaders usually know about the machine they run on.
(From OE-Core rev: cd2ed7f80b555add07795cc0cbaee866e6c193a3)
Signed-off-by: Florian Wickert <fw@javox-solutions.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index f9702f8032..2d344b52cd 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
@@ -229,9 +229,10 @@ EOF | |||
229 | # | 229 | # |
230 | # $1 ... .its filename | 230 | # $1 ... .its filename |
231 | # $2 ... Linux kernel ID | 231 | # $2 ... Linux kernel ID |
232 | # $3 ... DTB image ID | 232 | # $3 ... DTB image name |
233 | # $4 ... ramdisk ID | 233 | # $4 ... ramdisk ID |
234 | # $5 ... config ID | 234 | # $5 ... config ID |
235 | # $6 ... default flag | ||
235 | fitimage_emit_section_config() { | 236 | fitimage_emit_section_config() { |
236 | 237 | ||
237 | conf_csum="sha1" | 238 | conf_csum="sha1" |
@@ -244,6 +245,8 @@ fitimage_emit_section_config() { | |||
244 | kernel_line="kernel = \"kernel@${2}\";" | 245 | kernel_line="kernel = \"kernel@${2}\";" |
245 | fdt_line="" | 246 | fdt_line="" |
246 | ramdisk_line="" | 247 | ramdisk_line="" |
248 | setup_line="" | ||
249 | default_line="" | ||
247 | 250 | ||
248 | if [ -n "${3}" ]; then | 251 | if [ -n "${3}" ]; then |
249 | conf_desc="${conf_desc}, FDT blob" | 252 | conf_desc="${conf_desc}, FDT blob" |
@@ -260,10 +263,14 @@ fitimage_emit_section_config() { | |||
260 | setup_line="setup = \"setup@${5}\";" | 263 | setup_line="setup = \"setup@${5}\";" |
261 | fi | 264 | fi |
262 | 265 | ||
266 | if [ "${6}" = "1" ]; then | ||
267 | default_line="default = \"conf@${3}\";" | ||
268 | fi | ||
269 | |||
263 | cat << EOF >> ${1} | 270 | cat << EOF >> ${1} |
264 | default = "conf@1"; | 271 | ${default_line} |
265 | conf@1 { | 272 | conf@${3} { |
266 | description = "${conf_desc}"; | 273 | description = "${6} ${conf_desc}"; |
267 | ${kernel_line} | 274 | ${kernel_line} |
268 | ${fdt_line} | 275 | ${fdt_line} |
269 | ${ramdisk_line} | 276 | ${ramdisk_line} |
@@ -314,6 +321,7 @@ EOF | |||
314 | fitimage_assemble() { | 321 | fitimage_assemble() { |
315 | kernelcount=1 | 322 | kernelcount=1 |
316 | dtbcount="" | 323 | dtbcount="" |
324 | DTBS="" | ||
317 | ramdiskcount=${3} | 325 | ramdiskcount=${3} |
318 | setupcount="" | 326 | setupcount="" |
319 | rm -f ${1} arch/${ARCH}/boot/${2} | 327 | rm -f ${1} arch/${ARCH}/boot/${2} |
@@ -343,8 +351,8 @@ fitimage_assemble() { | |||
343 | DTB_PATH="arch/${ARCH}/boot/${DTB}" | 351 | DTB_PATH="arch/${ARCH}/boot/${DTB}" |
344 | fi | 352 | fi |
345 | 353 | ||
346 | fitimage_emit_section_dtb ${1} ${dtbcount} ${DTB_PATH} | 354 | DTBS="${DTBS} ${DTB}" |
347 | dtbcount=`expr ${dtbcount} + 1` | 355 | fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH} |
348 | done | 356 | done |
349 | fi | 357 | fi |
350 | 358 | ||
@@ -384,7 +392,13 @@ fitimage_assemble() { | |||
384 | # | 392 | # |
385 | fitimage_emit_section_maint ${1} confstart | 393 | fitimage_emit_section_maint ${1} confstart |
386 | 394 | ||
387 | fitimage_emit_section_config ${1} "${kernelcount}" "${dtbcount}" "${ramdiskcount}" "${setupcount}" | 395 | if test -n "${DTBS}"; then |
396 | i=1 | ||
397 | for DTB in ${DTBS}; do | ||
398 | fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`" | ||
399 | i=`expr ${i} + 1` | ||
400 | done | ||
401 | fi | ||
388 | 402 | ||
389 | fitimage_emit_section_maint ${1} sectend | 403 | fitimage_emit_section_maint ${1} sectend |
390 | 404 | ||