From owner-freebsd-current Sun Jun 16 21:14:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id B580D37B40E for ; Sun, 16 Jun 2002 21:14:18 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id OAA05652; Mon, 17 Jun 2002 14:14:10 +1000 Date: Mon, 17 Jun 2002 14:18:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nick Hibma Cc: FreeBSD CURRENT Mailing List Subject: Re: making make load work for /sys/modules/* In-Reply-To: <20020616201846.G1928-200000@heather.van-laarhoven.org> Message-ID: <20020617135321.S3207-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 16 Jun 2002, Nick Hibma wrote: > 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: > ... > After changing .CURDIR to .OBJDIR it selects the correct module > depending on whether it was created in the MAKEOBJDIR directory or not: > ... > Any objections to the attached patch? Any reason to wait for a system > makefiles guru? I patched this locally when the problem was first reported a year or two ago, but since I don't believe in modules and have only built a couple in the last year or two, this patch and nearby ones have not been tested much. %%% Index: kmod.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kmod.mk,v retrieving revision 1.124 diff -u -2 -r1.124 kmod.mk --- kmod.mk 14 May 2002 07:49:12 -0000 1.124 +++ kmod.mk 16 May 2002 19:15:55 -0000 @@ -278,11 +278,11 @@ .if !target(load) -load: ${PROG} - ${KMODLOAD} -v ${.CURDIR}/${KMOD}.ko +load: ${PROG} + ${KMODLOAD} -v ${.OBJDIR}/${PROG} .endif .if !target(unload) unload: - ${KMODUNLOAD} -v ${KMOD} + ${KMODUNLOAD} -v ${PROG} .endif %%% This bug is related to the full brokenness of the kernel's search for modules. The path was originally simply ${KMOD} (/sbin/modload -o ${KMOD}) imp committed my change to ./${KMOD} in rev.1.79. I forget what this was for, but it may have been an attempt to prevent the path search. Perhaps it actually did that then. Next, the path was changed to ./${KMOD}.ko in rev.1.82. I'm not sure why that was necessary, since one of the misfeatures in the module seaching is appending ".ko", but it is good for the pathname to be complete. Next, the path was changed to ${.CURDIR}/${KMOD}.ko, to work around the full brokenness of the search (the search apparently doesn't recognize that a "./" prefix means an absolute path) and to completely break the usual ${.OBJDIR} != ${.CURDIR} case. Fixing this can't make things worse :-). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message