Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
#!/bin/sh
#
# Custom script for test_xen.py
# This will run both in dom0 and in dom1.
# When we detect that we are in dom0 we mount the boot partition under /mnt,
# to see the kernel image and the initramfs.
#
DAEMON="custom"
start() {
printf 'Starting %s: ' "$DAEMON"
case $(cat /sys/hypervisor/uuid) in
00000000-0000-0000-0000-000000000000)
printf "dom0 "
mount /dev/vda1 /mnt -o ro
;;
*) printf "domU " ;;
esac
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
case $(cat /sys/hypervisor/uuid) in
00000000-0000-0000-0000-000000000000)
printf "dom0 "
umount /mnt
;;
*) printf "domU " ;;
esac
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@@ -0,0 +1,3 @@
# Avoid double-cooking the terminal, otherwise the test infrastructure
# would not be able to retrieve return codes properly.
stty raw

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -eu
# Remove unnecessary Xen binaries to spare ramdisk size.
for ext in bin fd rom; do
rm -vf "${TARGET_DIR}/usr/share/qemu-xen/qemu/"*."$ext"
done