switch from HWID to TSforge activation
- Switch MAS from /HWID to /Z-Windows (TSforge ZeroCID) which is hardware-independent and survives VM migration - Re-install product key and restart SPP service before TSforge to restore licensing state after sysprep - Add nicModel option to customizeImage and generalize for images without VirtIO drivers - Update MAS activation script to latest version Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4c1b710308
commit
55697e5d89
2 changed files with 20 additions and 4 deletions
|
|
@ -25,6 +25,10 @@
|
|||
smp ? 4,
|
||||
memSize ? 4096,
|
||||
nicModel ? null,
|
||||
# Flatten COW chain into a standalone qcow2 (removes backing file dependency)
|
||||
compact ? false,
|
||||
# QEMU timeout in seconds (default 30 min, increase for Windows Update)
|
||||
qemuTimeout ? 1800,
|
||||
}:
|
||||
let
|
||||
originalImageName = lib.strings.removeSuffix "-vmix" (lib.strings.removeSuffix ".qcow2" originalImage.name);
|
||||
|
|
@ -107,11 +111,11 @@
|
|||
${cdromArgs} \
|
||||
-nic user,model=${if nicModel != null then nicModel else if isAHCI then "e1000" else "virtio-net-pci"}"
|
||||
|
||||
timeout 1800 qemu-system-x86_64 $VMIX_DISPLAY $QEMU_ARGS || \
|
||||
timeout ${toString qemuTimeout} qemu-system-x86_64 $VMIX_DISPLAY $QEMU_ARGS || \
|
||||
if [[ "$VMIX_DISPLAY" == "-display sdl" ]]; then
|
||||
echo "=== vmix: SDL failed, retrying headless ==="
|
||||
cp ${pkgs.OVMF.fd}/FV/OVMF_VARS.fd vars.fd && chmod +w vars.fd
|
||||
timeout 1800 qemu-system-x86_64 -nographic $QEMU_ARGS
|
||||
timeout ${toString qemuTimeout} qemu-system-x86_64 -nographic $QEMU_ARGS
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -125,6 +129,11 @@
|
|||
[ -n "${diskSize}" ] && qemu-img resize ${resultImg} ${diskSize}
|
||||
${virtWinRegMerge}
|
||||
${auditBootCommands}
|
||||
${lib.optionalString compact ''
|
||||
echo "=== vmix: compacting image ==="
|
||||
qemu-img convert -O qcow2 ${resultImg} compact.qcow2
|
||||
mv compact.qcow2 ${resultImg}
|
||||
''}
|
||||
mv ${resultImg} $out
|
||||
'';
|
||||
builtImage = pkgs.runCommand customImageName ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue