diff --git a/utils/brmake b/utils/brmake index 70dfb6cdc8..4756016a0c 100755 --- a/utils/brmake +++ b/utils/brmake @@ -12,7 +12,13 @@ main() { start=${SECONDS} - ( exec 2>&1; unbuffer make "${@}"; ) \ + if [ -n "$BR2_DOCKER" ]; then + docker=("${0%/*}/docker-run") + else + docker=() + fi + + ( exec 2>&1; unbuffer "${docker[@]}" make "${@}"; ) \ > >( while read -r line; do printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}" done \ diff --git a/utils/readme.txt b/utils/readme.txt index b5862f1fb9..abff659d4f 100644 --- a/utils/readme.txt +++ b/utils/readme.txt @@ -7,6 +7,9 @@ brmake front of each line, redirects all of the build output to a file ("'br.log' in the current directory), and just outputs the Buildroot messages (those lines starting with >>>) on stdout. + To run this within a container using docker-run (see below), set + BR2_DOCKER=y in the environment, i.e. call it as + `BR2_DOCKER=y utils/brmake`. Do not run this script for interactive configuration (e.g. menuconfig) or on an unconfigured directory. The output is redirected so you will see nothing.