public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 11/27] u-boot-custom: Migrate to a bbclass
Date: Mon,  3 Nov 2025 12:51:59 +0100	[thread overview]
Message-ID: <ea6befd458b77631d417c3cb69ad4bf369ec8b9a.1762170735.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1762170735.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

"inherit u-boot" is shorter and a more common pattern compared to
OE/yocto. Keep the original .inc file as transitional helper, issuing a
warning when it's used with a migration suggestion.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../u-boot.bbclass}                           |  3 +-
 meta/recipes-bsp/u-boot/u-boot-custom.inc     | 74 ++-----------------
 2 files changed, 7 insertions(+), 70 deletions(-)
 copy meta/{recipes-bsp/u-boot/u-boot-custom.inc => classes-recipe/u-boot.bbclass} (96%)

diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/classes-recipe/u-boot.bbclass
similarity index 96%
copy from meta/recipes-bsp/u-boot/u-boot-custom.inc
copy to meta/classes-recipe/u-boot.bbclass
index 2d6dd8e0..02e1491f 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/classes-recipe/u-boot.bbclass
@@ -5,8 +5,6 @@
 #
 # SPDX-License-Identifier: MIT
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
 DESCRIPTION ?= "Custom U-Boot"
 
 PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev"
@@ -16,6 +14,7 @@ PROVIDES += "${@('u-boot-config u-boot-' + d.getVar('MACHINE') + '-config') \
 
 inherit dpkg
 
+FILESPATH:append = ":${LAYERDIR_core}/recipes-bsp/u-boot/files"
 SRC_URI += "file://debian/"
 
 DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 2d6dd8e0..9cc2c15f 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -1,75 +1,13 @@
-# Custom U-Boot build
+# Transitional include for u-boot.bbclass
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018-2025
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
+inherit u-boot
 
-DESCRIPTION ?= "Custom U-Boot"
-
-PROVIDES += "u-boot-${MACHINE} u-boot-${MACHINE}-dev"
-PROVIDES += "${@'u-boot-tools' if bb.utils.to_boolean(d.getVar('U_BOOT_TOOLS_PACKAGE')) else ''}"
-PROVIDES += "${@('u-boot-config u-boot-' + d.getVar('MACHINE') + '-config') \
-    if bb.utils.to_boolean(d.getVar('U_BOOT_CONFIG_PACKAGE')) else ''}"
-
-inherit dpkg
-
-SRC_URI += "file://debian/"
-
-DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
-
-U_BOOT_BIN_INSTALL ?= "${U_BOOT_BIN}"
-
-U_BOOT_EXTRA_BUILDARGS ??= "BL31=${BL31} TEE=${TEE}"
-
-TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
-TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS U_BOOT_CONFIG U_BOOT_BIN \
-    U_BOOT_EXTRA_BUILDARGS DEBIAN_COMPAT"
-
-U_BOOT_TOOLS_PACKAGE ?= "0"
-U_BOOT_CONFIG_PACKAGE ?= "0"
-
-do_prepare_build() {
-    cp -r ${WORKDIR}/debian ${S}/
-
-    deb_add_changelog
-
-    rm -f ${S}/debian/u-boot-${MACHINE}.install
-    for bin in ${U_BOOT_BIN_INSTALL}; do
-        echo "$bin /usr/lib/u-boot/${MACHINE}" >> \
-            ${S}/debian/u-boot-${MACHINE}.install
-    done
-
-    echo "tools/env/libubootenv.a usr/lib" > \
-        ${S}/debian/u-boot-${MACHINE}-dev.install
-
-    if [ "${U_BOOT_TOOLS_PACKAGE}" = "1" ]; then
-        cat <<EOF >>${S}/debian/control
-
-Package: u-boot-tools
-Architecture: linux-any
-Depends: \${shlibs:Depends}, \${misc:Depends}
-Description: ${DESCRIPTION}, companion tools
-EOF
-    fi
-
-    if [ "${U_BOOT_CONFIG_PACKAGE}" = "1" ]; then
-        cp ${WORKDIR}/fw_env.config ${S}/ || \
-            die "U_BOOT_CONFIG_PACKAGE requires a fw_env.config in SRC_URI"
-
-        cat <<EOF >>${S}/debian/control
-
-Package: u-boot-${MACHINE}-config
-Provides: u-boot-config
-Architecture: ${DISTRO_ARCH}
-Description: ${DESCRIPTION}, environment configuration
-EOF
-
-        cat <<EOF >>${S}/debian/u-boot-${MACHINE}-config.install
-u-boot-initial-env /etc
-fw_env.config      /etc
-EOF
-    fi
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-bsp/u-boot/u-boot-custom.inc\" to \"inherit u-boot\""
 }
+addtask warn_custom_inc before do_unpack
-- 
2.51.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/ea6befd458b77631d417c3cb69ad4bf369ec8b9a.1762170735.git.jan.kiszka%40siemens.com.

  parent reply	other threads:[~2025-11-03 11:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 11:51 [PATCH 00/27] Use more classes! 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 01/27] linux-custom: Drop redundant template inheritance 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 02/27] meta: Move INHERIT'ed classes into classes-global 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 03/27] meta: Move recipe-pulled classes into classes-recipe 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 04/27] meta-isar: " 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 05/27] linux-custom: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 06/27] meta-isar: Switch to linux-kernel class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 07/27] linux-module: Migrate to a bbclasss 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 08/27] meta-isar: Switch to linux-module class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 09/27] kselftest: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 10/27] meta-isar: Switch to kselftest class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` 'Jan Kiszka' via isar-users [this message]
2025-11-03 11:52 ` [PATCH 12/27] meta-isar: Switch to u-boot class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 13/27] optee-os[-tadevkit]-custom: Migrate to bbclass'es 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 14/27] meta-isar: Switch to optee-os[-tadevkit] classes 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 15/27] optee-client: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 16/27] meta-isar: Switch to optee-client class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 17/27] trusted-firmware-a: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 18/27] meta-isar: Switch to trusted-firmware-a class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 19/27] barebox: Add SPDX license identifiers 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 20/27] barebox: Move inherit dpkg into common .inc 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 21/27] barebox: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 22/27] meta-isar: Switch to barebox class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 23/27] initramfs-hook: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 24/27] meta[-isar]: Switch to initramfs-hook class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 25/27] container-loader: Migrate to bbclass'es 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 26/27] meta-isar: Switch to {docker,podman}-loader classes 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 27/27] RECIPES-API-CHANGELOG: Document include to class conversion 'Jan Kiszka' via isar-users

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea6befd458b77631d417c3cb69ad4bf369ec8b9a.1762170735.git.jan.kiszka@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox