diff mbox series

[4/8] conf/uboot.conf: move shared U-Boot defaults out of uboot-config

Message ID 20261203143044.592073-5-adrian.freihofer@siemens.com
State Under Review
Headers show
Series uboot-sign: prepare for HSM-backed FIT signing | expand

Commit Message

AdrianF Dec. 3, 2026, 2:30 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

kernel-fit-image.bbclass inherits uboot-config only for a few mkimage,
load address and signing defaults, which also pulls in the U-Boot build
configuration logic (UBOOT_CONFIG handling and its sanity checks). Move
those defaults unchanged into conf/uboot.conf, required by both
uboot-config.bbclass and kernel-fit-image.bbclass, and drop the
uboot-config inherit from kernel-fit-image.

No change for U-Boot recipes. Kernel FIT recipes no longer get the
remaining uboot-config defaults or run its anonymous python; none of
these are used by kernel-fit-image.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-fit-image.bbclass |  3 ++-
 meta/classes-recipe/uboot-config.bbclass     | 21 +---------------
 meta/conf/uboot.conf                         | 26 ++++++++++++++++++++
 3 files changed, 29 insertions(+), 21 deletions(-)
 create mode 100644 meta/conf/uboot.conf
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index c167fc8c64..3098573560 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -1,5 +1,6 @@ 
 
-inherit kernel-artifact-names uboot-config deploy
+inherit kernel-artifact-names deploy
+require conf/uboot.conf
 require conf/image-fitimage.conf
 
 S = "${UNPACKDIR}"
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index 5459430dee..e39d1bce7f 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -45,9 +45,6 @@  def removesuffix(s, suffix):
         return s[:-len(suffix)]
     return s
 
-UBOOT_ENTRYPOINT ?= "0x20008000"
-UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
-
 # When naming the files we install/deploy, the package version and revision
 # are part of the filename.  Create a single variable to represent this and
 # allow it to be customized if desired.
@@ -112,28 +109,12 @@  UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
 UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
 UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${UBOOT_VERSION}"
 
-# Options for the device tree compiler passed to mkimage '-D' feature:
-UBOOT_MKIMAGE_DTCOPTS ??= ""
-SPL_MKIMAGE_DTCOPTS ??= ""
-
-# mkimage command
-UBOOT_MKIMAGE ?= "uboot-mkimage"
-UBOOT_MKIMAGE_SIGN ?= "${UBOOT_MKIMAGE}"
-
-# Signature activation
-UBOOT_SIGN_ENABLE ?= "0"
-
-# Arguments passed to mkimage for signing
-UBOOT_MKIMAGE_SIGN_ARGS ?= ""
-SPL_MKIMAGE_SIGN_ARGS ?= ""
+require conf/uboot.conf
 
 # Options to deploy the u-boot device tree
 UBOOT_DTB ?= ""
 UBOOT_DTB_BINARY ??= ""
 
-# uboot-fit_check_sign command
-UBOOT_FIT_CHECK_SIGN ?= "uboot-fit_check_sign"
-
 python () {
     if bb.utils.to_boolean(d.getVar('UBOOT_INITIAL_ENV_BINARY')) and d.getVar('UBOOT_INITIAL_ENV_BINARY_SIZE') == "":
         bb.fatal("UBOOT_INITIAL_ENV_BINARY requires setting the U-Boot partition environment size with the UBOOT_INITIAL_ENV_BINARY_SIZE variable")
diff --git a/meta/conf/uboot.conf b/meta/conf/uboot.conf
new file mode 100644
index 0000000000..ef71edc3d1
--- /dev/null
+++ b/meta/conf/uboot.conf
@@ -0,0 +1,26 @@ 
+# Variables shared by U-Boot and FIT image generation.
+# Required by uboot-config.bbclass and by classes and recipes that need these
+# defaults without the U-Boot build logic, e.g. kernel-fit-image.bbclass.
+
+# Default kernel load address and entry point for FIT images.
+# Machine configurations typically override these in their .conf files.
+UBOOT_ENTRYPOINT ?= "0x20008000"
+UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
+
+# Options for the device tree compiler passed to mkimage '-D' feature:
+UBOOT_MKIMAGE_DTCOPTS ??= ""
+SPL_MKIMAGE_DTCOPTS ??= ""
+
+# mkimage command
+UBOOT_MKIMAGE ?= "uboot-mkimage"
+UBOOT_MKIMAGE_SIGN ?= "${UBOOT_MKIMAGE}"
+
+# Signature activation
+UBOOT_SIGN_ENABLE ?= "0"
+
+# Arguments passed to mkimage for signing
+UBOOT_MKIMAGE_SIGN_ARGS ?= ""
+SPL_MKIMAGE_SIGN_ARGS ?= ""
+
+# uboot-fit_check_sign command
+UBOOT_FIT_CHECK_SIGN ?= "uboot-fit_check_sign"