common: factor out common opts to all scripts

This commit is contained in:
Ciro Santilli
2018-08-14 00:27:55 +01:00
parent 0f5c5a9912
commit 63ec42f72f
14 changed files with 84 additions and 145 deletions

28
run
View File

@@ -34,11 +34,8 @@ trace_enabled=false
# just to prevent QEMU from emitting a warning that '' is not valid.
trace_type=pr_manager_run
vnc=
while getopts a:c:DdE:e:F:f:G:ghIiKkL:l:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
while getopts "c:DdE:e:F:f:G:hIiKkl:m:PRrT:U:uVX:x${common_getopts_flags}" OPT; do
case "$OPT" in
a)
common_arch="$OPTARG"
;;
c)
cpus="$OPTARG"
;;
@@ -67,9 +64,6 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:l:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
gem5opts="$OPTARG \\
"
;;
g)
common_gem5=true
;;
h)
cat build-usage.adoc 1>&2
exit
@@ -93,30 +87,15 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:l:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
#extra_append="$extra_append kgdbwait kgdboc=kbd"
kgdb=true
;;
L)
common_linux_variant="$OPTARG"
;;
l)
gem5_restore_last_checkpoint="${OPTARG}"
;;
M)
common_gem5_variant="$OPTARG"
;;
m)
memory="$OPTARG"
;;
N)
common_gem5_worktree="$OPTARG"
;;
n)
common_run_id="$OPTARG"
;;
P)
prebuilt=true
;;
Q)
common_qemu_variant="$OPTARG"
;;
R)
rr=replay
;;
@@ -127,9 +106,6 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:l:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
trace_enabled=true
trace_type="$OPTARG"
;;
t)
common_gem5_build_type="$OPTARG"
;;
U)
tmux_args="$OPTARG"
;;
@@ -147,7 +123,7 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:l:M:m:N:n:PQ:RrT:t:U:uVX:x OPT; do
"
;;
?)
exit 2
common_getopts_case "$OPT"
;;
esac
done