From owner-cvs-all Wed Aug 8 7:45:10 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id E963A37B403; Wed, 8 Aug 2001 07:44:57 -0700 (PDT) (envelope-from bde@zeta.org.au) 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 AAA23840; Thu, 9 Aug 2001 00:44:54 +1000 Date: Thu, 9 Aug 2001 00:42:25 +1000 (EST) From: Bruce Evans X-X-Sender: To: Brian Feldman Cc: , Subject: Re: cvs commit: src/sys/conf kmod.mk In-Reply-To: <200108081351.f78DpAv88221@freefall.freebsd.org> Message-ID: <20010809001222.Y8028-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 8 Aug 2001, Brian Feldman wrote: > green 2001/08/08 06:51:10 PDT > > Modified files: > sys/conf kmod.mk > Log: > In the KLD "load" make target, don't load using the "absolute" path of > "./foo.ko". Use "/full/path/foo.ko" instead so that when the path is > reported as being an absolute path to the "shared library", at least > it's not really a relative path. But "./foo.ko" is a relative path. What doesn't understand this? kldload(2) adds mostly-undocumented prefixes and suffixes to the path, so it is hard to tell exactly which file is unloaded, unlike for properly designed syscalls like open(2). The actual search in kern_linker.c:linker_search_path() seems to be: o If the path contains a slash, don't try anything else. o Otherwise: for each prefix in the kern.module_path sysctl tunable string for each suffix in fixed set { ".ko", "" } try the path with this prefix and suffix endfor endfor kldload(8) documents this superfically to the point of being mostly wrong. It says that "kld filename" converts the non-file name "filename" to the file name "filename.ko" and loads that. In particular, it says that ".ko" in the arg is an error. But actually, ".ko" in the arg is correct if and only if the arg doesn't contain a slash. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message