mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
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:
15
rungdb-user
15
rungdb-user
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user