[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v5 06/13] CI: extract building domU/dom0 out of qemu-alpine-x86_64.sh


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 5 Aug 2026 16:55:34 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm3 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 05 Aug 2026 14:57:08 +0000
  • Feedback-id: i1568416f:Fastmail
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add qemu-alpine-lib.sh with utility functions that build dom0/domU out
of container binaries.
This will be used in further tests that re-use similar structure.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
New in v5
---
 automation/scripts/qemu-alpine-lib.sh    | 62 +++++++++++++++++++++++++-
 automation/scripts/qemu-alpine-x86_64.sh | 59 +-----------------------
 2 files changed, 66 insertions(+), 55 deletions(-)
 create mode 100755 automation/scripts/qemu-alpine-lib.sh

diff --git a/automation/scripts/qemu-alpine-lib.sh 
b/automation/scripts/qemu-alpine-lib.sh
new file mode 100755
index 000000000000..29fdff4f562a
--- /dev/null
+++ b/automation/scripts/qemu-alpine-lib.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+build_domU() {
+    # DomU Busybox
+    mkdir -p initrd
+    mkdir -p initrd/bin
+    mkdir -p initrd/sbin
+    mkdir -p initrd/etc
+    mkdir -p initrd/dev
+    mkdir -p initrd/proc
+    mkdir -p initrd/sys
+    mkdir -p initrd/lib
+    mkdir -p initrd/var
+    mkdir -p initrd/mnt
+    cp /bin/busybox initrd/bin/busybox
+    initrd/bin/busybox --install initrd/bin
+    echo "#!/bin/sh
+
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t devtmpfs devtmpfs /dev
+/bin/sh" > initrd/init
+    chmod +x initrd/init
+    # DomU rootfs
+    cd initrd
+    find . | cpio -R 0:0 -H newc -o | gzip > ../domU-rootfs.cpio.gz
+    cd ..
+}
+
+build_dom0() {
+    # Dom0 rootfs
+    cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+    cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
+
+    # test-local configuration
+    mkdir -p rootfs
+    cd rootfs
+    mkdir -p root etc/local.d
+    mv ../domU-rootfs.cpio.gz ./root
+    cp ../bzImage ./root
+    echo "name=\"domU\"
+    memory=512
+    vcpus=1
+    kernel=\"/root/bzImage\"
+    ramdisk=\"/root/domU-rootfs.cpio.gz\"
+    extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
+    " > root/domU.cfg
+    echo "#!/bin/bash
+
+    set -x
+
+    bash /etc/init.d/xencommons start
+
+    xl list
+
+    xl -vvv create -c /root/domU.cfg
+
+    " > etc/local.d/xen.start
+    chmod +x etc/local.d/xen.start
+    find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
+    cd ..
+}
diff --git a/automation/scripts/qemu-alpine-x86_64.sh 
b/automation/scripts/qemu-alpine-x86_64.sh
index 0c60b2503858..e1b5060f4490 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -2,64 +2,13 @@
 
 set -ex -o pipefail
 
-# DomU Busybox
-cd binaries
-mkdir -p initrd
-mkdir -p initrd/bin
-mkdir -p initrd/sbin
-mkdir -p initrd/etc
-mkdir -p initrd/dev
-mkdir -p initrd/proc
-mkdir -p initrd/sys
-mkdir -p initrd/lib
-mkdir -p initrd/var
-mkdir -p initrd/mnt
-cp /bin/busybox initrd/bin/busybox
-initrd/bin/busybox --install initrd/bin
-echo "#!/bin/sh
+. "$(dirname "$0")"/qemu-alpine-lib.sh
 
-mount -t proc proc /proc
-mount -t sysfs sysfs /sys
-mount -t devtmpfs devtmpfs /dev
-/bin/sh" > initrd/init
-chmod +x initrd/init
-# DomU rootfs
-cd initrd
-find . | cpio -R 0:0 -H newc -o | gzip > ../domU-rootfs.cpio.gz
+cd binaries
+build_domU
+build_dom0
 cd ..
 
-# Dom0 rootfs
-cp rootfs.cpio.gz dom0-rootfs.cpio.gz
-cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
-
-# test-local configuration
-mkdir -p rootfs
-cd rootfs
-mkdir -p root etc/local.d
-mv ../domU-rootfs.cpio.gz ./root
-cp ../bzImage ./root
-echo "name=\"domU\"
-memory=512
-vcpus=1
-kernel=\"/root/bzImage\"
-ramdisk=\"/root/domU-rootfs.cpio.gz\"
-extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
-" > root/domU.cfg
-echo "#!/bin/bash
-
-set -x
-
-bash /etc/init.d/xencommons start
-
-xl list
-
-xl -vvv create -c /root/domU.cfg
-
-" > etc/local.d/xen.start
-chmod +x etc/local.d/xen.start
-find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
-cd ../..
-
 cat >> binaries/pxelinux.0 << EOF
 #!ipxe
 
-- 
git-series 0.9.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.