zip-img: create, zips all QEMU images

build-all: make gem5 rebuild optional

rootfs_post_image_script: prevent qemu-img from generating trace files
This commit is contained in:
Ciro Santilli
2018-04-10 23:24:42 +01:00
parent ca1ce45811
commit 4601aff344
5 changed files with 32 additions and 4 deletions

View File

@@ -3872,10 +3872,11 @@ cat ./out/arm/run.sh
Next, you will also want to give the relevant images to save them time. Zip the images with:
....
zip -r images.zip out/arm/buildroot/images
./build-all -G
./zip-img
....
and then upload that somewhere, e.g. GitHub release assets as in https://github.com/cirosantilli/linux-kernel-module-cheat/releases/tag/test-replay-arm
and then upload the `out/images-*.zip` file somewhere, e.g. GitHub release assets as in https://github.com/cirosantilli/linux-kernel-module-cheat/releases/tag/test-replay-arm
Finally, do a clone of the relevant repository out of tree and reproduce the bug there, to be 100% sure that it is an actual upstream bug, and to provide developers with the cleanest possible commands. For example as was done in this QEMU bug report: https://bugs.launchpad.net/qemu/+bug/1762179
@@ -3999,6 +4000,7 @@ BR2_TARGET_ROOTFS_EXT2=n
' >>.config
make olddefconfig
time env -u LD_LIBRARY_PATH make BR2_JLEVEL="$(nproc)"
ls -l output/images
....
Time: 11 minutes, 7 with full ccache hits. Breakdown: 47% GCC, 15% Linux kernel, 9% uclibc, 5% host-binutils. Conclusions:

View File

@@ -4,7 +4,18 @@ set -eux
# Will take forever from a clean repo, this is most useful
# after pulling the repository to do an incremental build
# then quickly test out all the setups.
gem5=true
while getopts G OPT; do
case "$OPT" in
G)
gem5=false
;;
esac
done
shift "$(($OPTIND - 1))"
for arch in x86_64 arm aarch64; do
./build -a "$arch" -klq
./build -a "$arch" -g -Gkl
if "$gem5"; then
./build -a "$arch" -g -Gkl
fi
done

1
common
View File

@@ -10,6 +10,7 @@ set_common_vars() {
out_arch_dir="${out_dir}/${arch_dir}"
buildroot_out_dir="${out_arch_dir}/buildroot"
build_dir="${buildroot_out_dir}/build"
images_dir="${buildroot_out_dir}/images"
host_dir="${buildroot_out_dir}/host"
gem5_out_dir="${out_arch_dir}/gem5"
m5out_dir="${gem5_out_dir}/m5out"

View File

@@ -4,5 +4,7 @@ cd "$images_dir"
f=rootfs.ext2
exe="${HOST_DIR}/bin/qemu-img"
if [ -f "$exe" ] && [ -f "$f" ]; then
"$exe" convert -f raw -O qcow2 "$f" "${f}.qcow2"
# TODO why does qemu-img produce traces?
# http://lists.nongnu.org/archive/html/qemu-discuss/2018-04/msg00019.html
"$exe" -T "pr_manager_run,file=/dev/null" convert -f raw -O qcow2 "$f" "${f}.qcow2"
fi

12
zip-img Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eu
# Ideally should be obtained from common.
# But the paths there are absolute, and get recorded by in zip.
# and generating relative paths seems hard:
# https://stackoverflow.com/questions/2564634/convert-absolute-path-into-relative-path-given-a-current-directory-using-bash
sha="$(git log -1 --format="%H")"
for arch in x86_64 arm aarch64; do
img_dir="out/${arch}/buildroot/images"
rm -f "${img_dir}/rootfs.ext2"
zip -r "out/images-${sha}.zip" "${img_dir}"
done