bisect-linux-boot-gem5 466 B

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