buster
February 22nd, 2007, 16:05
I generally stay away from kernel configuration, but I decided to patch my i386 based system (agp patch). However, I now have a question I hope someone can help me with?


I run OpenBSD 4.0 installed from an official DVD set.

On the default disc install the size of /bsd is 6046462.

I copied and extracted src.tar.gz from DVD3.

Before applying the kermel patches I decided to build the GENERIC kernel to ensure I was doing everything correctly.

I followed the instructions from the OpenBSD website and all seem to go well.

However, the size of my compiled /bsd is 6046430.

Can anyone tell me why the sizes don't match as I had expected they would???

Thanks.

molotov
February 22nd, 2007, 22:43
Hm, I know on some freebsd systems at least the GENERIC config doesnt generate an exact GENERIC kernel, but Im not sure if that can be the case on open. I would chalk it up to machine specific differences, or compiler settings.

Id be interested to see the exact commands they use to make the releases, I bet its in a cvs repo somewhere. When I get some time I might check it out.

Does your kernel boot and work properly? Also, if youre going to be compiling your own base be sure to apply the patches found at http://openbsd.com/errata.html if needed.

buster
February 23rd, 2007, 05:26
Thanks for the reply.

Both the CD kernel and my compiled kernel appear to work fine, and as noted the file size difference is only a few bytes.

I compiled GENERIC without applying any patches as I wanted to be sure I could generate exactly the same kernel.

I did wonder if it was machine specific etc but then if I am using the files/settings extracted from src.tar.gz on DISC3. Wouldn't you expect it to compile to the same file on any i386? I really know very little about how the compiler etc works.

Perhaps if anyone else running on i386 has a spare 5 minutes they could compile GENERIC and report what size they get for /bsd?

Many thanks.

bmw
February 24th, 2007, 17:43
Guys, when you compile a kernel, a number of strings that get compiled-in are dependent on things that can change, like the date/time and your user-id. Those changes can easily amount to a few bytes, which is what you are seeing here.

Don't sweat it! :-)

Here's a simple test to try: run strings(1) on your stock kernel and redirect it to a file ("stock"). Then run strings again on your custom kernel and save it to another file ("custom"). Now run "diff stock custom" and see what output you get.