diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-09-21 11:40:36 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-10-06 08:51:47 +0300 |
commit | c9561d1a25f2aadf09e5bd6071338f544f39d3e8 (patch) | |
tree | 27cfcc56d765db5c6300cae374b6869ecbd1cf74 | |
parent | 9454eec70ff1e18d43dc4332da9acea9cb1fad35 (diff) | |
download | openembedded-core-contrib-c9561d1a25f2aadf09e5bd6071338f544f39d3e8.tar.gz |
build-perf-bisect: pre-check sudo permissions
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-x | build-perf-bisect.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/build-perf-bisect.sh b/build-perf-bisect.sh index 4dae07304c..d903e7dcf5 100755 --- a/build-perf-bisect.sh +++ b/build-perf-bisect.sh @@ -175,6 +175,17 @@ run_cmd () { fi } +check_sudo () { + # Check that we're able to run the needed commands as superuser + output=`echo 0 | sudo -n -k /usr/bin/tee /proc/sys/vm/drop_caches 2>&1` + if echo $output | grep -q "a password is required"; then + log "ERROR: insufficient sudo permissions. Fix this e.g. by putting <user> ALL = NOPASSWD: /usr/bin/tee /proc/sys/vm/drop_caches into sudoers file" + exit 255 + else + log "sudo permissions OK" + fi +} + do_sync () { run_cmd sync || exit 255 log "dropping kernel caches" @@ -314,6 +325,8 @@ echo CONNECTIVITY_CHECK_URIS = \"\" >> conf/local.conf # Do actual build log "TESTING REVISION $git_rev (#$git_rev_cnt), AVERAGING OVER $test_count TEST RUNS" +check_sudo + log "fetching sources" if [ -n "$build_target" ]; then run_cmd bitbake $build_target -c fetchall || exit 125 |