Skip to content

Commit

Permalink
Show correct reason about omit tmpfs usage if FORCE_USE_RAMDISK is set
Browse files Browse the repository at this point in the history
  • Loading branch information
iav authored and igorpecovnik committed Mar 8, 2024
1 parent b798458 commit dfab067
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/functions/rootfs/trap-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function prepare_rootfs_build_params_and_trap() {
declare use_tmpfs=no # by default
if [[ ${FORCE_USE_RAMDISK} == no ]]; then # do not use, even if it fits
display_alert "Not using tmpfs for rootfs" "due to FORCE_USE_RAMDISK=no" "info"
elif [[ ${FORCE_USE_RAMDISK} == yes || ${available_physical_memory_mib} -gt ${tmpfs_estimated_size} ]]; then # use, either force or fits
elif [[ ${FORCE_USE_RAMDISK} == yes ]]; then # use, either force or fits
use_tmpfs=yes
display_alert "Using tmpfs for rootfs build" "FORCE_USE_RAMDISK forced to \"yes\"" "info"
elif [[ ${available_physical_memory_mib} -gt ${tmpfs_estimated_size} ]]; then
use_tmpfs=yes
display_alert "Using tmpfs for rootfs build" "RAM available: ${available_physical_memory_mib}MiB > ${tmpfs_estimated_size}MiB estimated" "info"
else
Expand Down

0 comments on commit dfab067

Please sign in to comment.