From: | John Leimon <jleimon@xxxxxxxxxxxxx> |
Date: | Fri, 14 Oct 2005 16:50:29 -0700 (PDT) |
I have modified the Building and Installing a Custom Kernel page in the dfly to better suit new users. In specific I added segment within 'Building a Kernel' that states that buildworld needs to be run after using cvsup. This is not mentioned explicitly in the original page and should ease confusion esp. in new users trying to build a custom kernel after cvsup'ing in a source tree. Modified version attached. - JohnTitle: Building and Installing a Custom Kernel
9.3 Building and Installing a Custom KernelFirst, let us take a quick tour of the kernel build directory. All directories mentioned will be relative to the main /usr/src/sys directory, which is also accessible through /sys. There are a number of subdirectories here representing different parts of the kernel, but the most important, for our purposes, are arch/conf, where you will edit your custom kernel configuration, and compile, which is the staging area where your kernel will be built. arch represents either i386 or amd64, at this point in development. Everything inside a particular architecture's directory deals with that architecture only; the rest of the code is common to all platforms to which DragonFly could potentially be ported. Notice the logical organization of the directory structure, with each supported device, file system, and option in its own subdirectory.
Next, move to the arch/conf directory and copy the GENERIC configuration file to the name you want to give your kernel. For example: # cd /usr/src/sys/i386/conf # cp GENERIC MYKERNEL Traditionally, this name is in all capital letters and, if you are maintaining multiple DragonFly machines with different hardware, it is a good idea to name it after your machine's hostname. We will call it MYKERNEL for the purpose of this example.
Now, edit MYKERNEL with your favorite text editor. If you are just starting out, the only editor available will probably be vi, which is too complex to explain here, but is covered well in many books in the bibliography. However, DragonFly does offer an easier editor called ee which, if you are a beginner, should be your editor of choice. Feel free to change the comment lines at the top to reflect your configuration or the changes you have made to differentiate it from GENERIC. If you have built a kernel under SunOS™ or some other BSD operating system, much of this file will be very familiar to you. If you are coming from some other operating system such as DOS, on the other hand, the GENERIC configuration file might seem overwhelming to you, so follow the descriptions in the Configuration File section slowly and carefully.
Building a Kernel
If you have modified your source tree using CVSup then you will have to use the buildworld, buildkernel sequence as follows:
The new kernel will be copied to the root directory as /kernel and the old kernel will be moved to /kernel.old. Now, shutdown the system and reboot to use your new kernel. In case something goes wrong, there are some troubleshooting instructions at the end of this chapter. Be sure to read the section which explains how to recover in case your new kernel does not boot.
Contact the Documentation mailing list for comments, suggestions and questions about this document. |