linux-bisect-boot-gem5 856 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
  3. while getopts "h${common_getopts_flags}" OPT; do
  4. case "$OPT" in
  5. h)
  6. echo "https://github.com/cirosantilli/linux-kernel-module-cheat#getvar" 2>&1
  7. exit
  8. ;;
  9. ?)
  10. common_getopts_case "$OPT"
  11. ;;
  12. esac
  13. done
  14. shift "$(($OPTIND - 1))"
  15. common_linux_variant=bisect
  16. common_setup
  17. cd "$common_root_dir"
  18. # We need a clean rebuild becuase rebuilds at different revisions:
  19. # - may fail
  20. # - may not actually rebuild all files, e.g. on header changes
  21. rm -rf "$(./getvar -a "$common_arch" -L "$common_linux_variant" linux_variant_dir)"
  22. ./build -a "$common_arch" -L "$common_linux_variant"
  23. status=0
  24. ./run -a "$common_arch" -E 'm5 exit' -L "$common_linux_variant" -g || status=$?
  25. if [ "$status" -eq 125 ] || [ "$status" -gt 127 ]; then
  26. status=1
  27. fi
  28. exit "$status"