summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/cmake.bbclass2
-rw-r--r--meta/classes-recipe/cml1.bbclass3
-rw-r--r--meta/classes-recipe/image.bbclass20
-rw-r--r--meta/classes-recipe/kernel-arch.bbclass8
-rw-r--r--meta/classes-recipe/kernel-fitimage.bbclass53
-rw-r--r--meta/classes-recipe/module.bbclass1
-rw-r--r--meta/classes-recipe/nativesdk.bbclass1
-rw-r--r--meta/classes-recipe/populate_sdk_base.bbclass2
-rw-r--r--meta/classes-recipe/populate_sdk_ext.bbclass2
-rw-r--r--meta/classes-recipe/qemu.bbclass8
-rw-r--r--meta/classes-recipe/rootfs-postcommands.bbclass4
-rw-r--r--meta/classes-recipe/rust-common.bbclass2
-rw-r--r--meta/classes-recipe/rust-target-config.bbclass10
-rw-r--r--meta/classes-recipe/testimage.bbclass4
-rw-r--r--meta/classes-recipe/uboot-config.bbclass17
-rw-r--r--meta/classes-recipe/uboot-sign.bbclass83
16 files changed, 113 insertions, 107 deletions
diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass
index 3d3781ef33..e8aca0db8b 100644
--- a/meta/classes-recipe/cmake.bbclass
+++ b/meta/classes-recipe/cmake.bbclass
@@ -67,6 +67,8 @@ EXTRA_OECMAKE:append = " ${PACKAGECONFIG_CONFARGS}"
67export CMAKE_BUILD_PARALLEL_LEVEL 67export CMAKE_BUILD_PARALLEL_LEVEL
68CMAKE_BUILD_PARALLEL_LEVEL:task-compile = "${@oe.utils.parallel_make(d, False)}" 68CMAKE_BUILD_PARALLEL_LEVEL:task-compile = "${@oe.utils.parallel_make(d, False)}"
69CMAKE_BUILD_PARALLEL_LEVEL:task-install = "${@oe.utils.parallel_make(d, True)}" 69CMAKE_BUILD_PARALLEL_LEVEL:task-install = "${@oe.utils.parallel_make(d, True)}"
70CMAKE_BUILD_PARALLEL_LEVEL:task-compile-ptest-base = "${@oe.utils.parallel_make(d, False)}"
71CMAKE_BUILD_PARALLEL_LEVEL:task-install-ptest-base = "${@oe.utils.parallel_make(d, True)}"
70 72
71OECMAKE_TARGET_COMPILE ?= "all" 73OECMAKE_TARGET_COMPILE ?= "all"
72OECMAKE_TARGET_INSTALL ?= "install" 74OECMAKE_TARGET_INSTALL ?= "install"
diff --git a/meta/classes-recipe/cml1.bbclass b/meta/classes-recipe/cml1.bbclass
index 03e5fe6f47..456305a315 100644
--- a/meta/classes-recipe/cml1.bbclass
+++ b/meta/classes-recipe/cml1.bbclass
@@ -93,10 +93,9 @@ python do_diffconfig() {
93 93
94 if isdiff: 94 if isdiff:
95 statement = 'diff --unchanged-line-format= --old-line-format= --new-line-format="%L" ' + configorig + ' ' + config + '>' + fragment 95 statement = 'diff --unchanged-line-format= --old-line-format= --new-line-format="%L" ' + configorig + ' ' + config + '>' + fragment
96 subprocess.call(statement, shell=True)
97 # No need to check the exit code as we know it's going to be 96 # No need to check the exit code as we know it's going to be
98 # non-zero, but that's what we expect. 97 # non-zero, but that's what we expect.
99 shutil.copy(configorig, config) 98 subprocess.call(statement, shell=True)
100 99
101 bb.plain("Config fragment has been dumped into:\n %s" % fragment) 100 bb.plain("Config fragment has been dumped into:\n %s" % fragment)
102 else: 101 else:
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 28be6c6362..1f0ee1861e 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -303,28 +303,22 @@ addtask do_image_complete_setscene
303# IMAGE_QA_COMMANDS += " \ 303# IMAGE_QA_COMMANDS += " \
304# image_check_everything_ok \ 304# image_check_everything_ok \
305# " 305# "
306#
306# This task runs all functions in IMAGE_QA_COMMANDS after the rootfs 307# This task runs all functions in IMAGE_QA_COMMANDS after the rootfs
307# construction has completed in order to validate the resulting image. 308# construction has completed in order to validate the resulting image.
308# 309#
309# The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs 310# The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
310# directory, which if QA passes will be the basis for the images. 311# directory, which if QA passes will be the basis for the images.
312#
313# The functions are expected to call oe.qa.handle_error() to report any
314# problems.
311fakeroot python do_image_qa () { 315fakeroot python do_image_qa () {
312 from oe.utils import ImageQAFailed
313
314 qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split() 316 qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
315 qamsg = ""
316 317
317 for cmd in qa_cmds: 318 for cmd in qa_cmds:
318 try: 319 bb.build.exec_func(cmd, d)
319 bb.build.exec_func(cmd, d) 320
320 except oe.utils.ImageQAFailed as e: 321 oe.qa.exit_if_errors(d)
321 qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description)
322 except Exception as e:
323 qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (cmd, e)
324
325 if qamsg:
326 imgname = d.getVar('IMAGE_NAME')
327 bb.fatal("QA errors found whilst validating image: %s\n%s" % (imgname, qamsg))
328} 322}
329addtask do_image_qa after do_rootfs before do_image 323addtask do_image_qa after do_rootfs before do_image
330 324
diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass
index b32f6137a2..36a6e0a60a 100644
--- a/meta/classes-recipe/kernel-arch.bbclass
+++ b/meta/classes-recipe/kernel-arch.bbclass
@@ -71,7 +71,13 @@ HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
71TARGET_OBJCOPY_KERNEL_ARCH ?= "" 71TARGET_OBJCOPY_KERNEL_ARCH ?= ""
72HOST_OBJCOPY_KERNEL_ARCH ?= "${TARGET_OBJCOPY_KERNEL_ARCH}" 72HOST_OBJCOPY_KERNEL_ARCH ?= "${TARGET_OBJCOPY_KERNEL_ARCH}"
73 73
74KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH}" 74KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} \
75 -fuse-ld=bfd ${DEBUG_PREFIX_MAP} \
76 -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \
77 -fmacro-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \
78 -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \
79 -fmacro-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \
80"
75KERNEL_LD = "${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" 81KERNEL_LD = "${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
76KERNEL_AR = "${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" 82KERNEL_AR = "${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
77KERNEL_OBJCOPY = "${HOST_PREFIX}objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" 83KERNEL_OBJCOPY = "${HOST_PREFIX}objcopy ${HOST_OBJCOPY_KERNEL_ARCH}"
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index 18ab17bd2c..3e20c3248b 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -5,6 +5,7 @@
5# 5#
6 6
7inherit kernel-uboot kernel-artifact-names uboot-config 7inherit kernel-uboot kernel-artifact-names uboot-config
8require conf/image-fitimage.conf
8 9
9def get_fit_replacement_type(d): 10def get_fit_replacement_type(d):
10 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" 11 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
@@ -52,58 +53,6 @@ python __anonymous () {
52 d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") 53 d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree")
53} 54}
54 55
55
56# Description string
57FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}"
58
59# Kernel fitImage Hash Algo
60FIT_HASH_ALG ?= "sha256"
61
62# Kernel fitImage Signature Algo
63FIT_SIGN_ALG ?= "rsa2048"
64
65# Kernel / U-Boot fitImage Padding Algo
66FIT_PAD_ALG ?= "pkcs-1.5"
67
68# Generate keys for signing Kernel fitImage
69FIT_GENERATE_KEYS ?= "0"
70
71# Size of private keys in number of bits
72FIT_SIGN_NUMBITS ?= "2048"
73
74# args to openssl genrsa (Default is just the public exponent)
75FIT_KEY_GENRSA_ARGS ?= "-F4"
76
77# args to openssl req (Default is -batch for non interactive mode and
78# -new for new certificate)
79FIT_KEY_REQ_ARGS ?= "-batch -new"
80
81# Standard format for public key certificate
82FIT_KEY_SIGN_PKCS ?= "-x509"
83
84# Sign individual images as well
85FIT_SIGN_INDIVIDUAL ?= "0"
86
87FIT_CONF_PREFIX ?= "conf-"
88FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
89
90FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
91
92# Allow user to select the default DTB for FIT image when multiple dtb's exists.
93FIT_CONF_DEFAULT_DTB ?= ""
94
95# length of address in number of <u32> cells
96# ex: 1 32bits address, 2 64bits address
97FIT_ADDRESS_CELLS ?= "1"
98
99# Keys used to sign individually image nodes.
100# The keys to sign image nodes must be different from those used to sign
101# configuration nodes, otherwise the "required" property, from
102# UBOOT_DTB_BINARY, will be set to "conf", because "conf" prevails on "image".
103# Then the images signature checking will not be mandatory and no error will be
104# raised in case of failure.
105# UBOOT_SIGN_IMG_KEYNAME = "dev2" # keys name in keydir (eg. "dev2.crt", "dev2.key")
106
107# 56#
108# Emit the fitImage ITS header 57# Emit the fitImage ITS header
109# 58#
diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
index f2f0b25a2d..4948e995c5 100644
--- a/meta/classes-recipe/module.bbclass
+++ b/meta/classes-recipe/module.bbclass
@@ -65,6 +65,7 @@ module_do_install() {
65 CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" \ 65 CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" \
66 STRIP="${KERNEL_STRIP}" \ 66 STRIP="${KERNEL_STRIP}" \
67 O=${STAGING_KERNEL_BUILDDIR} \ 67 O=${STAGING_KERNEL_BUILDDIR} \
68 KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \
68 ${MODULES_INSTALL_TARGET} 69 ${MODULES_INSTALL_TARGET}
69 70
70 if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then 71 if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass
index de6debda93..83ea901fa5 100644
--- a/meta/classes-recipe/nativesdk.bbclass
+++ b/meta/classes-recipe/nativesdk.bbclass
@@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
32# 32#
33PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" 33PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
34PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" 34PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
35TUNE_PKGARCH = "${SDK_ARCH}"
35 36
36# 37#
37# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit 38# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index a103e7b738..5c738dbf2a 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -13,7 +13,7 @@ PACKAGES = ""
13# SDK processing context. This class happens to be common to these usages. 13# SDK processing context. This class happens to be common to these usages.
14SPDX_MULTILIB_SSTATE_ARCHS = "${@all_multilib_tune_values(d, 'SSTATE_ARCHS')}" 14SPDX_MULTILIB_SSTATE_ARCHS = "${@all_multilib_tune_values(d, 'SSTATE_ARCHS')}"
15 15
16inherit image-postinst-intercepts image-artifact-names 16inherit image-postinst-intercepts image-artifact-names nopackages
17 17
18# Wildcards specifying complementary packages to install for every package that has been explicitly 18# Wildcards specifying complementary packages to install for every package that has been explicitly
19# installed into the rootfs 19# installed into the rootfs
diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass
index e76ef60720..662cc493ce 100644
--- a/meta/classes-recipe/populate_sdk_ext.bbclass
+++ b/meta/classes-recipe/populate_sdk_ext.bbclass
@@ -290,6 +290,8 @@ def copy_uninative(d, baseoutpath):
290 return uninative_checksum 290 return uninative_checksum
291 291
292def write_local_conf(d, baseoutpath, derivative, core_meta_subdir, uninative_checksum): 292def write_local_conf(d, baseoutpath, derivative, core_meta_subdir, uninative_checksum):
293 import shutil
294
293 #check if custome templateconf path is set 295 #check if custome templateconf path is set
294 use_custom_templateconf = d.getVar('SDK_CUSTOM_TEMPLATECONF') 296 use_custom_templateconf = d.getVar('SDK_CUSTOM_TEMPLATECONF')
295 297
diff --git a/meta/classes-recipe/qemu.bbclass b/meta/classes-recipe/qemu.bbclass
index dbb5ee0b66..8d7c82668b 100644
--- a/meta/classes-recipe/qemu.bbclass
+++ b/meta/classes-recipe/qemu.bbclass
@@ -60,8 +60,8 @@ def qemu_run_binary(data, rootfs_path, binary):
60# this dance). For others (e.g. arm) a -cpu option is not necessary, since the 60# this dance). For others (e.g. arm) a -cpu option is not necessary, since the
61# qemu-arm default CPU supports all required architecture levels. 61# qemu-arm default CPU supports all required architecture levels.
62 62
63QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}" 63QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) or ""}"
64QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}" 64QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}"
65 65
66QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" 66QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
67QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" 67QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc"
@@ -71,7 +71,3 @@ QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc"
71QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" 71QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc"
72QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" 72QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400"
73QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9" 73QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9"
74# Some packages e.g. fwupd sets PACKAGE_ARCH = MACHINE_ARCH and uses meson which
75# needs right options to usermode qemu
76QEMU_EXTRAOPTIONS_qemuppc = " -cpu 7400"
77QEMU_EXTRAOPTIONS_qemuppc64 = " -cpu POWER9"
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index 920da94ba2..5f4d67f93c 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -487,6 +487,10 @@ rootfs_reproducible () {
487 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \ 487 find ${IMAGE_ROOTFS}${sysconfdir}/gconf -name '%gconf.xml' -print0 | xargs -0r \
488 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' 488 sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
489 fi 489 fi
490
491 if [ -f ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status ]; then
492 sed -i 's/^Installed-Time: .*/Installed-Time: ${REPRODUCIBLE_TIMESTAMP_ROOTFS}/' ${IMAGE_ROOTFS}${localstatedir}/lib/opkg/status
493 fi
490 fi 494 fi
491} 495}
492 496
diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass
index 6940093e59..b4b70574a2 100644
--- a/meta/classes-recipe/rust-common.bbclass
+++ b/meta/classes-recipe/rust-common.bbclass
@@ -13,7 +13,7 @@ FILES:${PN} += "${rustlibdir}/*.so"
13FILES:${PN}-dev += "${rustlibdir}/*.rlib ${rustlibdir}/*.rmeta" 13FILES:${PN}-dev += "${rustlibdir}/*.rlib ${rustlibdir}/*.rmeta"
14FILES:${PN}-dbg += "${rustlibdir}/.debug" 14FILES:${PN}-dbg += "${rustlibdir}/.debug"
15 15
16RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}" 16RUSTLIB ?= "-L ${STAGING_DIR_HOST}${rustlibdir}"
17RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}" 17RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}"
18RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" 18RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
19RUSTLIB_DEP ??= "libstd-rs" 19RUSTLIB_DEP ??= "libstd-rs"
diff --git a/meta/classes-recipe/rust-target-config.bbclass b/meta/classes-recipe/rust-target-config.bbclass
index 926b0630b1..1bd7626bd8 100644
--- a/meta/classes-recipe/rust-target-config.bbclass
+++ b/meta/classes-recipe/rust-target-config.bbclass
@@ -195,7 +195,7 @@ MAX_ATOMIC_WIDTH[mipsel] = "32"
195DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" 195DATA_LAYOUT[mips64] = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
196TARGET_ENDIAN[mips64] = "big" 196TARGET_ENDIAN[mips64] = "big"
197TARGET_POINTER_WIDTH[mips64] = "64" 197TARGET_POINTER_WIDTH[mips64] = "64"
198TARGET_C_INT_WIDTH[mips64] = "64" 198TARGET_C_INT_WIDTH[mips64] = "32"
199MAX_ATOMIC_WIDTH[mips64] = "64" 199MAX_ATOMIC_WIDTH[mips64] = "64"
200 200
201## mips64-n32-unknown-linux-{gnu, musl} 201## mips64-n32-unknown-linux-{gnu, musl}
@@ -209,7 +209,7 @@ MAX_ATOMIC_WIDTH[mips64-n32] = "64"
209DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" 209DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
210TARGET_ENDIAN[mips64el] = "little" 210TARGET_ENDIAN[mips64el] = "little"
211TARGET_POINTER_WIDTH[mips64el] = "64" 211TARGET_POINTER_WIDTH[mips64el] = "64"
212TARGET_C_INT_WIDTH[mips64el] = "64" 212TARGET_C_INT_WIDTH[mips64el] = "32"
213MAX_ATOMIC_WIDTH[mips64el] = "64" 213MAX_ATOMIC_WIDTH[mips64el] = "64"
214 214
215## powerpc-unknown-linux-{gnu, musl} 215## powerpc-unknown-linux-{gnu, musl}
@@ -223,14 +223,14 @@ MAX_ATOMIC_WIDTH[powerpc] = "32"
223DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512" 223DATA_LAYOUT[powerpc64] = "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
224TARGET_ENDIAN[powerpc64] = "big" 224TARGET_ENDIAN[powerpc64] = "big"
225TARGET_POINTER_WIDTH[powerpc64] = "64" 225TARGET_POINTER_WIDTH[powerpc64] = "64"
226TARGET_C_INT_WIDTH[powerpc64] = "64" 226TARGET_C_INT_WIDTH[powerpc64] = "32"
227MAX_ATOMIC_WIDTH[powerpc64] = "64" 227MAX_ATOMIC_WIDTH[powerpc64] = "64"
228 228
229## powerpc64le-unknown-linux-{gnu, musl} 229## powerpc64le-unknown-linux-{gnu, musl}
230DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512" 230DATA_LAYOUT[powerpc64le] = "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512"
231TARGET_ENDIAN[powerpc64le] = "little" 231TARGET_ENDIAN[powerpc64le] = "little"
232TARGET_POINTER_WIDTH[powerpc64le] = "64" 232TARGET_POINTER_WIDTH[powerpc64le] = "64"
233TARGET_C_INT_WIDTH[powerpc64le] = "64" 233TARGET_C_INT_WIDTH[powerpc64le] = "32"
234MAX_ATOMIC_WIDTH[powerpc64le] = "64" 234MAX_ATOMIC_WIDTH[powerpc64le] = "64"
235 235
236## riscv32gc-unknown-linux-{gnu, musl} 236## riscv32gc-unknown-linux-{gnu, musl}
@@ -244,7 +244,7 @@ MAX_ATOMIC_WIDTH[riscv32gc] = "32"
244DATA_LAYOUT[riscv64gc] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" 244DATA_LAYOUT[riscv64gc] = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
245TARGET_ENDIAN[riscv64gc] = "little" 245TARGET_ENDIAN[riscv64gc] = "little"
246TARGET_POINTER_WIDTH[riscv64gc] = "64" 246TARGET_POINTER_WIDTH[riscv64gc] = "64"
247TARGET_C_INT_WIDTH[riscv64gc] = "64" 247TARGET_C_INT_WIDTH[riscv64gc] = "32"
248MAX_ATOMIC_WIDTH[riscv64gc] = "64" 248MAX_ATOMIC_WIDTH[riscv64gc] = "64"
249 249
250## loongarch64-unknown-linux-{gnu, musl} 250## loongarch64-unknown-linux-{gnu, musl}
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 954c213912..33b1c13f9d 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -25,7 +25,9 @@ TESTIMAGE_AUTO ??= "0"
25TESTIMAGE_FAILED_QA_ARTIFACTS = "\ 25TESTIMAGE_FAILED_QA_ARTIFACTS = "\
26 ${localstatedir}/log \ 26 ${localstatedir}/log \
27 ${sysconfdir}/version \ 27 ${sysconfdir}/version \
28 ${sysconfdir}/os-release" 28 ${sysconfdir}/os-release \
29 ${nonarch_libdir}/os-release \
30"
29 31
30# If some ptests are run and fail, retrieve corresponding directories 32# If some ptests are run and fail, retrieve corresponding directories
31TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/${MCNAME}/ptest', '', d)}" 33TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/${MCNAME}/ptest', '', d)}"
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index e55fc38b7c..bf21961977 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -101,12 +101,12 @@ python () {
101 # The "doc" varflag is special, we don't want to see it here 101 # The "doc" varflag is special, we don't want to see it here
102 ubootconfigflags.pop('doc', None) 102 ubootconfigflags.pop('doc', None)
103 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() 103 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
104 recipename = d.getVar("PN")
104 105
105 if not ubootmachine and not ubootconfig: 106 if not ubootmachine and not ubootconfig:
106 PN = d.getVar("PN")
107 FILE = os.path.basename(d.getVar("FILE")) 107 FILE = os.path.basename(d.getVar("FILE"))
108 bb.debug(1, "To build %s, see %s for instructions on \ 108 bb.debug(1, "To build %s, see %s for instructions on \
109 setting up your machine config" % (PN, FILE)) 109 setting up your machine config" % (recipename, FILE))
110 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) 110 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
111 111
112 if ubootmachine and ubootconfig: 112 if ubootmachine and ubootconfig:
@@ -140,9 +140,12 @@ python () {
140 if not found: 140 if not found:
141 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) 141 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys()))
142 142
143 if len(ubootconfig) == 1: 143 # This recipe might be inherited e.g. by the kernel recipe via kernel-fitimage.bbclass
144 d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip())) 144 # Ensure the uboot specific menuconfig settings do not leak into other recipes
145 else: 145 if 'u-boot' in recipename:
146 # Disable menuconfig for multiple configs 146 if len(ubootconfig) == 1:
147 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") 147 d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip()))
148 else:
149 # Disable menuconfig for multiple configs
150 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false")
148} 151}
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index c8e097f2f2..699db248e1 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -26,6 +26,7 @@
26 26
27# We need some variables from u-boot-config 27# We need some variables from u-boot-config
28inherit uboot-config 28inherit uboot-config
29require conf/image-fitimage.conf
29 30
30# Enable use of a U-Boot fitImage 31# Enable use of a U-Boot fitImage
31UBOOT_FITIMAGE_ENABLE ?= "0" 32UBOOT_FITIMAGE_ENABLE ?= "0"
@@ -85,9 +86,6 @@ UBOOT_FIT_KEY_SIGN_PKCS ?= "-x509"
85# ex: 1 32bits address, 2 64bits address 86# ex: 1 32bits address, 2 64bits address
86UBOOT_FIT_ADDRESS_CELLS ?= "1" 87UBOOT_FIT_ADDRESS_CELLS ?= "1"
87 88
88# This is only necessary for determining the signing configuration
89KERNEL_PN = "${PREFERRED_PROVIDER_virtual/kernel}"
90
91UBOOT_FIT_UBOOT_LOADADDRESS ?= "${UBOOT_LOADADDRESS}" 89UBOOT_FIT_UBOOT_LOADADDRESS ?= "${UBOOT_LOADADDRESS}"
92UBOOT_FIT_UBOOT_ENTRYPOINT ?= "${UBOOT_ENTRYPOINT}" 90UBOOT_FIT_UBOOT_ENTRYPOINT ?= "${UBOOT_ENTRYPOINT}"
93 91
@@ -96,8 +94,8 @@ python() {
96 sign = d.getVar('UBOOT_SIGN_ENABLE') == '1' 94 sign = d.getVar('UBOOT_SIGN_ENABLE') == '1'
97 if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' or sign: 95 if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' or sign:
98 d.appendVar('DEPENDS', " u-boot-tools-native dtc-native") 96 d.appendVar('DEPENDS', " u-boot-tools-native dtc-native")
99 if sign: 97 if d.getVar('FIT_GENERATE_KEYS') == '1' and sign:
100 d.appendVar('DEPENDS', " " + d.getVar('KERNEL_PN')) 98 d.appendVarFlag('do_uboot_assemble_fitimage', 'depends', ' virtual/kernel:do_kernel_generate_rsa_keys')
101} 99}
102 100
103concat_dtb() { 101concat_dtb() {
@@ -105,17 +103,69 @@ concat_dtb() {
105 binary="$2" 103 binary="$2"
106 104
107 if [ -e "${UBOOT_DTB_BINARY}" ]; then 105 if [ -e "${UBOOT_DTB_BINARY}" ]; then
108 # Re-sign the kernel in order to add the keys to our dtb 106 # Signing individual images is not recommended as that
107 # makes fitImage susceptible to mix-and-match attack.
108 #
109 # OE FIT_SIGN_INDIVIDUAL is implemented in an unusual manner,
110 # where the resulting signed fitImage contains both signed
111 # images and signed configurations. This is redundant. In
112 # order to prevent mix-and-match attack, it is sufficient
113 # to sign configurations. The FIT_SIGN_INDIVIDUAL = "1"
114 # support is kept to avoid breakage of existing layers, but
115 # it is highly recommended to avoid FIT_SIGN_INDIVIDUAL = "1",
116 # i.e. set FIT_SIGN_INDIVIDUAL = "0" .
117 if [ "${FIT_SIGN_INDIVIDUAL}" = "1" ] ; then
118 # Sign dummy image images in order to
119 # add the image signing keys to our dtb
120 ${UBOOT_MKIMAGE_SIGN} \
121 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
122 -f auto \
123 -k "${UBOOT_SIGN_KEYDIR}" \
124 -o "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
125 -g "${UBOOT_SIGN_IMG_KEYNAME}" \
126 -K "${UBOOT_DTB_BINARY}" \
127 -d /dev/null \
128 -r ${B}/unused.itb \
129 ${UBOOT_MKIMAGE_SIGN_ARGS}
130 fi
131
132 # Sign dummy image configurations in order to
133 # add the configuration signing keys to our dtb
109 ${UBOOT_MKIMAGE_SIGN} \ 134 ${UBOOT_MKIMAGE_SIGN} \
110 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ 135 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
111 -F -k "${UBOOT_SIGN_KEYDIR}" \ 136 -f auto-conf \
137 -k "${UBOOT_SIGN_KEYDIR}" \
138 -o "${FIT_HASH_ALG},${FIT_SIGN_ALG}" \
139 -g "${UBOOT_SIGN_KEYNAME}" \
112 -K "${UBOOT_DTB_BINARY}" \ 140 -K "${UBOOT_DTB_BINARY}" \
113 -r ${B}/fitImage-linux \ 141 -d /dev/null \
142 -r ${B}/unused.itb \
114 ${UBOOT_MKIMAGE_SIGN_ARGS} 143 ${UBOOT_MKIMAGE_SIGN_ARGS}
115 # Verify the kernel image and u-boot dtb 144
116 ${UBOOT_FIT_CHECK_SIGN} \ 145 # Verify the dummy fitImage signature against u-boot.dtb
117 -k "${UBOOT_DTB_BINARY}" \ 146 # augmented using public key material.
118 -f ${B}/fitImage-linux 147 #
148 # This only works for FIT_SIGN_INDIVIDUAL = "0", because
149 # mkimage -f auto-conf does not support -F to extend the
150 # existing unused.itb , and instead rewrites unused.itb
151 # from scratch.
152 #
153 # Using two separate unused.itb for mkimage -f auto and
154 # mkimage -f auto-conf invocation above would not help, as
155 # the signature verification process below checks whether
156 # all keys inserted into u-boot.dtb /signature node pass
157 # the verification. Separate unused.itb would each miss one
158 # of the signatures.
159 #
160 # The FIT_SIGN_INDIVIDUAL = "1" support is kept to avoid
161 # breakage of existing layers, but it is highly recommended
162 # to not use FIT_SIGN_INDIVIDUAL = "1", i.e. set
163 # FIT_SIGN_INDIVIDUAL = "0" .
164 if [ "${FIT_SIGN_INDIVIDUAL}" != "1" ] ; then
165 ${UBOOT_FIT_CHECK_SIGN} \
166 -k "${UBOOT_DTB_BINARY}" \
167 -f ${B}/unused.itb
168 fi
119 cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED} 169 cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED}
120 fi 170 fi
121 171
@@ -338,7 +388,7 @@ uboot_assemble_fitimage_helper() {
338 binary="$2" 388 binary="$2"
339 389
340 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then 390 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then
341 concat_dtb $type $binary 391 concat_dtb "$type" "$binary"
342 fi 392 fi
343 393
344 if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then 394 if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then
@@ -351,13 +401,10 @@ uboot_assemble_fitimage_helper() {
351} 401}
352 402
353do_uboot_assemble_fitimage() { 403do_uboot_assemble_fitimage() {
354 if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then
355 cp "${STAGING_DIR_HOST}/sysroot-only/fitImage" "${B}/fitImage-linux"
356 fi
357
358 if [ -n "${UBOOT_CONFIG}" ]; then 404 if [ -n "${UBOOT_CONFIG}" ]; then
359 unset i j k 405 unset i
360 for config in ${UBOOT_MACHINE}; do 406 for config in ${UBOOT_MACHINE}; do
407 unset j k
361 i=$(expr $i + 1); 408 i=$(expr $i + 1);
362 for type in ${UBOOT_CONFIG}; do 409 for type in ${UBOOT_CONFIG}; do
363 j=$(expr $j + 1); 410 j=$(expr $j + 1);