Re: Kernel Questions

Sean Kamath <[email protected]>
Newsgroups gmane.os.openbsd.sparc
Message-ID <[email protected]>
On Dec 25, 2008, at 9:03 AM, Dave Wilson wrote:

> Allen wrote:
>> I'm using a u5 as a firewall, dns among other things. I want to  
>> learn more
>> about working with the kernel. I have anonymous CVS set up. What I  
>> think I
>> need at this point is information on how to tweek the kernel. All I  
>> really
>> want to do for now is to only have what's necessary that I will  
>> commonly use
>> in the kernel. As far as I know this may already be done, I still  
>> want to be
>> able to identify how to do this.
>>
>> I have a couple scripts that I use to update my CVS, build and move  
>> kernel
>> and build all new binaries.
>>
>> I need direction to resources that will explain working with these  
>> sources?
>> Thank you.
>>
>>
>
> Allen,
>
> with the best will in the world, the correct answer to this one is
> "don't". See http://www.openbsd.org/faq/faq5.html#Why for more info on
> this. In a nutshell, the developers spend inordinate amounts of time  
> on
> building kernels which have the best combination of device support and
> detection in them; unless you *really* need the space, I'd leave it to
> them. My experience of these lists is that the developers will tell  
> you
> much the same.
>
> That said, if you're set on poking around with your kernel, I would
> suggest that before you start on custom kernel compiles, you  
> experiment
> with config(8), which can be used to modify a stock kernel to turn off
> drivers and systems within the kernel which you don't feel you need. I
> haven't done it myself, but I uspect that doing so will speed your  
> boot
> times, which is more likely to be what you're after rather than
> shrinking the MB the kernel takes up. If you later decide that you
> really truly honestly want to muck around with the compile, take a  
> look
> in /usr/src/sys/arch/$YOURARCH/conf/GENERIC. Good luck to you, and  
> feel
> free to keep both halves when it breaks.


I have a Sun IPX that's got a Cycle 5 motherboard with a Fujitsu  
170MHz turbosparc processor in it, so it looks like a Sun4m, even  
though it's got some Sun4c bits.  So I compiled my own kernels for  
about two years (yeah, it's about 18 years old, I guess) since if I  
used the sun4m kernel, I'd have stuff in the kernel that wasn't on the  
machine.  And of course it won't boot on a sun4c kernel.

Anyway, it got to a point where I just didn't care, as boot times were  
no faster, and it's not like it fills up log files saying it couldn't  
find stuff.

The last time I built custom kernel bits was when NFS was taken out of  
the RAMDISK kernel.  But when all the NFS bits were taken out of the  
miniroot, I just said screw it and now use FTP for installs (I may put  
it all back some day, but I have other priorities).

In a nutshell, there's very little reason to modify the GENERIC kernel  
these days.  Even 10 years ago there were only a few kernel configs  
you might want to tweak, like MAXUSERS, but that's all pretty much  
irrelevant now.  So unless you want to start working on device drivers  
or other kernel code, I wouldn't bother.  But you did say you wanted  
to learn about working with the kernel.  So if you're interested in  
learning how it works at a very deep and technical level, have at it,  
but be prepared to pooch the entire system if you make a mistake. :-S

Having said that, I do have scripts to sync CVS, compile the system,  
blah blah blah, and create a new distribution.  Allows me to keep a  
local copy of patched stable so I can rebuild my firewall (on a  
different machine than the build machine) without having to suck bits  
over the internet.  Plus, it's fun to make that little box cvs up and  
compile for 2.5 days. :-)

Sean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.