| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. sh |
| 2 | ## SPDX-License-Identifier: BSD-3-Clause |
| 3 | |
| 4 | # This script allows us to capture all the commands run in the shell by the |
| 5 | # coreboot build. This is better than using 'make v=1' because it captures |
| 6 | # commands right from the beginning of the build, and sends the output of any |
| 7 | # command to the interactive shell. |
| 8 | |
| 9 | # To use, run: |
| 10 | # make SHELL="${PWD}/util/scripts/capture_commands.sh" |
| 11 | |
| 12 | REALSHELL=${REALSHELL:-sh} |
| 13 | OUTPUT_DIR=${TOP:-/tmp} |
| 14 | CAPTURE_FILE=${CAPTURE_FILE:-commands.txt} |
| 15 | |
| 16 | envscip-shell system . . env. echo "$*" | sedscip-shell system . . sed. 's/^-c '// >> "${OUTPUT_DIR}/${CAPTURE_FILE}" |
| 17 | "${REALSHELL}" "$@" |