mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
bsdinstall: Emit a warning if the system has too little memory
PR: 251993 Reviewed by: adrian Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50944
This commit is contained in:
parent
be7272d78a
commit
eb5884c564
1 changed files with 8 additions and 0 deletions
|
|
@ -178,6 +178,14 @@ environment_save
|
|||
rm -rf $BSDINSTALL_TMPETC
|
||||
mkdir $BSDINSTALL_TMPETC
|
||||
|
||||
# With pkgbase, pkg OOM has been observed with QEMU-default 128 MiB memory size.
|
||||
# Ensure we have at least about 256 MiB (with an allowance for rounding etc.).
|
||||
physmem=$(($(sysctl -n hw.physmem) / 1048576))
|
||||
if [ $physmem -lt 200 ]; then
|
||||
bsddialog --backtitle "$OSNAME Installer" --title "Warning" \
|
||||
--msgbox "Insufficient physical memory (${physmem} MiB) detected. At least 256 MiB is recommended. The installer or installed system may not function correctly." 0 0
|
||||
fi
|
||||
|
||||
[ -f /usr/libexec/bsdinstall/local.pre-everything ] && f_dprintf "Running local.pre-everything" && sh /usr/libexec/bsdinstall/local.pre-everything "$BSDINSTALL_CHROOT"
|
||||
|
||||
trap true SIGINT # This section is optional
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue