diff --git a/profiles/DerGeret/Windows/Setup.ps1 b/profiles/DerGeret/Windows/Setup.ps1 index 414e6fc3..47c50398 100644 --- a/profiles/DerGeret/Windows/Setup.ps1 +++ b/profiles/DerGeret/Windows/Setup.ps1 @@ -15,8 +15,8 @@ $Global:SetupConfigPostprocessor = { $installationPartition.InnerText = "$($newIndex + 1)"; $partitionCreations = $diskConfig.SelectSingleNode("./ua:CreatePartitions", $namespace); $newPartition = $partitionCreations.SelectNodes("./ua:CreatePartition", $namespace)[0].CloneNode($true); - $newPartition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex"; - $newPartition.SelectSingleNode("./ua:Size", $namespace).InnerText = "65536"; # For testing purposes + + $offset = 0; for ($i = 0; $i -lt $partitionCreations.ChildNodes.Count; $i++) { $partition = $partitionCreations.ChildNodes[$i]; @@ -24,9 +24,15 @@ $Global:SetupConfigPostprocessor = { if ($order -ge $newIndex) { $partition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$($order + 1)"; + } else { + $offset += [int]$partition.SelectSingleNode("./ua:Size", $namespace).InnerText; } } + # Add 1 TB space before Windows installation... wha-!? For Linux, ofc! I use Arch Linux, btw. + $newPartition.SelectSingleNode("./ua:Size", $namespace).InnerText = "$((1 * 1024 * 1024) - $offset)"; + $newPartition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex"; + $null = $partitionCreations.AppendChild($newPartition); $partitionModifications = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace);