Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Oct 2001 23:12:39 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Mark Peek <mark@whistle.com>
Cc:        Warner Losh <imp@harmony.village.org>, cjclark@alum.mit.edu, bmah@FreeBSD.ORG, Ruslan Ermilov <ru@FreeBSD.ORG>, Bruce Evans <bde@zeta.org.au>, Boris Popov <bp@FreeBSD.ORG>, freebsd-current@FreeBSD.ORG
Subject:   Re: kldxref broken, maybe? 
Message-ID:  <20011011061239.219EB3809@overcee.netplex.com.au>
In-Reply-To: <p05101006b7ea88b4696c@[207.76.207.129]> 

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Peek wrote:
> At 4:04 PM -0700 10/10/01, Peter Wemm wrote:
> >Warner Losh wrote:
> >>  In message <20011010144919.N387@blossom.cjclark.org> "Crist J. 
> >>Clark" writes:
> >>  : I think just running 'installworld' twice will "fix" it. The error is
> >>  : non-fatal, but not without implications. The only one that I am aware
> >>  : of is that your system might have some trouble doing kldload(8) unless
> >>  : it is given the full path of the module.
> >>
> >>  Ummm, installworld N times won't fix things because the modules are
> >>  are installed as part of installkernel.
> >>
> >>  This is a database that should be rebuilt at boot time too.
> >
> >Absolutely.  Any takers for a /etc/rc patch to break apart sysctl
> >kern.module_path by the ';' and do a ldconfig refresh at boot after the
> >filesystems are mounted?  In theory we just need the / filesystem
> >read/write.
> 
> Something like this?
> 
> script_save_sep=$IFS
> IFS=";"
> for modpath in `sysctl -n kern.module_path`; do
>      if [ -d $modpath ]; then
>          kldxref $modpath
>      fi
> done
> IFS="$script_save_sep"
> 
> I would have provided a patch to /etc/rc but I didn't know when you 
> would want it executed.

The conservative option would be to have it after all local disks were mounted
but before nfs was mounted.

Ie: just before, or just after the section marked:
 # Run custom disk mounting function here
Actually, just after I think.

The other school of thought is to run it right after the root fs mount,
but before "mount -a -t nonfs".  This has the advantage that various
filesystems (eg: msdosfs) will be found if the module file is in a strange
location.  But the disadvantage is that then you wouldn't be auto rebuilding
(say) /usr/local/modules/linker.hints if /usr and/or /usr/local were on
some other fs.

An alternative may be something along the lines of:

mount root

script_save_sep=$IFS
extramods=""
IFS=";"
for modpath in `sysctl -n kern.module_path`; do
     if [ -d $modpath ]; then
         kldxref $modpath
     else
	 extramods="$extramods $modpath"
     fi
done
IFS="$script_save_sep"

mount -a -t nonfs

for modpath in $extramods; do
     if [ -d $modpath ]; then
         kldxref $modpath
     else
	 extramods2="$extramods2 $modpath"
     fi
done

... rest of stuff including nfs mounts...

for modpath in $extramods2; do
     if [ -d $modpath ]; then
         kldxref $modpath
     fi
done

This is probably overkill, but should cover all the possibilities. (and
could do with some cleanup)

> Mark
> 
> 

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"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 freebsd-current" in the body of the message




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