mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
run: fix extra flags after --
This commit is contained in:
12
run
12
run
@@ -47,7 +47,7 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
|
|||||||
;;
|
;;
|
||||||
d)
|
d)
|
||||||
debug=true
|
debug=true
|
||||||
extra_flags_qemu="$extra_flags_qemu -S \\
|
extra_flags_qemu="${extra_flags_qemu} -S \\
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
E)
|
E)
|
||||||
@@ -144,7 +144,6 @@ 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}${@}"
|
|
||||||
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
|
||||||
@@ -216,7 +215,6 @@ ${gem5opts}\
|
|||||||
--dtb "${common_gem5_system_dir}/arm/dt/armv8_gem5_v1_big_little_2_2.dtb" \\
|
--dtb "${common_gem5_system_dir}/arm/dt/armv8_gem5_v1_big_little_2_2.dtb" \\
|
||||||
--kernel="${common_vmlinux}" \\
|
--kernel="${common_vmlinux}" \\
|
||||||
--little-cpus=2 \\
|
--little-cpus=2 \\
|
||||||
${extra_flags}\
|
|
||||||
"
|
"
|
||||||
else
|
else
|
||||||
gem5_common="\
|
gem5_common="\
|
||||||
@@ -230,12 +228,11 @@ ${gem5_common}\
|
|||||||
"
|
"
|
||||||
if [ "$common_arch" = x86_64 ]; then
|
if [ "$common_arch" = x86_64 ]; then
|
||||||
if "$kvm"; then
|
if "$kvm"; then
|
||||||
extra_flags="$extra_flags --cpu-type=X86KvmCPU"
|
extra_flags="${extra_flags} --cpu-type=X86KvmCPU"
|
||||||
fi
|
fi
|
||||||
cmd="\
|
cmd="\
|
||||||
${gem5_common}\
|
${gem5_common}\
|
||||||
--command-line='earlyprintk=ttyS0 console=ttyS0 lpj=7999923 root=/dev/sda ${extra_append}' \\
|
--command-line='earlyprintk=ttyS0 console=ttyS0 lpj=7999923 root=/dev/sda ${extra_append}' \\
|
||||||
${extra_flags}\
|
|
||||||
"
|
"
|
||||||
elif [ "$common_arch" = arm ] || [ "$common_arch" = aarch64 ]; then
|
elif [ "$common_arch" = arm ] || [ "$common_arch" = aarch64 ]; then
|
||||||
# TODO why is it mandatory to pass mem= here? Not true for QEMU.
|
# TODO why is it mandatory to pass mem= here? Not true for QEMU.
|
||||||
@@ -244,7 +241,6 @@ ${extra_flags}\
|
|||||||
--command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 rw loglevel=8 mem=${memory} root=/dev/sda ${extra_append}' \\
|
--command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 rw loglevel=8 mem=${memory} root=/dev/sda ${extra_append}' \\
|
||||||
--dtb-file='${common_gem5_system_dir}/arm/dt/$([ "$common_arch" = arm ] && echo "armv7_gem5_v1_${cpus}cpu" || echo "armv8_gem5_v1_${cpus}cpu").dtb' \\
|
--dtb-file='${common_gem5_system_dir}/arm/dt/$([ "$common_arch" = arm ] && echo "armv7_gem5_v1_${cpus}cpu" || echo "armv8_gem5_v1_${cpus}cpu").dtb' \\
|
||||||
--machine-type=VExpress_GEM5_V1 \\
|
--machine-type=VExpress_GEM5_V1 \\
|
||||||
${extra_flags}\
|
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -382,6 +378,10 @@ 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
|
||||||
|
if [ -n "${1:-}" ]; then
|
||||||
|
extra_flags="${extra_flags}${@} \\
|
||||||
|
"
|
||||||
|
fi
|
||||||
cmd="time \\
|
cmd="time \\
|
||||||
${cmd}"
|
${cmd}"
|
||||||
if [ -z "$debug_vm" ]; then
|
if [ -z "$debug_vm" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user