From 637ed0e3a6c8a18b739b20045b456593e936d1d5 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 6 Jul 2026 05:09:29 +0200 Subject: [PATCH] fix: Do not match multiple files (#1211) --- src/disk.sh | 1 + src/install.sh | 9 +++++---- src/serial.sh | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/disk.sh b/src/disk.sh index 7225ae7..2a0c6ff 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -567,6 +567,7 @@ addDisk () { USED=$(du -sB 1 "$DISK_FILE" | cut -f1) FREE=$(df --output=avail -B 1 "$DIR" | tail -n 1) LEFT=$(( CUR_SIZE - USED - FREE )) + (( LEFT < 0 )) && LEFT=0 if (( LEFT > 0 )); then diff --git a/src/install.sh b/src/install.sh index d78429a..c15da8e 100644 --- a/src/install.sh +++ b/src/install.sh @@ -205,11 +205,12 @@ fi MSG="Preparing system partition..." info "Install: $MSG" && html "$MSG" -BOOT=$(find "$TMP" -name "*.bin.zip") -[ ! -s "$BOOT" ] && error "The PAT file contains no boot image." && exit 67 +BOOT=$(find "$TMP" -name "*.bin.zip" -print -quit) +[ -z "$BOOT" ] && error "The PAT file contains no boot image." && exit 67 +[ ! -s "$BOOT" ] && error "The PAT boot image archive is empty." && exit 67 -BOOT=$(echo "$BOOT" | head -c -5) -unzip -q -o "$BOOT".zip -d "$TMP" +unzip -q -o "$BOOT" -d "$TMP" +BOOT="${BOOT%.zip}" SYSTEM="$STORAGE/$BASE.system.img" rm -f "$SYSTEM" diff --git a/src/serial.sh b/src/serial.sh index 0d9c08e..86564aa 100644 --- a/src/serial.sh +++ b/src/serial.sh @@ -85,7 +85,7 @@ configureSerialPorts() { -chardev socket,id=charchannel0,host=127.0.0.1,port=$CHR_PORT,reconnect=10 \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=vchannel" - return 0 + return 0 } validateHostMac