Save image to temperary file instead of to stdout.

This commit is contained in:
Storm Dragon 2022-03-02 09:21:37 -05:00
parent 4d900804ba
commit f4dfa9b1fa
1 changed files with 6 additions and 1 deletions

View File

@ -31,6 +31,9 @@ cleanup() {
partx -d "${loopdev}"
losetup --detach "${loopdev}"
fi
if [[ -n "${imageFileName}" ]]; then
rm "${imageFileName}"
fi
exit 0
}
@ -139,7 +142,9 @@ mkdir /mnt/boot
mount "${loopdev}p1" /mnt/boot
# Things are mounted now, so set mounted to 0 (bash true)
mounted=0
wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
imageFileName=$(mktemp)
wget "${url[$imageVersion]}" -O "${imageFileName}"
bsdtar -xpf "${imageFileName}" -C /mnt
arch-chroot /mnt << EOF
# set up pacman
pacman-key --init