fix: typos, checksum, ordering

This commit is contained in:
Peter Šurda 2021-03-02 17:00:17 +01:00
parent a05d8e637b
commit ffbf818c97
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
4 changed files with 22 additions and 3 deletions

View File

@ -22,9 +22,24 @@ function download_version()
downloads="$(mktemp -d)"
pushd "$downloads"
download_and_verify "$release_version" boot-initrd
download_and_verify "$release_version" boot-kernel
if [ $? -eq 1 ]; then
popd
rm -rf "$downloads"
exit 1
fi
download_and_verify "$release_version" boot-initrd
if [ $? -eq 1 ]; then
popd
rm -rf "$downloads"
exit 1
fi
download_and_verify "$release_version" squashfs
if [ $? -eq 1 ]; then
popd
rm -rf "$downloads"
exit 1
fi
mount_efi "$drive"
mv boot-init "$mnt"/boot-initrd."$release_version"

View File

@ -54,10 +54,11 @@ function download_and_verify()
get_checksum "$release_version" "$fname"
wget "$url" -O "$fname"
sha256sum=$(sha256sum "$fname")
sha256sum=$(sha256sum "$fname"|cut -d\ -f1)
if [ "$sha256sum" == "$checksum" ]; then
return 0
fi
echo "Checksum fail"
rm -f "$fname"
return 1
}

View File

@ -23,6 +23,9 @@ function update_syslinux_menu()
partition_list "$drive"
for part in $partitions; do
version_from_partnum "$drive" "$part"
if [ -z "$version" ]; then
continue
fi
versions["$version"]=1
for f in "${files[@]}"; do
if [ ! -e "$mnt"/"$imagepath"/"$f""$version" ]; then

View File

@ -36,7 +36,7 @@ function mount_efi()
function umount_efi()
{
umount "$mnt"
flush
sync
rmdir "$mnt"
}