CI: Create initrd fragments explicitly as root

We have a mix of root and non-root containers, and are trying to become
rootless.  This can cause the local CPIO fragements to end up being user:user
in the test environment.

Nothing seems to go wrong so far, but it's a trap waiting to happen.

Make everything consistently root for the initrds, irrespective of the
rootness of the container the test is running in.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Andrew Cooper committed 2025-09-10 10:19:25 +01:00
1 parent 53c599cc33
commit e3042c9fc2
9 files changed
+18 -18

No files matched your search

+1 -1
View File
@@ -108,6 +108,6 @@ else
# Note: Some smoke tests depending on finding binaries/xen on a full build
# even though dist/ contains everything, while some containers don't even
# build Xen
(cd dist/install; find | cpio -o -H newc | gzip) > binaries/xen-tools.cpio.gz
(cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
collect_xen_artefacts
fi
+2 -2
View File
@@ -25,7 +25,7 @@ mount -t devtmpfs devtmpfs /dev
chmod +x initrd/init
# DomU rootfs
cd initrd
find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip > ../domU-rootfs.cpio.gz
cd ..
# Dom0 rootfs
@@ -57,7 +57,7 @@ xl -vvv create -c /root/domU.cfg
" > etc/local.d/xen.start
chmod +x etc/local.d/xen.start
find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
cd ../..
cat >> binaries/pxelinux.0 << EOF
+2 -2
View File
@@ -30,13 +30,13 @@ curl --fail --silent --show-error --location --output initrd.tar.gz https://dl-c
mkdir rootfs
cd rootfs
tar xvzf ../initrd.tar.gz
find . | cpio -H newc -o | gzip > ../root/initrd.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip > ../root/initrd.cpio.gz
cd ..
rm -rf rootfs
rm initrd.tar.gz
cp ../zImage ./root
find . | cpio -H newc -o | gzip > ../initrd.gz
find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
cd ..
# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
+2 -2
View File
@@ -24,7 +24,7 @@ mount -t devtmpfs devtmpfs /dev
/bin/sh" > initrd/init
chmod +x initrd/init
cd initrd
find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip > ../domU-rootfs.cpio.gz
cd ..
# Dom0 rootfs
@@ -54,7 +54,7 @@ xl -vvv create -c /root/domU.cfg
" > etc/local.d/xen.start
chmod +x etc/local.d/xen.start
find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
cd ../..
# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
@@ -75,7 +75,7 @@ mount -t devtmpfs devtmpfs /dev
${domU_check}
/bin/sh" > init
chmod +x init
find . | cpio -H newc -o | gzip > ../initrd.gz
find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
cd ..
# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
@@ -111,7 +111,7 @@ ${domU_check}
/bin/sh" > initrd/init
chmod +x initrd/init
cd initrd
find . | cpio --create --format='newc' | gzip > ../binaries/initrd
find . | cpio -R 0:0 -o -H newc | gzip > ../binaries/initrd
cd ..
# Dom0 rootfs
@@ -139,7 +139,7 @@ xl network-attach 1 type=vif
${dom0_check}
" > etc/local.d/xen.start
chmod +x etc/local.d/xen.start
find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
cd ..
# ImageBuilder
+3 -3
View File
@@ -184,7 +184,7 @@ ${domU_check}
Kernel \r on an \m (\l)
" > etc/issue
find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
cd ..
rm -rf rootfs
@@ -193,7 +193,7 @@ Kernel \r on an \m (\l)
cd rootfs
cp ../binaries/bzImage boot/vmlinuz-domU
cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
find . | cpio -H newc -o > ../binaries/domU-in-dom0.cpio
find . | cpio -R 0:0 -H newc -o > ../binaries/domU-in-dom0.cpio
cd ..
rm -rf rootfs
@@ -252,7 +252,7 @@ mkdir -p etc/default
echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
mkdir -p var/log/xen/console
find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
cd ..
@@ -102,7 +102,7 @@ echo "domU Welcome to Alpine Linux
Kernel \r on an \m (\l)
" > etc/issue
find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
cd ..
rm -rf rootfs
@@ -111,7 +111,7 @@ mkdir -p rootfs/boot
cd rootfs
cp ../binaries/bzImage boot/vmlinuz-domU
cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
find . | cpio -H newc -o > ../binaries/domU-in-dom0.cpio
find . | cpio -R 0:0 -H newc -o > ../binaries/domU-in-dom0.cpio
cd ..
rm -rf rootfs
@@ -141,7 +141,7 @@ echo "${DOMU_CFG}${DOMU_CFG_EXTRA}" > etc/xen/domU.cfg
echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
mkdir -p var/log/xen/console
find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
cd ..
# Load software into TFTP server directory.
@@ -50,7 +50,7 @@ echo "#!/bin/sh
${domU_check}
/bin/sh" > etc/local.d/xen.start
chmod +x etc/local.d/xen.start
find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
cd ..
rm -rf rootfs
@@ -71,7 +71,7 @@ bash /etc/init.d/xencommons start
${dom0_check}
" > etc/local.d/xen.start
chmod +x etc/local.d/xen.start
find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
find . | cpio -R 0:0 -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
cd ..
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.