diff --git a/src/disk.sh b/src/disk.sh index 9a835d7..165f5b2 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -433,6 +433,14 @@ fi DISK_EXT="$(fmt2ext "$DISK_FMT")" || exit $? +if [ -z "$ALLOCATE" ]; then + if [[ "${DISK_FMT,,}" == "raw" ]]; then + ALLOCATE="Y" + else + ALLOCATE="N" + fi +fi + if [[ "$ALLOCATE" == [Nn]* ]]; then DISK_TYPE="growable" DISK_ALLOC="preallocation=off" diff --git a/src/reset.sh b/src/reset.sh index 6690538..8b1cb5d 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -12,8 +12,8 @@ trap 'error "Status $? while: $BASH_COMMAND (line $LINENO/$BASH_LINENO)"' ERR # Docker environment variables : ${BOOT:=''} # URL of the ISO file -: ${DEBUG:='N'} # Disable debugging mode -: ${ALLOCATE:='N'} # Disable preallocation +: ${DEBUG:='N'} # Disable debugging +: ${ALLOCATE:=''} # Preallocate diskspace : ${ARGUMENTS:=''} # Extra QEMU parameters : ${CPU_CORES:='1'} # Amount of CPU cores : ${RAM_SIZE:='1G'} # Maximum RAM amount