trying to build a kernel

Ok, I have a book called Absolute BSD but it's the first edition and maybe it uses some old commands that aren't revelant to 8.1. According to the book it tells me to move my Generic kernel from /sys/i386/conf to my /usr/src directory and rename it, in my case I called it ServKern. After moving it I edit the file in vi and remove any unwanted drivers that I dont need. Once completed with the editing it tells me to use the config command:

config ServKern

But when I do this it just spits out
Code:
Specifiy machine type "e.g. machine i386"
Then the book tells me to do a make depend && make all install When I run this command it just compiles for a few hours and then compile crashes and spits out a bunch of Error code 1 errors in different directories.

As far as I understand kernels, building one should be a very straight forward process.
-Copy your GENERIC kernel to your /usr/src directory
- Edit the Generic kernel to your liking and rename it to whatever.
- Compile the new kernel and install it over the GENERIC one.
- Then reboot and it should be using your new kernel.

I have also tried using a different command: make buildkernel KERNCONF=ServKern
But when I tried this it just spits out:

Code:
Missing kernel configuration files.

I use this command while im in my /usr/src directory. Is this not the right command or did I just do it wrong? Do we not use the config command anymore for building kernels? Did I skip a step or something? Is there a different way of doing this for 8.1?

FreeBSD 8.1 installs just fine on my machine which is an old Dell Dimension 4600 single core Pentium 4 2.6 proc, with an Intel 865PE chip set, A simple ATA 80GB Seagate hard drive. An ATA cd-rom.

Any advice from the experts would be awesome.
 
Desreguard said:
As far as I understand kernels, building one should be a very straight forward process.
-Copy your GENERIC kernel to your /usr/src directory
- Edit the Generic kernel to your liking and rename it to whatever.
- Compile the new kernel and install it over the GENERIC one.
- Then reboot and it should be using your new kernel.

As the previous poster mentioned, the Handbook is the best resource for rebuilding your kernel. But in my experience, it boils down to:

  1. cd /usr/src/sys/<arch>/conf/
  2. cp GENERIC <name_of_your_custom_kernel>
  3. modify kernel to your liking
  4. rm -r /boot/kernel.old && cp -rp /boot/kernel /boot/kernel.old
  5. cd /usr/src
  6. make buildworld KERNCONF=<name_of_your_custom_kernel>
  7. make kernel KERNCONF=<name_of_your_custom_kernel>
  8. reboot
  9. cd /usr/src
  10. mergemaster -p
  11. make installworld KERNCONF=<name_of_your_custom_kernel>
  12. mergemaster

I've done this countless times now, so (unless I've overlooked something) this should be all you need. :)

Out of curiosity, why are you looking to rebuild the kernel?
 
Step number 4 isn't needed. The same thing is done during the installkernel phase ;)
 
Just learning BSD in general. I just like fast boot times, and learing to build firewalls and the like, thanks for the step by step, but I used make buildkernel KERNCONF=whatever and make installkernel KERNCONF=whatever. What's the difference between yours and what I did?
 
Desreguard said:
Whats the difference between yours and what i did?
make kernel is the same as make buildkernel && make installkernel.
 
I highly recommend the 2nd edition of this book. I've yet to run into an example that hasn't worked and it describes how to properly build a kernel using the handbook method along with the "include the GENERIC kernel" trick.

It sounds like the 1st edition of the book is a bit dated. I would stick with the handbook and or purchase the 2nd edition
 
Back
Top