pax_global_header00006660000000000000000000000064152520154130014510gustar00rootroot0000000000000052 comment=1b378a71176d1aa4b231b041a79c8e71b481b81a lxc-ci-0.0~git20260914.1b378a7/000077500000000000000000000000001525201541300152535ustar00rootroot00000000000000lxc-ci-0.0~git20260914.1b378a7/.github/000077500000000000000000000000001525201541300166135ustar00rootroot00000000000000lxc-ci-0.0~git20260914.1b378a7/.github/workflows/000077500000000000000000000000001525201541300206505ustar00rootroot00000000000000lxc-ci-0.0~git20260914.1b378a7/.github/workflows/commits.yml000066400000000000000000000016441525201541300230530ustar00rootroot00000000000000name: Commits on: - pull_request permissions: contents: read jobs: dco-check: permissions: pull-requests: read # for tim-actions/get-pr-commits to get list of commits from the PR name: Signed-off-by (DCO) runs-on: ubuntu-24.04 steps: - name: Get PR Commits id: 'get-pr-commits' uses: tim-actions/get-pr-commits@master with: token: ${{ secrets.GITHUB_TOKEN }} - name: Check that all commits are signed-off uses: tim-actions/dco@master with: commits: ${{ steps.get-pr-commits.outputs.commits }} target-branch: permissions: contents: none name: Branch target runs-on: ubuntu-24.04 steps: - name: Check branch target env: TARGET: ${{ github.event.pull_request.base.ref }} run: | set -x [ "${TARGET}" = "main" ] && exit 0 echo "Invalid branch target: ${TARGET}" exit 1 lxc-ci-0.0~git20260914.1b378a7/.github/workflows/tests.yml000066400000000000000000000013231525201541300225340ustar00rootroot00000000000000name: Tests on: - push - pull_request permissions: contents: read jobs: lint: runs-on: ubuntu-latest permissions: security-events: write steps: - name: Repository checkout uses: actions/checkout@v4 with: fetch-depth: 0 - id: ShellCheck name: Differential ShellCheck uses: redhat-plumbers-in-action/differential-shellcheck@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ always() }} name: Upload artifact with ShellCheck defects in SARIF format uses: actions/upload-artifact@v4 with: name: Differential ShellCheck SARIF path: ${{ steps.ShellCheck.outputs.sarif }} lxc-ci-0.0~git20260914.1b378a7/.gitignore000066400000000000000000000001041525201541300172360ustar00rootroot00000000000000*/__pycache__ etc/config etc/hosts build/* jenkins/jenkins_jobs.ini lxc-ci-0.0~git20260914.1b378a7/AUTHORS000066400000000000000000000003631525201541300163250ustar00rootroot00000000000000Unless mentioned otherwise in a specific file's header, all code in this project is released under the Apache 2.0 license. The list of authors and contributors can be retrieved from the git commit history and in some cases, the file headers. lxc-ci-0.0~git20260914.1b378a7/CONTRIBUTING.md000066400000000000000000000051411525201541300175050ustar00rootroot00000000000000# Contributing ## Pull requests: Changes to this project should be proposed as pull requests on Github at: Proposed changes will then go through code review there and once acked, be merged in the main branch. ## License and copyright: By default, any contribution to this project is made under the Apache 2.0 license. The author of a change remains the copyright holder of their code (no copyright assignment). ## Developer Certificate of Origin: To improve tracking of contributions to this project we use the DCO 1.1 and use a "sign-off" procedure for all changes going into the branch. The sign-off is a simple line at the end of the explanation for the commit which certifies that you wrote it or otherwise have the right to pass it on as an open-source contribution. > Developer Certificate of Origin > Version 1.1 > > Copyright (C) 2004, 2006 The Linux Foundation and its contributors. > 660 York Street, Suite 102, > San Francisco, CA 94110 USA > > Everyone is permitted to copy and distribute verbatim copies of this > license document, but changing it is not allowed. > > Developer's Certificate of Origin 1.1 > > By making a contribution to this project, I certify that: > > (a) The contribution was created in whole or in part by me and I > have the right to submit it under the open source license > indicated in the file; or > > (b) The contribution is based upon previous work that, to the best > of my knowledge, is covered under an appropriate open source > license and I have the right under that license to submit that > work with modifications, whether created in whole or in part > by me, under the same open source license (unless I am > permitted to submit under a different license), as indicated > in the file; or > > (c) The contribution was provided directly to me by some other > person who certified (a), (b) or (c) and I have not modified > it. > > (d) I understand and agree that this project and the contribution > are public and that a record of the contribution (including all > personal information I submit with it, including my sign-off) is > maintained indefinitely and may be redistributed consistent with > this project or the open source license(s) involved. An example of a valid sign-off line is: ``` Signed-off-by: Random J Developer ``` Use your real name and a valid e-mail address. Sorry, no pseudonyms or anonymous contributions are allowed. We also require each commit be individually signed-off by their author, even when part of a larger set. You may find `git commit -s` useful. lxc-ci-0.0~git20260914.1b378a7/COPYING000066400000000000000000000261361525201541300163160ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. lxc-ci-0.0~git20260914.1b378a7/bin/000077500000000000000000000000001525201541300160235ustar00rootroot00000000000000lxc-ci-0.0~git20260914.1b378a7/bin/build-distro000077500000000000000000000041131525201541300203510ustar00rootroot00000000000000#!/bin/sh -eu CNAME="distrobuilder-$(uuidgen)" # Check arguments if [ "${1:-}" = "" ] || [ "${2:-}" = "" ] || [ "${3:-}" = "" ] || [ "${4:-}" = "" ] || [ "${5:-}" = "" ]; then echo "Usage: ${0} [flags]" exit 1 fi YAML=${1} shift ARCH=${1} shift TYPE=${1} shift TIMEOUT=${1} shift TARGET=${1} shift cleanup() { incus delete --force "${CNAME}" } trap cleanup EXIT HUP INT TERM # Create the container incus copy "cache-distrobuilder-${ARCH}" "${CNAME}" # Start the container incus start "${CNAME}" set -x incus file push "${YAML}" "${CNAME}/root/image.yaml" ( cat << EOF #!/bin/sh # Wait for network while :; do ping -W1 -c1 linuxcontainers.org >/dev/null 2>&1 && break sleep 1 done set -eux # Workaround for plamo not liking dbus much rm -f /run/dbus/system_bus_socket # Build the image mkdir /root/build /root/build/cache if echo "${YAML}" | grep -q -E "almalinux|centos|openeuler|rockylinux"; then mount -t tmpfs tmpfs /root/build -o size=10G,nr_inodes=10000000 fi mv /root/image.yaml /root/build/ cd /root/build/ SERIAL=\$(date -u +%Y%m%d_%H:%M) distrobuilder --cache-dir /root/build/cache/ --timeout "${TIMEOUT}" build-dir image.yaml rootfs -o image.serial="\${SERIAL}" "\$@" if echo ${TYPE} | grep -q vm; then distrobuilder --cache-dir /root/build/cache/ pack-incus image.yaml rootfs --vm -o image.serial="\${SERIAL}" "\$@" fi if echo ${TYPE} | grep -q container; then distrobuilder --cache-dir /root/build/cache/ pack-lxc image.yaml rootfs -o image.serial="\${SERIAL}" "\$@" distrobuilder --cache-dir /root/build/cache/ pack-incus image.yaml rootfs -o image.serial="\${SERIAL}" "\$@" fi btrfs subvolume delete rootfs/var/lib/machines >/dev/null 2>&1 || true rm -Rf rootfs echo "\${SERIAL}" > serial exit 0 EOF ) | incus file push - "${CNAME}/root/build.sh" --mode=755 incus exec "${CNAME}" -- /root/build.sh "$@" incus exec "${CNAME}" -- tar -cf - -C /root/build/ . | tar -xvf - -C "${TARGET}" [ -n "${SUDO_UID:-}" ] && chown "${SUDO_UID}" -R "${TARGET}" [ -n "${SUDO_GID:-}" ] && chgrp "${SUDO_GID}" -R "${TARGET}" lxc-ci-0.0~git20260914.1b378a7/bin/build-image-distrobuilder000077500000000000000000000071171525201541300230070ustar00rootroot00000000000000#!/bin/sh -eu cleanup() { set +e incus delete build-distrobuilder-cache -f >/dev/null 2>&1 exit 0 } trap cleanup EXIT HUP INT TERM ARCH="$1" TARGET="$2" DISTRO="trixie" # Create the container incus init "images:debian/${DISTRO}/${ARCH}" build-distrobuilder-cache \ -c security.privileged=true -c security.nesting=true printf "lxc.cgroup2.devices.allow = b 259:* rw" | incus config set build-distrobuilder-cache raw.lxc=- # Setup loop devices ( incus config show build-distrobuilder-cache | sed "/devices:/d" cat << EOF devices: loop-control: major: "10" minor: "237" path: /dev/loop-control type: unix-char EOF for i in $(seq 0 64); do cat << EOF loop${i}: major: "7" minor: "${i}" path: /dev/loop${i} type: unix-block EOF done ) | incus config edit build-distrobuilder-cache # Start the container incus start build-distrobuilder-cache # Install distrobuilder ( cat << EOF #!/bin/sh set -eux # Wait for network while :; do ping -W1 -c1 linuxcontainers.org >/dev/null 2>&1 && break sleep 1 done # Workaround apparmor issues on older distributions. umount -l /sys/devices/system/cpu || true # Setup clean sources echo force-unsafe-io >> /etc/dpkg/dpkg.cfg cat > /etc/apt/apt.conf.d/60lxc-ci << EOL APT::Get::Show-Versions "true"; Acquire::Languages "none"; EOL if [ "$(uname -m)" = "loongarch64" ]; then cat > /etc/apt/sources.list << EOL deb https://loong13.debian.net/debian-loong64/ ${DISTRO} main deb https://loong13.debian.net/debian-loong64/ ${DISTRO}-updates main deb https://loong13.debian.net/debian-loong64-security/ ${DISTRO}-security main EOL else cat > /etc/apt/sources.list << EOL deb http://deb.debian.org/debian ${DISTRO} main deb http://deb.debian.org/debian ${DISTRO}-backports main deb http://deb.debian.org/debian ${DISTRO}-updates main deb http://security.debian.org/debian-security ${DISTRO}-security main EOL fi apt-get update --yes # Install dependencies apt-get install --yes --no-install-recommends \ btrfs-progs \ build-essential \ ca-certificates \ curl \ dirmngr \ e2fsprogs \ dosfstools \ fdisk \ gcc \ gdisk \ git \ gpg \ gpg-agent \ gpgv \ kpartx \ libc6-dev \ libncurses-dev \ make \ mawk \ patch \ python3 \ qemu-utils \ rsync \ squashfs-tools \ unzip \ xz-utils \ zstd if [ "${DISTRO}" = "bookworm" ]; then apt-get install --yes --no-install-recommends -t ${DISTRO}-backports \ debootstrap else apt-get install --yes --no-install-recommends debootstrap fi apt-get clean # Disable ext4 features unsupported by grub older than 2.12. sed -i "s/,metadata_csum_seed//; s/,orphan_file//" /etc/mke2fs.conf # Keep /tmp on disk as large source downloads don't fit in the tmpfs. systemctl mask tmp.mount # Install distrobuilder GOARCH=\$(dpkg --print-architecture) [ "\${GOARCH}" = "armhf" ] && GOARCH=armv6l curl -sL "https://go.dev/dl/go1.23.4.linux-\${GOARCH}.tar.gz" | tar -zx -C /usr/local/ export PATH=/usr/local/go/bin:\${PATH} git clone https://github.com/lxc/distrobuilder --depth 1 cd distrobuilder make cp /root/go/bin/distrobuilder /usr/local/bin/ cd - # Install umoci git clone https://github.com/opencontainers/umoci --depth 1 cd umoci make cp umoci /usr/local/bin/ cd - # Cleanup rm -Rf /root/distrobuilder /root/umoci /root/go /root/.cache # All done exit 0 EOF ) | incus exec build-distrobuilder-cache -- sh incus stop build-distrobuilder-cache incus export build-distrobuilder-cache "${TARGET}/build-distrobuilder-cache.tar.xz" --optimized-storage incus delete -f build-distrobuilder-cache lxc-ci-0.0~git20260914.1b378a7/bin/build-image-freebsd000077500000000000000000000140401525201541300215370ustar00rootroot00000000000000#!/bin/sh set -eux INCUS_ARCHITECTURE="$1" RELEASE="$2" IFS=+ read -r VARIANT FS </dev/null 2>&1 fi if [ "$FS" = "zfs" ]; then zfs unmount zroot/ROOT/default >/dev/null 2>&1 zpool export zroot >/dev/null 2>&1 if [ -n "$DEV" ]; then losetup -d "$DEV" >/dev/null 2>&1 fi fi if [ "$FAIL" = "1" ]; then exit 1 fi exit 0 } trap cleanup EXIT HUP INT TERM NOW="$(date +%s)" SERIAL="$(date -u +%Y%m%d_%H:%M)" echo "$SERIAL" > "$WORKSPACE/serial" SHORT_ARCHITECTURE="$INCUS_ARCHITECTURE" EXPANDED_ARCHITECTURE="$INCUS_ARCHITECTURE" if [ "$SHORT_ARCHITECTURE" = "arm64" ]; then SHORT_ARCHITECTURE="aarch64" EXPANDED_ARCHITECTURE="arm64-aarch64" elif [ "$SHORT_ARCHITECTURE" = "riscv64" ]; then EXPANDED_ARCHITECTURE="riscv-riscv64" fi BASE_URL="$MIRROR/releases/VM-IMAGES/$RELEASE-RELEASE/$SHORT_ARCHITECTURE/Latest" if [ "$VARIANT" = "cloud" ]; then IMAGE="FreeBSD-$RELEASE-RELEASE-$EXPANDED_ARCHITECTURE-BASIC-CLOUDINIT-$FS.raw.xz" else IMAGE="FreeBSD-$RELEASE-RELEASE-$EXPANDED_ARCHITECTURE-$FS.raw.xz" fi # Download a pre-built VM image curl -sSfL --retry 5 --retry-connrefused -o "$WORKSPACE/$IMAGE" "$BASE_URL/$IMAGE" curl -sSfL --retry 5 --retry-connrefused -o "$WORKSPACE/CHECKSUM.SHA256" "$BASE_URL/CHECKSUM.SHA256" (cd "$WORKSPACE" && sha256sum -c CHECKSUM.SHA256 --ignore-missing) # Decompress the image unxz -c "$WORKSPACE/$IMAGE" > "$WORKSPACE/image.raw" rm -f "$WORKSPACE/$IMAGE" "$WORKSPACE/CHECKSUM.SHA256" # Pad the image to 4KiB alignment (needed for QEMU block attachment) truncate -s %4096 "$WORKSPACE/image.raw" if [ "$FS" = "zfs" ]; then # Mount the ZFS partition OFFSET="$(fdisk -lo Start "$WORKSPACE/image.raw" | tail -n1)" DEV="$(losetup -fPo "$((OFFSET*512))" --show "$WORKSPACE/image.raw")" ROOTFS="$WORKSPACE/rootfs" zpool import -d "$DEV" -R "$ROOTFS" zroot zfs mount zroot/ROOT/default RUN="" else # Mount the UFS partition from within FreeBSD FREEBSD="$(mktemp -u freebsd-build-XXXXXX)" incus create images:freebsd/15.0 "$FREEBSD" --vm --config security.secureboot=false incus config device add "$FREEBSD" image disk source="$WORKSPACE/image.raw" incus start "$FREEBSD" incus wait "$FREEBSD" agent # The agent may restart shortly after first coming up for _ in 1 2 3 4 5; do sleep 5 if incus exec "$FREEBSD" -T -- true; then break fi done RUN="incus exec $FREEBSD -T --" # Padding moved the backup GPT away from the end of the disk $RUN gpart recover da1 || true PART="$($RUN gpart show -p da1 | awk '$4 == "freebsd-ufs" {print $3}')" ROOTFS=/mnt $RUN mount "/dev/$PART" "$ROOTFS" fi RUNSH="$RUN sh -c" # Prepare templates mkdir -p "$WORKSPACE/incus/templates" echo 'hostname="{{ instance.name }}"' > "$WORKSPACE/incus/templates/hostname.tpl" cat > "$WORKSPACE/incus/templates/hosts.tpl" << 'EOF' 127.0.1.1 {{ container.name }} 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF # Generate metadata cat > "$WORKSPACE/incus/metadata.yaml" << EOF architecture: $INCUS_ARCHITECTURE creation_date: $NOW expiry_date: $((NOW+2592000)) properties: architecture: $INCUS_ARCHITECTURE description: FreeBSD $RELEASE $INCUS_ARCHITECTURE ($SERIAL) name: freebsd-$RELEASE-$INCUS_ARCHITECTURE-$VARIANT-$SERIAL os: freebsd release: $RELEASE serial: "$SERIAL" variant: $VARIANT templates: /etc/rc.conf.d/hostname: when: - create - copy create_only: false template: hostname.tpl properties: {} /etc/hosts: when: - create - copy create_only: false template: hosts.tpl properties: {} EOF # Build the Incus TAR tar -cJf "$WORKSPACE/incus.tar.xz" -C "$WORKSPACE/incus" . # Prepare the agent $RUNSH "echo 'incus_agent_enable=\"YES\"' >> $ROOTFS/etc/rc.conf" $RUN mkdir -p "$ROOTFS/usr/local/etc/rc.d" $RUNSH "cat > $ROOTFS/usr/local/etc/rc.d/incus-agent" << 'EOF' #!/bin/sh # # PROVIDE: incus_agent # REQUIRE: FILESYSTEMS # . /etc/rc.subr name=incus_agent rcvar=incus_agent_enable pidfile="/var/run/${name}.pid" procname=/usr/sbin/daemon start_precmd="${name}_prestart" start_cmd="${name}_start" load_rc_config "$name" : ${incus_agent_enable:="NO"} incus_agent_prestart() { /usr/local/libexec/incus-agent-setup } incus_agent_start() { cd /var/run/incus_agent /usr/sbin/daemon -P "$pidfile" -S -T "$name" -r -f /var/run/incus_agent/incus-agent } run_rc_command "$1" EOF $RUN chmod 0500 "$ROOTFS/usr/local/etc/rc.d/incus-agent" $RUN mkdir "$ROOTFS/usr/local/libexec" $RUNSH "cat > $ROOTFS/usr/local/libexec/incus-agent-setup" << 'EOF' #!/bin/sh set -eu PREFIX="/var/run/incus_agent" # Functions. mount_9p() { kldload virtio_p9fs >/dev/null 2>&1 || true mount -t p9fs -o ro config "$PREFIX.mnt" >/dev/null 2>&1 } fail() { # Check if we already have an agent in place. if [ -x "$PREFIX/incus-agent" ]; then echo "$1, reusing existing agent" exit 0 fi # Cleanup and fail. umount "$PREFIX" >/dev/null 2>&1 || true rmdir "$PREFIX" >/dev/null 2>&1 || true echo "$1, failing" exit 1 } # Try getting an agent drive. mkdir -p "$PREFIX.mnt" mount_9p || fail "Couldn't mount 9p" # Setup the mount target. umount "$PREFIX" >/dev/null 2>&1 || true mkdir -p "$PREFIX" mount -t tmpfs -o mode=0700,size=50M tmpfs "$PREFIX" # Copy the data. cp -Ra "$PREFIX.mnt/"* "$PREFIX" # Unmount the temporary mount. umount "$PREFIX.mnt" rmdir "$PREFIX.mnt" # Fix up permissions. chown -R root:wheel "$PREFIX" # Load pty kldload pty >/dev/null 2>&1 || true exit 0 EOF $RUN chmod 0500 "$ROOTFS/usr/local/libexec/incus-agent-setup" # Unmount and cleanup if [ "$FS" = "zfs" ]; then zfs unmount zroot/ROOT/default zpool export zroot losetup -d "$DEV" else $RUN umount "$ROOTFS" incus rm -f "$FREEBSD" fi qemu-img convert -f raw -O qcow2 "$WORKSPACE/image.raw" "$WORKSPACE/disk.qcow2" FAIL=0 lxc-ci-0.0~git20260914.1b378a7/bin/build-image-netbsd000077500000000000000000000153421525201541300214120ustar00rootroot00000000000000#!/bin/sh set -eux INCUS_ARCHITECTURE="$1" RELEASE="$2" # The variant is not used but kept for consistency VARIANT="$3" WORKSPACE="$4" MIRROR="$5" FAIL=1 BASE_URL="" IMAGE="" cleanup() { set +e pkill rump_server if [ "$FAIL" = "1" ]; then exit 1 fi exit 0 } trap cleanup EXIT HUP INT TERM # Install dependencies apt-get update --yes apt-get install --yes --no-install-recommends \ build-essential \ git \ ca-certificates \ zlib1g-dev \ autoconf \ automake \ libtool \ pkg-config \ flex \ bison NOW="$(date +%s)" SERIAL="$(date -u +%Y%m%d_%H:%M)" echo "$SERIAL" > "$WORKSPACE/serial" SHORT_ARCHITECTURE="$INCUS_ARCHITECTURE" EXPANDED_ARCHITECTURE="$INCUS_ARCHITECTURE" if [ "$SHORT_ARCHITECTURE" = "amd64" ]; then BASE_URL="$MIRROR/pub/NetBSD/images/$RELEASE" IMAGE="NetBSD-$RELEASE-$SHORT_ARCHITECTURE-live.img.gz" else if [ "$SHORT_ARCHITECTURE" = "arm64" ]; then EXPANDED_ARCHITECTURE="evbarm-aarch64" elif [ "$SHORT_ARCHITECTURE" = "riscv64" ]; then EXPANDED_ARCHITECTURE="riscv-riscv64" fi BASE_URL="$MIRROR/pub/NetBSD/NetBSD-$RELEASE/$EXPANDED_ARCHITECTURE/binary/gzimg" IMAGE="$SHORT_ARCHITECTURE.img.gz" fi # Download a pre-built VM image curl -sSfL --retry 5 --retry-connrefused -o "$WORKSPACE/$IMAGE" "$BASE_URL/$IMAGE" curl -sSfL --retry 5 --retry-connrefused -o "$WORKSPACE/SHA512" "$BASE_URL/SHA512" # Checksums are currently broken on arm64 if [ "$SHORT_ARCHITECTURE" != "arm64" ]; then (cd "$WORKSPACE" && sha512sum -c SHA512 --ignore-missing) fi # Decompress the image gunzip -c "$WORKSPACE/$IMAGE" > "$WORKSPACE/image.raw" rm -f "$WORKSPACE/$IMAGE" "$WORKSPACE/SHA512" OFFSET=$(($(fdisk -lo Start "$WORKSPACE/image.raw" | tail -n1)*512)) SIZE="$(($(stat -c%s "$WORKSPACE/image.raw")-OFFSET))" # Patch headers sed -i 's/#define OPEN_TREE_CLONE\s*1/\/\/ #define OPEN_TREE_CLONE 1/' /usr/include/x86_64-linux-gnu/sys/mount.h # Fetch and build Rump ( cd "$WORKSPACE" git clone --recursive https://github.com/bensmrs/rumpctrl.git cd rumpctrl buildrump.sh/buildrump.sh -s src-netbsd -j "$(nproc)" -V _GCC_CRTBEGIN= -V _GCC_CRTBEGINS= -V _GCC_CRTEND= -V _GCC_CRTENDS= -V _GCC_CRTI= -V _GCC_CRTN= -F CPPFLAGS="-DLINUX_RUMP=1 -Wno-error=stringop-truncation" -V LINUX_RUMP=yes fullbuild ./buildnb.sh rm -rf src-netbsd ) export RUMP_SERVER=unix:///run/rump.sock BIN="$WORKSPACE/rumpctrl/bin" # Mount the FFS partition from within Rump "$WORKSPACE/rumpctrl/rump/bin/rump_server" -lrumpdev -lrumpdev_disk -lrumpvfs -lrumpfs_ffs -d "key=/dk,hostpath=$WORKSPACE/image.raw,offset=$OFFSET,size=$SIZE" "$RUMP_SERVER" RUN="env LD_LIBRARY_PATH=$WORKSPACE/rumpctrl/rump/lib LD_PRELOAD=librumphijack.so" $RUN "$BIN/mkdir" /mnt $RUN "$BIN/mount_ffs" /dk /mnt # Prepare templates mkdir -p "$WORKSPACE/incus/templates" echo 'hostname="{{ instance.name }}"' > "$WORKSPACE/incus/templates/hostname.tpl" cat > "$WORKSPACE/incus/templates/hosts.tpl" << 'EOF' 127.0.1.1 {{ container.name }} 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF # Generate metadata cat > "$WORKSPACE/incus/metadata.yaml" << EOF architecture: $INCUS_ARCHITECTURE creation_date: $NOW expiry_date: $((NOW+2592000)) properties: architecture: $INCUS_ARCHITECTURE description: NetBSD $RELEASE $INCUS_ARCHITECTURE ($SERIAL) name: netbsd-$RELEASE-$INCUS_ARCHITECTURE-$VARIANT-$SERIAL os: netbsd release: $RELEASE serial: "$SERIAL" variant: $VARIANT templates: /etc/rc.conf.d/network: when: - create - copy create_only: false template: hostname.tpl properties: {} /etc/hosts: when: - create - copy create_only: false template: hosts.tpl properties: {} EOF # Build the Incus TAR tar -cJf "$WORKSPACE/incus.tar.xz" -C "$WORKSPACE/incus" . # Some operation juggling file descriptors must be run partly outside of the rump kernel $RUN "$BIN/cat" /mnt/etc/ttys | sed -E '/^tty00\s/s/\s+\S+\s+(on|off).*$/ vt100 on secure/' > "$WORKSPACE/ttys" $RUN cp "$WORKSPACE/ttys" /rump/mnt/etc/ttys $RUN "$BIN/cat" /mnt/etc/rc.conf | sed '$a incus_agent=YES' > "$WORKSPACE/rc.conf" $RUN cp "$WORKSPACE/rc.conf" /rump/mnt/etc/rc.conf # Prepare the agent cat > "$WORKSPACE/incus-agent" << 'EOF' #!/bin/sh # # PROVIDE: incus_agent # REQUIRE: mountall # KEYWORD: shutdown # . /etc/rc.subr name=incus_agent rcvar=incus_agent pidfile="/var/run/$name.pid" start_cmd="${name}_start" stop_cmd="${name}_stop" status_cmd="${name}_status" extra_commands=status check_pid() { if [ -f "$pidfile" ]; then pid="$(cat "$pidfile")" if [ -n "${pid}" ] && kill -0 "${pid}" 2>/dev/null; then echo "$pid" return 0 fi return 1 fi return 1 } incus_agent_start() { if pid="$(check_pid)"; then echo "$name is already running (PID $pid)" return 1 fi /usr/libexec/incus-agent-setup || return 1 cd /var/run/incus_agent || return 1 ( child_pid= stop() { [ -n "$child_pid" ] && kill "$child_pid" exit 0 } trap stop TERM INT while :; do /var/run/incus_agent/incus-agent 2>&1 | /usr/bin/logger -t "$name" -p daemon.info & child_pid="$!" wait "$child_pid" child_pid= sleep 5 done )& echo $! > "${pidfile}" } incus_agent_stop() { if pid="$(check_pid)"; then kill "$pid" rm -f "$pidfile" else echo "$name is not running" return 1 fi } incus_agent_status() { if pid="$(check_pid)"; then echo "$name is running (PID $pid)" else echo "$name is not running" fi } load_rc_config "$name" run_rc_command "$1" EOF $RUN cp "$WORKSPACE/incus-agent" /rump/mnt/etc/rc.d/incus-agent $RUN "$BIN/chmod" 0500 /mnt/etc/rc.d/incus-agent cat > "$WORKSPACE/incus-agent-setup" << 'EOF' #!/bin/sh set -eu PREFIX="/var/run/incus_agent" fail() { # Check if we already have an agent in place. if [ -x "$PREFIX/incus-agent" ]; then echo "$1, reusing existing agent" exit 0 fi # Cleanup and fail. umount "$PREFIX" >/dev/null 2>&1 || true rmdir "$PREFIX" >/dev/null 2>&1 || true echo "$1, failing" exit 1 } # Try getting an agent drive. mkdir -p "$PREFIX.mnt" mount_9p -o ro -cu "/dev/$(dmesg | grep -o 'vio9p.*: tagged as config' | cut -d: -f1 | head -n1)" "$PREFIX.mnt" >/dev/null 2>&1 || fail "Couldn't mount 9p" # Setup the mount target. umount "$PREFIX" >/dev/null 2>&1 || true mkdir -p "$PREFIX" mount_tmpfs -m 0700 -u root -g wheel -s 50M tmpfs "$PREFIX" # Copy the data. cp -Ra "$PREFIX.mnt/"* "$PREFIX" # Unmount the temporary mount. umount "$PREFIX.mnt" rmdir "$PREFIX.mnt" exit 0 EOF $RUN cp "$WORKSPACE/incus-agent-setup" /rump/mnt/usr/libexec/incus-agent-setup $RUN "$BIN/chmod" 0500 /mnt/usr/libexec/incus-agent-setup # Unmount and cleanup $RUN "$BIN/umount" /mnt qemu-img convert -f raw -O qcow2 "$WORKSPACE/image.raw" "$WORKSPACE/disk.qcow2" FAIL=0 lxc-ci-0.0~git20260914.1b378a7/bin/check-images000077500000000000000000000012411525201541300202670ustar00rootroot00000000000000#!/bin/sh -eu export PATH="/snap/bin/:${PATH}" # shellcheck disable=SC1091 [ -e /lxc-ci/etc/config ] && . /lxc-ci/etc/config check_distrobuilder() { if [ "${DISTROBUILDER_ARCHES:-}" = "" ]; then return fi for arch in ${DISTROBUILDER_ARCHES}; do incus info "cache-distrobuilder-${arch}" >/dev/null 2>&1 || echo "cache-distrobuilder-${arch} missing on $(hostname)" done } check_lxc() { if [ "${LXC_ARCHES:-}" = "" ]; then return fi for arch in ${LXC_ARCHES}; do incus info "cache-lxc-${arch}" >/dev/null 2>&1 || echo "cache-lxc-${arch} missing on $(hostname)" done } check_distrobuilder check_lxc exit 0 lxc-ci-0.0~git20260914.1b378a7/bin/cleanup000077500000000000000000000031361525201541300174030ustar00rootroot00000000000000#!/bin/sh if [ "${1:-}" = "force" ]; then if incus info >/dev/null 2>&1; then incus list -cn -f csv | grep -v ^cache- | xargs -r incus delete -f incus image list -cF -fcsv | xargs -r incus image delete incus admin sql global "DELETE FROM storage_volumes WHERE name NOT LIKE 'cache-%' AND name NOT IN ('images', 'backups')" rm -Rf /var/log/incus/* for i in $(zfs list -o name -r default/containers | grep containers/ | grep -v containers/cache-); do zfs destroy -R "$i"; done for i in $(zfs list -o name -r default/images | grep images/); do zfs destroy -R "$i"; done for i in $(zfs list -o name -r default/deleted/containers | grep deleted/containers/); do zfs destroy -R "$i"; done for i in $(zfs list -o name -r default/deleted/images | grep deleted/images/); do zfs destroy -R "$i"; done for i in $(ls /var/lib/incus/storage-pools/default/containers | grep -v cache-); do rm -Rf "/var/lib/incus/storage-pools/default/containers/$i"; done for i in $(ls /var/lib/incus/containers/ | grep -v cache-); do rm -Rf "/var/lib/incus/containers/$i"; done incus storage volume list default -cnt -fcsv | grep container$ | cut -d, -f1 | while read line; do incus info $line >/dev/null 2>&1 || echo $line; done | while read line; do incus admin sql global "DELETE FROM storage_volumes WHERE type=0 AND name='$line'"; rm -Rf /var/lib/incus/containers/$line; rm -Rf /var/lib/incus/storage-pools/default/containers/$line; zfs destroy default/containers/$line; done systemctl restart incus fi fi chown -R jenkins:jenkins /home/jenkins lxc-ci-0.0~git20260914.1b378a7/bin/jenkins-import-images000077500000000000000000000741211525201541300221720ustar00rootroot00000000000000#!/usr/bin/python3 import datetime import fcntl import glob import hashlib import json import os import shutil import subprocess import sys import tempfile import time from urllib.request import urlopen, urlretrieve # Globals TARGET = "/data/images.linuxcontainers.org" GPG_KEYID = "0x22F6E216" BOUNDARY = "f012e447-25dd-4f6d-8a14-105c3b27a768" DEBUG = False DATA_RETENTION = 3 MAX_IMAGES = 30 IMAGE_EXPIRY_DAYS = 15 TEST_WARNING_HOURS = 24 JENKINS_URL = "https://jenkins.linuxcontainers.org" PREFIX = "image-" ALIASES = { "debian/bullseye": ["debian/11"], "debian/bookworm": ["debian/12"], "debian/trixie": ["debian/13"], "debian/forky": ["debian/14"], "ubuntu/jammy": ["ubuntu/22.04"], "ubuntu/noble": ["ubuntu/24.04"], "ubuntu/resolute": ["ubuntu/26.04"], } VARIANT_ALIASES = { "freebsd": { "default+zfs": ["default", "zfs"], "default+ufs": ["ufs"], "cloud+zfs": ["cloud"], }, } REQUIRE_CGROUP2 = [ "ubuntu/24.04", ] REQUIRE_CDROM_AGENT = [ "almalinux", "centos", "openeuler", "oracle", "rockylinux", ] REQUIRE_NO_SECUREBOOT = [ "alpine", "archlinux", "freebsd", "gentoo", "netbsd", "nixos", "openeuler", ] REQUIRE_VM = [ "freebsd", "netbsd", ] REQUIRE_CDROM_CLOUD_INIT = [ "freebsd", ] if len(sys.argv) > 1: if sys.argv[1] == "-d": DEBUG = True def hash256(path): sha256 = hashlib.sha256() with open(path, "rb") as fd: sha256.update(fd.read()) return sha256.hexdigest() def get_json(url, depth=0, tree=None): query = "depth=%d" % depth if tree: query = "tree=%s" % tree return json.loads(urlopen("%s/api/json?%s" % (url, query)).read().decode()) def format_timestamp(ms): return datetime.datetime.fromtimestamp(ms / 1000, datetime.timezone.utc).strftime( "%Y-%m-%d %H:%M UTC" ) def format_duration(ms): seconds = int(ms / 1000) if seconds >= 3600: return "%dh %02dm" % (seconds // 3600, (seconds % 3600) // 60) return "%dm %02ds" % (seconds // 60, seconds % 60) def sign_file(path, target=None, clear=False): if not target: target = "%s.asc" % path if os.path.exists(target): os.remove(target) mode = "-b" if clear: mode = "--clearsign" with open(os.devnull, "w") as devnull: subprocess.call( ["gpg", "-u", GPG_KEYID, "-o", target, "-a", mode, path], stderr=devnull, stdout=devnull, ) def string_to_dict(string): data = {} for variable in string.split(","): key, value = variable.split("=") data[key] = value return data def incus_fingerprints(path): meta_tar = os.path.join(path, "incus.tar.xz") # Generate sha256 if os.path.exists(os.path.join(path, "rootfs.squashfs")): sha256 = hashlib.sha256() with open(meta_tar, "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, "rootfs.squashfs"), "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, ".combined_fingerprint_squashfs"), "w") as fd: fd.write(sha256.hexdigest()) fd.write("\n") if os.path.exists(os.path.join(path, "rootfs.tar.xz")): sha256 = hashlib.sha256() with open(meta_tar, "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, "rootfs.tar.xz"), "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, ".combined_fingerprint"), "w") as fd: fd.write(sha256.hexdigest()) fd.write("\n") if os.path.exists(os.path.join(path, "disk.qcow2")): sha256 = hashlib.sha256() with open(meta_tar, "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, "disk.qcow2"), "rb") as fd: sha256.update(fd.read()) with open(os.path.join(path, ".combined_fingerprint_qcow2"), "w") as fd: fd.write(sha256.hexdigest()) fd.write("\n") def incus_squashfs_delta(src, dst): if not os.path.exists("%s/rootfs.squashfs" % src): return if not os.path.exists("%s/rootfs.squashfs" % dst): return target = "delta-%s.vcdiff" % os.path.basename(src) if ( subprocess.call( [ "xdelta3", "-e", "-s", "%s/rootfs.squashfs" % src, "%s/rootfs.squashfs" % dst, "%s/%s" % (dst, target), ] ) != 0 ): raise Exception("Failed xdelta3 call") return target def incus_qcow2_delta(src, dst): if not os.path.exists("%s/disk.qcow2" % src): return if not os.path.exists("%s/disk.qcow2" % dst): return target = "delta-%s.qcow2.vcdiff" % os.path.basename(src) if ( subprocess.call( [ "xdelta3", "-e", "-s", "%s/disk.qcow2" % src, "%s/disk.qcow2" % dst, "%s/%s" % (dst, target), ] ) != 0 ): raise Exception("Failed xdelta3 call") return target def artifacts_dict(data, base): artifacts = {} for artifact in data: artifact_url = "%s/artifact/%s" % (base, artifact["relativePath"]) artifacts[artifact["fileName"]] = artifact_url return artifacts # Lock file lock_file = "%s/.sync.lock" % TARGET lock_fd = open(lock_file, "w") try: fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: sys.exit(0) # Publication paths TARGET_IMAGES = "%s/images" % TARGET TARGET_META = "%s/meta" % TARGET # Get test data tested_images = {} test_results = {} last_tested = {} data = get_json("%s/job/test-image" % JENKINS_URL, 1) for build in data["builds"]: image_url = None for action in build["actions"]: if not "parameters" in action: continue image_url = action["parameters"][1]["value"] break if not image_url: continue if build["inProgress"]: status = "RUNNING" else: status = build["result"] # Record the most recent test of every image build if image_url not in test_results: test_results[image_url] = (status, build["url"]) if status != "SUCCESS": continue fields = image_url.split("/") image_build = int(fields[-2]) image_os = fields[-3].split("image-")[-1] if image_os not in tested_images: tested_images[image_os] = image_build last_tested[image_os] = build["timestamp"] # Download try: data = get_json("%s/view/All" % JENKINS_URL) except Exception: data = {"jobs": []} count = 0 for job in data["jobs"]: # Check that we're interested in the image if job["name"].startswith(PREFIX): IMG_DIST = job["name"].split(PREFIX)[-1] else: continue # Load the Jenkins data data = get_json(job["url"]) # Look at all the combinations for config in data["activeConfigurations"]: # Publish every 30 images if count > MAX_IMAGES: break # Skip images without a succesful build data = get_json(config["url"]) if not data["lastSuccessfulBuild"]: continue # Parse the matrix variables variables = string_to_dict(config["name"]) # Load the last succesful build build_url = data["lastSuccessfulBuild"]["url"].rstrip("/") data = get_json(build_url) console = data["url"] + "/consoleText" # Parse the artifacts artifacts = artifacts_dict(data["artifacts"], build_url) # Parse the image information try: IMG_BUILD = urlopen(artifacts["serial"]).read().decode().strip() except: print("Missing serial: %s" % IMG_BUILD) continue if ":" not in IMG_BUILD: print("Bad image build format, skipping: %s" % IMG_BUILD) continue IMG_ARCH = variables["architecture"] IMG_RELEASE = variables["release"] IMG_VARIANT = variables["variant"] IMG_URL = "/images/%s/%s/%s/%s/%s" % ( IMG_DIST, IMG_RELEASE, IMG_ARCH, IMG_VARIANT, IMG_BUILD, ) FS_PATH = "%s/%s/%s/%s/%s/%s" % ( TARGET_IMAGES, IMG_DIST, IMG_RELEASE, IMG_ARCH, IMG_VARIANT, IMG_BUILD, ) # Get the current builds current_builds = set() if os.path.exists(os.path.dirname(FS_PATH)): current_builds = set(os.listdir(os.path.dirname(FS_PATH))) # Check if we already processed this one if IMG_BUILD in current_builds: continue current_builds.add(IMG_BUILD) # Check if we have newer builds locally if IMG_BUILD not in sorted(current_builds)[-3:]: continue if IMG_DIST not in tested_images or tested_images[IMG_DIST] < int(data["id"]): print( "Skipping: %s/%s/%s/%s at %s" % (IMG_DIST, IMG_RELEASE, IMG_ARCH, IMG_VARIANT, IMG_BUILD) ) continue # Look at the artifacts DL_YAML = artifacts.get("image.yaml", None) DL_ROOTFS_TAR = artifacts.get("rootfs.tar.xz", None) DL_META = artifacts.get("meta.tar.xz", None) DL_ROOTFS_SQUASH = artifacts.get("rootfs.squashfs", None) DL_DISK = artifacts.get("disk.qcow2", None) DL_INCUS = artifacts.get("incus.tar.xz", None) DL_LOG = "%s/consoleText" % data["url"] # Skip partial images if ( not (DL_ROOTFS_TAR and DL_META) and not (DL_ROOTFS_SQUASH and DL_INCUS) and not (DL_DISK and DL_INCUS) ): continue # Download the artifacts try: if DEBUG: print( "Downloading: %s/%s/%s/%s at %s" % (IMG_DIST, IMG_RELEASE, IMG_ARCH, IMG_VARIANT, IMG_BUILD) ) TEMP_DIR = tempfile.mkdtemp() # Download from the builder if DL_ROOTFS_TAR: urlretrieve(DL_ROOTFS_TAR, "%s/rootfs.tar.xz" % TEMP_DIR) if DL_META: urlretrieve(DL_META, "%s/meta.tar.xz" % TEMP_DIR) if DL_ROOTFS_SQUASH: urlretrieve(DL_ROOTFS_SQUASH, "%s/rootfs.squashfs" % TEMP_DIR) if DL_INCUS: urlretrieve(DL_INCUS, "%s/incus.tar.xz" % TEMP_DIR) if DL_DISK: urlretrieve(DL_DISK, "%s/disk.qcow2" % TEMP_DIR) if DL_YAML: urlretrieve(DL_YAML, "%s/image.yaml" % TEMP_DIR) if DL_LOG: urlretrieve(DL_LOG, "%s/build.log" % TEMP_DIR) # File list files = [ "rootfs.tar.xz", "rootfs.tar.xz.asc", "rootfs.squashfs", "rootfs.squashfs.asc", "disk.qcow2", "disk.qcow2.asc", "meta.tar.xz", "meta.tar.xz.asc", "incus.tar.xz", "incus.tar.xz.asc", "image.yaml", "image.yaml.asc", "build.log", "build.log.asc", "SHA256SUMS", "SHA256SUMS.asc", ".combined_fingerprint", ".combined_fingerprint_squashfs", ".combined_fingerprint_qcow2", ] # Generate the missing artifacts incus_fingerprints(TEMP_DIR) # Generate deltas previous_index = sorted(current_builds).index(IMG_BUILD) - 1 if previous_index >= 0: src_id = sorted(current_builds)[previous_index] # squashfs tgt = incus_squashfs_delta( os.path.join(os.path.dirname(FS_PATH), src_id), TEMP_DIR ) if tgt: files.append(tgt) files.append("%s.asc" % tgt) # qcow2 tgt = incus_qcow2_delta( os.path.join(os.path.dirname(FS_PATH), src_id), TEMP_DIR ) if tgt: files.append(tgt) files.append("%s.asc" % tgt) # Hash everything with open("%s/SHA256SUMS" % TEMP_DIR, "w+") as fd: for entry in files: if ( not entry.endswith(".tar.xz") and not entry.endswith(".squashfs") and not entry.endswith(".qcow2") and not entry.endswith(".yaml") and not entry.endswith(".log") and not entry.endswith(".vcdiff") ): continue if os.path.exists("%s/%s" % (TEMP_DIR, entry)): fd.write( "%s %s\n" % (hash256("%s/%s" % (TEMP_DIR, entry)), entry) ) # Sign everything for entry in files: if entry.startswith(".combined_fingerprint"): continue if entry.endswith(".asc"): continue if os.path.exists("%s/%s" % (TEMP_DIR, entry)): sign_file("%s/%s" % (TEMP_DIR, entry)) # Move to final location os.makedirs(FS_PATH) for entry in files: if os.path.lexists("%s/%s" % (TEMP_DIR, entry)): shutil.move("%s/%s" % (TEMP_DIR, entry), "%s/%s" % (FS_PATH, entry)) shutil.rmtree(TEMP_DIR) count += 1 except Exception: shutil.rmtree(TEMP_DIR) if DEBUG: print( "Failed to download: %s/%s/%s/%s" % (IMG_DIST, IMG_RELEASE, IMG_ARCH, IMG_VARIANT) ) raise continue # Cleanup expired images for entry in sorted(glob.glob("%s/*/*/*/*" % TARGET_IMAGES)): images = sorted( [ image for image in os.listdir(entry) if "SHA256SUMS" in os.listdir("%s/%s" % (entry, image)) ] ) for image in images[:-DATA_RETENTION]: shutil.rmtree("%s/%s" % (entry, image)) # Cleanup stale images (equivalent to find -mtime +N) now = time.time() for entry in sorted(glob.glob("%s/*/*/*/*/*" % TARGET_IMAGES)): if not os.path.isdir(entry) or os.path.islink(entry): continue if int((now - os.lstat(entry).st_mtime) / 86400) > IMAGE_EXPIRY_DAYS: shutil.rmtree(entry) # Cleanup empty directories for root, dirs, files in os.walk(TARGET_IMAGES, topdown=False): if root == TARGET_IMAGES: continue if not os.listdir(root): os.rmdir(root) # Generate the index index = {"index-system": [], "index-user": []} html_index = [] for entry in sorted(glob.glob("%s/*/*/*/*" % TARGET_IMAGES)): distro, release, arch, variant = entry.split("/")[-4:] images = sorted( [ image for image in os.listdir(entry) if "SHA256SUMS" in os.listdir("%s/%s" % (entry, image)) ] ) if not images: continue latest_image = images[-1] url = "/images/%s/%s/%s/%s/%s/" % (distro, release, arch, variant, latest_image) latest_image_link = '%s' % (url, latest_image) # VM-only images if "desktop" in variant or distro in REQUIRE_VM: fields = [ distro, release, arch, variant, latest_image_link, "NO", "NO", "NO", "YES", ] html_index.append(fields) continue # Main index line = "%s;%s;%s;%s;%s;%s" % (distro, release, arch, variant, latest_image, url) index["index-system"].append(line) index["index-user"].append(line) incus_vm = "NO" if os.path.exists(os.path.join(entry, latest_image, "disk.qcow2")): incus_vm = "YES" # HTML index html_index.append( [ distro, release, arch, variant, latest_image_link, "YES", "YES", "YES", incus_vm, ] ) # Generate the index INDEX_PATH = "%s/1.0/" % TARGET_META if not os.path.exists(INDEX_PATH): os.makedirs(INDEX_PATH) for filename, content in index.items(): with open("%s/%s" % (INDEX_PATH, filename), "w+") as fd: fd.write("%s\n" % "\n".join(content)) sign_file("%s/%s" % (INDEX_PATH, filename)) # Remove the old LXC compat indexes for path in glob.glob("%s/index-*.[0-9]*" % INDEX_PATH): os.remove(path) # Generate the build overview try: data = get_json( "%s/view/All" % JENKINS_URL, tree="jobs[name,url,disabled,lastSuccessfulBuild[url,timestamp,duration]]", ) except Exception: data = {"jobs": []} html_builds = [] for job in sorted(data["jobs"], key=lambda job: job["name"]): if not job["name"].startswith(PREFIX) or job["disabled"]: continue distro = job["name"].split(PREFIX)[-1] name = '%s' % (job["url"], distro) build = job["lastSuccessfulBuild"] if build: last_build = '%s' % ( build["url"], format_timestamp(build["timestamp"]), ) duration = format_duration(build["duration"]) status, test_url = test_results.get(build["url"], ("UNKNOWN", None)) else: last_build = "-" duration = "-" status, test_url = "UNKNOWN", None badge = { "SUCCESS": "success", "FAILURE": "danger", "RUNNING": "warning", }.get(status, "secondary") test = '%s' % (badge, status) if test_url and status != "SUCCESS": test = '%s' % (test_url, test) # Warn when the published image is getting stale if ( distro not in last_tested or now - last_tested[distro] / 1000 > TEST_WARNING_HOURS * 3600 ): mtimes = [ os.path.getmtime(path) for path in glob.glob("%s/%s/*/*/*/*" % (TARGET_IMAGES, distro)) if os.path.exists(os.path.join(path, "SHA256SUMS")) ] if mtimes: # The cleanup uses find -mtime +N which only matches after N+1 full days expiry = datetime.datetime.fromtimestamp( max(mtimes), datetime.timezone.utc ) + datetime.timedelta(days=IMAGE_EXPIRY_DAYS + 1) warning = ( "No successful test in over %d hours, " "this image will disappear from the image server on %s" % (TEST_WARNING_HOURS, expiry.strftime("%Y-%m-%d")) ) else: warning = "No successful test in over %d hours" % TEST_WARNING_HOURS test += ' ⚠' % warning html_builds.append([name, last_build, duration, test]) # Generate the html index html = "" for entry in html_index: html += "" for field in entry: html += "%s" % field html += "\n" builds = "" for entry in html_builds: builds += "" for field in entry: builds += "%s" % field builds += "\n" with open("%s/index.html" % TARGET, "w+") as fd: with open("%s/.index.tpl" % TARGET, "r") as tpl: fd.write( tpl.read() .replace("@DATA@", html) .replace("@BUILDS@", builds) .replace("@TIMESTAMP@", time.asctime()) ) # Generate the image tree SS_PATH = "%s/simplestreams/v1/" % TARGET_META ss_products = set() ss_entries = {} published = set() for entry in sorted(glob.glob("%s/*/*/*/*" % TARGET_IMAGES)): distro, release, arch, variant = entry.split("/")[-4:] images = sorted( [ image for image in os.listdir(entry) if "SHA256SUMS" in os.listdir("%s/%s" % (entry, image)) ] ) if not images: continue latest_image = images[-1] for image in images: image_dir = "%s/%s/%s/%s/%s/%s" % ( TARGET_IMAGES, distro, release, arch, variant, image, ) fingerprint = None if os.path.exists("%s/.combined_fingerprint" % image_dir): with open("%s/.combined_fingerprint" % image_dir, "r") as fd: fingerprint_tar = fd.read().strip() fingerprint = fingerprint_tar if fingerprint_tar in published: print("found duplicate: %s" % image_dir) continue published.add(fingerprint_tar) if os.path.exists("%s/.combined_fingerprint_squashfs" % image_dir): with open("%s/.combined_fingerprint_squashfs" % image_dir, "r") as fd: fingerprint_squashfs = fd.read().strip() fingerprint = fingerprint_squashfs if fingerprint_squashfs in published: print("found duplicate: %s" % image_dir) continue published.add(fingerprint_squashfs) if os.path.exists("%s/.combined_fingerprint_qcow2" % image_dir): with open("%s/.combined_fingerprint_qcow2" % image_dir, "r") as fd: fingerprint_disk = fd.read().strip() if fingerprint_disk in published: print("found duplicate: %s" % image_dir) continue published.add(fingerprint_disk) ss_product = "%s:%s:%s:%s" % (distro, release, arch, variant) ss_products.add(ss_product) # Simplestream entries if ss_product not in ss_entries: aliases = ["%s/%s/%s" % (distro, release, variant)] variant_aliases = VARIANT_ALIASES.get(distro, {}).get(variant, []) for variant_alias in variant_aliases: aliases.append("%s/%s/%s" % (distro, release, variant_alias)) if "%s/%s" % (distro, release) in ALIASES: for alias in ALIASES["%s/%s" % (distro, release)]: aliases.append("%s/%s" % (alias, variant)) for variant_alias in variant_aliases: aliases.append("%s/%s" % (alias, variant_alias)) if variant == "default" or "default" in variant_aliases: aliases.append("%s/%s" % (distro, release)) if "%s/%s" % (distro, release) in ALIASES: for alias in ALIASES["%s/%s" % (distro, release)]: aliases.append(alias) if release == "current": if variant == "default": aliases.append(distro) else: aliases.append("%s/%s" % (distro, variant)) requirements = {} for alias in aliases: # Check for CGroupV2 for entry in REQUIRE_CGROUP2: if alias.startswith(entry): requirements["cgroup"] = "v2" break # Check for secureboot for entry in REQUIRE_NO_SECUREBOOT: if alias.startswith(entry): requirements["secureboot"] = "false" break # Check for cdrom agent for entry in REQUIRE_CDROM_AGENT: if alias.startswith(entry): requirements["cdrom_agent"] = "true" break # Check for cdrom cloud-init if variant.endswith("cloud"): for entry in REQUIRE_CDROM_CLOUD_INIT: if alias.startswith(entry): requirements["cdrom_cloud_init"] = "true" break ss_entries[ss_product] = { "aliases": ",".join(aliases), "arch": arch, "os": distro.title(), "release": release, "release_title": release, "requirements": requirements, "variant": variant, "versions": {}, } files = {} checksums_path = "%s/SHA256SUMS" % image_dir if os.path.exists(checksums_path): with open(checksums_path, "r") as fd: for line in fd: fields = line.split() if len(fields) < 2: continue stat = os.stat("%s/%s" % (image_dir, fields[1])) files[fields[1]] = (fields[0], int(stat.st_size)) items = {} if os.path.exists("%s/incus.tar.xz" % image_dir): items["incus.tar.xz"] = { "ftype": "incus.tar.xz", "sha256": files["incus.tar.xz"][0], "size": files["incus.tar.xz"][1], "path": "images/%s/%s/%s/%s/%s/incus.tar.xz" % (distro, release, arch, variant, image), } if os.path.exists("%s/rootfs.tar.xz" % image_dir): items["incus.tar.xz"]["combined_sha256"] = fingerprint_tar items["incus.tar.xz"]["combined_rootxz_sha256"] = fingerprint_tar if os.path.exists("%s/rootfs.squashfs" % image_dir): items["incus.tar.xz"][ "combined_squashfs_sha256" ] = fingerprint_squashfs if os.path.exists("%s/disk.qcow2" % image_dir): items["incus.tar.xz"][ "combined_disk-kvm-img_sha256" ] = fingerprint_disk if os.path.exists("%s/rootfs.tar.xz" % image_dir): items["root.tar.xz"] = { "ftype": "root.tar.xz", "sha256": files["rootfs.tar.xz"][0], "size": files["rootfs.tar.xz"][1], "path": "images/%s/%s/%s/%s/%s/rootfs.tar.xz" % (distro, release, arch, variant, image), } if os.path.exists("%s/rootfs.squashfs" % image_dir): items["root.squashfs"] = { "ftype": "squashfs", "sha256": files["rootfs.squashfs"][0], "size": files["rootfs.squashfs"][1], "path": "images/%s/%s/%s/%s/%s/rootfs.squashfs" % (distro, release, arch, variant, image), } if os.path.exists("%s/disk.qcow2" % image_dir): items["disk.qcow2"] = { "ftype": "disk-kvm.img", "sha256": files["disk.qcow2"][0], "size": files["disk.qcow2"][1], "path": "images/%s/%s/%s/%s/%s/disk.qcow2" % (distro, release, arch, variant, image), } for delta in glob.glob("%s/delta-*.vcdiff" % image_dir): filename = os.path.basename(delta) if "qcow2" in delta: continue items["root.%s" % filename.replace("delta-", "")] = { "ftype": "disk-kvm.img.vcdiff", "sha256": files[filename][0], "size": files[filename][1], "path": "images/%s/%s/%s/%s/%s/%s" % (distro, release, arch, variant, image, filename), "delta_base": filename.replace("delta-", "").replace( ".qcow2.vcdiff", "" ), } else: items["root.%s" % filename.replace("delta-", "")] = { "ftype": "squashfs.vcdiff", "sha256": files[filename][0], "size": files[filename][1], "path": "images/%s/%s/%s/%s/%s/%s" % (distro, release, arch, variant, image, filename), "delta_base": filename.replace("delta-", "").replace( ".vcdiff", "" ), } ss_entries[ss_product]["versions"][image] = {"items": items} # Main index with open("%s/index.json" % SS_PATH, "w+") as fd: meta = { "index": { "images": { "datatype": "image-downloads", "path": "streams/v1/images.json", "format": "products:1.0", } }, "format": "index:1.0", } meta["index"]["images"]["products"] = sorted(ss_products) fd.write(json.dumps(meta)) fd.write("\n") sign_file("%s/index.json" % SS_PATH, "%s/index.json.gpg" % SS_PATH) sign_file("%s/index.json" % SS_PATH, "%s/index.sjson" % SS_PATH, True) # Main image list with open("%s/images.json" % SS_PATH, "w+") as fd: meta = { "content_id": "images", "datatype": "image-downloads", "format": "products:1.0", "products": ss_entries, } fd.write(json.dumps(meta)) fd.write("\n") sign_file("%s/images.json" % SS_PATH, "%s/images.json.gpg" % SS_PATH) sign_file("%s/images.json" % SS_PATH, "%s/images.sjson" % SS_PATH, True) # Empty image list (served to LXD) with open("%s/.images.json.lxd_empty" % SS_PATH, "w+") as fd: meta = { "content_id": "images", "datatype": "image-downloads", "format": "products:1.0", "products": {}, } fd.write(json.dumps(meta)) fd.write("\n") sign_file( "%s/.images.json.lxd_empty" % SS_PATH, "%s/.images.json.gpg.lxd_empty" % SS_PATH ) sign_file( "%s/.images.json.lxd_empty" % SS_PATH, "%s/.images.sjson.lxd_empty" % SS_PATH, True ) # Update the serial timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M") with open("%s/.serial" % TARGET, "w+") as wfd: wfd.write("%s\n" % timestamp) # Atomic publication os.mkdir("%s/.snap/%s" % (TARGET, timestamp)) if os.path.exists("%s/.latest" % TARGET): os.remove("%s/.latest" % TARGET) os.symlink("%s/.snap/%s" % (TARGET, timestamp), "%s/.latest" % TARGET) snaps = sorted(os.listdir("%s/.snap/" % TARGET)) for snap in snaps[:-DATA_RETENTION]: os.rmdir("%s/.snap/%s" % (TARGET, snap)) # Unlock if os.path.exists(lock_file): os.remove(lock_file) lxc-ci-0.0~git20260914.1b378a7/bin/kernel-check000077500000000000000000000007251525201541300203100ustar00rootroot00000000000000#!/bin/sh -eu # shellcheck disable=SC1091 [ -e /lxc-ci/etc/config ] && . /lxc-ci/etc/config if [ "${DAILY_REBOOT:-}" != "true" ]; then exit 0 fi dmesg | grep -q "Out of memory" && reboot dmesg | grep -q "BTRFS.*forced readonly" && reboot dmesg | grep -q "kernel BUG at" && reboot dmesg | grep -q "WARNING: CPU:.*queue_work" && reboot dmesg | grep -q "blocked for more than 120 seconds" && reboot dmesg | grep -q "ceph.*tid.*pool does not exist" && reboot exit 0 lxc-ci-0.0~git20260914.1b378a7/bin/kernel-setup000077500000000000000000000160151525201541300203720ustar00rootroot00000000000000#!/bin/sh -eu export DEBIAN_FRONTEND="noninteractive" for i in $(echo "${1}" | tr ',' ' '); do case "$i" in default) echo "===> No kernel changes needed" exit 0 ;; cgroup1) echo "===> CGroup1" # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} systemd.unified_cgroup_hierarchy=0"' > /etc/default/grub.d/99-cgroup.cfg update-grub ;; cgroup2) echo "===> CGroup2" # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} systemd.unified_cgroup_hierarchy=1"' > /etc/default/grub.d/99-cgroup.cfg update-grub ;; swapaccount) echo "===> CGroup swap accounting" # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} swapaccount=1"' > /etc/default/grub.d/99-cgroup-swap.cfg update-grub ;; iommu) echo "===> Enabling iommu" # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} iommu=pt intel_iommu=on amd_iommu=on"' > /etc/default/grub.d/99-iommu.cfg update-grub ;; isolcpus) echo "===> Isolate CPUs from the kernel scheduler" # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} isolcpus=6,7,8,9,10,11,18,19,20,21,22,23"' > /etc/default/grub.d/99-isolcpus.cfg update-grub ;; nvidia) echo "===> Installing the NVIDIA driver" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes linux-generic apt-get remove --purge --yes linux.*hwe.* --yes apt-get install --no-install-recommends --yes nvidia-utils-460 nvidia-headless-460 libnvidia-compute-460 echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf echo "options nouveau modeset=0" >> /etc/modprobe.d/blacklist-nouveau.conf update-initramfs -u ;; nvidia-mig) echo "===> Installing the NVIDIA MIG driver" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes linux-generic apt-get remove --purge --yes linux.*hwe.* --yes apt-get install --no-install-recommends --yes nvidia-utils-460 nvidia-headless-460 libnvidia-compute-460 echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf echo "options nouveau modeset=0" >> /etc/modprobe.d/blacklist-nouveau.conf update-initramfs -u ;; amd-vgpu) echo "===> Installing the AMD vGPU driver" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes build-essential git clone https://github.com/kasperlewau/MxGPU-Virtualization (cd MxGPU-Virtualization && ./gim.sh) depmod -a echo "blacklist amdgpu" > /etc/modprobe.d/blacklist-amdgpu.conf update-initramfs -u ;; nvidia-vgpu) echo "===> Installing the NVIDIA vGPU driver" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes build-essential curl curl http://lab.linuxcontainers.org/nvidia/v570/nvidia-host.deb -o /root/nvidia-host.deb apt-get install --yes /root/nvidia-host.deb echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf echo "options nouveau modeset=0" >> /etc/modprobe.d/blacklist-nouveau.conf update-initramfs -u ;; intel-vgpu) echo "===> Installing the Intel vGPU driver" apt-get update apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes dkms git clone https://github.com/strongtz/i915-sriov-dkms cd i915-sriov-dkms dkms add . dkms install -m i915-sriov-dkms -k $(ls /lib/modules/ | sort -V | tail -1) -v $(ls /var/lib/dkms/i915-sriov-dkms) --force echo 'GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on i915.enable_guc=3 i915.max_vfs=7"' > /etc/default/grub.d/99-test.cfg update-initramfs -u update-grub ;; ubuntu) echo "===> Ensuring default kernel is up to date" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get dist-upgrade --yes ;; ubuntu-proposed) echo "===> Installing the current proposed kernel" # shellcheck disable=SC1091 . /etc/os-release echo "deb http://us.archive.ubuntu.com/ubuntu ${UBUNTU_CODENAME}-proposed main restricted universe multiverse" > /etc/apt/sources.list.d/proposed.list apt-get update apt-get install --no-install-recommends --yes linux-generic rm /etc/apt/sources.list.d/proposed.list apt-get update ;; ubuntu-bootstrap) echo "===> Installing the current bootstrap kernel" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get install --no-install-recommends --yes software-properties-common apt-add-repository ppa:canonical-kernel-team/bootstrap --yes apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes linux-generic-wip ;; ubuntu-unstable) echo "===> Installing the current unstable kernel" echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get install --no-install-recommends --yes software-properties-common apt-add-repository ppa:canonical-kernel-team/unstable --yes apt-get dist-upgrade --yes apt-get install --no-install-recommends --yes linux-generic-wip ;; daily) echo "===> Installing a mainline daily build" wget -e robots=off -r --no-parent -A '*all*.deb' -R '*lpae*' -R '*lowlatency*' https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/ wget -e robots=off -r --no-parent -A '*amd64*.deb' -R '*lpae*' -R '*lowlatency*' https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/ echo "MODULES=dep" > /etc/initramfs-tools/conf.d/modules.conf apt-get update apt-get install ./kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/amd64/*.deb --yes apt-get dist-upgrade --yes ;; zabbly) echo "===> Installing the current zabbly kernel" apt-get update apt-get install --no-install-recommends --yes curl curl -sL https://pkgs.zabbly.com/get/kernel-stable | sh ;; zabbly-zfs) echo "===> Installing the current zabbly kernel" apt-get update apt-get install --no-install-recommends --yes curl curl -sL https://pkgs.zabbly.com/get/zfs-stable | sh ;; *) echo "Unsupported kernel requested: ${1}" exit 1 ;; esac done reboot lxc-ci-0.0~git20260914.1b378a7/bin/maas-run000077500000000000000000000110171525201541300174740ustar00rootroot00000000000000#!/bin/sh -eu # shellcheck disable=SC1091 [ -e /lxc-ci/etc/config ] && . /lxc-ci/etc/config if [ "${1:-}" = "" ] || [ "${2:-}" = "" ] || [ "${3:-}" = "" ] || [ "${4:-}" = "" ] || [ "${5:-}" = "" ]; then echo "Usage: $0