mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
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:
@@ -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:
|
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
|
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
|
' >>.config
|
||||||
make olddefconfig
|
make olddefconfig
|
||||||
time env -u LD_LIBRARY_PATH make BR2_JLEVEL="$(nproc)"
|
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:
|
Time: 11 minutes, 7 with full ccache hits. Breakdown: 47% GCC, 15% Linux kernel, 9% uclibc, 5% host-binutils. Conclusions:
|
||||||
|
|||||||
13
build-all
13
build-all
@@ -4,7 +4,18 @@ set -eux
|
|||||||
# Will take forever from a clean repo, this is most useful
|
# Will take forever from a clean repo, this is most useful
|
||||||
# after pulling the repository to do an incremental build
|
# after pulling the repository to do an incremental build
|
||||||
# then quickly test out all the setups.
|
# 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
|
for arch in x86_64 arm aarch64; do
|
||||||
./build -a "$arch" -klq
|
./build -a "$arch" -klq
|
||||||
./build -a "$arch" -g -Gkl
|
if "$gem5"; then
|
||||||
|
./build -a "$arch" -g -Gkl
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
1
common
1
common
@@ -10,6 +10,7 @@ set_common_vars() {
|
|||||||
out_arch_dir="${out_dir}/${arch_dir}"
|
out_arch_dir="${out_dir}/${arch_dir}"
|
||||||
buildroot_out_dir="${out_arch_dir}/buildroot"
|
buildroot_out_dir="${out_arch_dir}/buildroot"
|
||||||
build_dir="${buildroot_out_dir}/build"
|
build_dir="${buildroot_out_dir}/build"
|
||||||
|
images_dir="${buildroot_out_dir}/images"
|
||||||
host_dir="${buildroot_out_dir}/host"
|
host_dir="${buildroot_out_dir}/host"
|
||||||
gem5_out_dir="${out_arch_dir}/gem5"
|
gem5_out_dir="${out_arch_dir}/gem5"
|
||||||
m5out_dir="${gem5_out_dir}/m5out"
|
m5out_dir="${gem5_out_dir}/m5out"
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ cd "$images_dir"
|
|||||||
f=rootfs.ext2
|
f=rootfs.ext2
|
||||||
exe="${HOST_DIR}/bin/qemu-img"
|
exe="${HOST_DIR}/bin/qemu-img"
|
||||||
if [ -f "$exe" ] && [ -f "$f" ]; then
|
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
|
fi
|
||||||
|
|||||||
12
zip-img
Executable file
12
zip-img
Executable 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
|
||||||
Reference in New Issue
Block a user