Formatting

This commit is contained in:
Kroese 2023-05-19 17:39:37 +02:00 committed by GitHub
parent 3cda109cf0
commit 052c65e257

View File

@ -143,13 +143,10 @@ 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)
if (( SYSTEM_SIZE > SPACE )); then (( SYSTEM_SIZE > SPACE )) && error "Not enough free space to create a 4 GB system disk." && exit 87
error "Not enough free space to create a 4 GB system disk." && exit 87
fi
if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then
rm -f "${SYSTEM}" rm -f "${SYSTEM}" && error "Could not allocate a file for the system disk." && exit 88
error "Could not allocate a file for the system disk." && exit 88
fi fi
if [[ "${ALLOCATE}" == [Zz]* ]]; then if [[ "${ALLOCATE}" == [Zz]* ]]; then
@ -158,17 +155,11 @@ if [[ "${ALLOCATE}" == [Zz]* ]]; then
fi fi
# Check if file exists # Check if file exists
if [ ! -f "${SYSTEM}" ]; then [ ! -f "${SYSTEM}" ] && error "System disk does not exist ($SYSTEM)" && exit 89
error "System disk does not exist ($SYSTEM)" && exit 89
fi
# Check the filesize # Check the filesize
SIZE=$(stat -c%s "${SYSTEM}") SIZE=$(stat -c%s "${SYSTEM}")
[[ SIZE -ne SYSTEM_SIZE ]] && rm -f "${SYSTEM}" && error "System disk has the wrong size: ${SIZE}" && exit 90
if [[ SIZE -ne SYSTEM_SIZE ]]; then
rm -f "${SYSTEM}"
error "System disk has the wrong size: ${SIZE}" && exit 90
fi
PART="$TMP/partition.fdisk" PART="$TMP/partition.fdisk"
@ -189,7 +180,6 @@ info "Install: Extracting system partition..."
MOUNT="$TMP/system" MOUNT="$TMP/system"
rm -rf "$MOUNT" && mkdir -p "$MOUNT" rm -rf "$MOUNT" && mkdir -p "$MOUNT"
mv -f "$HDA.tgz" "$HDA.txz" mv -f "$HDA.tgz" "$HDA.txz"
tar xpfJ "$HDP.txz" --absolute-names -C "$MOUNT/" tar xpfJ "$HDP.txz" --absolute-names -C "$MOUNT/"