From patchwork Fri Jan 30 16:02:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26062 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E1B7FC3226 for ; Fri, 30 Jan 2026 16:03:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6FBA561FDE; Fri, 30 Jan 2026 17:03:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="iHFEVCBe"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0405061FCF for ; Fri, 30 Jan 2026 17:02:58 +0100 (CET) Received: from pb-laptop.local (185.221.142.123.nat.pool.zt.hu [185.221.142.123]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8D1AF55C for ; Fri, 30 Jan 2026 17:02:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769788939; bh=B8O1Hzig9CTHv+hyFnQEbslVqByVqv4RDA+lKKCsfjU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iHFEVCBeIX8nMypk6QfT1V8mODouPASr3OORYaS81gS6x07WtuhFXlRbEAKEjsEU7 H68wmg4b+M8tKDkdehT/zOVau/QrAVNwzk1XgQPN5W38/NkP20T+L/4xmma5H/wqjw RWqXaxD5+s7bhel35KPIU0R1Ot6nlAc9Si9rRt/A= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v2 5/5] Add description about debian rootfs setup for testing Date: Fri, 30 Jan 2026 17:02:54 +0100 Message-ID: <20260130160254.1770742-6-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260130160254.1770742-1-barnabas.pocze@ideasonboard.com> References: <20260130160254.1770742-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a document that describes how the debian based root file system can be built and where it needs to be deployed. Signed-off-by: Barnabás Pőcze --- .../debian-rootfs/build-debian-rootfs.sh | 62 +++++++++++++++++++ containers/debian-rootfs/build.sh | 9 +++ .../overlay/opt/test-libcamera.sh | 18 ++++++ doc/debian-rootfs.rst | 47 ++++++++++++++ 4 files changed, 136 insertions(+) create mode 100755 containers/debian-rootfs/build-debian-rootfs.sh create mode 100755 containers/debian-rootfs/build.sh create mode 100755 containers/debian-rootfs/overlay/opt/test-libcamera.sh create mode 100644 doc/debian-rootfs.rst -- 2.52.0 diff --git a/containers/debian-rootfs/build-debian-rootfs.sh b/containers/debian-rootfs/build-debian-rootfs.sh new file mode 100755 index 0000000..af9db02 --- /dev/null +++ b/containers/debian-rootfs/build-debian-rootfs.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# based on https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/fb9d50ccb3cbbb4c6dc5f9ef53a0ad3cb0d8a177/bootstrap/cbuild + +set -ex + +packages=( + # misc. + ca-certificates + coreutils + chrony + curl + iproute2 + kmod + moreutils + openssh-server + v4l-utils + wget + + # runtime dependencies + # ensure that it is in sync with the `build-deb-for-lc-compliance-testing` job + libevent-2.1-7 + libevent-pthreads-2.1-7 + libssl3t64 + libudev1 + libyaml-0-2 + udev +) + +deb_distribution="$1" +deb_arch="$2" +container_image_name="$3" +overlay_dir="$4" + +newcontainer=$(buildah from scratch) +scratchmnt=$(buildah mount "$newcontainer") + +debootstrap --arch="$deb_arch" --variant=minbase "$deb_distribution" "$scratchmnt" + +buildah run --isolation=chroot "$newcontainer" apt update -y +buildah run --isolation=chroot "$newcontainer" apt install -y --no-install-recommends systemd systemd-sysv +buildah run --isolation=chroot "$newcontainer" apt install -y --no-install-recommends "${packages[@]}" +buildah run --isolation=chroot "$newcontainer" bash -c 'printf "root\nroot\n" | passwd root' +buildah run --isolation=chroot "$newcontainer" bash -c 'echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/10-allow-root-password.conf' +buildah run --isolation=chroot "$newcontainer" apt autoclean -y +buildah run --isolation=chroot "$newcontainer" apt autopurge -y + +buildah run --isolation=chroot "$newcontainer" rm -rf /var/cache/ +buildah run --isolation=chroot "$newcontainer" rm -rf /var/lib/apt/ + +if [[ -d "$overlay_dir" ]]; then + rsync -av --chown=root:root "$overlay_dir/" "$scratchmnt/" +fi + +buildah unmount "$newcontainer" + +buildah config --entrypoint '["/sbin/init"]' "$newcontainer" +buildah config --os linux "$newcontainer" +buildah config --arch "$deb_arch" "$newcontainer" + +buildah commit --format=docker "$newcontainer" "$container_image_name" + +podman image inspect "$container_image_name" diff --git a/containers/debian-rootfs/build.sh b/containers/debian-rootfs/build.sh new file mode 100755 index 0000000..71c9fa2 --- /dev/null +++ b/containers/debian-rootfs/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +exec buildah unshare ./build-debian-rootfs.sh \ + trixie \ + arm64 \ + localhost/libcamera-ci/debian-rootfs:arm64 \ + ./overlay diff --git a/containers/debian-rootfs/overlay/opt/test-libcamera.sh b/containers/debian-rootfs/overlay/opt/test-libcamera.sh new file mode 100755 index 0000000..a22a17d --- /dev/null +++ b/containers/debian-rootfs/overlay/opt/test-libcamera.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -ex + +pkg_source="$1" +camera_id="$2" + +trap 'rm -rf /tmp/libcamera.deb' EXIT +curl --retry 3 -f -o /tmp/libcamera.deb -- "$pkg_source" +dpkg -i /tmp/libcamera.deb +rm -rf /tmp/libcamera.deb + +env \ + LIBCAMERA_LOG_COLOR=no \ + GTEST_COLOR=no \ + ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 \ + UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 \ + lc-compliance -c "$camera_id" diff --git a/doc/debian-rootfs.rst b/doc/debian-rootfs.rst new file mode 100644 index 0000000..1cb45a1 --- /dev/null +++ b/doc/debian-rootfs.rst @@ -0,0 +1,47 @@ +.. SPDX-License-Identifier: CC-BY-SA-4.0 + +Creating the root file system for on device testing +=================================================== + +At the moment, the root file system used with boot2container for testing +needs to be built and deployed manually. + +Building +-------- + +Some dependencies that might need to be installed: + + * `buildah`_ + * debootstrap + * rsync + * qemu user emulation for aarch64 with binfmt setup + +.. _buildah: https://buildah.io/ + +Simply ``cd`` into the ``containers/debian-rootfs`` directory, and execute the ``build.sh``: + +.. code:: shell + + $ ./build.sh + +If everything succeeds, a new image tagged as ``localhost/libcamera-ci/debian-rootfs:arm64`` +should be available. + +Deployment +---------- + +The ``localhost/libcamera-ci/debian-rootfs:arm64`` image must be pushed to the internal +registry running alongside the LAVA services. After starting SSH forwarding: + +.. code:: shell + + $ ssh -N -v -L 127.0.0.1:5000:${REGISTRY_LOCAL_ADDR}:5000 ssh://${REGISTRY_REMOTE_ADDR} + +the image must be tagged for the registry and pushed: + +.. code:: shell + + $ podman image tag localhost/libcamera-ci/debian-rootfs:arm64 localhost:5000/libcamera-ci/debian-rootfs-arm64:latest + $ podman image push --tls-verify=false localhost:5000/libcamera-ci/debian-rootfs-arm64 + +Internal documentation describes how to gain access.