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 v2 21/27] barebox: Migrate to a bbclass
Date: Mon, 10 Nov 2025 08:22:34 +0100	[thread overview]
Message-ID: <aa80fd73c20d5b3007b656699a0b7f1735de2c49.1762759360.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1762759359.git.jan.kiszka@siemens.com>

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

"inherit barebox" 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>
---
 .../barebox.bbclass}                          |  3 +-
 meta/recipes-bsp/barebox/barebox.inc          | 60 +++----------------
 2 files changed, 9 insertions(+), 54 deletions(-)
 copy meta/{recipes-bsp/barebox/barebox.inc => classes-recipe/barebox.bbclass} (95%)

diff --git a/meta/recipes-bsp/barebox/barebox.inc b/meta/classes-recipe/barebox.bbclass
similarity index 95%
copy from meta/recipes-bsp/barebox/barebox.inc
copy to meta/classes-recipe/barebox.bbclass
index a11ef9e2..63c70fa1 100644
--- a/meta/recipes-bsp/barebox/barebox.inc
+++ b/meta/classes-recipe/barebox.bbclass
@@ -1,5 +1,6 @@
 # This software is a part of ISAR.
 # Copyright (C) 2022 ilbers GmbH
+# Copyright (c) Siemens, 2025
 #
 # SPDX-License-Identifier: MIT
 
@@ -18,7 +19,7 @@ BAREBOX_BUILD_DIR ?= "build"
 BAREBOX_VERSION_EXTENSION ?= ""
 BAREBOX_ENV ?= ""
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
+FILESPATH:append = ":${LAYERDIR_core}/recipes-bsp/barebox/files"
 SRC_URI += "file://rules.tmpl \
             file://version.cfg.tmpl \
             file://defaultenv.cfg.tmpl"
diff --git a/meta/recipes-bsp/barebox/barebox.inc b/meta/recipes-bsp/barebox/barebox.inc
index a11ef9e2..90004a70 100644
--- a/meta/recipes-bsp/barebox/barebox.inc
+++ b/meta/recipes-bsp/barebox/barebox.inc
@@ -1,59 +1,13 @@
+# Transitional include for barebox.bbclass
+#
 # This software is a part of ISAR.
-# Copyright (C) 2022 ilbers GmbH
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-inherit dpkg
-
-DESCRIPTION ?= "The barebox is a bootloader designed for embedded systems. It \
-                runs on a variety of architectures including x86, ARM, MIPS, \
-                PowerPC and others."
-CHANGELOG_V = "${PV}+${PR}"
-MAINTAINER ?= "isar-users <isar-users@googlegroups.com>"
-
-DEBIAN_BUILD_DEPENDS ?= "lzop, coreutils, bison, flex, lz4"
-
-BAREBOX_CONFIG ?= ""
-BAREBOX_BUILD_DIR ?= "build"
-BAREBOX_VERSION_EXTENSION ?= ""
-BAREBOX_ENV ?= ""
-
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-SRC_URI += "file://rules.tmpl \
-            file://version.cfg.tmpl \
-            file://defaultenv.cfg.tmpl"
-
-BAREBOX_CONFIG_FRAGMENTS = "version.cfg defaultenv.cfg"
-
-SRC_URI += "${@'file://%s' % d.getVar('BAREBOX_ENV') if d.getVar('BAREBOX_ENV') else ''}"
-
-TEMPLATE_FILES += "rules.tmpl version.cfg.tmpl defaultenv.cfg.tmpl"
-TEMPLATE_VARS += "BAREBOX_CONFIG BAREBOX_BUILD_DIR BAREBOX_VERSION_EXTENSION BAREBOX_ENV BAREBOX_CONFIG_FRAGMENTS BAREBOX_BASE_BIN"
-
-do_prepare_build[cleandirs] += "${S}/debian"
-do_prepare_build() {
-    deb_debianize
-
-    if [ -n "${BAREBOX_CONFIG_FRAGMENTS}" ]; then
-        (cd ${WORKDIR} && cp ${BAREBOX_CONFIG_FRAGMENTS} ${S}/)
-    fi
-    if [ -n "${BAREBOX_ENV}" ]; then
-        (cd ${WORKDIR} && cp -r ${BAREBOX_ENV} ${S}/)
-    fi
-}
-
-BAREBOX_BASE_BIN ?= "barebox"
-
-do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
-do_deploy() {
-    dpkg --fsys-tarfile ${WORKDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
-        tar xOf - ./usr/lib/barebox/barebox.bin \
-        > "${DEPLOY_DIR_IMAGE}/${BAREBOX_BASE_BIN}.img"
-    ln -sf ${BAREBOX_BASE_BIN}.img ${DEPLOY_DIR_IMAGE}/barebox.bin
+inherit barebox
 
-    dpkg --fsys-tarfile ${WORKDIR}/${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb | \
-        tar xOf - ./usr/lib/barebox/barebox.config \
-        > "${DEPLOY_DIR_IMAGE}/${BAREBOX_BASE_BIN}.config"
-    ln -sf ${BAREBOX_BASE_BIN}.config ${DEPLOY_DIR_IMAGE}/barebox.config
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-bsp/barebox/barebox.inc\" to \"inherit barebox\""
 }
-addtask deploy before do_deploy_deb after do_dpkg_build
+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/aa80fd73c20d5b3007b656699a0b7f1735de2c49.1762759360.git.jan.kiszka%40siemens.com.

  parent reply	other threads:[~2025-11-10  7:22 UTC|newest]

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