Move all build and run output to out/$arch/

Most of it was present inside buildroot/output.* and the rest scattered
on top level.

This came about for the n-th time when we were reviewing QEMU trace file
locations.

On one hand, it would be cool to have per arch traces.

This made buildroot/output.${arch}~/ a natural choice.

But on the other, those traces have nothing to do with Buildroot,
and could potentially interfere with Buildroot build files.

It also feels nicer to have buildroot/ pristine source code only,
and keep all output under a single directory out/
This commit is contained in:
Ciro Santilli
2018-03-28 23:57:37 +01:00
parent 01a84e7f79
commit 9fd72c786f
12 changed files with 137 additions and 132 deletions

33
run
View File

@@ -90,6 +90,7 @@ done
shift "$(($OPTIND - 1))"
extra_flags="$extra_flags $@"
set_common_vars "$arch" "$gem5"
images_dir="${buildroot_out_dir}/images"
if "$debug" && "$kvm"; then
echo 'error: -d and -K are incompatible' 1>&2
exit 1
@@ -117,29 +118,27 @@ if [ -n "$extra_append_after_dash" ]; then
fi
if "$gem5"; then
build_dir="${out_dir}/build/gem5-1.0"
gem5_build_dir="${buildroot_out_dir}/build/gem5-1.0"
gem5_src_dir="${gem5_build_dir}/gem5"
memory="${memory}B"
gem5_dir="${build_dir}/gem5"
if [ "$arch" = x86_64 ]; then
gem5_arch=X86
else
gem5_arch=ARM
fi
m5out_dir="${root_dir}/m5out"
gem5_cpt_dir="${m5out_dir}/cpts/${arch}"
mkdir -p "$gem5_cpt_dir"
m5out_dir="${gem5_out_dir}/m5out"
gem5_common="\
M5_PATH='${build_dir}/system' \
$debug_vm \
'${gem5_dir}/build/${gem5_arch}/gem5.opt' \
M5_PATH='${gem5_build_dir}/system' \
${debug_vm} \
'${gem5_src_dir}/build/${gem5_arch}/gem5.opt' \
${gem5opts} \
'${gem5_dir}/configs/example/fs.py' \
--checkpoint-dir='${gem5_cpt_dir}' \
--disk-image='${out_dir}/images/rootfs.ext2' \
--kernel='${out_dir}/build/linux-custom/vmlinux' \
-d '${m5out_dir}' \
'${gem5_src_dir}/configs/example/fs.py' \
--disk-image='${images_dir}/rootfs.ext2' \
--kernel='${buildroot_out_dir}/build/linux-custom/vmlinux' \
--mem-size=${memory} \
--num-cpus='${cpus}' \
--script='${m5out_dir}/myreadfile' \
--script='${root_dir}/readfile.gitignore' \
"
if [ "$arch" = x86_64 ]; then
if "$kvm"; then
@@ -155,7 +154,7 @@ ${extra_flags} \
# Anything smaller than physical blows up as expected, but why can't it auto-detect the right value?
cmd="${gem5_common} \
--command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 rw loglevel=8 mem=${memory} root=/dev/sda ${extra_append}' \
--dtb-file='${gem5_dir}/system/arm/dt/$([ "$arch" = arm ] && echo "armv7_gem5_v1_${cpus}cpu" || echo "armv8_gem5_v1_${cpus}cpu").dtb' \
--dtb-file='${gem5_src_dir}/system/arm/dt/$([ "$arch" = arm ] && echo "armv7_gem5_v1_${cpus}cpu" || echo "armv8_gem5_v1_${cpus}cpu").dtb' \
--machine-type=VExpress_GEM5_V1 \
${extra_flags} \
"
@@ -167,15 +166,15 @@ else
extra_flags="${extra_flags_qemu} ${extra_flags}"
qemu_common="\
${debug_vm} \
'${out_dir}/host/usr/bin/qemu-system-${arch}' \
'${buildroot_out_dir}/host/usr/bin/qemu-system-${arch}' \
-gdb tcp::1234 \
-m ${memory} \
-monitor telnet::45454,server,nowait \
-netdev user,hostfwd=tcp::45455-:45455,hostfwd=tcp::45456-:22,id=net0 \
-smp ${cpus} \
-trace enable=${trace_enable},file='${lkmc_out_dir}/trace.bin' \
-trace enable=${trace_enable},file='${qemu_out_dir}/trace.bin' \
-virtfs local,path=9p,mount_tag=host_scratch,security_model=mapped,id=host_scratch \
-virtfs local,path=${out_dir}/build,mount_tag=host_out,security_model=mapped,id=host_out \
-virtfs local,path=${buildroot_out_dir}/build,mount_tag=host_out,security_model=mapped,id=host_out \
"
if "$initrd"; then
extra_flags="${extra_flags} -initrd '${images_dir}/rootfs.cpio'"