mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
make.sh: Determine how much memory the build host has
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
3
make.sh
3
make.sh
@@ -65,6 +65,9 @@ mkdir $BASEDIR/log/ 2>/dev/null
|
||||
# Include funtions
|
||||
. tools/make-functions
|
||||
|
||||
# Get the amount of memory in this build system
|
||||
HOST_MEM=$(system_memory)
|
||||
|
||||
if [ -f .config ]; then
|
||||
. .config
|
||||
fi
|
||||
|
||||
@@ -60,6 +60,20 @@ WARN="\\033[1;35m"
|
||||
FAIL="\\033[1;31m"
|
||||
NORMAL="\\033[0;39m"
|
||||
|
||||
system_memory() {
|
||||
local key val unit
|
||||
|
||||
while read -r key val unit; do
|
||||
case "${key}" in
|
||||
MemTotal:*)
|
||||
# Convert to MB
|
||||
echo "$(( ${val} / 1024 ))"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < /proc/meminfo
|
||||
}
|
||||
|
||||
configure_build() {
|
||||
local build_arch="${1}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user