summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-09-16 09:57:10 +0000
committerphk <phk@FreeBSD.org>2002-09-16 09:57:10 +0000
commit698e63c0cd369ad3f18fbc67d4fe5f89814f1d4f (patch)
tree6982f3266986a132ccb6f2bae3e8fdebd9bef0d3 /tools
parent68a4af10a1006170c0077e2cddf97080be401047 (diff)
downloadFreeBSD-src-698e63c0cd369ad3f18fbc67d4fe5f89814f1d4f.zip
FreeBSD-src-698e63c0cd369ad3f18fbc67d4fe5f89814f1d4f.tar.gz
Pick up modules from the compile directory instead of /boot/kernel.
Allow the script to operate on any convenient kernel. Submitted by: "Matthew Emmerton" <matt@gsicomp.on.ca>
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/kernxref/kernxref.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/tools/kernxref/kernxref.sh b/tools/tools/kernxref/kernxref.sh
index 95e22dd..21acbf4 100644
--- a/tools/tools/kernxref/kernxref.sh
+++ b/tools/tools/kernxref/kernxref.sh
@@ -12,9 +12,18 @@
# This shellscript will make a cross reference of the symbols of the LINT
# kernel.
-COMPILEDIR=/sys/i386/compile
+COMPILEDIR=/sys/`uname -m`/compile
KERNELNAME=LINT
+if [ "x$1" != "x" ]; then
+ KERNELNAME=$1;
+fi
+
+if [ ! -d ${COMPILEDIR}/${KERNELNAME} ]; then
+ echo "Kernel $KERNELNAME does not exist in ${COMPILEDIR}!";
+ exit 1;
+fi
+
cd ${COMPILEDIR}/${KERNELNAME}
if file vers.o | grep -q ELF; then
OBJFORMAT=elf;
@@ -22,7 +31,9 @@ else
OBJFORMAT=aout;
fi
-OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o /boot/kernel/*.ko \
+MOD_OBJS=`find modules -name \*.ko`
+
+OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o $MOD_OBJS \
| tr ' ' '\012' \
| egrep -v '(aicasm|genassym)'` \
| tr : ' ' | awk '
OpenPOWER on IntegriCloud