bisect: use current script directory to call other scripts

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-14 00:00:00 +00:00
parent 89bb810768
commit 85be87d71c
4 changed files with 12 additions and 10 deletions

View File

@@ -1,10 +1,11 @@
#!/usr/bin/env bash
# https://cirosantilli.com/linux-kernel-module-cheat#bisection
set -eu
./build-linux --clean "$@"
./build-linux "$@"
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
"${root_dir}/build-linux" --clean "$@"
"${root_dir}/build-linux" "$@"
set +e
./run --quit-after-boot "$@" || status=$?
"${root_dir}/run" --quit-after-boot "$@" || status=$?
# https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593
if [ "$status" -eq 125 ] || [ "$status" -gt 127 ]; then
status=1