From 2d8a7fb3cbd5a0402f18dbb13baad96e6920f8e0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 20 Jun 2023 08:50:59 +0200 Subject: [PATCH] Implemented manjaro 22 and sha 512 check --- scripts/base.sh | 2 +- scripts/image/setup.sh | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/base.sh b/scripts/base.sh index bc2d0b0..aa5242a 100644 --- a/scripts/base.sh +++ b/scripts/base.sh @@ -93,7 +93,7 @@ set_device_path(){ OPTIMAL_BLOCKSIZE="4K" fi info "Optimal blocksize set to: $OPTIMAL_BLOCKSIZE" || error - +} overwritte_device_with_zeros(){ question "Should $device_path be overwritten with zeros before copying?(y/N)" && read -r copy_zeros_to_device diff --git a/scripts/image/setup.sh b/scripts/image/setup.sh index 1a38b05..3620cf8 100644 --- a/scripts/image/setup.sh +++ b/scripts/image/setup.sh @@ -95,7 +95,11 @@ case "$operation_system" in image_name="manjaro-gnome-20.0-200426-linux56.iso" ;; "21") - image_checksum="78b8fa6a5222bc10a2e767485e76f82f3c7b2b59f4a70501b4a9fb846c5ad94987cf8b8ed630a701a8a3386debc0a39fc7363a743df8f13f41d3d8324d74e227" + base_download_url="https://download.manjaro.org/gnome/21.3.7/" + image_name="manjaro-gnome-21.3.7-220816-linux515.iso" + ;; + "22") + base_download_url="https://download.manjaro.org/gnome/22.1.3/" image_name="manjaro-gnome-22.1.3-230529-linux61.iso" ;; esac @@ -164,17 +168,18 @@ case "$operation_system" in ;; esac -if [ -z "$image_checksum" ] - then - sha1_download_url="$download_url.sha1" - info "Image Chechsum is not defined. Try to download image signature from $sha1_download_url." - if wget -q --method=HEAD "$sha1_download_url"; - then - image_checksum="$(wget $sha1_download_url -q -O - | cut -d ' ' -f1 )" - info "Defined image_checksum as $image_checksum" - else - warning "No checksum found under $sha1_download_url." - fi +if [ -z "$image_checksum" ]; then + for ext in sha1 sha512; do + sha_download_url="$download_url.$ext" + info "Image Checksum is not defined. Try to download image signature from $sha_download_url." + if wget -q --method=HEAD "$sha_download_url"; then + image_checksum="$(wget $sha_download_url -q -O - | cut -d ' ' -f1)" + info "Defined image_checksum as $image_checksum" + break + else + warning "No checksum found under $sha_download_url." + fi + done fi info "Verifying image..."