MicroBSD Handbook

Prev Next

8.3 Building and Installing a Custom Kernel

To build a custom kernel you have to fulfil some requirements:

The first thing that you have to do is unpack the pack with kernel sources:

     # gunzip -d srcsys.X.X.tgz
     # tar xf srcsys.X.X.tar
     # mv sys/ /usr/src/
     

Go to /usr/src/sys/arch/$ARCH/conf/GENERIC , /usr/src/sys/conf/GENERIC and view them with:

     # cat GENERIC|more
     

After you see which options you have to change type:

     # cp /usr/src/sys/arch/$ARCH/conf/GENERIC NEWKERNEL
     # cp /usr/src/sys/conf/GENERIC NEWKERNEL
     

First edit the NEWKERNEL file which is in /usr/src/sys/conf/NEWKERNEL.This file stores non arch-dependent options. So when creating your kernel config be sure to look through the /usr/src/sys/conf/NEWKERNEL and see what you want.

After that edit the /usr/src/sys/arch/$ARCH/conf/NEWKERNEL

     # vi /usr/src/sys/arch/$ARCH/conf/NEWKERNEL
     

Make shure that you change the line include "../../../conf/GENERIC" to include "../../../conf/NEWKERNEL".

When you finish customize your NEWKERNEL type:

     # /usr/sbin/config /usr/src/sys/arch/$ARCH/conf/NEWKERNEL
     # cd /usr/src/sys/arch/$ARCH/compile/NEWKERNEL/
     

Before you start with compileing go to / and copy the original MicroBSD kernel to make sure that you can boot next time.

     # cp /boot /boot.old
     # cp /bsd /bsd.old
     

Start compiling the kernel:

     # make depend
     # make
     # make install
     

This will install automatic your NEWKERNEL and you can reboot from here.


Prev Home Next
Why Build a Custom Kernel? The Configuration File

This, and other documents, can be downloaded from MicroBSD.

For questions about MicroBSD, read the documentation before contacting <MicroBSD Support>.
Copyright © 1995-2003 by The FreeBSD Documentation Project, OpenBSD FAQ Copyright © 1998-2003 OpenBSD, Modified for MicroBSD