|Erik's linux page: Linux information for beginners and advanced users|
|Prev||Chapter 5. Compiling your kernel||Next|
We are now ready to do the real work. Configuring, complining and installing the kernel. I'm not going to describe every single configuration entry availiable, since that would be a novel by itself, and there's already very good documentation inside the tools you use to configure the kernel.
Configuration of the kernel can be done in four different ways.
First, there is the very manual way. This is when you edit the file /usr/src/linux/.config by hand. A very primitive way of doing things, don't do this since there is better ways.
Second, there is make config. Execute make config in the /usr/src/linux directory, and the kernel configurator will ask you a lot of questions. You have the ability to read some help text about each question by pressing '?'. This is a better way than the first one, but still quite boring.
Third, there is make menuconfig. This will present you with a text-based program where you make your choices by moving around in some menus. This is a good way of configuring the kernel if you computer doesn't have the X window system, or if it's to slow to run X.
Fourth, and last, is make xconfig. This will give you an X window system based configuration program that is really nifty. Very easy to use!
OK, I have some configuration tool up and running, what do I do next? There's a lot of confusing things here!
You're right. Kernel configuration can be very confusing. At present time (Linux 2.2.10) the kernel configuration has the following subcategories, each with a lot of choices.
Table 5-1. Kernel configuration subcategories with explanation
|Code maturity level options||This lets you select if you want to be prompted for experimental drivers in the kernel. Most often you want that.|
|Processor type and features||Select your processor type, if you have an mathematic processor and some other important stuff. Be warned, if you don't have a math coprocessor and don't choose math emulation here, your kernel will not boot. The same warning goes for choosing the wrong processor type.|
|Loadable Module support||Lets you enable the support for modules in the kernel. You want this. Read the Section called Modules, who are they, and how do they work ? in Chapter 3|
|General Setup||A lot of general stuff, like if you want network support, if you have a PCI system and if you want Advanced Power Management.|
|Plug and Play support||Choose if you want the kernel to be able to auto-configure some devices.|
|Block devices||This is where you tell the kernel what kind of harddisk and other storage devices you have|
|Networking options||There's a lot of more or less advanced networking options in the kernel. If you don't know what to do, read the help or let it be.|
|QoS and/or fair queueing||This is another advanced network option. Let it be if you don't know what it is.|
|SCSI support||If you have some type of SCSI devices in your system, you want to check out this entry.|
|SCSI low-level drivers||Here you add the adapter you have|
|Network device support||If you have a network card, you can choose it here|
|Amateur Radio support||This is for people with a radio connected to their computer.|
|IrDA subsystem support||If you want to use the IrDA port you might have on your computer, enable this.|
|Infrared-port device drivers||This also has to do with infrared devices|
|ISDN subsystem||If you access the internet (or something else) via ISDN, this is where to add support.|
|Old CD-ROM drivers (not SCSI, not IDE)||If you have some weird CDROM, for example one connected to a soundblaster sound card or something similar, there might be support for it here.|
|Character devices||Virtual terminals, serial ports and other similar things|
|Mice||Support for your mouse.|
|Watchdog Cards||A watchdog card is a piece of hardware checking your computer all the time. It communicates with the kernel, and if it doesn't get any response it will reboot the computer. This is conventient if your computer is located where you can't reach it.|
|Video for Linux||Support for videocapture and radios.|
|Joystick support||Guess! :)|
|Ftape, the floppy tape device driver||This is a driver for cheap tape drives connected to the floppy port in your computer.|
|Filesystems||Linux can read and write quite a few different filesystems..|
|Network File Systems||..There's also support for a few network based file systems such as NFS, SMB and NCP.|
|Partition Types||Here you can add the ability to read several different partition types, such as the one Free/Open/NetBSD uses. That will let you mount disks from those operating systems.|
|Native Language Support||Add support for your language, and you will be able to see the filenames of foreign partitions correctly.|
|Console drivers||Console drivers gives you high resolution text consoles.|
|Sound||Add sound support|
|Additional low level sound drivers||Drivers for some special sound cards|
|Kernel hacking||Lets you enable the magic SysRq key. Read the manual.|
I assume you are now even more confused. Anyway, the trick is to take your time and go through all the options availiable and try to decide what the answer should be. There is help, and if you are uncertaion, just let it be.
If your kernel doesn't work, it's easy to revert to the old one and reconfigure the kernel. Of course it takes time, but learning-by-doing is the only way.
When you're done, save and exit and proceed to the next step..
So, now our kernel is well configured and we are ready to compile it. This is done with the command make bzImage followed by make modules and make modules_install. If you haven't enabled modules, you don't need to do the last two steps. The whole process will, as I've mentioned earlier, take some time. If you didn't read the Section called Modules, who are they, and how do they work ? in Chapter 3 earlier, do it now.
The kernel is now ready for installation.
To run the new kernel you have to reboot your machine. This is one of the few things software related you have to reboot to fix.
Your newly compiled kernel is at /usr/src/linux/arch/i386/boot/bzImage . That's not a good place for a kernel to be, so let's move it. If you machine doesn't have a Intel family processor, the i386 should be replaced by something appropriate, such as 'alpha' or 'mips'.
Personally, I keep my kernels in /boot, but you are free to choose a place to copy the file above to. Keep in mind though that for most PC bioses to boot the kernel it has bo be located in the first 1024 cylinders of the harddisk.
Now install the kernel in the /etc/lilo.conf file, read the Section called Booting Linux with LILO in Chapter 2 if you don't know how to do. Basically you just put the name of the image file in the top of the file, and a symbolic name too. LILO will boot the first image in the configuration file. Don't forget to run /sbin/lilo - otherwise the change won't take effect. I've done that mistake, several times :-) Always keep at least one kernel you know work in the lilo.conf, so you may rescueboot if your newly compiled kernel doesn't work.
Reboot, and see what happends. If you're unlucky, it won't boot at all, then restart and choose another kernel at the LILO command line. Watch the boot messages closely, too see that all your hardware is found. With the dmesg you can see what the kernel said, after it's booted.