summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-07-14 17:45:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-15 12:33:21 +0100
commite116ad7c6993e88c30d6f7f4da6d371b52d96fc5 (patch)
treebb222a2942ccdcdfd3424744f243fe4972988e4e
parenta508d0cf1b96c83f48a7ad017b1bb4db08738a16 (diff)
downloadpoky-e116ad7c6993e88c30d6f7f4da6d371b52d96fc5.tar.gz
meta: introduce UBOOT_MKIMAGE_KERNEL_TYPE
Sometimes an end user might want to choose another kernel type argument for uboot-mkimage other than "kernel", for instance: "kernel_noload". Let's introduce a variable UBOOT_MKIMAGE_KERNEL_TYPE to support that, and it could be used by BSP layers as well. (From OE-Core rev: e288686e97de1265eeeaf452141e1473867efb1b) (From OE-Core rev: 4eb7bbcc2f08b25387a15b7e4a89ef199783c973) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-fitimage.bbclass2
-rw-r--r--meta/classes/kernel-uboot.bbclass3
-rw-r--r--meta/classes/kernel-uimage.bbclass2
-rw-r--r--meta/lib/oeqa/selftest/cases/fitimage.py4
4 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 7e09b075ff..2112ae4cfa 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -148,7 +148,7 @@ fitimage_emit_section_kernel() {
148 kernel-$2 { 148 kernel-$2 {
149 description = "Linux kernel"; 149 description = "Linux kernel";
150 data = /incbin/("$3"); 150 data = /incbin/("$3");
151 type = "kernel"; 151 type = "${UBOOT_MKIMAGE_KERNEL_TYPE}";
152 arch = "${UBOOT_ARCH}"; 152 arch = "${UBOOT_ARCH}";
153 os = "linux"; 153 os = "linux";
154 compression = "$4"; 154 compression = "$4";
diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
index 2facade818..1bc98e042d 100644
--- a/meta/classes/kernel-uboot.bbclass
+++ b/meta/classes/kernel-uboot.bbclass
@@ -2,6 +2,9 @@
2FIT_KERNEL_COMP_ALG ?= "gzip" 2FIT_KERNEL_COMP_ALG ?= "gzip"
3FIT_KERNEL_COMP_ALG_EXTENSION ?= ".gz" 3FIT_KERNEL_COMP_ALG_EXTENSION ?= ".gz"
4 4
5# Kernel image type passed to mkimage (i.e. kernel kernel_noload...)
6UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel"
7
5uboot_prep_kimage() { 8uboot_prep_kimage() {
6 if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then 9 if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
7 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux" 10 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
index cedb4fa070..2e661ea916 100644
--- a/meta/classes/kernel-uimage.bbclass
+++ b/meta/classes/kernel-uimage.bbclass
@@ -30,6 +30,6 @@ do_uboot_mkimage() {
30 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` 30 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
31 fi 31 fi
32 32
33 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage 33 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ${UBOOT_MKIMAGE_KERNEL_TYPE} -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
34 rm -f linux.bin 34 rm -f linux.bin
35} 35}
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index e6bfd1257e..d732a9020d 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -738,6 +738,7 @@ UBOOT_LOADADDRESS = "0x80000000"
738UBOOT_DTB_LOADADDRESS = "0x82000000" 738UBOOT_DTB_LOADADDRESS = "0x82000000"
739UBOOT_ARCH = "arm" 739UBOOT_ARCH = "arm"
740UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" 740UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
741UBOOT_MKIMAGE_KERNEL_TYPE = "kernel"
741UBOOT_EXTLINUX = "0" 742UBOOT_EXTLINUX = "0"
742FIT_GENERATE_KEYS = "1" 743FIT_GENERATE_KEYS = "1"
743KERNEL_IMAGETYPE_REPLACEMENT = "zImage" 744KERNEL_IMAGETYPE_REPLACEMENT = "zImage"
@@ -763,6 +764,7 @@ FIT_HASH_ALG = "sha256"
763 764
764 kernel_load = str(get_bb_var('UBOOT_LOADADDRESS')) 765 kernel_load = str(get_bb_var('UBOOT_LOADADDRESS'))
765 kernel_entry = str(get_bb_var('UBOOT_ENTRYPOINT')) 766 kernel_entry = str(get_bb_var('UBOOT_ENTRYPOINT'))
767 kernel_type = str(get_bb_var('UBOOT_MKIMAGE_KERNEL_TYPE'))
766 kernel_compression = str(get_bb_var('FIT_KERNEL_COMP_ALG')) 768 kernel_compression = str(get_bb_var('FIT_KERNEL_COMP_ALG'))
767 uboot_arch = str(get_bb_var('UBOOT_ARCH')) 769 uboot_arch = str(get_bb_var('UBOOT_ARCH'))
768 fit_hash_alg = str(get_bb_var('FIT_HASH_ALG')) 770 fit_hash_alg = str(get_bb_var('FIT_HASH_ALG'))
@@ -775,7 +777,7 @@ FIT_HASH_ALG = "sha256"
775 'kernel-1 {', 777 'kernel-1 {',
776 'description = "Linux kernel";', 778 'description = "Linux kernel";',
777 'data = /incbin/("linux.bin");', 779 'data = /incbin/("linux.bin");',
778 'type = "kernel";', 780 'type = "' + kernel_type + '";',
779 'arch = "' + uboot_arch + '";', 781 'arch = "' + uboot_arch + '";',
780 'os = "linux";', 782 'os = "linux";',
781 'compression = "' + kernel_compression + '";', 783 'compression = "' + kernel_compression + '";',