Refactor calculation of swap size

This commit is contained in:
Manuel Thalmann 2023-08-07 20:33:51 +02:00
parent ac3d551c95
commit af09e9a7ec

View file

@ -7,7 +7,7 @@ ARCH_DISK="${ARCH_DISK}";
SKIP_FORMAT_EFI="${SKIP_FORMAT_EFI}"; SKIP_FORMAT_EFI="${SKIP_FORMAT_EFI}";
PARTITION_SCRIPT="${PARTITION_SCRIPT:-"./default-partition.sh"}"; PARTITION_SCRIPT="${PARTITION_SCRIPT:-"./default-partition.sh"}";
memory="$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }')"; memory="$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }')";
swapSize="$(echo "$memory" | awk '{ print int(($1 / 1024 / 1024 4) + 0.5)}')"; swapSize="$(echo "$memory" | awk '{ print int((($1 / 1024 / 1024) * 0.75) + 0.5)}')";
export SWAP_SIZE="$swapSize"; export SWAP_SIZE="$swapSize";