[6/8] add host-tooling chroot for generic host tooling

Message ID 20260915100125.1991311-7-felix.moessbauer@siemens.com
State Under Review
Headers show
Series [1/8] rootfs: generalize deployment of rootfs artifact | expand

Commit Message

Felix Moessbauer Sept. 15, 2026, 10:01 a.m. UTC
As a preparation to provide needed cross tooling for initrd generation,
we provide a host-tooling-chroot and a corresponding class. This can be
used to install debian packages in the native version in a chroot, which
then can be used to perform cross-chroot tool execution.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/host-tooling.bbclass      | 14 ++++++++++
 .../host-tooling-chroot.bb                    | 28 +++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 meta/classes-recipe/host-tooling.bbclass
 create mode 100644 meta/recipes-devtools/host-tooling-chroot/host-tooling-chroot.bb

Patch

diff --git a/meta/classes-recipe/host-tooling.bbclass b/meta/classes-recipe/host-tooling.bbclass
new file mode 100644
index 00000000..b76f8898
--- /dev/null
+++ b/meta/classes-recipe/host-tooling.bbclass
@@ -0,0 +1,14 @@ 
+# This software is a part of Isar.
+#
+# Copyright (C) 2026 Siemens
+
+LICENSE = "gpl-2.0"
+LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
+
+HOST_TOOLING_PACKAGES ?= ""
+HOST_TOOLING_DEPENDS ?= ""
+
+# dependency to build the host-tooling-chroot
+HOST_TOOLING_DEP ?= "host-tooling-chroot:do_build"
+HOST_TOOLING_DEPLOY_DIR ?= "${DEPLOY_DIR}/chroot-host-tooling"
+HOST_TOOLING_CHROOT ?= "${HOST_TOOLING_DEPLOY_DIR}/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}.tar.zst"
diff --git a/meta/recipes-devtools/host-tooling-chroot/host-tooling-chroot.bb b/meta/recipes-devtools/host-tooling-chroot/host-tooling-chroot.bb
new file mode 100644
index 00000000..0ee2a7c5
--- /dev/null
+++ b/meta/recipes-devtools/host-tooling-chroot/host-tooling-chroot.bb
@@ -0,0 +1,28 @@ 
+# This software is a part of Isar.
+#
+# Copyright (C) 2026 Siemens
+
+LICENSE = "gpl-2.0"
+LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
+
+PV = "1.0"
+
+inherit rootfs
+inherit host-tooling
+
+ROOTFS_ARCH = "${HOST_ARCH}"
+ROOTFS_DISTRO = "${@get_rootfs_distro(d)}"
+ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
+
+ROOTFS_FEATURES:remove = "generate-initrd"
+ROOTFS_INSTALL_COMMAND:remove = "rootfs_restore_initrd_tooling"
+
+DEPENDS += "${HOST_TOOLING_DEPENDS}"
+ROOTFSDIR = "${WORKDIR}/rootfs"
+ROOTFS_PACKAGES += "${HOST_TOOLING_PACKAGES}"
+
+inherit rootfs-deploy
+
+ROOTFS_TAR_FLAGS = "--exclude=var/*"
+ROOTFS_DEPLOY_DIR = "${HOST_TOOLING_DEPLOY_DIR}"
+ROOTFS_DEPLOY_FILE = "${HOST_TOOLING_CHROOT}"