summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-fitimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r--meta/classes/kernel-fitimage.bbclass187
1 files changed, 146 insertions, 41 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 72b05ff8d1..7c7bcd3fc0 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -1,5 +1,7 @@
1inherit kernel-uboot kernel-artifact-names uboot-sign 1inherit kernel-uboot kernel-artifact-names uboot-sign
2 2
3KERNEL_IMAGETYPE_REPLACEMENT = ""
4
3python __anonymous () { 5python __anonymous () {
4 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" 6 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
5 if 'fitImage' in kerneltypes.split(): 7 if 'fitImage' in kerneltypes.split():
@@ -21,6 +23,8 @@ python __anonymous () {
21 else: 23 else:
22 replacementtype = "zImage" 24 replacementtype = "zImage"
23 25
26 d.setVar("KERNEL_IMAGETYPE_REPLACEMENT", replacementtype)
27
24 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal 28 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
25 # to kernel.bbclass . We have to override it, since we pack zImage 29 # to kernel.bbclass . We have to override it, since we pack zImage
26 # (at least for now) into the fitImage . 30 # (at least for now) into the fitImage .
@@ -45,6 +49,8 @@ python __anonymous () {
45 if d.getVar('UBOOT_SIGN_ENABLE') == "1" and d.getVar('UBOOT_DTB_BINARY'): 49 if d.getVar('UBOOT_SIGN_ENABLE') == "1" and d.getVar('UBOOT_DTB_BINARY'):
46 uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot' 50 uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
47 d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn) 51 d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn)
52 if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1":
53 d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' %s:do_populate_sysroot' % uboot_pn)
48} 54}
49 55
50# Options for the device tree compiler passed to mkimage '-D' feature: 56# Options for the device tree compiler passed to mkimage '-D' feature:
@@ -56,6 +62,12 @@ FIT_HASH_ALG ?= "sha256"
56# fitImage Signature Algo 62# fitImage Signature Algo
57FIT_SIGN_ALG ?= "rsa2048" 63FIT_SIGN_ALG ?= "rsa2048"
58 64
65# fitImage Padding Algo
66FIT_PAD_ALG ?= "pkcs-1.5"
67
68# Arguments passed to mkimage for signing
69UBOOT_MKIMAGE_SIGN_ARGS ?= ""
70
59# 71#
60# Emit the fitImage ITS header 72# Emit the fitImage ITS header
61# 73#
@@ -124,7 +136,7 @@ fitimage_emit_section_kernel() {
124 fi 136 fi
125 137
126 cat << EOF >> ${1} 138 cat << EOF >> ${1}
127 kernel@${2} { 139 kernel-${2} {
128 description = "Linux kernel"; 140 description = "Linux kernel";
129 data = /incbin/("${3}"); 141 data = /incbin/("${3}");
130 type = "kernel"; 142 type = "kernel";
@@ -133,7 +145,7 @@ fitimage_emit_section_kernel() {
133 compression = "${4}"; 145 compression = "${4}";
134 load = <${UBOOT_LOADADDRESS}>; 146 load = <${UBOOT_LOADADDRESS}>;
135 entry = <${ENTRYPOINT}>; 147 entry = <${ENTRYPOINT}>;
136 hash@1 { 148 hash-1 {
137 algo = "${kernel_csum}"; 149 algo = "${kernel_csum}";
138 }; 150 };
139 }; 151 };
@@ -160,14 +172,14 @@ fitimage_emit_section_dtb() {
160 dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" 172 dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;"
161 fi 173 fi
162 cat << EOF >> ${1} 174 cat << EOF >> ${1}
163 fdt@${2} { 175 fdt-${2} {
164 description = "Flattened Device Tree blob"; 176 description = "Flattened Device Tree blob";
165 data = /incbin/("${3}"); 177 data = /incbin/("${3}");
166 type = "flat_dt"; 178 type = "flat_dt";
167 arch = "${UBOOT_ARCH}"; 179 arch = "${UBOOT_ARCH}";
168 compression = "none"; 180 compression = "none";
169 ${dtb_loadline} 181 ${dtb_loadline}
170 hash@1 { 182 hash-1 {
171 algo = "${dtb_csum}"; 183 algo = "${dtb_csum}";
172 }; 184 };
173 }; 185 };
@@ -175,6 +187,43 @@ EOF
175} 187}
176 188
177# 189#
190# Emit the fitImage ITS u-boot script section
191#
192# $1 ... .its filename
193# $2 ... Image counter
194# $3 ... Path to boot script image
195fitimage_emit_section_boot_script() {
196
197 bootscr_csum="${FIT_HASH_ALG}"
198 bootscr_sign_algo="${FIT_SIGN_ALG}"
199 bootscr_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}"
200
201 cat << EOF >> $1
202 bootscr-$2 {
203 description = "U-boot script";
204 data = /incbin/("$3");
205 type = "script";
206 arch = "${UBOOT_ARCH}";
207 compression = "none";
208 hash-1 {
209 algo = "$bootscr_csum";
210 };
211 };
212EOF
213
214 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$bootscr_sign_keyname" ] ; then
215 sed -i '$ d' $1
216 cat << EOF >> $1
217 signature-1 {
218 algo = "$bootscr_csum,$bootscr_sign_algo";
219 key-name-hint = "$bootscr_sign_keyname";
220 };
221 };
222EOF
223 fi
224}
225
226#
178# Emit the fitImage ITS setup section 227# Emit the fitImage ITS setup section
179# 228#
180# $1 ... .its filename 229# $1 ... .its filename
@@ -185,7 +234,7 @@ fitimage_emit_section_setup() {
185 setup_csum="${FIT_HASH_ALG}" 234 setup_csum="${FIT_HASH_ALG}"
186 235
187 cat << EOF >> ${1} 236 cat << EOF >> ${1}
188 setup@${2} { 237 setup-${2} {
189 description = "Linux setup.bin"; 238 description = "Linux setup.bin";
190 data = /incbin/("${3}"); 239 data = /incbin/("${3}");
191 type = "x86_setup"; 240 type = "x86_setup";
@@ -194,7 +243,7 @@ fitimage_emit_section_setup() {
194 compression = "none"; 243 compression = "none";
195 load = <0x00090000>; 244 load = <0x00090000>;
196 entry = <0x00090000>; 245 entry = <0x00090000>;
197 hash@1 { 246 hash-1 {
198 algo = "${setup_csum}"; 247 algo = "${setup_csum}";
199 }; 248 };
200 }; 249 };
@@ -221,7 +270,7 @@ fitimage_emit_section_ramdisk() {
221 fi 270 fi
222 271
223 cat << EOF >> ${1} 272 cat << EOF >> ${1}
224 ramdisk@${2} { 273 ramdisk-${2} {
225 description = "${INITRAMFS_IMAGE}"; 274 description = "${INITRAMFS_IMAGE}";
226 data = /incbin/("${3}"); 275 data = /incbin/("${3}");
227 type = "ramdisk"; 276 type = "ramdisk";
@@ -230,7 +279,7 @@ fitimage_emit_section_ramdisk() {
230 compression = "none"; 279 compression = "none";
231 ${ramdisk_loadline} 280 ${ramdisk_loadline}
232 ${ramdisk_entryline} 281 ${ramdisk_entryline}
233 hash@1 { 282 hash-1 {
234 algo = "${ramdisk_csum}"; 283 algo = "${ramdisk_csum}";
235 }; 284 };
236 }; 285 };
@@ -244,13 +293,15 @@ EOF
244# $2 ... Linux kernel ID 293# $2 ... Linux kernel ID
245# $3 ... DTB image name 294# $3 ... DTB image name
246# $4 ... ramdisk ID 295# $4 ... ramdisk ID
247# $5 ... config ID 296# $5 ... u-boot script ID
248# $6 ... default flag 297# $6 ... config ID
298# $7 ... default flag
249fitimage_emit_section_config() { 299fitimage_emit_section_config() {
250 300
251 conf_csum="${FIT_HASH_ALG}" 301 conf_csum="${FIT_HASH_ALG}"
252 conf_sign_algo="${FIT_SIGN_ALG}" 302 conf_sign_algo="${FIT_SIGN_ALG}"
253 if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then 303 conf_padding_algo="${FIT_PAD_ALG}"
304 if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then
254 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" 305 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
255 fi 306 fi
256 307
@@ -260,45 +311,53 @@ fitimage_emit_section_config() {
260 kernel_line="" 311 kernel_line=""
261 fdt_line="" 312 fdt_line=""
262 ramdisk_line="" 313 ramdisk_line=""
314 bootscr_line=""
263 setup_line="" 315 setup_line=""
264 default_line="" 316 default_line=""
265 317
266 if [ -n "${2}" ]; then 318 if [ -n "${2}" ]; then
267 conf_desc="Linux kernel" 319 conf_desc="Linux kernel"
268 sep=", " 320 sep=", "
269 kernel_line="kernel = \"kernel@${2}\";" 321 kernel_line="kernel = \"kernel-${2}\";"
270 fi 322 fi
271 323
272 if [ -n "${3}" ]; then 324 if [ -n "${3}" ]; then
273 conf_desc="${conf_desc}${sep}FDT blob" 325 conf_desc="${conf_desc}${sep}FDT blob"
274 sep=", " 326 sep=", "
275 fdt_line="fdt = \"fdt@${3}\";" 327 fdt_line="fdt = \"fdt-${3}\";"
276 fi 328 fi
277 329
278 if [ -n "${4}" ]; then 330 if [ -n "${4}" ]; then
279 conf_desc="${conf_desc}${sep}ramdisk" 331 conf_desc="${conf_desc}${sep}ramdisk"
280 sep=", " 332 sep=", "
281 ramdisk_line="ramdisk = \"ramdisk@${4}\";" 333 ramdisk_line="ramdisk = \"ramdisk-${4}\";"
282 fi 334 fi
283 335
284 if [ -n "${5}" ]; then 336 if [ -n "${5}" ]; then
337 conf_desc="${conf_desc}${sep}u-boot script"
338 sep=", "
339 bootscr_line="bootscr = \"bootscr-${5}\";"
340 fi
341
342 if [ -n "${6}" ]; then
285 conf_desc="${conf_desc}${sep}setup" 343 conf_desc="${conf_desc}${sep}setup"
286 setup_line="setup = \"setup@${5}\";" 344 setup_line="setup = \"setup-${6}\";"
287 fi 345 fi
288 346
289 if [ "${6}" = "1" ]; then 347 if [ "${7}" = "1" ]; then
290 default_line="default = \"conf@${3}\";" 348 default_line="default = \"conf-${3}\";"
291 fi 349 fi
292 350
293 cat << EOF >> ${1} 351 cat << EOF >> ${1}
294 ${default_line} 352 ${default_line}
295 conf@${3} { 353 conf-${3} {
296 description = "${6} ${conf_desc}"; 354 description = "${7} ${conf_desc}";
297 ${kernel_line} 355 ${kernel_line}
298 ${fdt_line} 356 ${fdt_line}
299 ${ramdisk_line} 357 ${ramdisk_line}
358 ${bootscr_line}
300 ${setup_line} 359 ${setup_line}
301 hash@1 { 360 hash-1 {
302 algo = "${conf_csum}"; 361 algo = "${conf_csum}";
303 }; 362 };
304EOF 363EOF
@@ -324,15 +383,21 @@ EOF
324 fi 383 fi
325 384
326 if [ -n "${5}" ]; then 385 if [ -n "${5}" ]; then
386 sign_line="${sign_line}${sep}\"bootscr\""
387 sep=", "
388 fi
389
390 if [ -n "${6}" ]; then
327 sign_line="${sign_line}${sep}\"setup\"" 391 sign_line="${sign_line}${sep}\"setup\""
328 fi 392 fi
329 393
330 sign_line="${sign_line};" 394 sign_line="${sign_line};"
331 395
332 cat << EOF >> ${1} 396 cat << EOF >> ${1}
333 signature@1 { 397 signature-1 {
334 algo = "${conf_csum},${conf_sign_algo}"; 398 algo = "${conf_csum},${conf_sign_algo}";
335 key-name-hint = "${conf_sign_keyname}"; 399 key-name-hint = "${conf_sign_keyname}";
400 padding = "${conf_padding_algo}";
336 ${sign_line} 401 ${sign_line}
337 }; 402 };
338EOF 403EOF
@@ -355,6 +420,7 @@ fitimage_assemble() {
355 DTBS="" 420 DTBS=""
356 ramdiskcount=${3} 421 ramdiskcount=${3}
357 setupcount="" 422 setupcount=""
423 bootscr_id=""
358 rm -f ${1} arch/${ARCH}/boot/${2} 424 rm -f ${1} arch/${ARCH}/boot/${2}
359 425
360 fitimage_emit_fit_header ${1} 426 fitimage_emit_fit_header ${1}
@@ -365,7 +431,7 @@ fitimage_assemble() {
365 fitimage_emit_section_maint ${1} imagestart 431 fitimage_emit_section_maint ${1} imagestart
366 432
367 uboot_prep_kimage 433 uboot_prep_kimage
368 fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}" 434 fitimage_emit_section_kernel $1 $kernelcount linux.bin "$linux_comp"
369 435
370 # 436 #
371 # Step 2: Prepare a DTB image section 437 # Step 2: Prepare a DTB image section
@@ -399,7 +465,21 @@ fitimage_assemble() {
399 fi 465 fi
400 466
401 # 467 #
402 # Step 3: Prepare a setup section. (For x86) 468 # Step 3: Prepare a u-boot script section
469 #
470
471 if [ -n "${UBOOT_ENV}" ] && [ -d "${STAGING_DIR_HOST}/boot" ]; then
472 if [ -e "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" ]; then
473 cp ${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} ${B}
474 bootscr_id="${UBOOT_ENV_BINARY}"
475 fitimage_emit_section_boot_script ${1} "${bootscr_id}" ${UBOOT_ENV_BINARY}
476 else
477 bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found."
478 fi
479 fi
480
481 #
482 # Step 4: Prepare a setup section. (For x86)
403 # 483 #
404 if [ -e arch/${ARCH}/boot/setup.bin ]; then 484 if [ -e arch/${ARCH}/boot/setup.bin ]; then
405 setupcount=1 485 setupcount=1
@@ -407,9 +487,9 @@ fitimage_assemble() {
407 fi 487 fi
408 488
409 # 489 #
410 # Step 4: Prepare a ramdisk section. 490 # Step 5: Prepare a ramdisk section.
411 # 491 #
412 if [ "x${ramdiskcount}" = "x1" ] ; then 492 if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
413 # Find and use the first initramfs image archive type we find 493 # Find and use the first initramfs image archive type we find
414 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do 494 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do
415 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}" 495 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
@@ -430,7 +510,7 @@ fitimage_assemble() {
430 fi 510 fi
431 511
432 # 512 #
433 # Step 5: Prepare a configurations section 513 # Step 6: Prepare a configurations section
434 # 514 #
435 fitimage_emit_section_maint ${1} confstart 515 fitimage_emit_section_maint ${1} confstart
436 516
@@ -439,9 +519,9 @@ fitimage_assemble() {
439 for DTB in ${DTBS}; do 519 for DTB in ${DTBS}; do
440 dtb_ext=${DTB##*.} 520 dtb_ext=${DTB##*.}
441 if [ "${dtb_ext}" = "dtbo" ]; then 521 if [ "${dtb_ext}" = "dtbo" ]; then
442 fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`" 522 fitimage_emit_section_config ${1} "" "${DTB}" "" "${bootscr_id}" "" "`expr ${i} = ${dtbcount}`"
443 else 523 else
444 fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`" 524 fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${bootscr_id}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
445 fi 525 fi
446 i=`expr ${i} + 1` 526 i=`expr ${i} + 1`
447 done 527 done
@@ -452,7 +532,7 @@ fitimage_assemble() {
452 fitimage_emit_section_maint ${1} fitend 532 fitimage_emit_section_maint ${1} fitend
453 533
454 # 534 #
455 # Step 6: Assemble the image 535 # Step 7: Assemble the image
456 # 536 #
457 uboot-mkimage \ 537 uboot-mkimage \
458 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ 538 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
@@ -460,7 +540,7 @@ fitimage_assemble() {
460 arch/${ARCH}/boot/${2} 540 arch/${ARCH}/boot/${2}
461 541
462 # 542 #
463 # Step 7: Sign the image and add public key to U-Boot dtb 543 # Step 8: Sign the image and add public key to U-Boot dtb
464 # 544 #
465 if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then 545 if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
466 add_key_to_u_boot="" 546 add_key_to_u_boot=""
@@ -474,7 +554,8 @@ fitimage_assemble() {
474 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ 554 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
475 -F -k "${UBOOT_SIGN_KEYDIR}" \ 555 -F -k "${UBOOT_SIGN_KEYDIR}" \
476 $add_key_to_u_boot \ 556 $add_key_to_u_boot \
477 -r arch/${ARCH}/boot/${2} 557 -r arch/${ARCH}/boot/${2} \
558 ${UBOOT_MKIMAGE_SIGN_ARGS}
478 fi 559 fi
479} 560}
480 561
@@ -491,7 +572,11 @@ do_assemble_fitimage_initramfs() {
491 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ 572 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
492 test -n "${INITRAMFS_IMAGE}" ; then 573 test -n "${INITRAMFS_IMAGE}" ; then
493 cd ${B} 574 cd ${B}
494 fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 575 if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
576 fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage ""
577 else
578 fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
579 fi
495 fi 580 fi
496} 581}
497 582
@@ -502,22 +587,32 @@ kernel_do_deploy[vardepsexclude] = "DATETIME"
502kernel_do_deploy_append() { 587kernel_do_deploy_append() {
503 # Update deploy directory 588 # Update deploy directory
504 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then 589 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
505 echo "Copying fit-image.its source file..." 590 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
506 install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" 591 echo "Copying fit-image.its source file..."
507 ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}" 592 install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its"
593 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
594 ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
595 fi
508 596
509 echo "Copying linux.bin file..." 597 echo "Copying linux.bin file..."
510 install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin 598 install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin
511 ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}" 599 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
600 ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}"
601 fi
602 fi
512 603
513 if [ -n "${INITRAMFS_IMAGE}" ]; then 604 if [ -n "${INITRAMFS_IMAGE}" ]; then
514 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." 605 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
515 install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" 606 install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its"
516 ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" 607 ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
517 608
518 echo "Copying fitImage-${INITRAMFS_IMAGE} file..." 609 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
519 install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin" 610 echo "Copying fitImage-${INITRAMFS_IMAGE} file..."
520 ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" 611 install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin"
612 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
613 ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
614 fi
615 fi
521 fi 616 fi
522 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then 617 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then
523 # UBOOT_DTB_IMAGE is a realfile, but we can't use 618 # UBOOT_DTB_IMAGE is a realfile, but we can't use
@@ -527,3 +622,13 @@ kernel_do_deploy_append() {
527 fi 622 fi
528 fi 623 fi
529} 624}
625
626# The function below performs the following in case of initramfs bundles:
627# - Removes do_assemble_fitimage. FIT generation is done through
628# do_assemble_fitimage_initramfs. do_assemble_fitimage is not needed
629# and should not be part of the tasks to be executed.
630python () {
631 d.appendVarFlag('do_compile', 'vardeps', ' INITRAMFS_IMAGE_BUNDLE')
632 if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1":
633 bb.build.deltask('do_assemble_fitimage', d)
634}