Ensure to always remove all leftovers
This commit is contained in:
parent
a7a7de7b1a
commit
5904f56d11
|
@ -26,6 +26,17 @@ begin
|
||||||
set -l editionField "Edition ID"
|
set -l editionField "Edition ID"
|
||||||
set -l wimFile "sources/install.wim"
|
set -l wimFile "sources/install.wim"
|
||||||
|
|
||||||
|
set -l tempPaths \
|
||||||
|
"$winpeOverlay" \
|
||||||
|
"$winOverlay" \
|
||||||
|
"$upperDir" \
|
||||||
|
"$workDir"
|
||||||
|
|
||||||
|
set -l mountPaths \
|
||||||
|
"$valhallaPath" \
|
||||||
|
"$winPath" \
|
||||||
|
"$winpePath"
|
||||||
|
|
||||||
set -l files
|
set -l files
|
||||||
|
|
||||||
set -l fileDefinitions \
|
set -l fileDefinitions \
|
||||||
|
@ -129,7 +140,6 @@ begin
|
||||||
mkdir -p "$(dirname "$winpe")"
|
mkdir -p "$(dirname "$winpe")"
|
||||||
sudo mount --mkdir "$WIN11_IMAGE_PATH" "$winPath"
|
sudo mount --mkdir "$WIN11_IMAGE_PATH" "$winPath"
|
||||||
mkwinpeimg --iso --arch amd64 --overlay "$winpeOverlay" --windows-dir "$winPath" "$winpe"
|
mkwinpeimg --iso --arch amd64 --overlay "$winpeOverlay" --windows-dir "$winPath" "$winpe"
|
||||||
rm -rf "$winpeOverlay"
|
|
||||||
sudo mount --mkdir "$winpe" "$winpePath"
|
sudo mount --mkdir "$winpe" "$winpePath"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -164,6 +174,11 @@ begin
|
||||||
-output "$isoFile" \
|
-output "$isoFile" \
|
||||||
"$valhallaPath"
|
"$valhallaPath"
|
||||||
else
|
else
|
||||||
|
set -a mountPaths \
|
||||||
|
"$bootPath" \
|
||||||
|
"$dataPath"
|
||||||
|
|
||||||
|
|
||||||
if [ ! -b "$WIN_DISK" ]
|
if [ ! -b "$WIN_DISK" ]
|
||||||
chooseDisk WIN_DISK
|
chooseDisk WIN_DISK
|
||||||
end
|
end
|
||||||
|
@ -215,15 +230,14 @@ begin
|
||||||
|
|
||||||
sudo cp -r "$valhallaPath"/* "$dataPath"
|
sudo cp -r "$valhallaPath"/* "$dataPath"
|
||||||
sudo cp -r "$valhallaPath/efi" "$bootPath"
|
sudo cp -r "$valhallaPath/efi" "$bootPath"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for path in "$valhallaPath" \
|
for path in $mountPaths
|
||||||
"$winPath" \
|
|
||||||
"$winpePath" \
|
|
||||||
"$bootPath" \
|
|
||||||
"$dataPath"
|
|
||||||
sudo umount -vf "$path"
|
sudo umount -vf "$path"
|
||||||
|
end
|
||||||
|
|
||||||
|
for path in $mountPaths $tempPaths
|
||||||
sudo rm -rf "$path"
|
sudo rm -rf "$path"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
Loading…
Reference in a new issue