mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-12 08:29:16 +00:00
No swap on devices with 4GB+ RAM
This commit is contained in:
parent
9320d4c54e
commit
c2d218d19b
|
@ -331,8 +331,11 @@ if [ $IS_RASPI -eq 1 ] || [ $IS_ROCKPRO64 -eq 1 ]; then
|
|||
dd if=/dev/zero of=/mnt/hdd/swapfile count=1000 bs=1MiB
|
||||
chmod 600 /mnt/hdd/swapfile
|
||||
fi
|
||||
mkswap /mnt/hdd/swapfile
|
||||
dphys-swapfile swapon
|
||||
# Only setup swap for low-mem devices
|
||||
if [ "$TOTAL_RAM_GB" -lt "4" ]; then
|
||||
mkswap /mnt/hdd/swapfile
|
||||
dphys-swapfile swapon
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ elif [ $IS_X86 -eq 1 ]; then
|
|||
DEVICE_TYPE="debian"
|
||||
fi
|
||||
|
||||
TOTAL_RAM_GB=$(free --giga | grep Mem | awk '{print $2}')
|
||||
|
||||
SERIAL_NUM=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2)
|
||||
if [[ "$SERIAL_NUM" == "" ]]; then
|
||||
|
|
Loading…
Reference in New Issue
Block a user