Initial Commit
- initial default booting image
This commit is contained in:
61
support/testing/tests/package/test_xen/common/overlay/etc/init.d/S99custom
Executable file
61
support/testing/tests/package/test_xen/common/overlay/etc/init.d/S99custom
Executable 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
|
||||
@@ -0,0 +1,3 @@
|
||||
# Avoid double-cooking the terminal, otherwise the test infrastructure
|
||||
# would not be able to retrieve return codes properly.
|
||||
stty raw
|
||||
7
support/testing/tests/package/test_xen/common/post-build.sh
Executable file
7
support/testing/tests/package/test_xen/common/post-build.sh
Executable 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
|
||||
Reference in New Issue
Block a user