mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
armbian-install: limit automated swap creation to 16Gb (#4528)
This commit is contained in:
@@ -360,6 +360,13 @@ create_armbian()
|
||||
|
||||
if [[ $2 == ${DISK_ROOT_PART} && -z $1 && $DEVICE_TYPE = uefi ]]; then
|
||||
|
||||
# create swap file size of your memory so we can use it for S4
|
||||
MEM_TOTAL=$(cat /proc/meminfo | awk '/MemTotal/ {print $2}')
|
||||
|
||||
# but no more then 16Gb
|
||||
[[ ${MEM_TOTAL} -gt 16107868 ]] && MEM_TOTAL=16107868
|
||||
dd if=/dev/zero of="${TempDir}"/rootfs/swapfile bs=${MEM_TOTAL} count=1024 conv=notrunc
|
||||
|
||||
# create swap file size of your memory so we can use it for S4
|
||||
dd if=/dev/zero of="${TempDir}"/rootfs/swapfile bs=$(cat /proc/meminfo | awk '/MemTotal/ {print $2}') count=1024 conv=notrunc
|
||||
mkswap "${TempDir}"/rootfs/swapfile
|
||||
|
||||
Reference in New Issue
Block a user