Skip to content

Commit

Permalink
check the table is exist
Browse files Browse the repository at this point in the history
  • Loading branch information
linD026 committed Oct 5, 2024
1 parent de60e3c commit 13cb3f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .ci/build-n-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ function list_mod()
function run_mod()
{
# insert/remove twice to ensure resource allocations
( sudo insmod "examples/$1.ko" && sudo rmmod "$1" ) || exit 1
( sudo insmod "examples/$1.ko" && sudo rmmod "$1" ) || exit 1
( sudo insmod "examples/$1.ko" && sudo rmmod "$1" ) || ( echo "first $1" && exit 1 )
( sudo insmod "examples/$1.ko" && sudo rmmod "$1" ) || ( echo "second $1" && exit 1 )
#( sudo insmod "examples/$1.ko" && sudo rmmod "$1" ) || exit 1
}

function run_examples()
Expand All @@ -26,5 +27,7 @@ function run_examples()
done
}

table=`sudo cat /proc/kallsyms | grep "sys_call_table" | awk '{print $1}'`
build_example
( sudo insmod "example/syscall-steal.ko" --sym="$table" && sudo rmmod "syscall-steal" ) || exit 1
run_examples

0 comments on commit 13cb3f6

Please sign in to comment.