feat: Unattended installation

This commit is contained in:
Kroese 2024-01-15 16:08:22 +01:00 committed by GitHub
parent aa40aec586
commit 02d6ca55da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: "${ATTENDED:="N"}"
: "${VERSION:="win11x64"}"
ARGUMENTS="-chardev socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock $ARGUMENTS"
@ -36,6 +37,11 @@ info "Customizing ISO to remove keypress requirement during boot..."
DIR="$TMP/unpack"
7z x "$TMP/$BASE" -o"$DIR"
if [ -f "/run/assets/$VERSION.xml" ]; then
cp "/run/assets/$VERSION.xml" "$DIR/Unattend.xml"
fi
genisoimage -b boot/etfsboot.com -no-emul-boot -c BOOT.CAT -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "$VERSION" -udf -boot-info-table -eltorito-alt-boot -eltorito-boot efi/microsoft/boot/efisys_noprompt.bin -no-emul-boot -o "$TMP/$BASE.tmp" -allow-limited-size "$DIR"
mv "$TMP/$BASE.tmp" "$STORAGE/$BASE"