forked from Bitmessage/sysdeploy
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)"
|
downloads="$(mktemp -d)"
|
||||||
pushd "$downloads"
|
pushd "$downloads"
|
||||||
|
|
||||||
download_and_verify "$release_version" boot-initrd
|
|
||||||
download_and_verify "$release_version" boot-kernel
|
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
|
download_and_verify "$release_version" squashfs
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
popd
|
||||||
|
rm -rf "$downloads"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
mount_efi "$drive"
|
mount_efi "$drive"
|
||||||
mv boot-init "$mnt"/boot-initrd."$release_version"
|
mv boot-init "$mnt"/boot-initrd."$release_version"
|
||||||
|
|
|
@ -54,10 +54,11 @@ function download_and_verify()
|
||||||
get_checksum "$release_version" "$fname"
|
get_checksum "$release_version" "$fname"
|
||||||
|
|
||||||
wget "$url" -O "$fname"
|
wget "$url" -O "$fname"
|
||||||
sha256sum=$(sha256sum "$fname")
|
sha256sum=$(sha256sum "$fname"|cut -d\ -f1)
|
||||||
if [ "$sha256sum" == "$checksum" ]; then
|
if [ "$sha256sum" == "$checksum" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
echo "Checksum fail"
|
||||||
rm -f "$fname"
|
rm -f "$fname"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ function update_syslinux_menu()
|
||||||
partition_list "$drive"
|
partition_list "$drive"
|
||||||
for part in $partitions; do
|
for part in $partitions; do
|
||||||
version_from_partnum "$drive" "$part"
|
version_from_partnum "$drive" "$part"
|
||||||
|
if [ -z "$version" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
versions["$version"]=1
|
versions["$version"]=1
|
||||||
for f in "${files[@]}"; do
|
for f in "${files[@]}"; do
|
||||||
if [ ! -e "$mnt"/"$imagepath"/"$f""$version" ]; then
|
if [ ! -e "$mnt"/"$imagepath"/"$f""$version" ]; then
|
||||||
|
|
|
@ -36,7 +36,7 @@ function mount_efi()
|
||||||
function umount_efi()
|
function umount_efi()
|
||||||
{
|
{
|
||||||
umount "$mnt"
|
umount "$mnt"
|
||||||
flush
|
sync
|
||||||
rmdir "$mnt"
|
rmdir "$mnt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user