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