forked from M-Labs/wfvm
Compare commits
3 Commits
1357f493bd
...
f1b52c0da7
Author | SHA1 | Date |
---|---|---|
Markus Partheymüller | f1b52c0da7 | |
Markus Partheymüller | 0becb115f6 | |
Markus Partheymüller | 84ef1ec7e5 |
|
@ -13,8 +13,8 @@
|
||||||
, timeZone ? "UTC"
|
, timeZone ? "UTC"
|
||||||
, services ? {}
|
, services ? {}
|
||||||
, impureShellCommands ? []
|
, impureShellCommands ? []
|
||||||
|
, driveLetter ? "D:"
|
||||||
, efi ? true
|
, efi ? true
|
||||||
, driveLetter ? if efi then "E:" else "D:"
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ let
|
||||||
"usb-storage,drive=virtio-win"
|
"usb-storage,drive=virtio-win"
|
||||||
# USB boot
|
# USB boot
|
||||||
"-drive"
|
"-drive"
|
||||||
"id=win-install,file=usbimage.img,if=none,format=raw,readonly=on,media=${if efi then "disk" else "cdrom"}"
|
"id=win-install,file=${if efi then "usb" else "cd"}image.img,if=none,format=raw,readonly=on,media=${if efi then "disk" else "cdrom"}"
|
||||||
"-device"
|
"-device"
|
||||||
"usb-storage,drive=win-install"
|
"usb-storage,drive=win-install"
|
||||||
# Output image
|
# Output image
|
||||||
|
@ -99,7 +99,7 @@ let
|
||||||
''
|
''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
export PATH=${lib.makeBinPath [ p7zip utils.qemu libguestfs pkgs.wimlib pkgs.cdrkit ]}:$PATH
|
export PATH=${lib.makeBinPath [ p7zip utils.qemu libguestfs pkgs.wimlib ]}:$PATH
|
||||||
|
|
||||||
# Create a bootable "USB" image
|
# Create a bootable "USB" image
|
||||||
# Booting in USB mode circumvents the "press any key to boot from cdrom" prompt
|
# Booting in USB mode circumvents the "press any key to boot from cdrom" prompt
|
||||||
|
@ -120,7 +120,7 @@ let
|
||||||
rm win/sources/install.wim
|
rm win/sources/install.wim
|
||||||
|
|
||||||
# Split image so it fits in FAT32 partition
|
# Split image so it fits in FAT32 partition
|
||||||
wimsplit win/sources/install_selected.wim win/sources/install.swm 3072
|
wimsplit win/sources/install_selected.wim win/sources/install.swm 4096
|
||||||
rm win/sources/install_selected.wim
|
rm win/sources/install_selected.wim
|
||||||
|
|
||||||
cp ${autounattend.autounattendXML} win/autounattend.xml
|
cp ${autounattend.autounattendXML} win/autounattend.xml
|
||||||
|
@ -128,7 +128,7 @@ let
|
||||||
${if efi then ''
|
${if efi then ''
|
||||||
virt-make-fs --partition --type=fat win/ usbimage.img
|
virt-make-fs --partition --type=fat win/ usbimage.img
|
||||||
'' else ''
|
'' else ''
|
||||||
mkisofs -iso-level 4 -l -R -udf -D -b boot/etfsboot.com -no-emul-boot -boot-load-size 8 -hide boot.catalog -eltorito-alt-boot -o usbimage.img win/
|
${pkgs.cdrkit}/bin/mkisofs -iso-level 4 -l -R -udf -D -b boot/etfsboot.com -no-emul-boot -boot-load-size 8 -hide boot.catalog -eltorito-alt-boot -o cdimage.img win/
|
||||||
''}
|
''}
|
||||||
rm -rf win
|
rm -rf win
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue