aboutsummaryrefslogtreecommitdiff
path: root/tools/tools/kernxref
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-09-16 09:57:10 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-09-16 09:57:10 +0000
commitf4f9b36d573560858a9edc35506e7433820ca410 (patch)
tree6982f3266986a132ccb6f2bae3e8fdebd9bef0d3 /tools/tools/kernxref
parentab93c874b41e368ee0ad994b6e65d70b556c2a3f (diff)
downloadsrc-f4f9b36d573560858a9edc35506e7433820ca410.tar.gz
src-f4f9b36d573560858a9edc35506e7433820ca410.zip
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>
Notes
Notes: svn path=/head/; revision=103392
Diffstat (limited to 'tools/tools/kernxref')
-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 95e22dd31df5..21acbf4a1586 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 '