Kernel: config Specify machine type

I'm trying to optimize my GENERIC kernel in FreeBSD 8.1, I'm running it on an old Dell Dimension 4600, with an Intel P4. I backed up the GENERIC kernel and renamed the backup to FLAVEKERN1. When I try to build new optimized FLAVEKERN1 with the config command

config FLAVEKERN1

it spits out:

Code:
Specify machine type, e.g. "machine i386"

Can anyone point me in the direction of what I'm doing wrong? Am I misusing the config command? I'm in the directory of FLAVEKERN1 and logged in as root. Any help would be nice.
 
I don't see any usage of # config there.

Just # cp /usr/src/sys/i386/conf/GENERIC /usr/src/sys/i386/conf/FLAVEKERN1
# cd /usr/src
# make buildkernel KERNCONF=FLAVEKERN1
# make installernel KERNCONF=FLAVEKERN1 should work.

(Of course you should change something in new file and set new IDENT value there to make all this usefull)
 
The manual config way is the old way, but I think (IIRC) I'm using the "new" way since FreeBSD 4.5 (the handbook still might call it "the new way" for the last 10 years). You should be fine to copy your kernel config file to /usr/src/sys/ARCH/conf/ (where $ARCH = uname -m), then make buildkernel KERNCONF=YOURKERNELCONFIGFILE in /usr/src (assuming your kernel config file is ok). For your next question you may want to post that file too, so nobody has to do guesswork.

What I don't understand is, why folks write their own kernel config files and avoid using includes? Depending on your custom kernel config file needs, it might be easier to create a new (blank) file, include GENERIC and put some of your overwriting values in it and be good.

If you miss an important kernel change that requires a config file modification, you're safe to have GENERIC included (you aren't if you maintain your own config file). If you don't want to have something in your kernel, what GENERIC includes, use "nocpu", "nooption" or "nodevice" to exclude that. Using that, you can have a full blown kernel config file in two or three lines.
 
  • Thanks
Reactions: jef
vwe@ said:
What I don't understand is, why folks write their own kernel config files and avoid using includes? Depending on your custom kernel config file needs, it might be easier to create a new (blank) file, include GENERIC and put some of your overwriting values in it and be good.

The feature isn't well known. That's on my list of ideas for a short article, but I haven't done it yet.
 
Back
Top