From db90403f8784e42f7ce250ad359a904cf1e6352a Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 7 Jul 2026 23:01:58 +0200 Subject: [PATCH 1/2] fix: Get ESD field value --- src/install.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/install.sh b/src/install.sh index a473e8e58..8bc01f6f3 100644 --- a/src/install.sh +++ b/src/install.sh @@ -435,15 +435,10 @@ detectCustom() { getEsdFieldValue() { - local values="$1" + local list="$1" local index="$2" - awk -F: -v index="$index" ' - NR == index { - gsub(/^[ \t]+|[ \t]+$/, "", $2) - print $2 - } - ' <<< "$values" + awk -v idx="$index" 'NR == idx { gsub(/[^0-9]/, "", $0); print }' <<< "$list" return 0 } From 9470cc9b88a63ff82cd6706d75f3a045cb7acae1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 7 Jul 2026 23:06:01 +0200 Subject: [PATCH 2/2] Update install.sh --- src/install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/install.sh b/src/install.sh index 8bc01f6f3..5d50cf8f5 100644 --- a/src/install.sh +++ b/src/install.sh @@ -433,12 +433,12 @@ detectCustom() { return 0 } -getEsdFieldValue() { +getEsdField() { local list="$1" local index="$2" - awk -v idx="$index" 'NR == idx { gsub(/[^0-9]/, "", $0); print }' <<< "$list" + sed -n "${index}p" <<< "$list" | tr -cd '0-9' return 0 } @@ -501,8 +501,8 @@ extractESD() { totals=$(grep "Total Bytes:" <<< "$info" || true) links=$(grep "Hard Link Bytes:" <<< "$info" || true) - bootTotal=$(getEsdFieldValue "$totals" 1) - bootLinks=$(getEsdFieldValue "$links" 1) + bootTotal=$(getEsdField "$totals" 1) + bootLinks=$(getEsdField "$links" 1) if [[ ! "$bootTotal" =~ ^[0-9]+$ ]] || [[ ! "$bootLinks" =~ ^[0-9]+$ ]]; then error "Cannot read bootdisk size from ESD file!" @@ -511,8 +511,8 @@ extractESD() { bootSize=$(( bootTotal - bootLinks )) - wimTotal=$(getEsdFieldValue "$totals" 3) - wimLinks=$(getEsdFieldValue "$links" 3) + wimTotal=$(getEsdField "$totals" 3) + wimLinks=$(getEsdField "$links" 3) if [[ ! "$wimTotal" =~ ^[0-9]+$ ]] || [[ ! "$wimLinks" =~ ^[0-9]+$ ]]; then error "Cannot read boot.wim size from ESD file!"