feat: Identify ESD media throughout image preparation (#2048)

This commit is contained in:
Kroese
2026-08-05 05:04:00 +02:00
committed by GitHub
parent b296a37d65
commit 089d9dd98a
+12 -8
View File
@@ -854,7 +854,7 @@ getESD() {
return 1 return 1
fi fi
local msg="Downloading catalog from the Microsoft servers..." local msg="Downloading ESD catalog from the Microsoft servers..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
rm -rf "$dir" rm -rf "$dir"
@@ -965,7 +965,7 @@ verifyFile() {
fi fi
local algo="SHA256" local algo="SHA256"
local hash local type="ISO" hash
[ -z "$check" ] && return 0 [ -z "$check" ] && return 0
enabled "$VERIFY" || return 0 enabled "$VERIFY" || return 0
@@ -973,8 +973,9 @@ verifyFile() {
# Microsoft ESD catalogs publish SHA1, while current mirror metadata normally # Microsoft ESD catalogs publish SHA1, while current mirror metadata normally
# uses SHA256; the digest length identifies which algorithm is required. # uses SHA256; the digest length identifies which algorithm is required.
[[ "${#check}" == "40" ]] && algo="SHA1" [[ "${#check}" == "40" ]] && algo="SHA1"
[[ "${iso,,}" == *.esd ]] && type="ESD file"
local msg="Verifying downloaded ISO..." local msg="Verifying downloaded $type..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
if [[ "${algo,,}" != "sha256" ]]; then if [[ "${algo,,}" != "sha256" ]]; then
@@ -1006,7 +1007,7 @@ verifyFile() {
fi fi
if [[ "$hash" == "$check" ]]; then if [[ "$hash" == "$check" ]]; then
info "Successfully verified ISO!" && return 0 info "Successfully verified $type!" && return 0
fi fi
error "The downloaded file has an unknown $algo checksum: $hash , as the expected value was: $check. Please report this at $SUPPORT/issues" error "The downloaded file has an unknown $algo checksum: $hash , as the expected value was: $check. Please report this at $SUPPORT/issues"
@@ -1022,9 +1023,12 @@ downloadFile() {
local web_desc="$5" local web_desc="$5"
local connections="${6:-1}" local connections="${6:-1}"
local domain parent local domain parent suffix=""
local msg="Downloading $web_desc"
local console_msg="Downloading $desc" [[ "${iso,,}" == *.esd ]] && suffix=" ESD file"
local msg="Downloading $web_desc$suffix"
local console_msg="Downloading $desc$suffix"
# Keep mirror messages concise by reducing subdomains to the final two # Keep mirror messages concise by reducing subdomains to the final two
# labels, while Microsoft downloads retain the generic description. # labels, while Microsoft downloads retain the generic description.
@@ -1037,7 +1041,7 @@ downloadFile() {
fi fi
if [ -n "$domain" ] && [[ "${domain,,}" != *"microsoft.com" ]]; then if [ -n "$domain" ] && [[ "${domain,,}" != *"microsoft.com" ]]; then
console_msg="Downloading $desc from $domain" console_msg="Downloading $desc$suffix from $domain"
fi fi
info "$console_msg..." info "$console_msg..."