kernel build - can't omit device

Hey all,

I've followed the steps in the handbook for building a custom kernel to the letter. It's pretty straight forward really. I'm not getting any errors either, so don't know what to look for in the forums.

The skinny is that even though I've specified my own MYKERNEL file with said devices commented out, they still get compiled, still show up in the kernel.

So, I make my own MYKERNEL config and comment out the line:

Code:
#device ...yada yada...

...save it then do a:

make buildkernel KERNELCONF=MYKERNEL

...wait for it...then:

make installkernel KERNEL=MYKERNEL

I reboot, it's fine all is well ...except the devices are still there!

if I do a:
strings KERNEL | grep <device>

...a whole lot of entries show up.

If I do a:
dmesg | grep <device>

...again, there it is.


Another note is that I'm trying to compile an amd64 arch. The handbook doesn't seem to mention anything but to edit the kernel config in the right arch, and I have.

Just to be sure it's using the right one, as a last ditch effort, I deleted every reference in any file to the device in the /usr/src. I also removed the i386 arch completely. And I also removed the GENERIC config ...all easy to get back after synching the source, just trying to test here.

But now when I try to compile, I get an:
Code:
ERROR: Missing kernel configuration file(s) (GENERIC).

Why would it be looking for GENERIC at all? Should it be looking for MYKERNEL?

So, is there any more complete guide to help with this or any steps missing to "omit" a device from the build that may not be indicated in the guide? Something to do with the amd64?

I've been on this project for 3 days now and it's gotten pretty frustrating.

thanks!
 
oh snap, figured it out, 2 things:

must use: TARGET_ARCH=amd64 in the both the build and install

typo: KERNELCONF= should be KERNCONF (bad var was just ignored and so I ended up with a GENERIC kernel)

Hope this helps others =)
 
Pfarthing6 said:
must use: TARGET_ARCH=amd64 in the both the build and install
This shouldn't be needed. Only if you were to build amd64 on a different architecture.
 
SirDice said:
This shouldn't be needed. Only if you were to build amd64 on a different architecture.

Hmm, maybe you're right. When the make built a GENERIC kernel the last few times, it did default to amd64. But I guess it didn't hurt either =)
 
Hint: copy GENERIC to some file open it and replace all "device" with "nodevice" and then replace back on only needed devices
that's ur new kernel config

make new kernel with

Code:
include         GENERIC
ident           YOURKERNELNAME
nomakeoption   DEBUG
makeoptions     NO_MODULES
or
makeoptions    MODULES_OVERRIDE="modulename ... ..."
options ..
options ...
device ..

and all other stuff
nodevice ...
nodevice ...
nodevice ...
nodevice ...
all stuff u don't have
like SCSI controlers and unneeded NICs

this way u can end up with unbootable kernel but if u know what devices u need it will work
remember to include device for ur disk controller


for CPU optimizations add
Code:
CPUTYPE?=native
and
KERNCONF=YOURKERNELNAME
to automate buildworld
to make.conf
 
Speaking of kernel config, you generally should move things to modules only if they would not have been loaded on every boot (e.g. You have two NICs, only one driver is loaded at time depending where you are, and you want to preserve laptop battery by using hw.pci.do_power_nodriver=3 in /boot/loader.conf). Drivers compiled in kernel use less memory. (+ with all drivers in modules memory fragmentation occurs).
 
Back
Top