Add hypervisor and move cleanup trap to setup body
This commit is contained in:
parent
cd8d9c8dd4
commit
684c285f7e
|
@ -70,6 +70,9 @@ setup() {
|
||||||
BOOT_LABEL="nnd-boot"
|
BOOT_LABEL="nnd-boot"
|
||||||
CRYPT_LABEL="nnd-root-encrypted"
|
CRYPT_LABEL="nnd-root-encrypted"
|
||||||
|
|
||||||
|
# Always clean up
|
||||||
|
trap cleanup_err INT TERM EXIT HUP
|
||||||
|
|
||||||
# Set up file as loopback
|
# Set up file as loopback
|
||||||
fallocate -v -l "$size" "$image"
|
fallocate -v -l "$size" "$image"
|
||||||
if ! [ -r "$image" ]; then
|
if ! [ -r "$image" ]; then
|
||||||
|
@ -249,6 +252,3 @@ custom() {
|
||||||
echo "Upon exit, the image will be packed."
|
echo "Upon exit, the image will be packed."
|
||||||
wrapped sh || true # Handle graceful exit
|
wrapped sh || true # Handle graceful exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Always clean up
|
|
||||||
trap cleanup_err INT TERM EXIT HUP
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue