diff options
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index 72b05ff8d1..fa4ea6feef 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
@@ -257,12 +257,21 @@ fitimage_emit_section_config() { | |||
257 | # Test if we have any DTBs at all | 257 | # Test if we have any DTBs at all |
258 | sep="" | 258 | sep="" |
259 | conf_desc="" | 259 | conf_desc="" |
260 | conf_node="conf@" | ||
260 | kernel_line="" | 261 | kernel_line="" |
261 | fdt_line="" | 262 | fdt_line="" |
262 | ramdisk_line="" | 263 | ramdisk_line="" |
263 | setup_line="" | 264 | setup_line="" |
264 | default_line="" | 265 | default_line="" |
265 | 266 | ||
267 | # conf node name is selected based on dtb ID if it is present, | ||
268 | # otherwise its selected based on kernel ID | ||
269 | if [ -n "${3}" ]; then | ||
270 | conf_node=$conf_node${3} | ||
271 | else | ||
272 | conf_node=$conf_node${2} | ||
273 | fi | ||
274 | |||
266 | if [ -n "${2}" ]; then | 275 | if [ -n "${2}" ]; then |
267 | conf_desc="Linux kernel" | 276 | conf_desc="Linux kernel" |
268 | sep=", " | 277 | sep=", " |
@@ -287,12 +296,18 @@ fitimage_emit_section_config() { | |||
287 | fi | 296 | fi |
288 | 297 | ||
289 | if [ "${6}" = "1" ]; then | 298 | if [ "${6}" = "1" ]; then |
290 | default_line="default = \"conf@${3}\";" | 299 | # default node is selected based on dtb ID if it is present, |
300 | # otherwise its selected based on kernel ID | ||
301 | if [ -n "${3}" ]; then | ||
302 | default_line="default = \"conf@${3}\";" | ||
303 | else | ||
304 | default_line="default = \"conf@${2}\";" | ||
305 | fi | ||
291 | fi | 306 | fi |
292 | 307 | ||
293 | cat << EOF >> ${1} | 308 | cat << EOF >> ${1} |
294 | ${default_line} | 309 | ${default_line} |
295 | conf@${3} { | 310 | $conf_node { |
296 | description = "${6} ${conf_desc}"; | 311 | description = "${6} ${conf_desc}"; |
297 | ${kernel_line} | 312 | ${kernel_line} |
298 | ${fdt_line} | 313 | ${fdt_line} |
@@ -434,6 +449,13 @@ fitimage_assemble() { | |||
434 | # | 449 | # |
435 | fitimage_emit_section_maint ${1} confstart | 450 | fitimage_emit_section_maint ${1} confstart |
436 | 451 | ||
452 | # kernel-fitimage.bbclass currently only supports a single kernel (no less or | ||
453 | # more) to be added to the FIT image along with 0 or more device trees and | ||
454 | # 0 or 1 ramdisk. | ||
455 | # If a device tree is to be part of the FIT image, then select | ||
456 | # the default configuration to be used is based on the dtbcount. If there is | ||
457 | # no dtb present than select the default configuation to be based on | ||
458 | # the kernelcount. | ||
437 | if [ -n "${DTBS}" ]; then | 459 | if [ -n "${DTBS}" ]; then |
438 | i=1 | 460 | i=1 |
439 | for DTB in ${DTBS}; do | 461 | for DTB in ${DTBS}; do |
@@ -445,6 +467,9 @@ fitimage_assemble() { | |||
445 | fi | 467 | fi |
446 | i=`expr ${i} + 1` | 468 | i=`expr ${i} + 1` |
447 | done | 469 | done |
470 | else | ||
471 | defaultconfigcount=1 | ||
472 | fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" "${defaultconfigcount}" | ||
448 | fi | 473 | fi |
449 | 474 | ||
450 | fitimage_emit_section_maint ${1} sectend | 475 | fitimage_emit_section_maint ${1} sectend |