Added swap size limit of 32 GiB

This commit is contained in:
2025-10-14 11:39:01 -04:00
parent 203a09eb05
commit 67763d1b39

View File

@@ -44,6 +44,10 @@ sgdisk \
if [[ "${ENABLE_SWAP}" == "yes" ]]; then if [[ "${ENABLE_SWAP}" == "yes" ]]; then
SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))" SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
if [[ "${SWAP_SIZE#}" -gt '32' ]]; then
SWAP_SIZE='32'
fi
sgdisk \ sgdisk \
-n2:0:+${SWAP_SIZE}G \ -n2:0:+${SWAP_SIZE}G \
-t2:BF02 \ -t2:BF02 \