epitls_vm/build.sh

34 lines
652 B
Bash
Executable file

#!/bin/sh
set -e
cd "$(dirname "$(realpath "$0")")"
alias log='echo [build.sh]'
log "creating iso"
sudo rm -fr tmp
mkdir -p tmp output
sudo mkarchiso -v -w $PWD/tmp/wdir -r -o $PWD/output $PWD/profile
mv output/archlinux-*.iso output/install.iso
VM_NAME="epitls_build"
if VBoxManage showvminfo $VM_NAME 2> /dev/null
then log "disposing old VM"
VBoxManage unregistervm $VM_NAME --delete-all
fi
log "creating VM"
VBoxManage createvm --name=$VM_NAME --register
log "running VM with iso"
virtualboxvm --startvm $VM_NAME --dvd output/install.iso
log "disposing VM"
VBoxManage unregistervm $VM_NAME --delete-all