feat: Centralize image and boot state checks (#2137)

This commit is contained in:
Kroese
2026-08-14 11:07:46 +02:00
committed by GitHub
parent 019c70dbaa
commit a3461db9a8
5 changed files with 49 additions and 30 deletions
+6 -6
View File
@@ -400,9 +400,9 @@ extractImage() {
local archive="${dir}.archive"
local file size required archiveSize rc
if [ -z "$CUSTOM" ]; then
if ! isCustomImage; then
desc="downloaded ISO"
if [[ "$version" != "http"* ]]; then
if ! isURL "$version"; then
desc=$(printVariant "$version" "$desc")
fi
fi
@@ -1652,7 +1652,7 @@ extractESD() {
index=""
if [[ "${version,,}" == "http"* ]]; then
if isURL "$version"; then
# Direct ESD URLs have no catalog identity. Restrict automatic detection
# to installable images because indexes 1-3 contain setup components.
@@ -1758,7 +1758,7 @@ extractESD() {
return 1
fi
if [[ "${version,,}" != "http"* ]] &&
if ! isURL "$version" &&
[[ "${resultEdition,,}" != "${edition,,}" ]]; then
error "Prepared install.esd does not contain only '$edition' at index 1!"
return 1
@@ -1925,7 +1925,7 @@ buildImage() {
checkFreeSpace "$TMP" "$size" || return 1
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]] && [ -z "${BOOT_LOAD_SIZE:-}" ]; then
if isLegacyBoot && [ -z "${BOOT_LOAD_SIZE:-}" ]; then
if [[ "${DETECTED,,}" != "win9"* && "${DETECTED,,}" != "winnt4" ]]; then
error "Failed to determine the boot image load size!"
return 1
@@ -1951,7 +1951,7 @@ buildImage() {
# Use separate layouts for modern hybrid media, NT 5.x legacy media, Win9x,
# and other legacy releases because their El Torito requirements differ.
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
if ! isLegacyBoot; then
args+=(
-no-emul-boot