// How to Configure a Linux Kernel // // by BoBB // // http://www.oldskoolphreak.com Okay, in this file I am going to attempt to explain what exactly is required to configure a kernel from scratch. I'd like to point out straight from the beginning that learning to configure a kernel is no small task. It will take time and you will need knowledge of Linux. If you dont know what you are doing it can be very dangerous to your system to boot a custom kernel. I would like to spew out the standard CYA disclaimer JIC. You will need to be root to do most of the stuff in this howto, and everything done is tested on my setup and has not caused any problems. But every system is different and don't do anything you don't think you should do. I take NO responsibilty for what happens - this is just a guide. And now on to the good stuff! First thing we want to do is get the latest stable kernel sources from http://kernel.org. It will say on the front page what the latest version is, and at the time of writing it is 2.4.21. Okay, once you have the sources downloaded, cd to /usr/src and untar the kernel like so: # tar -xjvf linux-2.4.21.tar.bz2 That should create a directory called linux-2.4.21 or something to that effect. You will need to make a symlink to this directory called linux so that other programs can locate the kernel sources when compiling. If one already exists, just remove it. # ln -s linux-2.4.21 linux Now, if you already have a kernel .config for an older version, you would copy it into the new kernel directory and do this: # make oldconfig That will go through the config file and prompt you for a yes/no/help on any new options in the kernel. This is not very useful the first time around, but you will come to love this feature when new kernels come out and you dont want to go searching through to find new options. Since you probably don't have a .config already, you will want to config from scratch. This is where it gets fun. cd into the kernel source directory(/usr/src/linux-2.4.21) and type # make menuconfig Optionally, you can use "# make xconfig" and that will bring up a GUI configuration almost identical to the ncurses based one that I will be going over. I'm not covering the xconfig option because not everyone runs X on their box. So this way everyone can use it. Unless of course they dont have ncurses! But who doesn't right? Okay, as daunting as this seems the first time, it will be fairly easy. It just takes time and you have to know what is in your system. The first option you see will be "Code maturity level options." This section has an option to prompt for development and/or incomplete code/drivers. You will want to enable this. It may warn you about it being unstable and such, but there will be additional warnings if the code will mess things up. It may not work, but it shouldn't hurt. You will also get lots of cool new options with this enabled. The next section is all about modules and that stuff. You want to enable modules for sure. Some people like to have everything as modules. Some people like to have everything compiled into thier kernel. Personally, I like to compile everything as a module untill I know it is working properly. Then I will usually compile it into the kernel and ditch the module. The next section is Processor type and features. One thing you want to set for sure is the first option. Just hit enter on the very top selection and it will bring up a window with a list of different supported processor types. Pick yours so the kernel will be optimized to run on your procesor. This is the first section with lots of confusing looking options. If your not sure if something should be enabled just read the help section on it. I recommend reading the help section on every single option in the kernel. It is very time consuming, but you will know exactly what you need afterwards. Another important thing in this section is SMP, or symmetric multi-processing support. If you need, it enable it. Otherwise, disable it. I have had quite a few problems enabling SMP with only one processor even though it's not supossed to cause problems. The next section is fairly generalized options. Most things are straight- forward and the defaults are usually okay. If you know you don't need something you can disable it to save space, like ISA bus support. It comes enabled by default, but most modern computers don't use the ISA bus, including mine, so I disable it. Again, if your not sure about an option read the help section on it. Another important option here, if you are running a laptop, is support for hot-pluggable devices and PCMCIA support. Also, you may or may not want to enable APM. The next section is Memory Technology Devices. If you need this enabled you would know it. I have never had to use it. It's mainly for solid state storage on embeded devices, so you most definitely won't need it. The next option is fairly straight forward. If you use the parallel port on the back of your computer, you need to enable this. Certain hardware requires some of the lower level options that come up when you enable it to be enabled as well. You would have to look that up though. This next section is for Plug and Play, or more commonly known as Plug 'n Pray. If you use ISA, chances are you will want this too. If you aren't using the ISA bus, you wont need this option most likely. There is always that one obscure piece of hardware someone has from like 10 years ago that needs wierd options. You can usually find information on things like that on goodle.com/linux fairly easily. Some of the important options in the next section, block devices, are floppy disk support. Most people still use floppys! Also, if you want to be able to mount .iso files, you can enable the loopback device option. Depending on your configuration, you might want RAM disk support. Again, I cant stress the importance of reading the help files to see what you need!!! If you plan on using RAID or LVM (Logical Volume Management), you will want to check out this section. I have never used RAID before or LVM, so I dont know much about this section. I'm sure there are MANY howto's on the subject. The next section, Networking Options, is fairly important, although the defaults are fine for most people. There are lots of different TCP/IP options that you may or may not want to enable. Also, if you have an appletalk network, you might want to read through those options. I also believe you have to enable 802.11b or wireless networking seperately in this section, but its never come up for me. This next section is another one of those obscure sections you probably wont need. If you have a telephony card (yeah, Ive never heard of one either), you can enable this and do VoIP stuff at the hardware level! This next section seems small at first but is VERY important if you want your kernel to boot the first time around. You obviously want IDE support unless you are running an all SCSI system, which I have no experience with, so you might still need IDE! The second option, once expanded, has a ton of options. Some of the more important ones are DMA and other options for booting from add-on cards such as promise RAID cards. The option to boot off-board chipsets first would be important if for some reason your onboard chip is fried or you have to put the boot loader on a hard drive on a PCI IDE card. Also, you will want to read through ALL of the chipset support options. If you have one of these chipsets thats listed and you don't enable it, chances are your system will not boot properly. This next section is for SCSI support. Most boxes wont need this but again some old obscure hardware thats NOT SCSI still uses the SCSI bus. The most common piece of hardware I can think of for this is the parllel Zip drives from Iomega. I happen to have one of those and they work great, but you will have to dig through this section for the ppa driver. As I said before, I have never used a SCSI device, but from what I understand most SCSI hardware has its own low level SCSI driver and there aren't many generic drivers. You will probably want to google for a howto about your hardware and that should help you a lot. I'm sorry I can't elaborate on this subject more because I'm sure a lot of people use SCSI devices. The next two sections are for more obscure hardware! Damn, there's tons of support in the linux kernel, huh?! This appears to be for the LSI Logic Fusions Message Passing Technology devices, and the second is for I2O (Intelligent Input/Output) architecture. If you need these options you will most likely know so! This next section is also fairly important if you want networking, and who doesn't? Most people will have a 10/100mb ethernet card. Almost all network cards are supported. Figuring out which driver you need is something else all together. But if you know what module your current kernel uses that will help a lot. You also might have a gigabit ethernet card and you can enable that here too. Also, I believe wi-fi cards are in this section as well as PCMCIA networking cards. This next section is for ham radio support. I haven't used this but a lot of you might be interested in this. Next section is for infared support. I have also never used this, but if you run a laptop you might want to work with this. I can't imagine it would be a top priority though. This next section is new to me in 2.4.21. I dont remember ever seeing this section, but I have never even bothered reading about ISDN, so I might have just passed it over a lot. If you have ISDN, you might want to look into this section. Next is more obscure hardware support. If you have a super old non-IDE, non-SCSI cdrom, this is where you would find the support for it. The next section says it is for "USB Human Interface Device (HID) support." I would assume this means things like the retina scanners and fingerprint scanners, but I could be way off-base there. It's not really explained. This next section is my favorite. This is where they put all the cool stuff. There are the default selections and then there is i2c, which you might want to enable depending on the version on lm_sensors you use. As of 2.4.0, i2c is a seperate package, at least in my distro. Also, if you have a non-PS2 mouse, you will have to enable it here. By the way, this doesn't include USB mice, which are a PAIN! Those are covered in the USB section. If you want to hookup a joystick for your hours of tuxracer playing, you would do it in here. There are lots of other chipset fixes and feature additions in here. Search through it for your chipset!!! Also, if you want to use an AGP card, you enable that in here too (as well as DRM). There are lots of other cool options for lots of cool hardware, so read through the help files in here for a while. If you have a TV tuner card you can enable Video for Linux in this section. Watching TV on your linux box is kewl! FILE SYSTEMS!!! File systems are so much fun. You will probably want things like ext2 and ext3 and possibly vfat. You might also use rieserfs or xfs or some other obscure file system! Also, you will want to enable the smb file system if you plan on mounting Windows shares from other Windows boxes. Also, NFS is another commonly used file system. If you need other file systems, you should know. This is my second favorite section. I can't describe how pretty a frame buffered console looks. Not to mention if you get around to applying the console splash patch from SuSE and can set a background image on your console. Everyone wants sound. This is where you would enable it. Personally, I use alsa drivers and not OSS, but some cards don't work well with alsa. Either way, you would want to enable sound support and possibly a driver for your card. If you don't know which driver your sound card uses, http://google.com/linux it! *SCREAM* USB!!! I have never ever ever used a USB device. When I started out with Linux all I heard about was how much hell USB was. I understand that it is MUCH better now, but I can't really offer any advice on configuring the USB section aside from READ THE HELP FILES!@# It might sound a little preachy by now, but I'm telling you, you will have a much smoother ride if you spend the time to read the help files. The last section I know anything about is Bluetooth support. From what I have read, Bluetooth is VERY cool when you get it working. I really want to start messing around with this stuff, but haven't been able to get my hands on some Bluetooth hardware. The last two sections you won't need help on if you need to use them. They are for writing your own kernel modules and stuff like that. Once you are done with all of that, just hot exit on the main menu and it will prompt you to save it. Obviously you won't want to do that all again so save it!!! I'm not going to go through how to compile the kernel once its configured because there are so many howtos about it and it is also different for most distributions. If you have any questions or comments or "you're a retard" emails, send them to snoogans@qwest.net.