dey-image-container: generate canonical tar.gz LXC bundle payloads

Switch the Yocto LXC bundle output to tar.gz and require the same format
in the external DCP generator so the DCP can embed the payload
without extra conversion.
This saves time on the device when installing.

https://onedigi.atlassian.net/browse/DEL-10037

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2026-04-09 11:25:01 +02:00
parent efa04d2069
commit f70b5328c4
4 changed files with 6 additions and 8 deletions

View File

@ -20,7 +20,7 @@ The `dey-image-container` workflow produces:
- A base rootfs (`tar.xz`)
- An OCI image output
- A Podman archive (`*.tar`)
- An LXC bundle (`*.tar.xz`)
- An LXC bundle (`*.tar.gz`)
- Final container artifacts (`*.tar.gz`) with:
- `manifest.json`
- `payload/`
@ -42,7 +42,7 @@ This script requires:
- `manifest.json`
- payload artifact, which may be one of:
- Podman: `image.tar`
- LXC: a Yocto-style LXC bundle (`.tar.xz`) containing `rootfs/` and `config`
- LXC: a Yocto-style LXC bundle (`.tar.gz`) containing `rootfs/` and `config`
Usage:

View File

@ -36,7 +36,7 @@ do_image_lxc_bundle() {
-e "s|@CONTAINER_INIT_SCRIPT@|${CONTAINER_INIT_SCRIPT}|g" \
"${config_in}" > "${lxc_dir}/config"
tar -C "${workdir}" -cJf "${lxc_tar}" "${CONTAINER_NAME}"
tar -C "${workdir}" -czf "${lxc_tar}" "${CONTAINER_NAME}"
if [ ! -s "${lxc_tar}" ]; then
bbfatal "LXC bundle was not generated correctly: ${lxc_tar}"

View File

@ -47,7 +47,7 @@ PODMAN_OUTPUT_NAME ?= "${CONTAINER_NAME}_podman_${MACHINE}.tar"
########################
CONTAINERS_DIR ?= "${THISDIR}/../../containers"
LXC_FOLDER ?= "/var/lib/lxc"
LXC_OUTPUT_NAME ?= "${CONTAINER_NAME}_lxc_${MACHINE}.tar.xz"
LXC_OUTPUT_NAME ?= "${CONTAINER_NAME}_lxc_${MACHINE}.tar.gz"
LXC_CONFIG_DIR ?= "${CONTAINER_PROFILE_DIR}/configs_lxc"
LXC_CONFIG_FILE ?= "${LXC_CONFIG_DIR}/config_lxc_${MACHINE}"

View File

@ -146,8 +146,8 @@ def validate_payload(path: Path, runtime: str) -> None:
if not lowered.endswith(".tar"):
fail("invalid payload: runtime podman requires a .tar file")
return
if not lowered.endswith(".tar.xz"):
fail("invalid payload: runtime lxc requires a .tar.xz file")
if not lowered.endswith(".tar.gz"):
fail("invalid payload: runtime lxc requires a .tar.gz file")
def tar_mode_for_path(path: Path, *, writing: bool = False) -> str:
@ -188,8 +188,6 @@ def ensure_lxc_layout(payload: Path) -> tuple[str, str]:
return dirs[0].name, dirs[0].name
fail("invalid payload: LXC archive must contain rootfs/ and config")
def write_default_readme(path: Path, manifest: dict, *, created_at: str, payload_name: str) -> None:
content = (
f"Package: {manifest['package_id']}\n"