kernel-fitimage: refactor order in its

When the ITS file is created, the mandatory properties are written first
before the optional properties are written.
This is not really useful for the current implementation. But it is a
preparation for a new Python-based implementation that will expect
mandatory properties first. This change makes it possible to run the
tests with both the old and the new implementation.

(From OE-Core rev: 1044366a32d544af53307a03d7d3b0aaf4519990)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Adrian Freihofer 2025-06-03 10:23:20 +02:00 committed by Richard Purdie
parent 1e29226879
commit 8263346476
2 changed files with 12 additions and 12 deletions

View File

@ -128,11 +128,11 @@ fitimage_emit_section_kernel() {
cat << EOF >> $1 cat << EOF >> $1
kernel-$2 { kernel-$2 {
description = "Linux kernel"; description = "Linux kernel";
data = /incbin/("$3");
type = "${UBOOT_MKIMAGE_KERNEL_TYPE}"; type = "${UBOOT_MKIMAGE_KERNEL_TYPE}";
compression = "$4";
data = /incbin/("$3");
arch = "${UBOOT_ARCH}"; arch = "${UBOOT_ARCH}";
os = "linux"; os = "linux";
compression = "$4";
load = <${UBOOT_LOADADDRESS}>; load = <${UBOOT_LOADADDRESS}>;
entry = <$ENTRYPOINT>; entry = <$ENTRYPOINT>;
hash-1 { hash-1 {
@ -177,10 +177,10 @@ fitimage_emit_section_dtb() {
cat << EOF >> $1 cat << EOF >> $1
fdt-$2 { fdt-$2 {
description = "Flattened Device Tree blob"; description = "Flattened Device Tree blob";
data = /incbin/("$3");
type = "flat_dt"; type = "flat_dt";
arch = "${UBOOT_ARCH}";
compression = "none"; compression = "none";
data = /incbin/("$3");
arch = "${UBOOT_ARCH}";
$dtb_loadline $dtb_loadline
hash-1 { hash-1 {
algo = "$dtb_csum"; algo = "$dtb_csum";
@ -215,10 +215,10 @@ fitimage_emit_section_boot_script() {
cat << EOF >> $1 cat << EOF >> $1
bootscr-$2 { bootscr-$2 {
description = "U-boot script"; description = "U-boot script";
data = /incbin/("$3");
type = "script"; type = "script";
arch = "${UBOOT_ARCH}";
compression = "none"; compression = "none";
data = /incbin/("$3");
arch = "${UBOOT_ARCH}";
hash-1 { hash-1 {
algo = "$bootscr_csum"; algo = "$bootscr_csum";
}; };
@ -252,11 +252,11 @@ fitimage_emit_section_setup() {
cat << EOF >> $1 cat << EOF >> $1
setup-$2 { setup-$2 {
description = "Linux setup.bin"; description = "Linux setup.bin";
data = /incbin/("$3");
type = "x86_setup"; type = "x86_setup";
compression = "none";
data = /incbin/("$3");
arch = "${UBOOT_ARCH}"; arch = "${UBOOT_ARCH}";
os = "linux"; os = "linux";
compression = "none";
load = <0x00090000>; load = <0x00090000>;
entry = <0x00090000>; entry = <0x00090000>;
hash-1 { hash-1 {
@ -301,11 +301,11 @@ fitimage_emit_section_ramdisk() {
cat << EOF >> $1 cat << EOF >> $1
ramdisk-$2 { ramdisk-$2 {
description = "${INITRAMFS_IMAGE}"; description = "${INITRAMFS_IMAGE}";
data = /incbin/("$3");
type = "ramdisk"; type = "ramdisk";
compression = "none";
data = /incbin/("$3");
arch = "${UBOOT_ARCH}"; arch = "${UBOOT_ARCH}";
os = "linux"; os = "linux";
compression = "none";
$ramdisk_loadline $ramdisk_loadline
$ramdisk_entryline $ramdisk_entryline
hash-1 { hash-1 {

View File

@ -513,11 +513,11 @@ class KernelFitImageTests(FitImageTestCase):
its_field_check = [ its_field_check = [
'description = "%s";' % bb_vars['FIT_DESC'], 'description = "%s";' % bb_vars['FIT_DESC'],
'description = "Linux kernel";', 'description = "Linux kernel";',
'data = /incbin/("linux.bin");',
'type = "' + str(bb_vars['UBOOT_MKIMAGE_KERNEL_TYPE']) + '";', 'type = "' + str(bb_vars['UBOOT_MKIMAGE_KERNEL_TYPE']) + '";',
# 'compression = "' + str(bb_vars['FIT_KERNEL_COMP_ALG']) + '";', defined based on files in TMPDIR, not ideal...
'data = /incbin/("linux.bin");',
'arch = "' + str(bb_vars['UBOOT_ARCH']) + '";', 'arch = "' + str(bb_vars['UBOOT_ARCH']) + '";',
'os = "linux";', 'os = "linux";',
# 'compression = "' + str(bb_vars['FIT_KERNEL_COMP_ALG']) + '";', defined based on files in TMPDIR, not ideal...
'load = <' + str(bb_vars['UBOOT_LOADADDRESS']) + '>;', 'load = <' + str(bb_vars['UBOOT_LOADADDRESS']) + '>;',
'entry = <' + str(bb_vars['UBOOT_ENTRYPOINT']) + '>;', 'entry = <' + str(bb_vars['UBOOT_ENTRYPOINT']) + '>;',
] ]