diff --git a/make-root/func.sh b/make-root/func.sh index 469cff2..6141f48 100644 --- a/make-root/func.sh +++ b/make-root/func.sh @@ -70,6 +70,9 @@ setup() { BOOT_LABEL="nnd-boot" CRYPT_LABEL="nnd-root-encrypted" + # Always clean up + trap cleanup_err INT TERM EXIT HUP + # Set up file as loopback fallocate -v -l "$size" "$image" if ! [ -r "$image" ]; then @@ -249,6 +252,3 @@ custom() { echo "Upon exit, the image will be packed." wrapped sh || true # Handle graceful exit } - -# Always clean up -trap cleanup_err INT TERM EXIT HUP diff --git a/make-root/hypervisor.sh b/make-root/hypervisor.sh new file mode 100755 index 0000000..4b6dd56 --- /dev/null +++ b/make-root/hypervisor.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Exit on any errors +set -e + +DIR="$(dirname "$0")" + +. "$DIR"/func.sh + +depcheck + +kextparam="console=ttyS0 console=tty0" kflav="lts" size=4G setup + +addpkg \ + openssh-server \ + libvirt \ + libvirt-qemu \ + libvirt-client \ + qemu \ + qemu-audio-spice \ + qemu-chardev-spice \ + qemu-hw-display-qxl \ + qemu-hw-display-virtio-vga \ + qemu-hw-usb-host \ + qemu-hw-usb-redirect \ + qemu-img \ + qemu-system-x86_64 \ + qemu-ui-spice-core \ + swtpm + +addtty ttyS0 +addsvc bundle.core bundle.net bundle.libvirt bundle.tty sshd.1 +addsshkey "$DIR"/id_ed25519.pub + +pack