From 02d6ca55da478c532c963c9467056b00d9304ece Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 15 Jan 2024 16:08:22 +0100 Subject: [PATCH] feat: Unattended installation --- src/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/install.sh b/src/install.sh index 20f6960..c33a5c6 100644 --- a/src/install.sh +++ b/src/install.sh @@ -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"