tarballed
August 16th, 2002, 23:52
Ok..as I grow to love *BSD, I have some questions regarding compiling a *BSD kernel.
I've yet to compile a *BSD kernel, however I have compiled Linux kernels.
Question is this: How similar are the two? I mean in Linux, you need to d/l the source to your /usr/src directory, backup your current kernel, untar the source, run make config/menu/xconfig, make dep, yada yada yada.
As I play more with my OpenBSD box, i'm wondering if im going to need to compile a new kernel with the new patches I will be installing.
Just wanted to get an idea on what a kernel compile is like on *BSD. :)
One last thing: Is openbsd.org, the FAQ probably the best place to find information on compiling a kernel?
Thanks everyone.
Tarballed
mrkelly
August 16th, 2002, 23:59
As I play more with my OpenBSD box, i'm wondering if im going to need to compile a new kernel with the new patches I will be installing.
There are three kernel patches at the moment.
Just wanted to get an idea on what a kernel compile is like on *BSD. :)
One last thing: Is openbsd.org, the FAQ probably the best place to find information on compiling a kernel?
I found it a little backward compared to the linux kernel build, but the FAQ does a good job of explaining it. It was easy enough for me to do, but awkward enough that I've put off two of the rebuilds.
bsdjunkie
August 17th, 2002, 00:53
the FAQ is the best place for this., its diff from the linux kernel, but actually easier in many regards since so much stuff works in GENERIC that you dont and shouldnt need to make changes to config unless you Absolutely know what your doing. This is one of those places where obsd mailing lists are so touchy, a non GENERIC kernel will get you flamed and thrown out :P
frisco
August 17th, 2002, 08:42
compiling an OpenBSD kernel is very different from a linux kernel, with the main difference being that you edit a config file instead of having a menu to do it.
Personally, i like it better - seems cleaner to me to edit a file instead of having another program edit a file for me.
That said, unless you need to squeeze out every bit of performance or you need to add functionality, dont bother editing (past being a learning experience, too). I used to edit my kernels to take things out, but it gets to be a hastle, once i add a scsi card, need to recompile kernel, add a tape drive, need to recompile kernel, different sound card, recompile, and then i realised GENERIC had support for almost everything i had added, if i had left it at GENERIC i would save myself a lot of time.
Now the only time i edit is to add options like RAID and NMBCLUSTERS, and to slim the kernel on my more challenged machines (the 486's running in 12mb RAM).
A note about custom kernels and the OpenBSD developers:
Do not expect support from the developers if you are running a custom kernel. Expect flames worthy of hell if you are running a custom kernel but do not mention this in your request. Expect bolts of lightning in your vicinity if you are running a custom kernel with IPF support.
If you are having trouble with a custom kernel, revert back to generic and try to reproduce the problems. If it's reproducible with GENERIC, great, send in a bug report with full ddb ps and trace output. If it isn't, then keep working at your custom config until you get the bug worked out.
You become a developer when editing your config file, so you provide yourself with support. Given the small size of OpenBSD dev team, they choose to support only one kernel - the GENERIC one, not your kernel with god knows what changes. Consider how difficult it would be to support all the different possibilities, particularly when you've already given someone a working version. "I set 'option BUFCACHEPERCENT=100' and can't boot" - yup, why would you do something so silly?
Still, if you are sure you need X option in your kernel (RAIDframe is great!), feel free to email for support, but be upfront about your changes and your reasons behind your changes.
Vile
October 2nd, 2003, 03:41
These two URLs are all you need for the basics.
http://www.openbsd.org/anoncvs.html
http://www.openbsd.org/stable.html
Here is what I do...
If you have extracted the source code already, just follow these 4 steps to get the latest -stable branch code
#export CVS_RSH="/usr/bin/ssh"
#export CVSROOT="anoncvs@rt.fm:/cvs"
--- If you are following the patch branch for 3.X
#cd /usr/src
#cvs -q up -rOPENBSD_3_X -Pd
To compile your new kernel:
#cd /usr/src/sys/arch/i386/conf
#/usr/sbin/config GENERIC
#cd /usr/src/sys/arch/i386/compile/GENERIC
#make clean && make depend && make
#cp /bsd /obsd
#cp bsd /bsd
#reboot
---To recompile your system binaries
#cd /usr/src
#rm -r /usr/obj/*
#make obj && make build