From 56599eb448181bddf318cf7baf6567363182c214 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 25 Jan 2024 14:13:58 +0100 Subject: [PATCH] fix: Hide genisoimage warning --- src/install.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/install.sh b/src/install.sh index 540c68d..581be62 100644 --- a/src/install.sh +++ b/src/install.sh @@ -429,7 +429,7 @@ updateImage() { len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$") offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$") - if ! dd "if=$iso" "of=$dir/boot.img" bs=2048 "count=$len" "skip=$offset" status=none; then + if ! dd "if=$iso" "of=$dir/$ETFS" bs=2048 "count=$len" "skip=$offset" status=none; then error "Failed to extract boot image from ISO!" exit 67 fi @@ -444,7 +444,7 @@ buildImage() { local dir="$1" local cat="BOOT.CAT" local label="${BASE%.*}" - local size size_gb space space_gb error + local size size_gb space space_gb label="${label::30}" local out="$TMP/$label.tmp" @@ -469,22 +469,24 @@ buildImage() { if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then if ! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "$label" \ - -udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log"; then + -udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log"; then + [ -f "$log" ] && echo "$(<"$log")" return 1 fi else if ! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "$label" \ - -udf -allow-limited-size -quiet "$dir" 2> "$log"; then + -udf -allow-limited-size -quiet "$dir" 2> "$log"; then + [ -f "$log" ] && echo "$(<"$log")" return 1 fi fi - error=$(<"$log") - echo "$error" - rm -f "$log" + local error="" + [ -f "$log" ] && error="$(<"$log")" + [[ "$error" != "$hide" ]] && echo "$error" if [ -f "$STORAGE/$BASE" ]; then error "File $STORAGE/$BASE does already exist?!"