From af2e58552f626ba40644b99454ca1e42c16d1d84 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 22 Jun 2023 15:20:02 +0200 Subject: [PATCH] Embed git in winiso --- deploy.sh | 7 +++++++ winfs/Scripts/Startup.ps1 | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/deploy.sh b/deploy.sh index f3815a0..a06f5cf 100755 --- a/deploy.sh +++ b/deploy.sh @@ -26,17 +26,24 @@ else bootPath="/media/boot"; dataPath="/media/data"; setupLabel="winiso"; + gitArchive="./$buildDir/git.msi"; pwshArchive="./$buildDir/pwsh.zip"; editionField="Edition ID"; mkdir -p "$buildDir"; cp -r winfs/* "$overlayDir"; + if [ ! -f "$gitArchive" ] + then + curl -L "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/PortableGit-2.41.0-64-bit.7z.exe" -o "$gitArchive"; + fi; + if [ ! -f "$pwshArchive" ] then curl -L "https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/PowerShell-7.3.4-win-x64.zip" -o "$pwshArchive"; fi; + unzip "$pwshArchive" -d "$overlayDir/git"; unzip "$pwshArchive" -d "$overlayDir/PowerShell"; sudo mount --mkdir "$WIN11_IMAGE_PATH" "$mountPath"; diff --git a/winfs/Scripts/Startup.ps1 b/winfs/Scripts/Startup.ps1 index 01fff33..96acbf9 100644 --- a/winfs/Scripts/Startup.ps1 +++ b/winfs/Scripts/Startup.ps1 @@ -1,14 +1,6 @@ $null = $env:WIN_COMPUTER_NAME; $null = $env:SETUP_SCRIPT_NAME; -Set-ExecutionPolicy Bypass -Scope Process -Force; -[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; -Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')); - -Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1; -choco install -y git -choco install -y powershell-core; -refreshenv; -git clone https://git.nuth.ch/manuth/PortValhalla.git; +& "X:\git\git.exe" clone https://git.nuth.ch/manuth/PortValhalla.git; Set-Location PortValhalla; pwsh;