feat: Emulate TPM module

This commit is contained in:
Kroese 2024-01-14 20:31:13 +01:00 committed by GitHub
parent 34ee85c37c
commit f50c785b3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,9 @@ set -Eeuo pipefail
: "${VERSION:="win11x64"}" : "${VERSION:="win11x64"}"
ARGUMENTS="-chardev socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock $ARGUMENTS"
ARGUMENTS="-tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 $ARGUMENTS"
BASE="$VERSION.iso" BASE="$VERSION.iso"
[ -f "$STORAGE/$BASE" ] && return 0 [ -f "$STORAGE/$BASE" ] && return 0
@ -27,9 +30,9 @@ cd "$STORAGE/tmp"
bash "$SCRIPT" "$VERSION" bash "$SCRIPT" "$VERSION"
rm -f "$SCRIPT" rm -f "$SCRIPT"
[ ! -f "$STORAGE/tmp/$BASE" ] && error "Failed to download $VERSION.iso!" && exit 66 [ ! -f "$STORAGE/tmp/$BASE" ] && error "Failed to download $VERSION.iso from the Microsoft servers!" && exit 66
info "Modifying ISO to remove keypress requirement..." info "Modifying ISO to remove keypress requirement during boot..."
7z x "$BASE" -ounpack 7z x "$BASE" -ounpack
genisoimage -b boot/etfsboot.com -no-emul-boot -c BOOT.CAT -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "Custom" -udf -boot-info-table -eltorito-alt-boot -eltorito-boot efi/microsoft/boot/efisys_noprompt.bin -no-emul-boot -o "$STORAGE/tmp/$BASE.tmp" -allow-limited-size unpack genisoimage -b boot/etfsboot.com -no-emul-boot -c BOOT.CAT -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -v -V "Custom" -udf -boot-info-table -eltorito-alt-boot -eltorito-boot efi/microsoft/boot/efisys_noprompt.bin -no-emul-boot -o "$STORAGE/tmp/$BASE.tmp" -allow-limited-size unpack