Skip to content

Commit 32cf66b

Browse files
committed
add the capability to use 'nice' to avoid locking everything up during long compiles
1 parent 280834a commit 32cf66b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ manage-tools -s install gdb
140140
# install pwntools, but don't let it sudo install dependencies
141141
manage-tools install pwntools
142142

143+
# install qemu, but use "nice" to avoid degrading performance during compilation
144+
manage-tools -n install qemu
145+
143146
# uninstall gdb
144147
manage-tools uninstall gdb
145148

bin/manage-tools

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Usage: $(basename $0) [-sv] (list|setup|install|uninstall|bin|search) tool
1212
1313
Where:
1414
-s allow running things with sudo (i.e., to install debs)
15+
-n "nice" the installer to reduce background load
1516
-v verbose mode. print log while installing
1617
-f force certain actions (such as installing over an installed tool)
1718
tool the name of the tool. if "all", does the action on all (installed) tools
@@ -247,6 +248,9 @@ do
247248
-s)
248249
export ALLOW_SUDO=1
249250
;;
251+
-n)
252+
export NICE_LEVEL=10
253+
;;
250254
-f)
251255
export FORCE=1
252256
;;
@@ -264,6 +268,7 @@ done
264268
[[ -z ${ALLOW_SUDO+x} ]] && export ALLOW_SUDO=0
265269
[[ -z ${FORCE+x} ]] && export FORCE=0
266270
[[ -z ${VERBOSE_OUTPUT+x} ]] && export VERBOSE_OUTPUT=0
271+
[[ -z ${NICE_LEVEL+x} ]] && export NICE_LEVEL=0
267272
export EXPECTFAIL=${EXPECTFAIL:-0}
268273

269274
if [[ $# -ge 1 ]]; then
@@ -398,9 +403,9 @@ case $ACTION in
398403
# execute install script
399404
set +e
400405
if [ "$VERBOSE_OUTPUT" -eq 1 ]; then
401-
DISTRI=$DISTRI PATH=$CTF_TOOLS_ROOT/bin/:$PATH ./install 2>&1 | tee -a install.log
406+
DISTRI=$DISTRI PATH=$CTF_TOOLS_ROOT/bin/:$PATH nice -n$NICE_LEVEL ./install 2>&1 | tee -a install.log
402407
else
403-
DISTRI=$DISTRI PATH=$CTF_TOOLS_ROOT/bin/:$PATH ./install >>install.log 2>&1
408+
DISTRI=$DISTRI PATH=$CTF_TOOLS_ROOT/bin/:$PATH nice -n$NICE_LEVEL ./install >>install.log 2>&1
404409
fi
405410
INSTALL_FAILED=$?
406411
set -e

0 commit comments

Comments
 (0)