From 6b92513eccaf33f5fcc5fd49af7cf70caf52b74f Mon Sep 17 00:00:00 2001 From: layman Date: Sun, 25 Nov 2018 02:03:47 +0100 Subject: [PATCH] buildCurrentSymlinkedKernel: use load average --- buildCurrentSymlinkedKernel.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildCurrentSymlinkedKernel.sh b/buildCurrentSymlinkedKernel.sh index d728212..bd0833f 100755 --- a/buildCurrentSymlinkedKernel.sh +++ b/buildCurrentSymlinkedKernel.sh @@ -11,6 +11,7 @@ cd "$SRC_TREE" || exit 1 if [[ ! -f $SRC_CONFIG ]] ; then NOCONFIG="1" fi + if [[ "$1" == "--force" ]] ; then FORCE="1" fi @@ -45,7 +46,8 @@ if [[ "$NOCONFIG" || "$FORCE" ]] ; then echo mounting boot if not yet mounted mount /boot 2> /dev/null - (make -j17 -l15 CC="ccache gcc" && make install && make modules_install) > "buildlog-$TIMESTAMP" || tail -n 20 "buildlog-$TIMESTAMP" + CORES="$(getconf _NPROCESSORS_ONLN)" + (nice make -j -l$((CORES-1)) CC="ccache gcc" && make install ; make modules_install) > "buildlog-$TIMESTAMP" || tail -n 20 "buildlog-$TIMESTAMP" GRUBMKONFIG="$(which grub2-mkconfig 2> /dev/null)" if [[ -z "$GRUBMKONFIG" ]] ; then @@ -68,6 +70,6 @@ if [[ "$NOCONFIG" || "$FORCE" ]] ; then fi - cd "${LWD}" || exit 1 +cd "${LWD}" || exit 1 emerge @module-rebuild