@@ -981,83 +981,3 @@ fragment, this can be specified via adding `${S}/path/to/fragment.cfg` to
`KERNEL_CONFIG_FRAGMENTS`. If a fragment was checked out into ${WORKDIR} as
part of a repository, a tarball, or some other directory structure, just
specify it relative to ${WORKDIR} in `KERNEL_CONFIG_FRAGMENTS`.
-
-### Change DEPLOY_DIR_IMAGE path and artifacts naming
-
-Change DEPLOY_DIR_IMAGE from ${DEPLOY_DIR}/images/${MACHINE} to
-${DEPLOY_DIR}/images/${MACHINE}/${DISTRO}-${IMAGE_PN}.
-
-When building different distros with the same machine the following
-error occurs:
-
-do_copy_boot_files: The recipe isar-image-base is trying to install
-files into a shared area when those files already exists. It happens
-when some files have the same names (e.g., dtb files) for different
-distros.
-
-To prevent such collisions, image artifacts are now deployed into a
-distro- and image-specific subdirectory.
-
-Additionally, artifact filenames have been shortened by removing the
-${DISTRO} and ${IMAGE_PN} prefix, since this information is now
-encoded in the directory path.
-
-Example 1: Build isar-image-base (phyboard-mira, debian-bookworm)
-Under "build/tmp/deploy/images/":
-Before:
-phyboard-mira/imx6q-phytec-mira-rdk-nand.dtb
-phyboard-mira/isar-image-base-debian-bookworm-phyboard-mira-initrd.img
-phyboard-mira/isar-image-base-debian-bookworm-phyboard-mira-vmlinuz
-phyboard-mira/isar-image-base-debian-bookworm-phyboard-mira.dpkg_status
-phyboard-mira/isar-image-base-debian-bookworm-phyboard-mira.ubi
-
-After:
-phyboard-mira/debian-bookworm-isar-image-base/imx6q-phytec-mira-rdk-nand.dtb
-phyboard-mira/debian-bookworm-isar-image-base/initrd.img
-phyboard-mira/debian-bookworm-isar-image-base/vmlinuz
-phyboard-mira/debian-bookworm-isar-image-base/phyboard-mira.dpkg_status
-phyboard-mira/debian-bookworm-isar-image-base/phyboard-mira.ubi
-
-Example 2: Build isar-image-ci (qemuamd64, debian-bookworm)
-Under "build/tmp/deploy/images/":
-Before:
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64-initrd.img
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64-vmlinuz
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64.dpkg_status
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64.manifest
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64.wic
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64.wic.bmap
-qemuamd64/isar-image-ci-debian-bookworm-qemuamd64.wic.manifest
-
-After:
-qemuamd64/debian-bookworm-isar-image-ci/initrd.img
-qemuamd64/debian-bookworm-isar-image-ci/vmlinuz
-qemuamd64/debian-bookworm-isar-image-ci/qemuamd64.dpkg_status
-qemuamd64/debian-bookworm-isar-image-ci/qemuamd64.manifest
-qemuamd64/debian-bookworm-isar-image-ci/qemuamd64.wic
-qemuamd64/debian-bookworm-isar-image-ci/qemuamd64.wic.bmap
-qemuamd64/debian-bookworm-isar-image-ci/qemuamd64.wic.manifest
-
-Artifacts that do not belong to a full image (e.g. isar-image-base,
-isar-image-ci) remain unchanged. For example, a customized initramfs
-built independently is not affected.
-
-This change affects the location and naming of build artifacts and must
-be taken into account by downstream users.
-
-Note that this approach differs from OpenEmbedded.
-
-OpenEmbedded typically avoids artifact collisions in multiconfig builds
-by using separate TMPDIRs per configuration, resulting in multiple
-build directories such as tmp-qemuarm64 and tmp-qemuarm64customized. In
-this model, artifacts with identical names but different contents do
-not cause conflicts because they reside in their own isolated build
-directories.
-
-If multiple configurations are intentionally configured to share the
-same TMPDIR in OpenEmbedded, conflicts may occur and are not handled by
-OE. Artifacts with the same name overwrite each other, leading to
-incorrect build results.
-
-Changes in next
----------------
@@ -13,10 +13,9 @@ INSTALLER_TARGET_IMAGES ??= "${INSTALLER_TARGET_IMAGE}"
INSTALLER_TARGET_MC ??= "installer-target"
INSTALLER_TARGET_DISTRO ??= "${DISTRO}"
INSTALLER_TARGET_MACHINE ??= "${MACHINE}"
-INSTALLER_TARGET_IMAGE ??= "${IMAGE_PN}"
-INSTALLER_TARGET_DEPLOY_DIR_IMAGE ??= "${DEPLOY_DIR}/images/${INSTALLER_TARGET_MACHINE}/${INSTALLER_TARGET_DISTRO}-${INSTALLER_TARGET_IMAGE}"
+INSTALLER_TARGET_DEPLOY_DIR_IMAGE ??= "${DEPLOY_DIR}/images/${INSTALLER_TARGET_MACHINE}"
-IMAGE_DATA_FILE ??= "${INSTALLER_TARGET_MACHINE}"
+IMAGE_DATA_FILE ??= "${INSTALLER_TARGET_IMAGE}-${INSTALLER_TARGET_DISTRO}-${INSTALLER_TARGET_MACHINE}"
IMAGE_DATA_POSTFIX ??= "wic.zst"
IMAGE_DATA_POSTFIX:buster ??= "wic.xz"
IMAGE_DATA_POSTFIX:bullseye ??= "wic.xz"
@@ -30,7 +29,7 @@ def get_installer_sources(d, suffix):
target_machine = d.getVar('INSTALLER_TARGET_MACHINE')
sources = []
for image in installer_target_images:
- image_data = f"{target_machine}"
+ image_data = f"{image}-{target_distro}-{target_machine}"
sources.append(f"{target_deploy_dir}/{image_data}.{suffix}")
return sources
@@ -42,7 +41,7 @@ def get_installer_destinations(d, suffix):
target_machine = d.getVar('INSTALLER_TARGET_MACHINE')
dests = []
for image in installer_target_images:
- image_data = f"{target_machine}"
+ image_data = f"{image}-{target_distro}-{target_machine}"
dests.append(f"/install/{image_data}.{suffix}")
return dests
@@ -18,9 +18,8 @@ IMAGE_ROOTFS ?= "${WORKDIR}/rootfs"
KERNEL_IMAGE_PKG ??= "${@ ("linux-image-" + d.getVar("KERNEL_NAME")) if d.getVar("KERNEL_NAME") else ""}"
IMAGE_INSTALL += "${KERNEL_IMAGE_PKG}"
-# Name the image as the machine name only, since the path includes distro name now
-IMAGE_FULLNAME = "${MACHINE}"
-IMAGE_PN = "${PN}"
+# Name of the image including distro&machine names
+IMAGE_FULLNAME = "${PN}-${DISTRO}-${MACHINE}"
# Deprecated; this would be set to e.g. "${INITRAMFS_RECIPE}-${DISTRO}-${MACHINE}-initrd.img"
INITRD_IMAGE ?= ""
@@ -30,7 +29,7 @@ INITRD_IMAGE ?= ""
IMAGE_INITRD ?= ""
# Name of the deployed initrd image
-INITRD_DEPLOY_FILE = "initrd.img"
+INITRD_DEPLOY_FILE = "${@ d.getVar('IMAGE_INITRD') or '${PN}' }-${DISTRO}-${MACHINE}-initrd.img"
# Make sure dependent initramfs recipe is built
do_image[depends] += "${@ '${IMAGE_INITRD}:do_build' if '${IMAGE_INITRD}' else '' }"
@@ -53,7 +52,7 @@ python() {
ROOTFS_FEATURES += "${@ 'generate-initrd' if (d.getVar('INITRD_IMAGE') == '' and d.getVar('IMAGE_INITRD') == '') else ''}"
# This variable is used by wic and start_vm
-KERNEL_IMAGE ?= "${KERNEL_FILE}"
+KERNEL_IMAGE ?= "${IMAGE_FULLNAME}-${KERNEL_FILE}"
# This defines the deployed dtbs for reuse by imagers
DTB_FILES ?= ""
@@ -109,7 +108,7 @@ ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${@isar_multiarch_packages('IMAGE_INSTAL
ROOTFS_VARDEPS += "IMAGE_INSTALL"
ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
-ROOTFS_PACKAGE_SUFFIX ?= "${MACHINE}"
+ROOTFS_PACKAGE_SUFFIX ?= "${PN}-${DISTRO}-${MACHINE}"
CACHE_DEB_SRC = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', '1', '0', d)}"
python () {
@@ -9,7 +9,7 @@
CONTAINER_TYPES = "oci-archive docker-archive docker-daemon containers-storage"
USING_CONTAINER = "${@bb.utils.contains_any('IMAGE_BASETYPES', d.getVar('CONTAINER_TYPES').split(), '1', '0', d)}"
-CONTAINER_IMAGE_NAME ?= "container-${DISTRO_ARCH}"
+CONTAINER_IMAGE_NAME ?= "${PN}-${DISTRO}-${DISTRO_ARCH}"
CONTAINER_IMAGE_TAG ?= "${PV}-${PR}"
CONTAINER_IMAGE_CMD ?= "/bin/dash"
CONTAINER_IMAGE_ENTRYPOINT ?= ""
@@ -57,8 +57,7 @@ WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
GIT_DL_LINK_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}"
DEPLOY_DIR_BOOTSTRAP = "${DEPLOY_DIR}/bootstrap"
DEPLOY_DIR_SDKCHROOT = "${DEPLOY_DIR}/sdkchroot"
-IMAGE_PN ?= ""
-DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}${@('/%s-%s' % (d.getVar('DISTRO'), d.getVar('IMAGE_PN'))) if d.getVar('IMAGE_PN') != '' else ''}"
+DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}"
DL_DIR ?= "${TOPDIR}/downloads"
SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}"
@@ -196,7 +196,7 @@ class IsoImagePlugin(SourcePlugin):
raise WicError("Couldn't find MACHINE, exiting.")
pattern = '%s/%s*%s.%s' % (initrd_dir, image_name, machine, image_type)
- pattern = '%s/initrd.%s' % (initrd_dir, image_type)
+ pattern = '%s/%s-%s-initrd.%s' % (initrd_dir, image_name, machine, image_type)
files = glob.glob(pattern)
if files:
initrd = files[0]
@@ -44,7 +44,7 @@ class CIBaseTest(CIBuilder):
self.configure(wic_deploy_parts=wic_deploy_parts, **kwargs)
self.bitbake(targets, **kwargs)
- wic_path = f"{self.build_dir}/tmp/deploy/images/*/*/*.wic.p1"
+ wic_path = f"{self.build_dir}/tmp/deploy/images/*/*.wic.p1"
partition_files = set(glob.glob(wic_path))
if wic_deploy_parts and len(partition_files) == 0:
self.fail("Found raw wic partitions in DEPLOY_DIR")
@@ -498,9 +498,8 @@ class InitRdBaseTest(CIBaseTest):
super().init()
self.deploy_dir = os.path.join(self.build_dir, 'tmp', 'deploy')
- def deploy_dir_image(self, mc, image):
- multiconfig = f"{mc}:{image}"
- return CIUtils.getVars('DEPLOY_DIR_IMAGE', target=multiconfig)
+ def deploy_dir_image(self, machine):
+ return os.path.join(self.deploy_dir, 'images', machine)
def dracut_in_image(self, targets):
machine = 'qemuamd64'
@@ -529,7 +528,7 @@ class InitRdBaseTest(CIBaseTest):
bb_should_fail=False):
mc = f'mc:{machine}-{distro.removeprefix("debian-")}'
initrd_image = f'{initrd}-{distro}-{machine}-initrd.img'
- initrd_path = os.path.join(self.deploy_dir_image(mc, initrd), initrd_image)
+ initrd_path = os.path.join(self.deploy_dir_image(machine), initrd_image)
# cleansstate if the initrd image was already built/deployed to verify
# that a new build does result in the image being deployed
@@ -50,7 +50,7 @@ def format_qemu_cmdline(
image_type = image_fstypes.split()[0]
base = 'ubuntu' if distro in ['jammy', 'focal', 'noble'] else 'debian'
- rootfs_image = f"qemu{arch}.{image_type}"
+ rootfs_image = f"{image}-{base}-{distro}-qemu{arch}.{image_type}"
if image_type == 'ext4':
kernel_image = deploy_dir_image + '/' + kernel_image
This reverts commit 13cb77dd04614b655499bbb6d2b88b96718634cd. As the changing of the DEPLOY_DIR_IMAGE has proven to be fundamentally incompatible with custom initrd recipes, this patch was reverted, re-introducing the do_copy_boot_files error on DTBs that are named equally but belong to different mc targets. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- RECIPE-API-CHANGELOG.md | 80 ------------------- .../installer-add-rootfs.bbclass | 9 +-- meta/classes-recipe/image.bbclass | 11 ++- .../imagetypes_container.bbclass | 2 +- meta/conf/bitbake.conf | 3 +- .../plugins/source/isoimage-isohybrid-isar.py | 2 +- testsuite/cibase.py | 2 +- testsuite/citest.py | 7 +- testsuite/start_vm.py | 2 +- 9 files changed, 17 insertions(+), 101 deletions(-)