diff --git a/deploy.fish b/deploy.fish index 9b3963b..57d28a1 100644 --- a/deploy.fish +++ b/deploy.fish @@ -20,55 +20,85 @@ begin set -l editionField "Edition ID" set -l wimFile "$dataPath/sources/install.wim" - set -l intelNetworkArchive "$cacheDir/intelNetwork.zip" - set -l marvellNetworkArchive "$cacheDir/marvellNetwork.zip" - set -l gitArchive (realpath -m "$cacheDir/git.msi") - set -l pwshArchive "$cacheDir/pwsh.zip" + set -l files + + set -l fileDefinitions \ + drivers/network/intel \ + "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Intel_I211_UWD_TP_W10_64_VER12151841_20190306R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" \ + zip \ + . \ + \ + drivers/network/marvell \ + "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Marvell_TP_TSD_W11_64_V3130_20211118R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" \ + zip \ + ./x64 \ + \ + software/git \ + "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/PortableGit-2.41.0-64-bit.7z.exe" \ + exe \ + . \ + \ + software/pwsh \ + "https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip" \ + zip \ + . + + for i in (seq 1 4 (count $fileDefinitions)) + set -l entry $fileDefinitions[$i.."$(math "$i" + 3)"] + set -l name "$entry[1]" + set -l url "$entry[2]" + set -l type "$entry[3]" + set -l dir "$entry[4]" + set -l downloadPath "$cacheDir/$name.$type" + + set -a files \ + "$downloadPath" \ + "$dir" + + mkdir -p (dirname "$downloadPath") + + if [ ! -f "$downloadPath" ] + curl -L "$url" -o "$downloadPath" + end + end + + set -l intel $files[1..2] + set -l marvell $files[3..4] + set -l git $files[5..6] + set -l pwsh $files[7..8] - mkdir -p "$buildDir" cp -r "$dir/winfs"/* "$winpeOverlay" - - if [ ! -f "$intelNetworkArchive" ] - curl -L "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Intel_I211_UWD_TP_W10_64_VER12151841_20190306R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" -o "$intelNetworkArchive" - end - - if [ ! -f "$marvellNetworkArchive" ] - curl -L "https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Marvell_TP_TSD_W11_64_V3130_20211118R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" -o "$marvellNetworkArchive" - end - - if [ ! -f "$gitArchive" ] - 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" - end - - if [ ! -f "$pwshArchive" ] - curl -L "https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip" -o "$pwshArchive" - end - mkdir -p "$winpeOverlay/drivers" begin set -l tempDir (mktemp -d) - unzip "$intelNetworkArchive" -d "$tempDir" - cp -r "$tempDir" "$winpeOverlay/drivers/IntelNetwork" + unzip "$intel[1]" -d "$tempDir" + cp -r "$tempDir/$intel[2]" "$winpeOverlay/drivers/IntelNetwork" rm -rf "$tempDir" end begin set -l tempDir (mktemp -d) - unzip "$marvellNetworkArchive" -d "$tempDir" - cp -r "$tempDir/x64" "$winpeOverlay/drivers/MarvellNetwork" + unzip "$marvell[1]" -d "$tempDir" + cp -r "$tempDir/$marvell[2]" "$winpeOverlay/drivers/MarvellNetwork" rm -rf "$tempDir" end begin - set -l dir "$winpeOverlay/git" - mkdir -p "$dir" - pushd "$dir" > /dev/null - 7z x "$gitArchive" + set -l tempDir (mktemp -d) + pushd "$tempDir" > /dev/null + 7z x "$git[1]" popd > /dev/null + cp -r "$tempDir/$git[2]" "$winpeOverlay/git" + rm -rf "$tempDir" end - unzip "$pwshArchive" -d "$winpeOverlay/PowerShell" + begin + set -l tempDir (mktemp -d) + unzip "$pwsh[1]" -d "$tempDir" + cp -r "$tempDir/$pwsh[2]" "$winpeOverlay/PowerShell" + rm -rf "$tempDir" + end mkdir -p "$(dirname "$isoFile")" sudo mount --mkdir "$WIN11_IMAGE_PATH" "$winPath"