More Kernels
- 0
- Add a Comment
- No Related Post
More Kernels
Yesterday, we presented a high-level overview of the process of creating and compiling your own custom Linux kernel. Referring back to yesterday’s Penguin Shell, we defined the first step of the process as:
- Configure your new kernel’s parameters. This will define the components and set of instructions that are both built into the kernel and those that are created as loadable modules. This step is, in some ways, the most time consuming step of the process.
This requires a couple of steps.
a. Open a console window and change the user to root.
b. Change directory (cd) to /usr/src/linux
Note that the /linux subdirectory is, in many distributions, a symbolic link to /linux-2.x.x where .x.x is the kernel version. If you don’t have a directory named /usr/src/linux, you probably don’t have the symlink. In that case, ls in the /usr/src directory to find the actual path to your kernel source directory.
Like most things Linux, there are several ways to proceed from here. The first is the “old-school” method - a pure console window listing all the kernel options in text only. To select this option, issue the make config command. The second is a somewhat prettier configuration version, brought on by executing the make menuconfig command. This breaks out the kernel configuration hierarchically. The third and preferred version is to issue the make xconfig command. This will bring up a graphical menu for configuring your kernel.
The first few times I configured a kernel, I was very confused by some of the options presented in the process. Consequently, those first few times, I didn’t make big changes to the kernel, using the reconfiguration instead as an opportunity to become familiar with the process. If you haven’t been through this process yourself, I believe you’ll probably find it so, also.
I’ll assume that you’re using the xconfig method from this point on. All three methods will get you to the same place, though the first two are simply not as pretty or convenient as the xconfig method. In this method, you’ll see options for every element of your kernel. These are broken out by categories and, in some cases, further divided into subcategories. You should find three columns for each option. These columns represent, from left to right:
a. options you’d like to include directly in the kernel
b. options that can be built as loadable modules
c. options that should be left out completely
It gets a bit tricky for me, at this point. Not knowing your individual hardware configuration, I can’t make specific suggestions as to what should and should not be included in your kernel. You should know that there are defaults in every area. If you have any question as to whether or not to include a specific option in the kernel, or as a loadable module, the default should be safe. There’s a lot to go through in the configuration process - take the time to learn what each area has to offer and to understand, as best you can, how each option will affect the performance of your kernel code.
When you’ve worked your way through all the options, you can save the configuration and return to the main menu. You’ll see a popup window with further instructions, as well. At this point, you’ve saved your custom kernel configuration to a text file, awaiting compilation. Congratulations - you’ve taken the first step in what is, for many, the defining moment in a Linux geek’s use of his OS; customizing and controlling the operating system in your own way by configuring a kernel specific to your needs.
Tomorrow, we’ll continue along the path to your own custom kernel.
