Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jun 2002 20:29:36 +0200 (CEST)
From:      Nick Hibma <n_hibma@van-laarhoven.org>
To:        FreeBSD CURRENT Mailing List <current@FreeBSD.ORG>
Cc:        Nick Hibma <n_hibma@van-laarhoven.org>
Subject:   making make load work for /sys/modules/*
Message-ID:  <20020616201846.G1928-200000@heather.van-laarhoven.org>

index | next in thread | raw e-mail

[-- Attachment #1 --]

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
-- 
n_hibma@van-laarhoven.org                  http://www.van-laarhoven.org/
n_hibma@FreeBSD.org                        http://www.etla.net/~n_hibma/

[-- Attachment #2 --]
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)
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020616201846.G1928-200000>