|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v4 03/13] Add debian rootfs artifact
Will be used as dom0/domU in some tests.
Install systemd, but set it up to start scripts in /etc/local.d/ too, so
tests don't need different paths for Alpine and Debian.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
Changes in v4:
- disable persistent journal via config
Changes in v3:
- fix typo and missing dropbear args
Changes in v2:
- Use systemd
- update to trixie
- disable systemd-journal-catalog-update.service,
systemd-modules-load.service and persistent journal to save boot time
---
---
.gitlab-ci.yml | 7 ++-
images/debian/13-x86_64-base.dockerfile | 4 +-
scripts/debian-rootfs.sh | 100 +++++++++++++++++++++++++-
3 files changed, 111 insertions(+)
create mode 100644 images/debian/13-x86_64-base.dockerfile
create mode 100755 scripts/debian-rootfs.sh
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5281c1f..4147be5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -71,6 +71,13 @@ alpine-3.23-x86_64-rootfs:
variables:
CONTAINER: alpine:3.23-x86_64-base
+debian-13-x86_64-rootfs:
+ extends: .x86_64-artifacts
+ script:
+ - ./scripts/debian-rootfs.sh
+ variables:
+ CONTAINER: debian:13-x86_64-base
+
linux-6.6.56-x86_64:
extends: .x86_64-artifacts
script: ./scripts/build-linux.sh
diff --git a/images/debian/13-x86_64-base.dockerfile
b/images/debian/13-x86_64-base.dockerfile
new file mode 100644
index 0000000..f98355f
--- /dev/null
+++ b/images/debian/13-x86_64-base.dockerfile
@@ -0,0 +1,4 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 debian:trixie-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@xxxxxxxxxxxxxxxxxxxx"
diff --git a/scripts/debian-rootfs.sh b/scripts/debian-rootfs.sh
new file mode 100755
index 0000000..1da54a5
--- /dev/null
+++ b/scripts/debian-rootfs.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+set -eu
+
+WORKDIR="${PWD}"
+COPYDIR="${WORKDIR}/binaries"
+UNAME=$(uname -m)
+
+apt-get update
+
+PKGS=(
+ # System
+ bridge-utils
+ dropbear
+ udev
+ systemd-sysv
+ iproute2
+ inetutils-ping
+ util-linux
+ cpio
+
+ # Xen toolstack runtime deps
+ libbz2-1.0
+ libuuid1
+ liblzo2-2
+ liblzma5
+ libyajl2
+
+ # Xen Test Framework
+ python3
+
+ # QEMU
+ libglib2.0-0
+ libaio1t64
+ libpixman-1-0
+ )
+
+case $UNAME in
+ x86_64)
+ PKGS+=(
+ # System
+ pciutils
+
+ # QEMU
+ libelf1
+ )
+ ;;
+
+ aarch64)
+ PKGS+=(
+ # Xen
+ libfdt
+ )
+ ;;
+esac
+
+apt-get -y install "${PKGS[@]}"
+
+# Xen
+cd /
+# Minimal ramdisk environment in case of cpio output
+echo "ttyS0" >> /etc/securetty
+echo "hvc0" >> /etc/securetty
+echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab
+echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab
+echo "rc_verbose=yes" >> /etc/rc.conf
+echo "DROPBEAR_EXTRA_ARGS=\"-R\"" >> /etc/default/dropbear
+echo > /etc/modules
+# disable unneded services
+rm -f etc/systemd/system/timers.target.wants/apt-daily*.timer
+rm -f etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
+rm -f
usr/lib/systemd/system/sysinit.target.wants/systemd-journal-catalog-update.service
+rm -f usr/lib/systemd/system/sysinit.target.wants/systemd-modules-load.service
+# don't need persistent logging, avoid journal flush service
+mkdir -p etc/systemd/journald.conf.d
+cat >> etc/systemd/journald.conf.d/storage.conf <<EOF
+[Journal]
+Storage=volatile
+EOF
+# Tests install a startup script as /etc/local.d/xen.start
+cat > /etc/rc.local << EOF
+#!/bin/sh
+
+for f in /etc/local.d/*.start; do
+ \$f
+done
+EOF
+chmod +x /etc/rc.local
+passwd -d root
+
+# Create rootfs
+cd /
+{
+ PATHS="bin etc home init lib lib64 mnt opt root sbin srv tmp usr var"
+ find $PATHS -print0
+ echo -ne "dev\0proc\0run\0sys\0"
+} | cpio -0 -H newc -o | gzip > "${COPYDIR}/rootfs.cpio.gz"
+
+# Print the contents for the build log
+zcat "${COPYDIR}/rootfs.cpio.gz" | cpio -tv
--
git-series 0.9.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |