mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Build gem5 through buildroot
Oh, btw, also make it work, since the build was completely broken since the recent -K refactoring :0)
This commit is contained in:
24
run
24
run
@@ -74,13 +74,15 @@ buildroot_dir="${root_dir}/buildroot"
|
||||
out_dir="${root_dir}/buildroot/output.${arch_dir}~"
|
||||
|
||||
if "$gem5"; then
|
||||
gem5_dir="${root_dir}/gem5/gem5"
|
||||
build_dir="${out_dir}/build/gem5-1.0"
|
||||
gem5_dir="${build_dir}/gem5"
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
if "$kvm"; then
|
||||
extra_flags="$extra_flags --cpu-type=X86KvmCPU"
|
||||
fi
|
||||
cmd="\
|
||||
M5_PATH='${root_dir}/gem5/gem5-system' \
|
||||
M5_PATH='${build_dir}/system' \
|
||||
$debug_vm \
|
||||
'${gem5_dir}/build/X86/gem5.opt' \
|
||||
${gem5opts} \
|
||||
'${gem5_dir}/configs/example/fs.py' \
|
||||
@@ -92,7 +94,7 @@ $extra_flags \
|
||||
"
|
||||
elif [ "$arch" = arm ] || [ "$arch" = aarch64 ]; then
|
||||
cmd="\
|
||||
M5_PATH='${root_dir}/gem5/gem5-system' \
|
||||
M5_PATH='${build_dir}/system' \
|
||||
$debug_vm \
|
||||
'${gem5_dir}/build/ARM/gem5.opt' \
|
||||
${gem5opts} \
|
||||
@@ -102,7 +104,7 @@ ${gem5opts} \
|
||||
--dtb-file='${gem5_dir}/system/arm/dt/$([ "$arch" = arm ] && echo "armv7_gem5_v1_${cpus}cpu" || echo "armv8_gem5_v1_${cpus}cpu").dtb' \
|
||||
--kernel='${out_dir}/build/linux-custom/vmlinux' \
|
||||
--machine-type=VExpress_GEM5_V1 \
|
||||
--num-cpus=${cpus} \
|
||||
--num-cpus='${cpus}' \
|
||||
$extra_flags \
|
||||
"
|
||||
fi
|
||||
@@ -113,8 +115,8 @@ else
|
||||
extra_flags="${extra_flags_qemu} ${extra_flags}"
|
||||
images_dir="${out_dir}/images"
|
||||
qemu_common="\
|
||||
${debug_vm} \
|
||||
${out_dir}/host/usr/bin/qemu-system-${arch} \
|
||||
'${debug_vm}' \
|
||||
'${out_dir}/host/usr/bin/qemu-system-${arch}' \
|
||||
-m 128M \
|
||||
-monitor telnet::45454,server,nowait \
|
||||
-netdev user,hostfwd=tcp::45455-:45455,id=net0 \
|
||||
@@ -141,7 +143,7 @@ ${out_dir}/host/usr/bin/qemu-system-${arch} \
|
||||
-device edu \
|
||||
-device lkmc_pci_min \
|
||||
-device virtio-net-pci,netdev=net0 \
|
||||
-kernel ${images_dir}/bzImage \
|
||||
-kernel '${images_dir}/bzImage' \
|
||||
${extra_flags} \
|
||||
"
|
||||
;;
|
||||
@@ -157,8 +159,8 @@ ${extra_flags} \
|
||||
-M versatilepb \
|
||||
-append '$root $extra_append' \
|
||||
-device rtl8139,netdev=net0 \
|
||||
-dtb ${images_dir}/versatile-pb.dtb \
|
||||
-kernel ${images_dir}/zImage \
|
||||
-dtb '${images_dir}/versatile-pb.dtb' \
|
||||
-kernel '${images_dir}/zImage' \
|
||||
-serial stdio \
|
||||
$extra_flags \
|
||||
"
|
||||
@@ -172,7 +174,7 @@ $extra_flags \
|
||||
-append 'root=/dev/sda ${extra_append}' \
|
||||
-cpu cortex-a57 \
|
||||
-device virtio-net-device,netdev=net0 \
|
||||
-kernel ${images_dir}/Image \
|
||||
-kernel '${images_dir}/Image' \
|
||||
-nographic \
|
||||
-serial stdio \
|
||||
${extra_flags} \
|
||||
@@ -188,7 +190,7 @@ ${extra_flags} \
|
||||
-append 'root=/dev/hda ${extra_append}' \
|
||||
-cpu I6400 \
|
||||
-device pcnet \
|
||||
-kernel ${images_dir}/vmlinux \
|
||||
-kernel '${images_dir}/vmlinux' \
|
||||
-nographic \
|
||||
${extra_flags} \
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user