Skip to contentSkip to conversation

kernel-fitimage: generate a default conf@ entry for non-dtb images

PATCH New Michael Scott 1 participant 1 message May 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-fitimage: generate a default conf@ entry for non-dtb images

Step 5 of fitimage_assemble() creates a series of configurations for each kernel DTB referenced in the fitimage. These configurations are usually used as bootm parameters to alias items like the kernel and ramdisk, etc. The conf@ entries are also used when generating signature data for verified boot.

Boards without kernel DTBs in the fitimage skip this step and no conf@ entries are generated. This presents a problem if the u-boot scripts still wish to use the conf@ references for the kernel and ramdisk.

Examples of this would be using QEMU ARM64 or RISC-V based .WIC images with a vfat boot partition and ext4 rootfs. The fitImage is stored in the boot partition similar to other actual HW. However, without the conf@ entry the boot scripts still need to use kernel@1 and ramdisk@1 hard-coded references.

Also, a u-boot patch is currently being tested which adds signing / verified boot functionality for HW which doesn't use appended u-boot DTBs. IE: QEMU uses prior stage hand-off and Raspberry Pi 3 uses an embedded DTB, etc. By having the conf@ entry in the fitImage, the entire OE signing process "just works" for testing this new setup.

---
 meta/classes/kernel-fitimage.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/kernel-fitimage.bbclass +7 -0
index 2820ff9689..8ade9eb410 100644
@@ -458,6 +458,13 @@ fitimage_assemble() {
 			fi
 			i=`expr ${i} + 1`
 		done
+	else
+		# insert 1 default configuration w/o DTBs
+		if [ "x${ramdiskcount}" = "x1" ] ; then
+				fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" ""
+		else
+				fitimage_emit_section_config ${1} "${kernelcount}" "" "" "${setupcount}" ""
+		fi
 	fi
 
 	fitimage_emit_section_maint ${1} sectend
Signature · 1 line
2.21.0