From owner-cvs-all Wed Aug 8 20:19:56 2001 Delivered-To: cvs-all@freebsd.org Received: from green.bikeshed.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9E29637B401; Wed, 8 Aug 2001 20:19:48 -0700 (PDT) (envelope-from green@green.bikeshed.org) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.4/8.11.1) with ESMTP id f793JgS63297; Wed, 8 Aug 2001 23:19:47 -0400 (EDT) (envelope-from green@green.bikeshed.org) Message-Id: <200108090319.f793JgS63297@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Bruce Evans Cc: Brian Feldman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/conf kmod.mk In-Reply-To: Message from Bruce Evans of "Thu, 09 Aug 2001 00:42:25 +1000." <20010809001222.Y8028-100000@besplex.bde.org> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Aug 2001 23:19:39 -0400 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 Bruce Evans wrote: > 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? GDB, the only thing that really matters. > 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 I'm extremely unhappy with the state of kldload(8) and all this. It's so amazingly inconsistent... I can kldload ./file.ko, but not kldload file.ko, though those are both correct relative paths. kldload(8) should have absolutely no trouble checking the cwd for existence of a path before giving up. Why don't we just replace that search algorithm with one less broken? I'll do the work... -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message