Save .log output files to out/arch/

This is cleaner as it removes yet another .gitignore rule and allows
for one command per arch.

This was prompted by the recent Docker patch creating files as root,
which then breaks future host runs.

Also separate all arguments by newlines. This:

- makes it much easier to minimize when reporting QEMU bugs
- shows the full command on the screen despite line wrapping being turned off
  by one of the annoying emulators, to be investigated.

The commands are not yet pristine, because:

- there are some leading spaces
- options not sorted

but it is already a huge improvement, and those operations are now be easy from Vim.

The general strategy is:

- end every variable containing a command with a newline
- when expanding such variables, don't add an extra newline
This commit is contained in:
Ciro Santilli
2018-04-08 16:55:06 +01:00
parent 21499559eb
commit 9e79b9b06f
5 changed files with 113 additions and 97 deletions

36
build
View File

@@ -5,7 +5,7 @@ set -- ${cli_build:-} "$@"
rm -f br2_cli.gitignore
touch br2_cli.gitignore
configure=true
config_fragments='br2'
config_fragments=br2
extra_make_args=
gem5=false
j="$(nproc)"
@@ -29,7 +29,8 @@ while getopts 'a:B:b:CGgj:hIiK:klp:qSv' OPT; do
configure=false
;;
G)
extra_make_args="$extra_make_args gem5-reconfigure"
extra_make_args="${extra_make_args} gem5-reconfigure \\
"
gem5=true
;;
g)
@@ -60,17 +61,20 @@ BR2_TARGET_ROOTFS_INITRAMFS=n
linux_kernel_custom_config_file="$OPTARG"
;;
k)
extra_make_args="$extra_make_args kernel_module-reconfigure"
extra_make_args="${extra_make_args} kernel_module-reconfigure \\
"
;;
l)
linux_reconfigure=true
extra_make_args="$extra_make_args linux-reconfigure"
extra_make_args="${extra_make_args} linux-reconfigure \\
"
;;
p)
post_script_args="$OPTARG"
;;
q)
extra_make_args="$extra_make_args host-qemu-reconfigure"
extra_make_args="${extra_make_args} host-qemu-reconfigure \\
"
;;
S)
qemu_sdl=
@@ -84,7 +88,7 @@ BR2_TARGET_ROOTFS_INITRAMFS=n
esac
done
shift $(($OPTIND - 1))
extra_make_args="$extra_make_args $@"
extra_make_args="${extra_make_args} $@"
set_common_vars "$arch" "$gem5"
config_file="${buildroot_out_dir}/.config"
case "$arch" in
@@ -173,15 +177,15 @@ cd "${buildroot_dir}"
#
# BR2_ options may be given on the command line here, and they do have direct "define" effects.
# But this is generally bad, as it skips the Kconfig mechanism, e.g. it does not set defaults properly.
cmd="time \
env \
-u LD_LIBRARY_PATH \
make \
O='${buildroot_out_dir}' \
HOST_QEMU_OPTS='--enable-debug --extra-cflags=-DDEBUG_PL061=1 --enable-trace-backends=simple ${qemu_sdl}' \
V='$v' \
${extra_make_args} \
all \
cmd="time \\
env \\
-u LD_LIBRARY_PATH \\
make \\
O='${buildroot_out_dir}' \\
HOST_QEMU_OPTS='--enable-debug --extra-cflags=-DDEBUG_PL061=1 --enable-trace-backends=simple ${qemu_sdl}' \\
V='${v}' \\
${extra_make_args} \
all \\
"
echo "$cmd" | tee "${root_dir}/build.log"
echo "$cmd" | tee "${out_arch_dir}/build.sh"
eval "$cmd"