From 53032abea33a8b48b6fb982d3c45fd023ede9972 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 3 Jul 2023 13:10:53 +0200 Subject: [PATCH] Enlarge size before windows installation --- profiles/DerGeret/Windows/Setup.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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);