fix: typos, checksum, ordering
This commit is contained in:
parent
a05d8e637b
commit
ffbf818c97
17
install.inc
17
install.inc
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -36,7 +36,7 @@ function mount_efi()
|
|||
function umount_efi()
|
||||
{
|
||||
umount "$mnt"
|
||||
flush
|
||||
sync
|
||||
rmdir "$mnt"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user