mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
run: factor out arm and aarch64
Make the generated command beautiful and perfect without any trailing whitespace. I have to review my life choices
This commit is contained in:
44
run
44
run
@@ -144,7 +144,7 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift "$(($OPTIND - 1))"
|
shift "$(($OPTIND - 1))"
|
||||||
extra_flags="$extra_flags $@"
|
extra_flags="${extra_flags}${@}"
|
||||||
OPTIND=1
|
OPTIND=1
|
||||||
if [ -n "$extra_opts" ]; then
|
if [ -n "$extra_opts" ]; then
|
||||||
while getopts b OPT $extra_opts; do
|
while getopts b OPT $extra_opts; do
|
||||||
@@ -209,7 +209,7 @@ ${gem5opts} \
|
|||||||
"
|
"
|
||||||
if "$gem5_fsbiglittle"; then
|
if "$gem5_fsbiglittle"; then
|
||||||
cmd="${gem5_common}\
|
cmd="${gem5_common}\
|
||||||
"${common_gem5_default_src_dir}/configs/example/arm/fs_bigLITTLE.py" \
|
"${common_gem5_default_src_dir}/configs/example/arm/fs_bigLITTLE.py" \\
|
||||||
--big-cpus=2 \\
|
--big-cpus=2 \\
|
||||||
--cpu-type=atomic \\
|
--cpu-type=atomic \\
|
||||||
--disk="${common_images_dir}/rootfs.ext2" \\
|
--disk="${common_images_dir}/rootfs.ext2" \\
|
||||||
@@ -251,8 +251,8 @@ ${extra_flags} \
|
|||||||
else
|
else
|
||||||
mkdir -p "$common_qemu_run_dir"
|
mkdir -p "$common_qemu_run_dir"
|
||||||
if [ -z "$debug_vm" ]; then
|
if [ -z "$debug_vm" ]; then
|
||||||
serial_monitor='-serial mon:stdio \
|
serial_monitor="-serial mon:stdio \\
|
||||||
'
|
"
|
||||||
else
|
else
|
||||||
serial_monitor=
|
serial_monitor=
|
||||||
fi
|
fi
|
||||||
@@ -260,7 +260,7 @@ else
|
|||||||
extra_flags="${extra_flags} -enable-kvm"
|
extra_flags="${extra_flags} -enable-kvm"
|
||||||
fi
|
fi
|
||||||
if "$kgdb"; then
|
if "$kgdb"; then
|
||||||
extra_flags_qemu="$extra_flags_qemu -serial 'tcp::${common_gdb_port},server,nowait' \\
|
extra_flags_qemu="${extra_flags_qemu}-serial 'tcp::${common_gdb_port},server,nowait' \\
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
if "$prebuilt"; then
|
if "$prebuilt"; then
|
||||||
@@ -311,7 +311,7 @@ ${vnc}"
|
|||||||
extra_flags="${extra_flags}-drive 'file=${common_qcow2_file},format=qcow2,if=${driveif}${snapshot}${rrid}' \\
|
extra_flags="${extra_flags}-drive 'file=${common_qcow2_file},format=qcow2,if=${driveif}${snapshot}${rrid}' \\
|
||||||
"
|
"
|
||||||
if [ -n "$rr" ]; then
|
if [ -n "$rr" ]; then
|
||||||
extra_flags="${extra_flags} \\
|
extra_flags="${extra_flags}\
|
||||||
-drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \\
|
-drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \\
|
||||||
-device ide-hd,drive=img-blkreplay \\
|
-device ide-hd,drive=img-blkreplay \\
|
||||||
"
|
"
|
||||||
@@ -339,40 +339,29 @@ ${qemu_common} \
|
|||||||
-M pc \\
|
-M pc \\
|
||||||
-append '${root} nopat ${extra_append}' \\
|
-append '${root} nopat ${extra_append}' \\
|
||||||
-device edu \\
|
-device edu \\
|
||||||
${extra_flags} \
|
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
arm)
|
arm|aarch64)
|
||||||
if "$kgdb"; then
|
if "$kgdb"; then
|
||||||
extra_append="${extra_append} kgdboc=ttyAMA0,115200"
|
extra_append="${extra_append} kgdboc=ttyAMA0,115200"
|
||||||
fi
|
fi
|
||||||
|
if [ "$common_arch" = arm ]; then
|
||||||
|
cpu=cortex-a15
|
||||||
|
else
|
||||||
|
cpu=cortex-a57
|
||||||
|
fi
|
||||||
cmd="\
|
cmd="\
|
||||||
${qemu_common}\
|
${qemu_common}\
|
||||||
-M virt \\
|
-M virt \\
|
||||||
-append '${root} ${extra_append}' \\
|
-append '${root} ${extra_append}' \\
|
||||||
-cpu cortex-a15 \\
|
-cpu "$cpu" \\
|
||||||
${virtio_gpu_pci}\
|
${virtio_gpu_pci}\
|
||||||
${extra_flags} \
|
|
||||||
"
|
|
||||||
;;
|
|
||||||
aarch64)
|
|
||||||
if "$kgdb"; then
|
|
||||||
extra_append="${extra_append} kgdboc=ttyAMA0,115200"
|
|
||||||
fi
|
|
||||||
cmd="\
|
|
||||||
${qemu_common} \
|
|
||||||
-M virt \\
|
|
||||||
-append '${root} ${extra_append}' \\
|
|
||||||
-cpu cortex-a57 \\
|
|
||||||
${virtio_gpu_pci} \
|
|
||||||
${extra_flags} \
|
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
mips64)
|
mips64)
|
||||||
if ! "$ramfs"; then
|
if ! "$ramfs"; then
|
||||||
root='root=/dev/hda'
|
root='root=/dev/hda'
|
||||||
extra_flags="${extra_flags} \
|
extra_flags="${extra_flags}-drive 'file=${common_qcow2_file},format=qcow2${snapshot}' \\
|
||||||
-drive 'file=${common_qcow2_file},format=qcow2${snapshot}' \\
|
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
cmd="\
|
cmd="\
|
||||||
@@ -380,7 +369,6 @@ ${qemu_common} \
|
|||||||
-M malta \\
|
-M malta \\
|
||||||
-append '${root} ${extra_append}' \\
|
-append '${root} ${extra_append}' \\
|
||||||
-cpu I6400 \\
|
-cpu I6400 \\
|
||||||
${extra_flags} \
|
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -392,9 +380,11 @@ if "$tmux"; then
|
|||||||
eval "./tmu ./rungdb -a '${common_arch} -L ${common_linux_variant}' -n ${common_run_id} ${tmux_args}"
|
eval "./tmu ./rungdb -a '${common_arch} -L ${common_linux_variant}' -n ${common_run_id} ${tmux_args}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
cmd="time ${cmd}"
|
cmd="time \\
|
||||||
|
${cmd}"
|
||||||
if [ -z "$debug_vm" ]; then
|
if [ -z "$debug_vm" ]; then
|
||||||
cmd="${cmd}\
|
cmd="${cmd}\
|
||||||
|
${extra_flags}\
|
||||||
|& tee >(ts -s %.s > ${common_termout_file})\
|
|& tee >(ts -s %.s > ${common_termout_file})\
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user