kernel compile error

Danny Pansters danny at
Sun Feb 29 09:57:25 PST 2004

[CC'd to -questions so that it gets archived]

On Sunday 29 February 2004 04:56, you wrote:
> > Never run "make world" literally. Run make buildworld, make kernel, make
> > installworld, mergemaster.
> >
> >> Or is it possible that my GENERIC file is wrong?
> >
> > Yes, you edited too much out. This is a FAQ:
> >> #device         scbus           # SCSI bus (required for SCSI)
> >> device          umass           # Disks/Mass storage - Requires scbus
> >> and
> i dont have any SCSI devices.  Is it still needed?  Can you give me
> specific instructions to clean my slate and start over from the
> buildworld part?

It's needed because USB disks work through the SCSI interface, that is as if 
they were SCSI disks.

> IS there a howto that is very detailed that you have?

The Handbook. Apart from that, for kernel options and devices you can look 
at /usr/src/sys/conf/NOTES for architecture independent stuff, 
and /usr/src/sys/i386/conf/NOTES for specific i386 kernel options and other 
knobs. In 4.x this used to be the LINT file.

> btw, i did the thing the other guy said to do....
> cd /usr/src/sys/i386/conf/
> edited GENERIC file
> couldn't find
> cd ../compile/GENERIC [i typed it as you wrote, didnt work, so i went into
> ../compile and #ls but no files....

This is often (wrongly) referred to as "the old method" to build a kernel. 
You'll use configure, make depend, make install if you want to compile a 
custom kernel against your installed version ("world") of FreeBSD. 

The often (wrongly) called "new method" is make kernel KERNCONF=BLAH 
from /usr/src. Now you are building a kernel against what's in your object 
tree (/usr/obj). Normally it will be have been populated when you did a make 
buildworld. You're going to install that version (world) later on, so you'll 
want a kernel that is built against this "future world" and with its 
toolchain. The difference seems subtle, but if you don't do this, you may 
find yourself with an unbootable kernel after you've run installworld, or a 
kernel that boots but a userland that gives you nothing but coredumps if it 
doesn't panic at init right away.

Of course you can have a situation in which your object tree holds the same 
"world" that you're currently running and it is in that case and in that case 
only that you can safely use either method to build a custom kernel. 

To be fair, you can get away with using the wrong kernel build method if 
there's only minor differences between the currently installed and the newly 
built worlds if you're lucky but still it may cause certain quirks and 
instabilities that are quite impossible to pin down. Things like seemingly 
random panics or reboots that never get explained.

> so i went into
> #cd /usr/src and then
> make clean && make depend && make && make install

I think this effectly translates to running "make world".

> and it worked out.  could i work with that??  or should i do a clean slate
> reinstall?

Well, I wouldn't recommend making it into a habit but if you got your bootable 
system with kernel and world from the same codebase ("in sync" as they say) 
and it runs OK, then just stick with it.

Please note that if all you want is to rebuild your kernel without updating 
FreeBSD itself, you don't have to cvsup or make world at all. Just use the 
so-called "old method". Also, in that case you only need the kernel source 
which you can simply extract from your install CD manually or with 

FreeBSD kernels are not versioned, the whole FreeBSD OS is. Cvsup and building 
world is moving to another version and in that case the kernel you build 
while going through your updating procedure should match that OS version. 
With Linux, the kernel *is* seperately versioned and the rest of a 
distribution can be considered something like our ports. So it's different 
concepts and it seems to never cease confusing the heck out of people :)



More information about the freebsd-questions mailing list