Small enhancements
This commit is contained in:
parent
64f5514ea0
commit
ed6d0d2d65
@ -36,14 +36,15 @@ debootstrap_ng()
|
||||
|
||||
# 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.2GiB+ (Xenial Desktop w/o HW acceleration)
|
||||
# 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
|
||||
if [[ $BUILD_DESKTOP == yes ]]; then local tmpfs_max_size=3200; else local tmpfs_max_size=1500; fi # 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
|
||||
local use_tmpfs=yes
|
||||
fi
|
||||
[[ -n $FORCE_TMPFS_SIZE ]] && phymem=$FORCE_TMPFS_SIZE
|
||||
|
||||
[[ $use_tmpfs == yes ]] && mount -t tmpfs -o size=${phymem}M tmpfs $SDCARD
|
||||
|
||||
|
||||
@ -127,6 +127,7 @@ create_board_package()
|
||||
IMAGE_TYPE=$IMAGE_TYPE
|
||||
BOARD_TYPE=$BOARD_TYPE
|
||||
INITRD_ARCH=$INITRD_ARCH
|
||||
KERNEL_IMAGE_TYPE=$KERNEL_IMAGE_TYPE
|
||||
EOF
|
||||
|
||||
# this is required for NFS boot to prevent deconfiguring the network on shutdown
|
||||
|
||||
Loading…
Reference in New Issue
Block a user