From owner-cvs-all Tue May 21 16:49:14 2002 Delivered-To: cvs-all@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id 47A6B37B40E; Tue, 21 May 2002 16:49:04 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4LNn3130999; Tue, 21 May 2002 16:49:03 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id DA22F380A; Tue, 21 May 2002 16:49:02 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Brian Somers Cc: John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Makoto Matsushita Subject: Re: cvs commit: src/sys/i386/i386 userconfig.c In-Reply-To: <200205211504.g4LF4plr006616@hak.lan.Awfulhak.org> Date: Tue, 21 May 2002 16:49:02 -0700 From: Peter Wemm Message-Id: <20020521234902.DA22F380A@overcee.wemm.org> 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 Brian Somers wrote: > > On 21-May-2002 Brian Somers wrote: > > >> > > >> jhb> Compile in the 'intro' command if VISUAL_USERCONFIG is > > >> jhb> specified not just for INTRO_USERCONFIG. This allows a > > >> jhb> userconfig script to use the 'intro' command to bring up the > > >> jhb> introduction kernel config screen which cdboot ISO's use. > > >> > > >> Wonderful! > > >> > > >> jhb> The only downside for a cdboot ISO now is that when you boot up > > >> jhb> you get bogus error messages from kldloading the drivers in the > > >> jhb> mfsroot since the kernel modules are already present in GENERIC. > > >> > > >> I'm also same problem in my mind. Perhaps we can steal some codes > > >> (or logics) from ifmaybeload() at src/usr.sbin/ifconfig/ifconfig.c. > > > > > > Or perhaps src/usr.sbin/ppp/defs.c:loadmodules(). > > > > Maybe we need a generic function in libutil then to avoid duplicating > > this code. > > The problem is that the code would read something like: > > int > loadmodule(const char *module) > { > if (modfind(module) == -1) > return (kldload(module)); > return (0); > } This is actually inadequate. If you are looking for a specfic module, there is no guarantee that it is in the file that you load. You really need to check that the file load works and it yieled the correct module. eg: if (modfind("ccd") < 0) { /* Not present in kernel, try loading it */ if (kldload("ccd") < 0 || modfind("ccd") < 0) warn("ccd module not available!"); } Specifically, the second modfind() afterwards is necessary. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message