tarballed
August 21st, 2002, 19:34
Hello everyone. Back with some more questions.
As I patch my OpenBSD 3.1 box i'm learning more and more how the paches work and I understand a bit better on the kernel.

Here is where I am at so far. As I read the errata for the patches, I noticed that some require a "Rebuild of the Kernel." Fair enough. To this point, their are 3 patches that require a rebuild of the kernel: 2, 9 and 14 (I believe)

First question is, do I need to rebuild the kernel after each patch that requires a rebuild? Or, can I do all the patches and then rebuild the kernel after the last patch, #14?

Second question is in regards to rebuilding the kernel in general. Here is a quick snip from the FAQ:

# cd /somewhere
# cp /usr/src/sys/arch/$ARCH/conf/SOMEFILE .
# vi SOMEFILE (to make the changes you want)
# config -s /usr/src/sys -b . SOMEFILE

I understand all of this for the most part. However, im a little confused on some parts.

Second line: cp /usr/src/sys/arch/i386/conf/SOMEFILE
Im confused on the SOMEFILE...
Anyone care to elaborate on what exactly that means? That is where im confused. Once I have that figured out, I can then proceed with the rest of the rebuild as the next couple of lines rely on SOMEFILE.

Thats about it at this moment. That is where I am confused.

Thanks everyone. I appreciate your help.

Tarballed

elmore
August 21st, 2002, 19:47
OK don't make this harder than it has to be. Rebuilding a kernel is easy, easy. It just sounds advanced.

patch the kernel source. Run all three patches then rebuild. No need to rebuild each time, that's counter-productive.

SOMEFILE refers to the filename of your kernel. In your case some file refers to GENERIC.

You really don;t need to edit it at this point, uless you are adding/removing functionality from the kernel. Your just patching so all you need to do is compile it. so really all you need to do is this:



cd /usr/src/sys/arch/i386/conf
config GENERIC
cd ../../compile/GENERIC
make
make depend
make install
reboot




Have fun with your new patched kernel

tarballed
August 21st, 2002, 19:57
Ta da!

elmore comes through again. :)

Thanks elmore. I guess what I do some times is that I want to understand so much of whats going on, that sometimes I look into something to much. Over analyzing I guess. :shock:

Anyways, i'll let you know how it goes tonight...should be a piece of cake.

tarballed

frisco
August 21st, 2002, 20:11
cd ../../compile/GENERIC


should be
cd ../compile/GENERIC

elmore
August 21st, 2002, 20:16
oops got a little over zealous with the 'ole ../'s

they are fun to type

tarballed
August 22nd, 2002, 11:53
Back again. :D

Basically, my questions revolve around actually editing the kernel. From what i've read and from what people have posted, their does not seem to be a whole lot of editing of the GENERIC kernel.

Basically, it just seems that the kernel is rebuilt and that's it.

I guess my question is: 1) Is it necessary to even edit the GENERIC kernel

2) From reading forums and mailing list, it seems that its not generally liked if you edit a kernel, then post with problems.

In a nutshell, the command config ./GENERIC would just configure and compile a new Kernel with nothing major done, correct? ( I skipped appropriate steps ahead like cd and cp)

Just more curious then anything. Reason I ask is that I've compiled kernels in Linux and it was almost like: "Here's your kernel and sources, edit to your heart's desire," sort a speak.

More curious then anything.

Thanks everyone.

Tarballed

elmore
August 22nd, 2002, 12:13
For your purposes there is no reason to edit the GENERIC kernel. It comes suitable for a firewall. Just patch the source recompile and go. Later on once you have a little better understanding of OBSD you might want to *SLIM* the kernel down, see minion's dmassage how-to for that. For right now though I would just stick with the plain jane GENERIC kernel.

tarballed
August 22nd, 2002, 13:18
Sounds good.

Was more curious then anything else. I'll wait until openbsd and I get to know one another before I start editing the kernel. :twisted:

Thanks elmore

Tarballed

bsdjunkie
August 22nd, 2002, 13:32
Yeah, as a relative newbie i wouldnt mess with GENERIC, not at least if you want a shred of help from the obsd mailing lists. (never mind the fact that i was already using kernel mods like etherspoof and raw4all 8) ) Be careful if you do trim it down, removing one line but not another further below can have consequences as well.

mrkelly
August 25th, 2002, 12:19
Be careful if you do trim it down, removing one line but not another further below can have consequences as well.

This is why I preferred the linux kernel. Although rebuilding without editing is very easy.

frisco
August 25th, 2002, 13:12
This is why I preferred the linux kernel. Although rebuilding without editing is very easy.

Cool!! Let's start a flamefest!!

mrkelly
August 25th, 2002, 17:56
[quote:f3fbe95880="mrkelly"]This is why I preferred the linux kernel. Although rebuilding without editing is very easy.

Cool!! Let's start a flamefest!![/quote:f3fbe95880]

Oops ... That wasn't my intention. ;) I just think there are merits to having a "simple" configuration system.

bsdjunkie
August 25th, 2002, 19:37
I just think there are merits to having a "simple" configuration system.

You can edit the linux kernel the same way, just vi the config file ;)

IcePic
September 6th, 2002, 05:48
[quote:fd83918db1="frisco"][quote:fd83918db1="mrkelly"]This is why I preferred the linux kernel. Although rebuilding without editing is very easy.

Cool!! Let's start a flamefest!![/quote:fd83918db1]

Oops ... That wasn't my intention. ;) I just think there are merits to having a "simple" configuration system.[/quote:fd83918db1]
I dont get this. First of all, few really need to recompile GENERIC, since it already contains
all supported devices. Sure, if you want to swap on another disk or boot from raid, you need
to, but for everyone else (like 99.99%) there is no need to recompile at all.
Secondly, giving the linux "make menuconfig" to a new linux user is perhaps prettier, but I
wouldn't call it "easy". How many people haven't installed some redhat/whatever-dist, gotten
a kernel the know _nothing_ about, downloaded a new kernel when slashdot says 2.4.2323
is out and then started "make xconfig" and just gasped at all the weird options you never
even knew existed. Do I need atapiscsi emulation? usbfilesystem support if I own a Rio?
I takes several minutes to just press "next" for each page, and the config page will *NOT*
contain the defaults you are running with now, that's for sure.

The chance for this new kernel to be anything like the one he got from the default install
is something around 1% or less. To add to this confusion, RedHat sometimes ships a
different kernel from the one that you get if you download the kernel-source rpm that
goes with the dist, much to the fun and joy of all those external persons writing filesystems
and other kernel add-ons that get endless support nightmares from people having one
kernel that doesn't match the kernel sources, from where the add-on must get its info
from.

In that perspective, having an "easy configuration" is worth less than nothing. Of course
its more fun to click through the Tcl/Tk interface than reading BSD configfiles in vi/mg,
but boy, the difficult part isn't in the configuration. It's in the realisation of when you need
to edit something or not.
In BSD, you seldom need to. In the cases where a newer kernel is required, most people
can wait one day and pick the kernel from the snapshot directories instead, since most
everyone run x86 anyway and those snapshots are built all the time. If you happen to
run sparc64, alpha, mvme88k or something else, you probably wont feel that the config
part of making a new kernel is the hardest thing.

elmore
September 6th, 2002, 09:33
Of course if you're interested in applying any of the 3.1 patches, you'd better learn how-to recompile a kernel then shouldn't you. Which was what this thread was all about to begin with. Your points are well taken however. ;)

tarballed
September 6th, 2002, 11:38
Of course if you're interested in applying any of the 3.1 patches, you'd better learn how-to recompile a kernel then shouldn't you. Which was what this thread was all about to begin with

Ya, exactly the reason I started this thread. :)

After some great help from elmore and bsdjunkie, recompiling the BSD kernel was a snap. Much easier in my opinions compared to Linux (Not trying to start a flame war)

It asked questions regarding recompiling the kernel due to what elmore stated: if you're interested in applying any of the 3.1 patches

Thats why I learned. :)

Tarballed

P.S. Im back! Let the posts begin!! :) hehe

elmore
September 6th, 2002, 11:46
why is it all of your posts have multple pages? ;)

Nice to see you around the forums again.

frisco
September 6th, 2002, 13:14
Sure, if you want to swap on another disk or boot from raid, you need
to, but for everyone else (like 99.99%) there is no need to recompile at all.


for swap, you can specify different or multiple locations in /etc/fstab
/dev/wd1b none swap sw 0 0
no need to recompile kernel.

tarballed
September 6th, 2002, 14:52
why is it all of your posts have multple pages?


You know, I noticed that as well today. Not sure why that happens. :oops:

Guess I hold the lead at the moment for threads containing multiple pages. hehe

Tarballed

infinity
October 3rd, 2002, 13:07
Is it "necessary" to reboot the system after rebuilding my kernel?

|MiNi0n|
October 3rd, 2002, 14:15
YES!!!!