This commit is contained in:
Kroese 2023-05-20 01:53:46 +02:00 committed by GitHub
parent 35c9167af4
commit 8cbe226206

View File

@ -97,8 +97,8 @@ PAT="/$BASE.pat"
rm -f "$PAT" rm -f "$PAT"
{ wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || : { wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
(( rc != 0 )) && error "Failed to download $URL, reason: $rc" && exit 69
(( rc != 0 )) && error "Failed to download $URL, reason: $rc" && exit 69
[ ! -f "$PAT" ] && error "Failed to download $URL" && exit 69 [ ! -f "$PAT" ] && error "Failed to download $URL" && exit 69
SIZE=$(stat -c%s "$PAT") SIZE=$(stat -c%s "$PAT")
@ -129,7 +129,6 @@ HDP="$TMP/synohdpack_img"
[ ! -d "$PKG" ] && error "The PAT file contains no packages." && exit 68 [ ! -d "$PKG" ] && error "The PAT file contains no packages." && exit 68
BOOT=$(find "$TMP" -name "*.bin.zip") BOOT=$(find "$TMP" -name "*.bin.zip")
[ ! -f "$BOOT" ] && error "The PAT file contains no boot file." && exit 67 [ ! -f "$BOOT" ] && error "The PAT file contains no boot file." && exit 67
BOOT=$(echo "$BOOT" | head -c -5) BOOT=$(echo "$BOOT" | head -c -5)
@ -142,7 +141,6 @@ SYSTEM_SIZE=4954537983
# Check free diskspace # Check free diskspace
SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1) SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1)
(( SYSTEM_SIZE > SPACE )) && error "Not enough free space to create a 4 GB system disk." && exit 87 (( SYSTEM_SIZE > SPACE )) && error "Not enough free space to create a 4 GB system disk." && exit 87
if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then