Build a new kernel in 8.1

Hi.

Having problem buildning a new kernel, have followed the handbook and searched this forum with no luck.

uname:
Code:
FreeBSD xxxxxxxxxxx 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010     
[email]root@mason.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  amd64

What I have done:
--------------------------------
srv# cd /usr/src/sys/i386/conf
srv# mkdir /root/kernels
srv# cp GENERIC /root/kernels/MYKERNEL
srv# ln -s /root/kernels/MYKERNEL

edited MYKERNEL and remove IPv6

srv# cd /usr/src
Code:
srv# make buildkernel KERNCONF=MYKERNEL
ERROR: Missing kernel configuration file(s) (MYKERNEL).
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
What am I doing wrong, what is missing? Can anyone help me to build my first kernel in FreeBSD.

Thanks in advanced
/Krister
 
You are running amd64, why are you copying a i386 kernel config? Copy the GENERIC in /usr/src/sys/amd64/conf/. Your custom kernel config must also be stored in /usr/src/sys/amd64/conf/.
 
Thank you, thats what I get for following the handbook :)

My kernel is building as we speak.

Thansk again.

/Krister
 
You are building a custom kernel to only remove ipv6. Sounds like a lot of effort for not much gain to me. Any particular reason you are doing this?
 
why not just do

Code:
cd /usr/src/sys/amd64/conf
cp GENERIC MYKERNEL
<edit MYKERNEL>
cd /usr/src
make buildkernel KERNCONF=MYKERNEL 
make installkernel KERNCONF=MYKERNEL
 
Unless you're a dev, you needn't back up your source tree, since you can just pull down a new copy when you're restoring your system. Keeping your custom kernel conf files elsewhere and linking is a nice way to avoid losing them.
 
fronclynne said:
Unless you're a dev, you needn't back up your source tree, since you can just pull down a new copy when you're restoring your system. Keeping your custom kernel conf files elsewhere and linking is a nice way to avoid losing them.

How would that happen? I've never kept a kernel config anywhere but in conf, and never had one deleted. They're outside CVS. I do back up the conf directory.
 
UNIXgod said:
You need to alias it away from the conf dir as it would get blown away on make world upgrades.

never happened to me in years of using freebsd.

GENERIC gets overwritten sure, but not custom files.

also makeworld doesnt touch the src dir its csup.
 
UNIXgod said:
You need to alias it away from the conf dir as it would get blown away on make world upgrades.

No it doesn't, if you use a new name (MYKERNEL, for example). And, if it did get blown away during a buildworld or a source tree update, a link to an external file wouldn't save it.

The only time a custom kernel config file gets deleted/overwritten is if you name it GENERIC, NOTES, SMP (aka any of the existing files) or you manually delete /usr/src.
 
I stand corrected... once again. =) I guess linking it to /root/kernels/ simply makes a nice shortcut to save typing out vi /usr/src/sys/{arch}/conf/MYKERNALCONFIG
 
Back
Top