From 03b00859f47ed06e27a15ab33d55522baa1bcc8f Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 1 Aug 2022 00:09:44 +0200 Subject: [PATCH] don't use swap size above 16G --- entry.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entry.sh b/entry.sh index dce0b9d..b33542c 100755 --- a/entry.sh +++ b/entry.sh @@ -76,7 +76,13 @@ function first_stage(){ export LVM_SIZE=$(dev_size ${DEVICE}2) - export SWAP_SIZE=$(($(mem_size)/1024/1024)) + if [[ $(($(mem_size)/1024/1024)) -gt 16384 ]] + then + export SWAP_SIZE=16384 + else + export SWAP_SIZE=$(($(mem_size)/1024/1024)) + fi + export ROOT_SIZE=$(($LVM_SIZE/1024/1024-$SWAP_SIZE-512)) echo lvcreate /dev/vg0 --name=root --size=${ROOT_SIZE}M