forked from M-Labs/wfvm
remove wimsplit, do imageSelection by name
This commit is contained in:
parent
54d9f41a6d
commit
07813c3c4f
|
@ -15,6 +15,7 @@
|
||||||
, impureShellCommands ? []
|
, impureShellCommands ? []
|
||||||
, driveLetter ? "D:"
|
, driveLetter ? "D:"
|
||||||
, efi ? true
|
, efi ? true
|
||||||
|
, imageSelection ? "Windows 10 Pro"
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -203,8 +204,8 @@ let
|
||||||
</InstallTo>
|
</InstallTo>
|
||||||
<InstallFrom>
|
<InstallFrom>
|
||||||
<MetaData wcm:action="add">
|
<MetaData wcm:action="add">
|
||||||
<Key>/IMAGE/INDEX</Key>
|
<Key>/IMAGE/NAME</Key>
|
||||||
<Value>1</Value>
|
<Value>${imageSelection}</Value>
|
||||||
</MetaData>
|
</MetaData>
|
||||||
</InstallFrom>
|
</InstallFrom>
|
||||||
</OSImage>
|
</OSImage>
|
||||||
|
@ -302,7 +303,7 @@ let
|
||||||
</component>
|
</component>
|
||||||
</settings>
|
</settings>
|
||||||
|
|
||||||
<cpi:offlineImage cpi:source="wim:c:/wim/windows-10/install.wim#Windows 10 Enterprise LTSC 2019 Evaluation" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
<cpi:offlineImage cpi:source="wim:c:/wim/windows-10/install.wim#${imageSelection}" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||||
</unattend>
|
</unattend>
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
16
wfvm/win.nix
16
wfvm/win.nix
|
@ -6,7 +6,7 @@
|
||||||
, installCommands ? []
|
, installCommands ? []
|
||||||
, users ? {}
|
, users ? {}
|
||||||
# autounattend always installs index 1, so this default is backward-compatible
|
# autounattend always installs index 1, so this default is backward-compatible
|
||||||
, imageSelection ? "1"
|
, imageSelection ? "Windows 10 Pro"
|
||||||
, efi ? true
|
, efi ? true
|
||||||
, ...
|
, ...
|
||||||
}@attrs:
|
}@attrs:
|
||||||
|
@ -117,19 +117,9 @@ let
|
||||||
mkdir -p win/nix-win
|
mkdir -p win/nix-win
|
||||||
7z x -y ${windowsIso} -owin
|
7z x -y ${windowsIso} -owin
|
||||||
|
|
||||||
# Extract desired variant from install.wim
|
|
||||||
# This is useful if the install.wim contains multiple Windows
|
|
||||||
# versions (e.g., Home, Pro, ..), because the autounattend file
|
|
||||||
# will always select index 1. With this mechanism, a variant different
|
|
||||||
# from the first one can be automatically selected.
|
|
||||||
# imageSelection can be either an index (1-N) or the image name
|
|
||||||
# wiminfo can list all images contained in a given WIM file
|
|
||||||
wimexport win/sources/install.wim "${imageSelection}" win/sources/install_selected.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 4096
|
wimsplit win/sources/install.wim win/sources/install.swm 4090
|
||||||
rm win/sources/install_selected.wim
|
rm win/sources/install.wim
|
||||||
|
|
||||||
cp ${autounattend.autounattendXML} win/autounattend.xml
|
cp ${autounattend.autounattendXML} win/autounattend.xml
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue