DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 24th August 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default Change for rc.lkm

An lkm is a loadable kernel module. These usually reside in /usr/lkm. For exmaple, the lkm pf.o must be loaded to use packet filter with the GENERIC kernel (without recompiling).

Generally, lkm's are loaded with modload(8). If you want modules automatically loaded at boot-time, they should be listed in /etc/lkm.conf. In lkm.conf(5) you specify for each module various parameters, such as modload options -d and -v, any postinstall script, and when in the boot process it should load.

Finally, the boot-time script /etc/rc.lkm checks lkm.conf and loads the modules requested there. Now to the point of all this . modload has an important flag -A kernel, which is used to resolve module references. The default kernel is "/netbsd", but if you're running a different kernel image and don't use the -A flag this could lead to a crash.

The problem is, I don't see a way to pass the "-A kernel" into the existing structure described above. In fact, ISTM it ought to be built-in by changing rc.lkm in a small way: replace

Code:
modload $flags $path
with something like

Code:
modload -A /$(/sbin/sysctl -n machdep.booted_kernel) $flags $path
This would put the running kernel filename into the modload command for each lkm to be loaded by rc.lkm.

Does this seem ok, or did I miss something?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Username Change ninjatux Off-Topic 3 24th March 2009 06:45 PM
Change CRT to LCD mfaridi FreeBSD General 19 9th September 2008 12:51 PM
change ttl value ecnalbya OpenBSD Security 18 23rd August 2008 12:46 PM
rpc.nfsd threads, how do i change them? NathanL FreeBSD General 2 11th July 2008 11:28 AM
Change the Size of a Slice kienjakenobi FreeBSD General 9 27th June 2008 03:01 PM


All times are GMT. The time now is 01:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick