diff --git a/lib/debootstrap.sh b/lib/debootstrap.sh index 862b7c7ce8..22358e07ad 100644 --- a/lib/debootstrap.sh +++ b/lib/debootstrap.sh @@ -36,10 +36,9 @@ debootstrap_ng() mkdir -p $SDCARD $MOUNT $DEST/images $SRC/cache/rootfs # stage: verify tmpfs configuration and mount - # default maximum size for tmpfs mount is 1/2 of available RAM - # CLI needs ~1.2GiB+ (Xenial CLI), Desktop - ~2.8GiB+ (Xenial Desktop w/o HW acceleration) - # calculate and set tmpfs mount to use 2/3 of available RAM - local phymem=$(( $(awk '/MemTotal/ {print $2}' /proc/meminfo) / 1024 * 2 / 3 )) # MiB + # CLI needs ~1.5GiB, desktop - ~3.5GiB + # calculate and set tmpfs mount to use 2/3 of available RAM+SWAP + local phymem=$(( (($(awk '/MemTotal/ {print $2}' /proc/meminfo) + $(awk '/SwapTotal/ {print $2}' /proc/meminfo))) / 1024 * 2 / 3 )) # MiB if [[ $BUILD_DESKTOP == yes ]]; then local tmpfs_max_size=3500; else local tmpfs_max_size=1500; fi # MiB if [[ $FORCE_USE_RAMDISK == no ]]; then local use_tmpfs=no elif [[ $FORCE_USE_RAMDISK == yes || $phymem -gt $tmpfs_max_size ]]; then