diff --git a/deploy.fish b/deploy.fish index e84aa84..4dbfcd9 100644 --- a/deploy.fish +++ b/deploy.fish @@ -7,10 +7,10 @@ begin set -l buildDir "$(status dirname)/build" set -l cacheDir ~/.cache/winiso-valhalla set -l isoFile "$buildDir/win.iso" - set -l mountPath "/media/wininstall" + set -l winPath "/media/wininstall" set -l bootPath "/media/boot" set -l dataPath "/media/data" - set -l overlayDir (mktemp -d) + set -l winpeOverlay (mktemp -d) set -q WIN11_IMAGE_PATH or begin @@ -19,7 +19,7 @@ begin end set -l dir (status dirname) - set -l overlayDir (mktemp -d) + set -l winpeOverlay (mktemp -d) set -l editionField "Edition ID" set -l wimFile "$dataPath/sources/install.wim" @@ -29,7 +29,7 @@ begin set -l pwshArchive "$cacheDir/pwsh.zip" mkdir -p "$buildDir" - cp -r "$dir/winfs"/* "$overlayDir" + 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" @@ -47,37 +47,37 @@ begin curl -L "https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip" -o "$pwshArchive" end - mkdir -p "$overlayDir/drivers" + mkdir -p "$winpeOverlay/drivers" begin set -l tempDir (mktemp -d) unzip "$intelNetworkArchive" -d "$tempDir" - cp -r "$tempDir" "$overlayDir/drivers/IntelNetwork" + cp -r "$tempDir" "$winpeOverlay/drivers/IntelNetwork" rm -rf "$tempDir" end begin set -l tempDir (mktemp -d) unzip "$marvellNetworkArchive" -d "$tempDir" - cp -r "$tempDir/x64" "$overlayDir/drivers/MarvellNetwork" + cp -r "$tempDir/x64" "$winpeOverlay/drivers/MarvellNetwork" rm -rf "$tempDir" end begin - set -l dir "$overlayDir/git" + set -l dir "$winpeOverlay/git" mkdir -p "$dir" pushd "$dir" > /dev/null 7z x "$gitArchive" popd > /dev/null end - unzip "$pwshArchive" -d "$overlayDir/PowerShell" + unzip "$pwshArchive" -d "$winpeOverlay/PowerShell" mkdir -p "$(dirname "$isoFile")" - sudo mount --mkdir "$WIN11_IMAGE_PATH" "$mountPath" - mkwinpeimg --iso --arch amd64 --overlay "$overlayDir" --windows-dir "$mountPath" "$isoFile" - sudo umount "$mountPath" - rm -rf "$overlayDir" + sudo mount --mkdir "$WIN11_IMAGE_PATH" "$winPath" + mkwinpeimg --iso --arch amd64 --overlay "$winpeOverlay" --windows-dir "$winPath" "$isoFile" + sudo umount "$winPath" + rm -rf "$winpeOverlay" if [ ! -b "$WIN_DISK" ] chooseDisk WIN_DISK @@ -126,13 +126,13 @@ begin sudo mkfs.ntfs -fFL "$setupLabel" "$dataDisk" sudo mount --mkdir "$bootDisk" "$bootPath" sudo mount --mkdir "$dataDisk" "$dataPath" - sudo mount --mkdir "$isoFile" "$mountPath" - sudo cp -r "$mountPath"/* "$bootPath" - sudo umount "$mountPath" + sudo mount --mkdir "$isoFile" "$winPath" + sudo cp -r "$winPath"/* "$bootPath" + sudo umount "$winPath" - sudo mount "$WIN11_IMAGE_PATH" "$mountPath" - sudo cp -r "$mountPath"/* "$dataPath" - sudo cp -r "$mountPath/efi" "$bootPath" + sudo mount "$WIN11_IMAGE_PATH" "$winPath" + sudo cp -r "$winPath"/* "$dataPath" + sudo cp -r "$winPath/efi" "$bootPath" while [ ! (wiminfo "$wimFile" 1 | grep "^$editionField" | cut -d ":" -f2 | string trim) = "Professional" ] sudo wimdelete --soft "$wimFile" 1 @@ -142,6 +142,6 @@ begin sudo wimdelete --soft "$wimFile" 2 end - sudo -- bash -c "umount -vf $(string escape "$mountPath"); umount -vf $(string escape "$bootPath"); umount -vf $(string escape "$dataPath"); rm -rf $(string escape "$mountPath") $(string escape "$dataPath");" + sudo -- bash -c "umount -vf $(string escape "$winPath"); umount -vf $(string escape "$bootPath"); umount -vf $(string escape "$dataPath"); rm -rf $(string escape "$winPath") $(string escape "$dataPath");" end end