Disable networking at runtime with lkmc_nonet cli instead of build

This is necessary because qemu and gem5 now use the same build folder.

Separate ./run -e and -f for kernel options before and after the ' - '.
This was already the better thing to do when -E was introduced,
but lkmc_nonet prompted me to do it nicer now.

Use the common script to find the out_dir on every toplevel script.

Include usage man pages on README.
This commit is contained in:
Ciro Santilli
2018-03-22 02:39:37 +00:00
parent 60b9e56038
commit 29908dffb2
13 changed files with 160 additions and 84 deletions

View File

@@ -1,12 +1,17 @@
#!/usr/bin/env bash
set -e
set -eu
. common
usage="$0 <exec-relative-path> [<brk-symbol>]"
arch='x86_64'
while getopts a:h OPT; do
gem5=false
while getopts a:gh OPT; do
case "$OPT" in
a)
arch="$OPTARG"
;;
g)
gem5=true
;;
h)
echo "$usage"
exit 0
@@ -22,9 +27,9 @@ if [ "$#" -gt 0 ]; then
else
brk=''
fi
buildroot_out_dir="$(pwd)/buildroot/output.${arch}~"
executable="${buildroot_out_dir}/build/${executable_rel}"
readelf="${buildroot_out_dir}/host/usr/bin/${arch}-linux-readelf"
set_common_vars "$arch" "$gem5"
executable="${out_dir}/build/${executable_rel}"
readelf="${out_dir}/host/usr/bin/${arch}-linux-readelf"
addr="$("$readelf" -h "$executable" | awk '/Entry/{ print $NF }' )"
ex="-ex \"add-symbol-file $executable $addr\""
# Twice because lx-symbols overrides our add-symbol-file commands.