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 25/27] container-loader: Migrate to bbclass'es
Date: Mon,  3 Nov 2025 12:52:13 +0100	[thread overview]
Message-ID: <c47e8f372e9c3c1487a831a4e60d308b997e9df8.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 {docker,podman}-loader" is shorter and a more common pattern
compared to OE/yocto. Keep the original .inc files as transitional
helpers, issuing a warning when they are used with a migration
suggestion.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 doc/user_manual.md                                  | 12 +++++-------
 .../container-loader.bbclass}                       |  5 ++---
 .../docker-loader.bbclass}                          |  4 ++--
 .../podman-loader.bbclass}                          |  4 ++--
 .../container-loader/docker-loader.inc              | 13 ++++++++-----
 .../container-loader/podman-loader.inc              | 13 ++++++++-----
 6 files changed, 27 insertions(+), 24 deletions(-)
 rename meta/{recipes-support/container-loader/container-loader.inc => classes-recipe/container-loader.bbclass} (94%)
 copy meta/{recipes-support/container-loader/docker-loader.inc => classes-recipe/docker-loader.bbclass} (70%)
 copy meta/{recipes-support/container-loader/podman-loader.inc => classes-recipe/podman-loader.bbclass} (68%)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 3064c17b..26562dfa 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1652,12 +1652,10 @@ image name, replacing all `/` with `.` and appending `:<tag>.zst`. Example:
 
 To create a Debian package which can carry container images and load them into
 local storage of docker or podman, there is a set of helpers available. To use
-them in an own recipe, add
-`require recipes-support/container-loader/docker-loader.inc` when using docker
-and `require recipes-support/container-loader/podman-loader.inc` when using
-podman. The loader will try to transfer the packaged image into the container
-runtime storage on boot, but only if no container image of the same name and
-tag is present already.
+them in an own recipe, add `inherit docker-loader` when using docker and
+`inherit podman-loader` when using podman. The loader will try to transfer the
+packaged image into the container runtime storage on boot, but only if no
+container image of the same name and tag is present already.
 
 Unless `CONTAINER_DELETE_AFTER_LOAD` is set to `1`, the source container images
 remain by default available and may be used again for loading the storage after
@@ -1675,7 +1673,7 @@ runtime services are installed on the target as well. The packaged image will
 be deleted from the target device's rootfs after successful import.
 
 ```
-require recipes-support/container-loader/docker-loader.inc
+inherit docker-loader
 
 CONTAINER_DELETE_AFTER_LOAD = "1"
 
diff --git a/meta/recipes-support/container-loader/container-loader.inc b/meta/classes-recipe/container-loader.bbclass
similarity index 94%
rename from meta/recipes-support/container-loader/container-loader.inc
rename to meta/classes-recipe/container-loader.bbclass
index 90c16228..f76480be 100644
--- a/meta/recipes-support/container-loader/container-loader.inc
+++ b/meta/classes-recipe/container-loader.bbclass
@@ -1,12 +1,11 @@
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2024
+# Copyright (c) Siemens AG, 2024-2025
 #
 # SPDX-License-Identifier: MIT
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
 inherit dpkg-raw
 
+FILESPATH:append = ":${LAYERDIR_core}/recipes-support/container-loader/files"
 SRC_URI += " \
     file://container-loader.service.tmpl \
     file://container-loader.sh.tmpl"
diff --git a/meta/recipes-support/container-loader/docker-loader.inc b/meta/classes-recipe/docker-loader.bbclass
similarity index 70%
copy from meta/recipes-support/container-loader/docker-loader.inc
copy to meta/classes-recipe/docker-loader.bbclass
index b864c854..8fc87759 100644
--- a/meta/recipes-support/container-loader/docker-loader.inc
+++ b/meta/classes-recipe/docker-loader.bbclass
@@ -1,9 +1,9 @@
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2024
+# Copyright (c) Siemens AG, 2024-2025
 #
 # SPDX-License-Identifier: MIT
 
-require container-loader.inc
+inherit container-loader
 
 CONTAINER_ENGINE = "docker"
 
diff --git a/meta/recipes-support/container-loader/podman-loader.inc b/meta/classes-recipe/podman-loader.bbclass
similarity index 68%
copy from meta/recipes-support/container-loader/podman-loader.inc
copy to meta/classes-recipe/podman-loader.bbclass
index d2c9a12d..30b1a088 100644
--- a/meta/recipes-support/container-loader/podman-loader.inc
+++ b/meta/classes-recipe/podman-loader.bbclass
@@ -1,9 +1,9 @@
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2024
+# Copyright (c) Siemens AG, 2024-2025
 #
 # SPDX-License-Identifier: MIT
 
-require container-loader.inc
+inherit container-loader
 
 CONTAINER_ENGINE = "podman"
 
diff --git a/meta/recipes-support/container-loader/docker-loader.inc b/meta/recipes-support/container-loader/docker-loader.inc
index b864c854..8dde04ee 100644
--- a/meta/recipes-support/container-loader/docker-loader.inc
+++ b/meta/recipes-support/container-loader/docker-loader.inc
@@ -1,10 +1,13 @@
+# Transitional include for docker-loader.bbclass
+#
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2024
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-require container-loader.inc
-
-CONTAINER_ENGINE = "docker"
+inherit docker-loader
 
-CONTAINER_ENGINE_PACKAGES ?= "docker.io, apparmor"
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-support/container-loader/docker-loader.inc\" to \"inherit docker-loader\""
+}
+addtask warn_custom_inc before do_unpack
diff --git a/meta/recipes-support/container-loader/podman-loader.inc b/meta/recipes-support/container-loader/podman-loader.inc
index d2c9a12d..dc8bc30f 100644
--- a/meta/recipes-support/container-loader/podman-loader.inc
+++ b/meta/recipes-support/container-loader/podman-loader.inc
@@ -1,10 +1,13 @@
+# Transitional include for podman-loader.bbclass
+#
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2024
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-require container-loader.inc
-
-CONTAINER_ENGINE = "podman"
+inherit podman-loader
 
-CONTAINER_ENGINE_PACKAGES ?= "podman"
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-support/container-loader/podman-loader.inc\" to \"inherit podman-loader\""
+}
+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/c47e8f372e9c3c1487a831a4e60d308b997e9df8.1762170735.git.jan.kiszka%40siemens.com.

  parent reply	other threads:[~2025-11-03 12:04 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 ` [PATCH 11/27] u-boot-custom: Migrate to a bbclass 'Jan Kiszka' via isar-users
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 ` 'Jan Kiszka' via isar-users [this message]
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=c47e8f372e9c3c1487a831a4e60d308b997e9df8.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