From 36cf5b220e8b5f191342d13ed2d069d2bbca77d5 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 30 Mar 2010 10:01:09 +0200 Subject: [ptxdist] add option to modify scheduling priority (nice) Signed-off-by: Marc Kleine-Budde --- bin/ptxdist | 11 +++++++++++ scripts/libptxdist.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/ptxdist b/bin/ptxdist index 674ed1d3a..e8a33db9b 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -836,6 +836,9 @@ Options: --load-average=, -l try to limit load to + --nice=, -n run with reduced scheduling priority (i.e. nice) + (default = 10) + -k keep going. Continue as much as possible after an error. @@ -1299,6 +1302,14 @@ parse_first() --load-average=*) PTXDIST_LOADMFLAGS_INTERN="-l${arg#*=}" ;; + -n*) + PTX_NICE="${arg#*n}" + PTX_NICE="${PTX_NICE:-10}" + ;; + --nice=*) + PTX_NICE="${arg#*=}" + PTX_NICE="${PTX_NICE:-10}" + ;; -q|--quiet) PTXDIST_QUIET=1 ;; diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 8e12f8f55..6af6aaaa3 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -344,7 +344,7 @@ ptxd_make() { for lib in "${SCRIPTSDIR}/lib/ptxd_make_"*.sh; do source "${lib}" || ptxd_bailout "failed to source lib: ${lib}" done - "${PTXCONF_SETUP_HOST_MAKE}" \ + ${PTX_NICE:+nice -n ${PTX_NICE}} "${PTXCONF_SETUP_HOST_MAKE}" \ "${PTX_MAKE_ARGS[@]}" "${PTXDIST_PARALLELMFLAGS_EXTERN}" \ -f "${RULESDIR}/other/Toplevel.make" "${@}" || return } -- cgit v1.2.3