don't use swap size above 16G

This commit is contained in:
j3d1 2022-08-01 00:09:44 +02:00
parent 2e5de10b64
commit 03b00859f4
1 changed files with 7 additions and 1 deletions

View File

@ -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