At the moment 'make load' does not work in /sys/modules. The attached
patch fixes that by using .OBJDIR instead of .CURDIR as the absolute
path to find the module at:

heidi:toor# make
Warning: Object directory not changed from original /usr/src-current/sys/modules/umass
...
heidi:toor# make load
/sbin/kldload -v /usr/src-current/sys/modules/umass/umass.ko
Loaded /usr/src-current/sys/modules/umass/umass.ko, id=5
...
heidi:toor# make obj
/usr/obj/usr/src-current/sys/modules/umass created for 
/usr/src-current/sys/modules/umass
heidi:toor# make
...
heidi:toor# make load
/sbin/kldload -v /usr/src-current/sys/modules/umass/umass.ko
kldload: can't load /usr/src-current/sys/modules/umass/umass.ko: No such file or 
directory
*** Error code 1

Stop in /usr/src-current/sys/modules/umass.



After changing .CURDIR to .OBJDIR it selects the correct module
depending on whether it was created in the MAKEOBJDIR directory or not:

heidi:toor# make
Warning: Object directory not changed from original /usr/src-current/sys/modules/umass
...
heidi:toor# make load
/sbin/kldload -v /usr/src-current/sys/modules/umass/umass.ko
Loaded /usr/src-current/sys/modules/umass/umass.ko, id=5
...
heidi:toor# make obj
/usr/obj/usr/src-current/sys/modules/umass created for 
/usr/src-current/sys/modules/umass
heidi:toor# make
...
heidi:toor# make load
/sbin/kldload -v /usr/obj/usr/src-current/sys/modules/umass/umass.ko
Loaded /usr/obj/usr/src-current/sys/modules/umass/umass.ko, id=5



Any objections to the attached patch? Any reason to wait for a system
makefiles guru?

Nick
-- 
[EMAIL PROTECTED]                  http://www.van-laarhoven.org/
[EMAIL PROTECTED]                        http://www.etla.net/~n_hibma/
Index: kmod.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kmod.mk,v
retrieving revision 1.124
diff -u -r1.124 kmod.mk
--- kmod.mk     14 May 2002 07:49:12 -0000      1.124
+++ kmod.mk     16 Jun 2002 18:18:17 -0000
@@ -278,7 +278,7 @@
 
 .if !target(load)
 load:  ${PROG}
-       ${KMODLOAD} -v ${.CURDIR}/${KMOD}.ko
+       ${KMODLOAD} -v ${.OBJDIR}/${KMOD}.ko
 .endif
 
 .if !target(unload)

Reply via email to