If you are reading this, I assume you already know what the Linux kernel is and why you may want to update it. However, if you are accidentally reading this walkthrough, just happen to be running Linux, and have no idea what the kernel is or why you would want to update it, the next two paragraphs are for you (if you are looking instead into a less verbose and more generic way of updating your kernel on any Linux distro, read here). In a neophyte nutshell, the Linux kernel is the brain of the Linux system. It tells your system which file systems, hardware, protocols, etc. are supported. There is a lot more to it than that, of course, but I think that diminutive description will suffice for now.
MY THANKS
Before we begin, I would like to sincerely thank all of the people who provided me with valuable feedback regarding my last article “The Very Verbose Debian 3.0 Installation Walkthrough“. I am grateful for your insights, corrections and comments. Also, I would like to apologize for the lateness of this article. My life has taken many twists and unforeseen paths during the last few months. I’m glad to finally feel back on track.
INTRODUCTION AND EXPECTATIONS
So why would you want to mess with the kernel? Well, all the people (who are a step beyond mere mortals and a lot smarter than I am) that work on the Linux kernel are constantly adding support for new hardware, new technologies, new bug fixes, and making myriad other improvements to the Linux kernel. By upgrading our kernel, we increase the abilities and support of our Linux system. Also, a computer has not been built, that I know of anyway, which utilizes all the hardware and other support available in the Linux Kernel. Therefore, why carry around support for a lot of things you don’t need if you don’t have to.
In this walkthrough, I will attempt to describe the process of updating and compiling a Linux kernel under Debian. I will try to explain the necessary steps in a way that will dispel all mystery and fear. My hope is that somebody new to Linux will be able to go through this comfortably and end up with an updated system when they are done.
As much as I want to make this a painless process, and one devoid of failure, one thing I cannot provide is a detailed description of your hardware or the things you want your system to support. Therefore, I am focusing on the three most requested topics, sound, journaling filesystems, and the ability to burn CDs. However, I feel I am giving enough detail that you shouldn’t have any problems with the rest of the configuration process and enabling things like USB.
Knowing what hardware is in your system is absolutely necessary if you want to optimize your kernel specifically for the hardware you have. For example, to compile in support for your sound card, you must know what kind of sound card you have. Often times you can find this information in the manuals that came with your computer, from Windows Device Manager (if you run Windows), or from the manufacturer’s web site if you bought your computer from a company such as Gateway, HP or Dell.
Please don’t be completely discouraged if you don’t know what hardware you have in your machine. While you may be out of luck as far as configuring the kernel for your motherboard’s specific chipset, there are still many improvements you can make to your system, such as support for the EXT3 journaling file system, which will be worth while.
One more thing before we begin. Parts of what I will present in this walkthrough are applicable to all Linux distributions, while other parts are specific to Debian and distributions, such as Libranet and Xandros, which are derived from Debian. While I will not cover the non-Debian way of updating and compiling the kernel, the configuration part of the article is applicable to all versions of Linux (as long as they are running X that is).
Okay. Let’s update our kernel.
DOWNLOADING A NEW KERNEL
If you read and followed “The Very Verbose Debian 3.0 Installation Walkthrough”, you should now have the 2.2.20 kernel installed on your system. This kernel lacks support for things like USB and the EXT3 file system. If you have a very large drive and have ever had to sit through your next three birthdays waiting for Linux to check your partitions after an unclean shutdown, you will love journaling filesystems like EXT3 and definitely want to have support for them in your kernel.
In this walkthrough, we are going to upgrade our kernel to version 2.4.20 (which was the latest stable kernel when I started writing this. Please feel free to grab a later kernel you want to). In order to do so, we need to download the source for that kernel. To download the kernel source, you can use any of your favorite methods (wget, ncftp, etc.), however, in this tutorial I am going to download the 2.4.20 kernel via Mozilla since we should already have it installed and most people are familiar with downloading files through a web browser.
In order to download the latest kernel (2.4.20), launch Mozilla (or your favorite web browser) and go to The Linux Kernel Archives (http://www.kernel.org). On the main page you will see a box under the title, which has links to an HTTP server, an FTP server, and an RSYNC server. Below this box, you will see the line, “The latest stable version of the Linux kernel is 2.4.20” (or whatever it currently happens to be), with “2.4.20” highlighted as a link. For this tutorial, you do not want to download from this link since it is just a patch. However, this information is important since it will tell you what the latest kernel available is, so when you go to the correct download area, you will know which kernel to download; assuming you want the latest one.
To go to the download area where you can obtain the full updated kernel, click on the HTTP link in the gray box at the top of the page.
You should now be on a page titled, “The Public Linux Archive – (As if there were a private one you could get to)”. There is another gray box at the top of this page. Please click the first link listed (http://www.kernel.org/pub/linux).
You should now be on page titled, “Index of /pub/linux”. In the directory structure on this page, click on the “kernel” link.
Now you should be on a page titled, “Index of /pub/linux/kernel”. In the directory structure shown on this page, click on the “v2.4/” link.
You should now be on a page titled, “Index of /pub/linux/kernel/v2.4”. This is where we will find the kernel. There are oodles of files listed in the directory on this page. You want to make sure to download the file called “linux-2.4.20.tar.gz”. You will notice that there is also a bz2 and a bz2.sign file. Bz2 is another compression format, but the utility to uncompress this file is not loaded on your Debian machine by default (although it wouldn’t take much effort to install it using apt). The tar utility, however, is already installed on your Debian machine, so I have chosen to download the linux-2.4.20.tar.gz file for this walkthrough. Download the file and save it in your home directory (/home/
PREPARING THE 2.4.20 KERNEL’S SOURCE
In the last section, we downloaded the kernel source code. Currently it is contained in one compressed file (linux-2.4.20.tar.gz) in you home directory. In this section, we will move this source code to the correct location and uncompress it.
In order to compile the new kernel, we need to place it in the /usr/src directory. You may be asking yourself, “If I wanted the kernel source file in the /usr/src directory, why didn’t I save it there in the first place?” The answer is that you didn’t have rights to do so since you were logged in as a normal user (at least I hope you were logged in as a normal user and not as root).
I don’t recommend surfing the web as the root user. Your computer is not going to explode or anything like that, but it is risky if you do everything as root. Therefore, I suggest downloading files off the internet as a regular user and saving them to your home directory. Once your download is complete, you can use the “su” command to log in as root and move the files into more secure locations if necessary.
If you are familiar with Linux (don’t worry if you are not, I’ll help you more in a minute), login as root and move the “linux-2.4.20.tar.gz” file from your home directory, where you saved it, to the “/usr/src” directory.
Next, uncompress the file by entering “tar xvzf linux-2.4.20.tar.gz” at the command line. This will create a directory called “linux-2.4.20” inside the “/usr/src” directory.
Next, create a symbolic link named “linux”, which points to the “linux-2.4.20” directory by entering “ln -s linux-2.4.20 linux” at the command line. If this symbolic link already exists, delete it and create it again as described above.
You may now skip over the rest of this section and go to the “APT FILES NECESSARY TO CONFIGURE AND COMPILE YOUR KERNEL” section.
If the above four paragraphs were confusing to you, here are the same steps in almost mind numbing detail.
In order to move the “linux-2.4.20.tar.gz” file to the correct location, follow these steps:
Step 1: (Open a terminal window)
If you followed my installation document, you will be running the WindowMaker window manager. If you are, then right click on the desktop to bring up the menu, click on XShells, and then click on XTerm to bring up a terminal window. If you are running a different window manager, use whatever method your window manager requires in order to launch a terminal window.
CONFIGURING THE LINUX KERNEL CONFIGURING DEBIAN TO SUPPORT CD BURNERS SETTING UP YOUR MACHINE TO USE THE EXT3 JOURNALING FILE SYSTEM
Step 2: (Go to the directory where you downloaded the “linux-2.4.20.tar.gz” kernel file)
Make sure you are in your “/home/
Step 3: (Log in as root using “su”)
Now you need to log in as root by entering “su” at the command line if you haven’t already. Enter the root user’s password when prompted.
Step 4: (Move the “linux-2.4.20.tar.gz” file to the “/usr/src” directory)
Now enter “mv linux-2.4.20.tar.gz /usr/src” at the command line. This will move the “linux-2.4.20.tar.gz” file from your home directory to the “/usr/src” directory. If you get a “Öno such file or directory” error, you either did not download the kernel file, or you are not in the directory you downloaded the file to. Go to the directory you downloaded the kernel source in to and try this step again.
Step 5: (Check the /usr/src directory)
Change to the “/usr/src” directory by entering “cd /usr/src” at the command line. At the command prompt, enter the “ls -l” command. As you probably know, the “ls” command shows you a list of all the files in the current directory. The “-l” switch after “ls” shows you more information than when you only type “ls” by itself. It shows you the “long” format; hence the ‘-l’. You should see the “linux-2.4.20.tar.gz” file we just copied into this directory. It should be the only file there. If this is the case, skip the rest of this section and go to Step 6.
It is possible that the directory has other files other than the “linux-2.4.20.tar.gz” file we just copied here. If you have the source code for an old kernel on your machine, it will be in this directory as well. Also, you may have a symbolic link pointing to these old kernel sources.
Before I go on, let me explain what a symbolic link is. A symbolic link is a link or alias that points to another file or directory. If you are familiar with Windows, a symbolic link is similar to a Shortcut. We will create a symbolic link in Step 6, so if they still aren’t clear, hopefully they will be after you make one.
Now, please look at the other files in the “/usr/src” directory. Is there one named “linux”? If not, you may skip the rest of this section and go to Step 6. If there is an item in this directory named “linux”, check to see whether it is a symbolic link or a regular directory. You can determine this by using the “ls -l” command and looking at the output. Enter “ls -l” at the command line. The output may be something like this (only formatted better).
lrwxrwxrwx 1 root src 12 Oct 31 13:03 linux -> linux-2.4.18
drwxr-xr-x 14 573 573 4096 Aug 2 18:39 linux-2.4.18
-rw——- 1 clinton clinton 32219641 Oct 30 14:40 linux-2.4.20.tar.gz
Let me use the first file listed as an example to explain where you need to look. The first part “lrwxrwxrwx” shows the file type and permissions of this file.
The first character, ‘l’ indicates that this file is a symbolic link. Directories, on the other hand, are indicated by a ‘d’ in this position instead of an ‘l’. Regular files are indicated by a ‘-‘ in the first position (there are some other characters that can appear here as well, but they are beyond the scope of this document). The other characters are referring to file permissions for the user, group, and other users respectively. I am going to ignore these for now.
I am also going to skip by the entire middle section of the directory listing and move to the end, which is the name of the file. If you look at the three files listed above, you will notice that the top one shows the name of the file “linux”, followed by an “->” and then “linux-2.4.18. This means that the file “linux” is a symbolic link that points (hence the nice arrow [“->”] motif) to “linux-2.4.18”. If you look at linux-2.4.18, you will see that it is a directory (notice the very first character of the “linux-2.4.18” line is a ‘d’ signifying a directory).
Once you have determined that you have a “linux” file in the “/usr/src” directory, do one of the following.
If the “linux” file is a symbolic link, delete it by entering “rm linux” at the command line.
If the “linux” file is a directory, rename it by entering “mv linux linux.old.one” at the command line.
You should now be ready to continue.
Step 6: (Uncompress the “linux-2.4.20.tar.gz” file)
Now we need to uncompress the linux-2.4.20.tar.gz file so we can access the kernel source. To do this, enter “tar xvzf linux-2.4.20.tar.gz” at the command prompt. It will take a while to uncompress the “linux-2.4.20.tar.gz” file. When it is done, you should be back at the command prompt (‘#’) again.
Step 7: (Creating a symbolic link called “linux”, which points to “linux-2.4.20”)
Finally, we can create a symbolic link called “linux” that will point to our new kernel source code, which is located in the “linux-2.4.20” directory. Enter “ln -s linux-2.4.20 linux” at the command line to create this symbolic link. If you type “ls -l” at the prompt, you should now see a symbolic link called “linux” that is pointing to the “linux-2.4.20” directory (or the directory for whichever version of the kernel you decided to download).
APT FILES NECESSARY TO CONFIGURE AND COMPILE YOUR KERNEL
In order to configure and compile our kernel, we are going to need to use apt (or Synaptic if you prefer) to download a few things.
Enter the following command, while logged in as root, to download what we need (or select each of the items in this list from within Synaptic and install them that way):
“apt-get install tk8.2 make gcc bin86 libc6-dev kernel-package”
In this tutorial, I will be using the graphical kernel configuration tool from within X. If you would rather use the command line configuration tool, you will need to replace “tk8.2” with “libncurses5-dev” in the command above (or you can install both of them and do it either way you want to; depending on your mood).
After everything is downloaded and installed, a screen titled “Configuring Binutils” will be displayed. It is warning saying that this version of binutils will not work with some kernels. Since we are using the latest stable kernel, we will not have any problems. Just press enter to continue.
STARTING THE LINUX KERNEL CONFIGURATION TOOL
Assuming you are still in the “/usr/src” directory and have followed the instructions above, enter “cd linux” to change directories into the linux directory (which you may recall is a symbolic link to the linux-2.4.20 directory).
Once you are in the “/usr/src/linux” directory, you are ready to start the kernel configuration tool. Enter “make xconfig” at the command line to start the Linux Kernel Configuration tool.
If you would rather use the command line version of this tool instead of a graphical window, you need to enter “make menuconfig” at the command prompt. I’m not going to cover this tool in this walkthrough, but I think you should be able to follow along since the two tools are somewhat similar.
You should now be looking at a gray screen with a lot of buttons on it. If you received an error at the command line, and the tool didn’t launch, open up another terminal window and enter “xhost +” as your regular user in order to allow other users (in this case root) to launch graphical applications from within your X environment. Once you have done this, enter “make xconfig” as root again to launch the Linux Kernel Configuration tool.
If the Linux Kernel Configuration tool still won’t start, and you are still getting an error, make sure you installed all the necessary tools mentioned above. These are:
tk8.2, make, gcc, bin86, libc6-dev, kernel-package, libncurses5-dev (only necessary if you want to use the command line configuration tool)
If you have been able to successfully launch the Linux Kernel Configuration tool, we can continue to the next section.
You should now have the Linux Kernel Configuration tool open. Before we begin, I recommend moving the Linux Kernel Configuration window up to the top of your screen. We will be opening up many child windows during the process of configuring the kernel, and those windows will pop up in relation to the main window (the one with all the buttons on it). If you place the main window towards the bottom of the screen, many of the child windows will appear mostly off the screen and you will forever be dragging them up so you can see them. You can save yourself a lot of clicking, dragging, and cursing by moving the main Linux Kernel Configuration window to the top of the screen.
Configuring the kernel sounds like a very scary task to some, but in reality, all you are doing is answering a whole bunch of multiple choice questions. For the most part, the Linux Kernel Configuration tool will ask you if you want to load support for something, and you will answer ‘Y’ (Yes) to load support for that item, ‘N’ (No) to not load support for that item, and ‘M’ (Module) to load support for that item as a module.
The benefit of loading things as modules is that the kernel is smaller (and probably faster) and you can load and unload that module at will without having to recompile your kernel. For the first time, however, I recommend selecting ‘Y’ for things you want to support. You can read about how to use modules later; once you are familiar and comfortable with recompiling your kernel.
Now, there is really no way for me to walk through every setting of the Linux kernel, since everyone’s hardware is different. However, the Linux Kernel Configuration tool has a lot of help available. In fact, every multiple choice line of the Linux Kernel Configuration tool has a help button associated with it, and there is almost always good information in the help dialogs. I highly recommend reading the help dialogs for each line as you go through the kernel. It will help you make the right choices for your hardware, and also help you get familiar with the services the kernel provides.
Code maturity level options:
To see an example of the Linux Kernel Configuration tool and how it works, including the help dialogs, click on the “Code maturity level options” button, which is at the top left corner of the Linux Kernel Configuration window. You will notice that a new dialog window appears. In the case of the “Code maturity level options” dialog, there is only one question you need to answer, “Prompt for development and/or incomplete code/drivers”.
Before we decide whether or not we want support for this item in our kernel, let’s look at the help dialog. To do so, click on the “Help” button to the right of the “Prompt for development and/or incomplete code/drivers” text.
After you have read the help dialog, go back to the last paragraph and look at the first sentence again. It reads, “Unless you intend to help test and develop a feature or driver that falls into this category, or you have a situation that requires using these features, you should probably say N here.” Many of the helps that are available in the Linux Kernel Configuration tool will explain what you are currently looking at and also suggest answers to you. I think this is very useful for those who are not familiar with compiling their own kernel. If you are unsure about a particular line item, I recommend following the suggestion offered by the help dialog. If no suggestion is given, the default value is usually a safe bet.
Just in case anybody has a question about this, by enabling the “Prompt for development and/or incomplete code/drivers”, you enable sections in the Linux Kernel Configuration utility which are considered experimental or still a bit unstable. Firewire support is an example of this. If you look at the main window of the Linux Kernel Configuration tool, you will notice that there is a button for Firewire support that is disabled (meaning you can’t click on it). If you were to select ‘Y’ for “Prompt for development and/or incomplete code/drivers” and then look at the main window again, you would see that the Firewire support button is now enabled. I don’t recommend enabling this for now. Wait until you are more familiar with configuring your kernel.
Now that we know what the “Prompt for development and/or incomplete code/drivers” line item is, we can safely select ‘N’ (which is the default) at the left side of the line. You will also notice that there are only options for Y (Yes) and N (No). M (Module) is missing. If any of the three choices (Y, N, or M) are unavailable for a specific kernel option, it will not be displayed.
Since there are no more kernel settings on this dialog, click the “Next” button at the bottom of the dialog to go to the next dialog in the list. You could also click the “Main Menu” button and then select the next button below the “Code maturity level options” button, which is the “Loadable module support” button, but it is easier in my opinion to simply click the “Next” button when you are done with each dialog, and move through the configuration process in a linear fashion.
Loadable Module Support:
On the “Loadable module support” dialog, you will notice that there are three kernel options you need to set. Please read the descriptions of all three options and then select ‘Y’ for each of them. Press the “Next” button when you are finished.
Processor Type and Features:
This is the point of the kernel configuration where it gets specific to your hardware. The only reason I am bringing this dialog up is to show the drop down lists that also exist in the Linux Kernel Configuration tool, and help you out with a couple of the more cryptic options.
The very first item on this dialog is the “Processor family” option. You will notice, however, that instead of the standard Y – M – N choice that you have previously seen, you are presented with a button instead (I believe the default, and therefore the title currently displayed on the button, is “Pentium-III/Celeron (Coppermine). Click this button and select your computers processor from the list. If you don’t know what kind of processor you have, the default will work, but it won’t be optimized for your machine. My machine, for example, uses an AMD Athlon processor, so I will select the line that says “Athlon/Duron/K7” from the drop down list. If you don’t know what processor you have, 386 is a safe, but un-optimized choice.
Please read the help dialogs available for each of the remaining options and chose the appropriate Y (Yes), N (No), or (M) Module settings for each. When you are finished, press the “Next” button. Also notice that some of the options you mill run into are not checkboxes or drop-down lists, but are actually buttons that bring up new windows. Make sure you click on all of these. Also, if you always click the “Next” button at the bottom of each window, you are guaranteed to see all aspects of the kernel. If you don’t do this, you might miss something.
I will help configure CD-R/RW drives, Journaling file systems, and sound cards in a minute, but in the meantime, continue the procedure of reading the help for each line, making the appropriate selection (Y – N – or M), and selecting “Next” at the bottom of each window until you have gone completely through the kernel configuration. This will take some time, but it is well worth it.
I wish I could offer more help during this process, but I don’t know your hardware, nor do I know what specifically you want to do with your machine. Therefore, I leave you in the competent hands of the help screens.
I would like to suggest that you adhere to the following guidelines, at least until you become familiar and comfortable with the Linux kernel. Often times, people think, “I’ll just install support for everything”. This is a very bad idea. Only compile support in for things you know you want or need. Also, if you don’t know what something is, just accept the default. If you have questions, please use a good internet search engine, such as Google, to look for help. You may also email me if you’d like and I will help out where I can.
Please go through the entire kernel once before continuing.
CONFIGURING YOUR KERNEL FOR SOUND
Now that you have gone through the entire kernel once, let’s go back and configure support for sound, journaling file systems, and CD burners. We will start with sound.
Click on the “Sound” button, which is the third button down in the third column (it may be in a different location if you are using a different version of the kernel, but it should be labeled “Sound” still). This will bring up the “Sound” window.
The first item on this window says, “Sound Card Support”. You need to set this to ‘Y’. Then, you need to select the correct sound card from the list of sound cards presented here. For example, I have a Sound Blaster Live! Value card. To enable support for this card, I want to set the “Creative SBLive! (EMU10K1)” option to ‘Y’.
Another popular card is the “Creative Ensoniq AudioPCI 97 (ES1371)”. If you aren’t sure what card you have, or if your card is built into your motherboard, try setting this option to ‘Y’. More often than not your sound card will work with this setting.
If you know which card you have, set the appropriate option to ‘Y’ and set everything else to ‘N’ (except for the first option, “Sound Card Support” of course). When you are done, click on the “Main Menu” button.
Next, let’s configure your machine to support a CD burner. Linux only supports SCSI CD burners, so if you have one, you should already be able to burn CDs under Linux. Most people, however, own IDE CD burners and by default these are not supported per se under Linux.
Fortunately, the Linux kernel can be configured to support your IDE CD burner through SCSI emulation. To set this up, we will need to go into a couple of different areas in the Linux Kernel Configuration utility.
The first area we need to configure is the “ATA/IDE/MFM/RLL Support” area. From the main configuration screen, click on the button labeled “ATA/IDE/MFM/RLL Support”. This will bring up a Window with only two items on it. The second item is a button labeled “IDE, ATA and ATAPI Block Devices”. Click on this to bring up a new window.
You should now be on the “IDE, ATA and ATAPI Block Devices” window. There are several different ways to configure your machine to support your IDE CD burner as a SCSI device, however, for the sake of simplicity; I have chosen to do it as described below.
First, you need to disable support in your kernel for IDE CD-ROM drives. Do this by setting the “Include IDE/ATAPI CDROM Support” option to ‘N’.
Next, you need to enable SCSI emulation support by setting “SCSI Emulation” to ‘Y’.
NOTE: For those who like to complain that I didn’t do something a certain way that you happen to like, I know this may not the preferred way to add support for a CD burner, but it works and it is simple (after all, this article is geared towards new users). Once you are comfortable with configuring your kernel, feel free to add support for IDE CDROMs back into the kernel and specify which CDROM drives should be considered SCSI via the ‘append=”hdx=ide-scsi’ in lilo.conf. I’m not going to cover that method in this article.
Click the ‘OK’ button to close this window, and then click on the “Main Menu” button of the “ATA/IDE/MFM/RLL Support” to close it as well. You should now be back at the main menu.
Next, click on the “SCSI Support” button on the main menu.
On the “SCSI Support” window, set the following options to ‘Y’:
SCSI Support
SCSI Disk Support
SCSI CD-ROM Support
SCSI Generic Support
Enable Extra Checks in New Queuing Code
Set everything else to ‘N’.
NOTE: It is usually difficult for new users to track down SCSI issues, and you usually don’t need to when you are only using SCSI emulation as we are here. If you would like to support SCSI error logging (for fun or because you are having a problem), then you can also enable the following options:
Verbose SCSI Error Reporting
SCSI Logging Facility
That’s it. Click on the “Main Menu” button to close the SCSI window.
ENABLING SUPPORT FOR THE EXT3 FILE SYSTEM (YOU WANT TO DO THIS)
Finally, let’s enable support for the EXT3 file system. There are other journaling file systems supported by the Linux kernel as well, such as JFS and ReiserFS, but I am only going to focus on EXT3 in this article. EXT3 is very stable and if something does go wrong, you already have the tools to work with and make corrections to the file system since it is compatible with the standard EXT2 filesystem.
To enable EXT3 support, from the main configuration window, click on the “File Systems” button. This will bring up the File Systems window. Scroll down to the “EXT3 Jounaling File System Support” option and set it to ‘Y’. Leave everything else on this window at its default (unless there are other filesystems you want to use; such as vfat, which allows you to mount Windows FAT32 partitions).
When you set the “EXT3 Jounaling File System Support” option to ‘Y’, the item right below in, EXT3 debugging, will become enabled. Leave it at the default ‘N’.
The sound and SCSI support are now configured for us (well, except for changing the /dev/cdrom device to point to the right place, which we’ll do later), but we are not quite finished with the EXT3 support yet. However, we must compile the kernel before going on with those tasks.
Click the “Main Menu” button to close this window.
SAVING THE KERNEL CONFIGUATION AND COMPILING
Now we are ready to compile the kernel. Before we do that, however, I would like to mention one thing. If you have multiple machines that you want to install the same kernel on (This won’t work well if the hardware on the machines isn’t the same) click the “Store Configuration to File” button. This will save all the changes you just made to a file. You can then copy that file to your other machines, and when you open the Linux Kernel Configuration utility on those machines, you just have to click on the “Load Configuration from File” button and open your saved kernel file. This will save you from having to go through the configuration process on each machine.
Now, let’s compile the kernel. From the main Linux Kernel Configuration window, click on the button titled “Save and Exit”. It will pop up a window telling you to check the top level makefile and run make dep. You don’t have to do either of these things, so just click the “OK” button. You should now be back at the command prompt.
At the command prompt, type “pwd” to print the working directory. It should return “/usr/src/linux” (if it returns anything else, type “cd /usr/src/linux” to go to the directory that contains your kernel’s source code).
Once you are in this directory, type the following two commands:
make-kpkg clean
make-kpkg –revision=786:MyKernel2.4.20 kernel_image
The second of these commands is where the actual compiling takes place. On my AMD Athlon 1800+ machine, the compile process takes around ten minutes to finish. On one of my older machines, it can take over an hour (on a 486, you’re probably looking at a few days). If you have an older machine, go eat lunch and enjoy a good comedy movie. The compilation should be finished by the time you come back. You probably need a break anyway.
If you really want to understand the deep crevices of what is going on here, you can read the documentation that is located in /usr/doc/kernel-package/ for more information. In a nutshell, however, what you are doing is creating a .deb file that we are going to install in exactly the same way we install programs; using the dpkg utility. This file we are generating will automatically handle the system configuration tasks for us that the poor saps that use other Linux distributions have to do manually. This is generally a good thing.
INSTALLING THE NEW KERNEL
Once you have finished lunch and a movie, your machine should be finished compiling the kernel and you should be back at a prompt. You should also have a new file in your /usr/src directory.
Let’s go there now by typing “cd /usr/src” at the command line. If you type “ls -l” at the command prompt, assuming you didn’t receive any compile errors, you should see a file called “kernel-image-2.4.20_MyKernel2.4.20.deb”; or something like that.
Now we need to install the kernel, just as we would any .deb file, by using the dpkg utility. Type “dpkg -i kernel-image-2.4.20_MyKernel2.4.20.deb” (or the name of the file if yours is different) at the command prompt and press Enter.
Once the installation is finished, you will be prompted to create a boot floppy. I suggest you do so, but you don’t have to.
Next, you will be prompted to install a boot block using the existing /etc/lilo.conf. If you don’t say yes here you won’t be able to boot your machine into your new kernel (unless you said yes to the floppy question, but then you can only boot with that floppy). Regardless of which you choose, make sure you say “yes” to either or both questions; otherwise you will be left without the ability to boot your shiny new 2.4.20 Linux machine.
Once this process has finished, you need to reboot your machine. Upon reboot, type “dmesg” and look at the output. Look for any errors. You should also notice (if you can read cryptic Linux messages) that your sound card has been recognized. If you see a problem, such as you picked the wrong sound card, then you will need to make the change in the kernel and try again. If that happens, see the last section of this article.
Remember a while back when I said we weren’t done with the EXT3 stuff yet? Well, it’s now time to remedy that situation. Before beginning, you will need to have a text editor such as vim, nano, pico, or any of the graphical ones available. Please pick one that you like and then let’s continue.
First, you will need to know which partitions you have on your machine. If you don’t remember, you can type the command “df” at the command line, and it should list all the partitions mounted on your machine. Here is an example of df’s output:
Filesystem Mounted on
/dev/hda1 . . . /
/dev/hda3 . . . /usr
/dev/hda5 . . . /var
/dev/hda6 . . . /home
Now you need to use this information in the following command. You can either type:
“/sbin/tune2fs -j /dev/hdxx” (where x is the drive and partition number, such as /dev/hda1, or /dev/hdb3) at the command line for each partition you have, or you can do it all at once using the following script command (don’t type the ‘#’ or ‘>’, those are the prompts. Also, press
# for each in /dev/hda1 /dev/hda3 /dev/hda5 /dev/hda6
> do
> /sbin/tune2fs -j $each
> done
If you get an error, you either didn’t type it correctly, or you have put an invalid device in the list. Make the appropriate corrections and retype the command.
This will convert all of your partitions from ext2 to ext3. Once this is done, you need to tell Linux to mount all your partitions as ext3 partitions. This is where we need the text editor.
As root, open the file /etc/fstab. Wherever you see the word “ext2”, change it to “ext3”. Once you are finished, save the file and exit the editor.
Now, we have to do one more thing before we reboot again (you could manually unmount and remount all your partitions into ext3, but it’s probably easier to just have you reboot again and have Linux automatically mount everything using ext3 for you).
I briefly hinted at this before, but we need to fix our /mnt/cdrom device. It is currently pointing somewhere like /dev/hdb, however since we made our CDs emulate SCSI, our CDROM doesn’t exist there any more. We need to fix the /dev/cdrom link.
To do this, you first need to know where to change the /dev/cdrom link to point to. Usually, it will be /dev/scd0, but let’s make sure. Place a data CD in the CDROM drive and type:
“Mount /dev/scd0 /cdrom”
If all goes well, you should be able to type “ls /cdrom” at the command prompt and get a directory listing of your CD. If not, and especially if you have more than one CD device in your computer, then try other devices, such as /dev/scd1, /dev/scd2, etc.
Once you know which drive you want to be the default CD drive, change the /dev/cdrom symbolic link to point at it (you probably remember symbolic links from our discussion on where to save the Linux kernel source code. /dev/cdrom is just a symbolic link that points to a device on your computer). To demonstrate how to do this, I am going to use my system, on which the default CD drive is on /dev/scd0. To change the /dev/cdrom link to point to the right device, type these commands at the command line:
“rm /dev/cdrom” (this removes the current, incorrect /dev/cdrom link)
“ln -s /dev/scd0 /dev/cdrom” (this will create a new /dev/cdrom link that points to the correct device)
Now you should be done. To make sure, at the command prompt, type “umount /cdrom” to unmount the CD you mounted a few minutes ago. Next, you should type “mount /cdrom” at the command prompt. You should now be able to type “ls /cdrom” and get a directory listing of your CD. If so, you have done everything correctly. If not, go back and check your settings again. Also, it should be there already, but if something isn’t working, type “cat /etc/fstab” at the command prompt and make sure your fstab file contains a line that begins “/dev/cdrom /cdrom”. If not, you will need to add the following line to your fstab file:
/dev/acd0c /cdrom cd9660 ro,noauto 0 0
If everything is working, it is time to reboot. If you have placed a bootable CD in your drive during this process, remove it before rebooting.
WHAT IF SOMETHING GOES WRONG?
Seeing as this is probably the first time you have compiled your kernel, it is possible, although entirely unwanted, that you will make a mistake (such as including the wrong sound card in the kernel).
There are a few things that you need to do before trying to recompile your kernel again. First, you need to delete or rename the .deb file in your /usr/src directory (or change the name you give it during the “make kpkg” steps listed earlier in the article).
Next, if you are attempting to recompile the same kernel version as before (for example, 2.4.20), you will need to rename or delete some things before you can recompile again. The nice thing is that during the “dpkg -i
If there is one point that I want to emphasize in this article, it is to read everything; both this document and the help screens. Don’t guess; that will pretty much guarantee failure.
CONCLUSION
That is it. Hopefully you are a little more comfortable with obtaining, configuring and compiling your Linux kernel under Debian. I hope you have fun learning with Debian.
About the Author:
My name is Clinton De Young and I work as a Development Manager for a software company called Altiris. I am a native English speaker, and am fluent in Japanese. On the side I translate documents to and from Japanese and sometimes freelance with companies to write software for the Japanese market. In spite of all that, my family comes first. They are the most important people in my life.
Articles like this are what most Linux users are looking for! Slashdot usually is a little too snobbish to post stuff like this but people need this. Hell of a lot easier than being told to RTFM on some mailing list. Good job, Clinton!
Considering you can install the kernel source via apt, and basically just untar, copy a config files, run make oldconfig, and then run the make-kpkg stuff … this tutorial is more like a generic kernel install than it needs to be. Plus the kernel sources gotten via apt have been patched for cramfs support so you can use the nice initrd option that is standard in debian kernels, which you don’t get from vanilla sources.
http://newbiedoc.sourceforge.net/
Strike, I think your post is indicatave of the problem new users to Linux, or Debian in this case, have. People who are familiar with any given process are all too happy to teach new users how to do whatever it is in an extremely terse and impossible to understand format. Then they get mad when the new user has questions and tell him/her to go RTFM. A pseudo-polite way of saying use Windows you pathetic imbicile.
Reading your post, someone new to obtaining, configuring and compiling a kernel under Debian would know, perhaps, that they could use apt to get the latest kernel, but what do they type? They don’t know, so your instructions become useless to them. If they do figure the apt part out somehow, how do they untar those sources? Where do they put them once they are untarred? What config files do they copy? What is the cramfs patch and why do they want it? What is the nice initrd option you mention and why would they want it?
I’m glad that there are people like Clinton out there who are willing to spend a good deal of their time (for free I would expect) writing instructions like this. I think it is very helpful for new users. Once somebody is able to get familiar with compiling their kernel using some good directions, then they can branch out from there and explore other options. I think this article is a great place to start.
Many years ago, I worked in technical support helping people with their computer hardware problems. One of the things the company I worked for made us do was have the customers open their computers and do things like pull out the sound card and modem in order to troubleshoot problems. Many people were very timid of doing this. I found that by talking them through it and verbally holding their hand and reassuring them the task was indeed possible every few seconds, they were comforted and were able to do what they considered a very difficult task. I think this article provides new users with that type of reassurance and guidance. Its nice to see that not all Linux users are terse and selfish with their knowledge.
Thanks Clinton for giving new users an excellent place to start.
Iconoclast: have you ever considered the occasions where people are told to RTFM, because *gasp* the questions they are asking are in the manual or man pages?
Just because someone points you to documentation doesn’t mean they think you’re an idiot.
Senor-D: Do you think the solutions to problems could be made intuitive enough that referring to the manual was not required?
there’s a good debian specific kernel howto on linuxorbit.com
Great article, I’m sure lots of people will find it usefull.
I have installed debian reading Clinton’s install post easily. This article answers to many questions that I didn’t resolve after Debian install . Just one missing point which confuses many newbies. There should be some directions about compiling ACPI in the kernel or how to enable apm in Debian especially for laptop users.
I think that about apm the problem could be resolve easily by just adding this line in /etc/lilo/conf append=”apm=on” , but practically nobody says that
Just a newbie thought.
Iconoclast: have you ever considered the occasions where people are told to RTFM, because *gasp* the questions they are asking are in the manual or man pages?
Just because someone points you to documentation doesn’t mean they think you’re an idiot.
They often tell you to RTFM even though the answer to the actual question is usually just a one line command or parameter. Sure, people should learn to check the manuals, but people should also learn to answer in a proper way when they know the simple answer.
What a great resource! Can’t say thanks enough.
I didn’t notice anything Debian specific in that article. Debian users should use make-kpkg. Makes it so much easier.
The above doesn’t work especially for newbies. It is easy for an experienced person to say and do it but not for newbies. Sometime the newbies ask “How to RTFM” since they don’t even know about man …, info…., *** –help and other command to read the manual. There are a lot more people than came from non-unix world comapared to those familiar with the said command that unix use.
So the best thing is the articles such as this one. And for any newbies that looking for guidelines on Linux, most information can be found easily at http://www.tldp.org . Here many howtos are available for reference. Other alternative is just googling the web.
By the way, I think Debian kernel source for 2.4.20 still didn’t fix the bugs fo ALI 15×3 chipset which cause the kernel to hang during boot time. I’ve to path it to eanble my laptop to work. And I think many other distro also having this problem such as Mandrake.
Its nice to see that not all Linux users are terse and selfish with their knowledge.
As someone who has put forth a lot of effort in documenting process such as getting your CD burner working, building a kernel, and creating your own LAMP project (besides numerous other papers and howto’s), I take great offense to this comment. It’s not that all advanced users are adverse to helping newbies… it’s that most topics (especially building a kernel) have been documented extensively online already. I find that most beginners are just too lazy (yes, lazy!) to research this information at all.
Just as you shouldn’t stereotype about all advanced users, I shouldn’t cast all beginners into this role. Fact is, I had to start somewhere as well… it was at a local Linux User’s Group. The folks there were very helpful, and I go back routinely to give talks on a variety of topics.
Again, it’s not that “we” are being terse… but we appreciate when folks show some manner of effort. Particularly since we aren’t getting paid for any of our services. It seems like the only time most newbies are even aware of our work is when they might get promoted on a site like this. Heaven forbid they use Google to find the information they require.
-fp
Sorry, didn’t mean to post that anonymously.
-fp
I’ll have you know that I’ve spent plenty of time writing documentation that wasn’t just for Linux, but specifically geared at newbies. Not only that, I’ve given personal attention to helping newbies become more familiar with Linux for about 3 years now. I’ve written several articles for what was LinuxNewbie.org and has recently become JustLinux.com, not to mention I moderated the forums there (for a span of time there, I was pretty much the only moderator around) for several years, helping innumerable people both directly and through maintaining a community site. So you can spare me your lectures and name-calling, because I have most certainly “done my part” to advancing the newbie community.
Besides, I did provide the basic instructions right there in my post. No, they aren’t a step-by-step process, but it’s a starting point. Anyone who is semi-familiar with APT can figure out how to apt-cache kernel source. And from there, it’s relatively easy to figure out. This totally ignores the fact that the Debian kernel image debs are suitable for the vast majority of cases. The only cases I can see where you might need to use a different kernel (and the Deb kernels are more modularized than what most people produce thanks to the initrd part, so “slimming it down” isn’t an excuse) is if you have hardware that isn’t supported by the current kernel debs, and the kernel modules require a patch to the kernel instead of just a binary installation.
So, in short, Iconoclast, call me part of the problem all you want but I sleep soundly at night knowing that I’ve definitely done my part whereas you seem to get your jollies by crying foul at those who provide criticism.
anon wrote:
> there’s a good debian specific kernel howto on
> linuxorbit.com
Thanks! Didn’t know about that site. Found a number of howto’s and mini-howto’s, as well as a pile of “quick tips”.
[i]I didn’t notice anything Debian specific in that article. Debian users should use make-kpkg. Makes it so much easier. [i]
It’s there. Read the whole article.
Iconoclast: have you ever considered the occasions where people are told to RTFM, because *gasp* the questions they are asking are in the manual or man pages?
I have, but there are times when someone says RTMF, and the information is NOT in the manual, or is very difficult to understand. Also, as I mentioned earlier, there are times when the manual does not help new users feel secure in their own abilities to accomplish certain tasks. This article helps people in that way.
I’m not bashing the people that write manuals. They are fine for their target audience. However, Linux’s target audience is beginning to expand into the casual user arena. The documentation should too.
As someone who has put forth a lot of effort in documenting process such as getting your CD burner working, building a kernel, and creating your own LAMP project (besides numerous other papers and howto’s), I take great offense to this comment.
I’m sorry that you felt I was referring to you personally. I wasn’t. I was talking about a certain stereotype. If you don’t fit that description, then I wasn’t talking about you.
It’s not that all advanced users are adverse to helping newbies… it’s that most topics (especially building a kernel) have been documented extensively online already. I find that most beginners are just too lazy (yes, lazy!) to research this information at all.
You are correct to some degree I believe and I agree with you (this is exactly why I personally don’t actively look for people to help with Linux). However, as I mentioned above, often times new users just need to have a little handholding and compassion shown towards them. They are willing to venture out into the unknown when they feel somebody is there to back them up. Somebody they feel who cares that they have success. I think Clinton has done a lot towards this end in his article.
Just as you shouldn’t stereotype about all advanced users, I shouldn’t cast all beginners into this role. Fact is, I had to start somewhere as well… it was at a local Linux User’s Group. The folks there were very helpful, and I go back routinely to give talks on a variety of topics.
I don’t stereotype all advanced users in this category. I am an advanced user, and if somebody asks me to help them, I will (I just don’t go looking for those opportunities and usually I just end up doing the work for them while they watch); however, we have all run into the stereotype I was talking about. It is common enough that a lot of new users hate Linux experts. Is this not true?
Again, it’s not that “we” are being terse… but we appreciate when folks show some manner of effort.
I appreciate the same thing, and think it is necessary. However, I also appreciate that things that seem trivial to me now, were not trivial to me six or seven years ago. Often times, Linux documents are written to those with experience. I think beginner docs are very important. I haven’t read your documentation, so I’m not commenting on it, so don’t take offense.
Particularly since we aren’t getting paid for any of our services. It seems like the only time most newbies are even aware of our work is when they might get promoted on a site like this. Heaven forbid they use Google to find the information they require.
Perhaps they don’t know what to search for. Anyway, I’m glad that Clinton wrote this article and that OSNews is open enough to this type of documentation to post it.
Besides, I did provide the basic instructions right there in my post. No, they aren’t a step-by-step process, but it’s a starting point. Anyone who is semi-familiar with APT can figure out how to apt-cache kernel source.
That was my point actually. This article is specifically geared towards new users; ones that probably don’t know anything about apt. Therefore, for this article’s target audience, your post is cryptic and probably not very useful.
It appears that this article is very detailed on purpose, I would imagine, and very geared towards new users. Perhaps the author thought a more generic approach was the best way to write the article. If you feel differently, perhaps you could write an equally detailed article on the method you feel is best so people can have a choice of well documented methods instead of complaining because this guy didn’t write exactly what you think he ought to have.
Again, I think the article serves its purpose well.
Sure it gets the job done, but a generic kernel compile article would get the job done as well. There’s nothing wrong with doing make dep bzImage modules modules_install in Debian for kernel installs. My whole point (which you seem to have missed) is that if you are going to gear an article to a specific distribution, go all the way. Herbert Xu goes to a lot of trouble to package up the kernel sources so people can apt-get them and be happy – no reason not to use them, especially when they are geared towards Debian.
Interesting Title however the content is not the “Debian way” unfortunately and will give wrong advices to newbies.
I don’t think you can have initrd image from a vanilla kernel as debian kernel sources have a special patch for cramfs.
Herbert Xu takes great care to package kernel-sources with security patch from development versions. The safest is to use them, unless you’re a developper yourself.
I was glad to see the author telling people to use make-kpkg to build the kernel, another of the many helpful advantages of Debian over many other distributions. I wonder why he told people to go to http://www.kernel.org for the source instead of just using apt:
#apt-get install kernel-source-2.4.20
Anyway, an excellent walkthrough. Also, the part on using SCSI emulation to get IDE cd recorders to work was great – I don’t have any problems building new kernels, but I hadn’t yet figured out why my new cd recorder plays but doesn’t record under Linux. Thanks.
That’s smart : you post under the nickname fuzzyping and you think that’s not anonymous ?
At which point in the article did you guys hit snooze and went back to sleep ? This text shows how to install a new kernel in Debian : )
Its nice to see that not all Linux users are terse and selfish with their knowledge.
As someone who has put forth a lot of effort in documenting process such as getting your CD burner working, building a kernel, and creating your own LAMP project (besides numerous other papers and howto’s), I take great offense to this comment. It’s not that all advanced users are adverse to helping newbies… it’s that most topics (especially building a kernel) have been documented extensively online already. I find that most beginners are just too lazy (yes, lazy!) to research this information at all.
Just as you shouldn’t stereotype about all advanced users, I shouldn’t cast all beginners into this role. Fact is, I had to start somewhere as well… it was at a local Linux User’s Group. The folks there were very helpful, and I go back routinely to give talks on a variety of topics.
Again, it’s not that “we” are being terse… but we appreciate when folks show some manner of effort. Particularly since we aren’t getting paid for any of our services. It seems like the only time most newbies are even aware of our work is when they might get promoted on a site like this. Heaven forbid they use Google to find the information they require.
-fp
Took the worlds from my mouth. Most people don’t realize that almost everybody here had only Windows background and even so managed to use Linux properly an understand it. But if you tell someone to read the damn docs… Oh, my God! What horrible person you are…
if you have a linux question and have no idea where the hell the manual is that are you are asked to read, post your question at linuxquestions.org . The site is geared towards newbies.
When posting a question on a forum, THE FIRST THING YOU SHOULD DO is use the “SEARCH” command and type your question in there. It may have already been asked and answered, it will SAVE YOU TIME.
thanks,
ds
” Strike, I think your post is indicatave of the problem new users to Linux, or Debian in this case, have. People who are familiar with any given process are all too happy to teach new users how to do whatever it is in an extremely terse and impossible to understand format. Then they get mad when the new user has questions and tell him/her to go RTFM. A pseudo-polite way of saying use Windows you pathetic imbicile.”
Hear! Hear! You’ve hit the nail right on the head.
People like Strike and the rest of them, although they deny being what they are, are mostly advanced users who relish humilliating newbies and directing them to RTFM, which IMO, and for the most part, is badly written and lack clear and precise instructions for newcomers; to them, we are drooling morons, I guess “priests seldom remember when they were altar boys”.
As for Clinton De Young, he’s done it again, kudos to him.
You the Man, dog!
Hooray for passing judgement on someone who you don’t know! The world needs much more of that!
People like Strike and the rest of them, although they deny being what they are, are mostly advanced users who relish humilliating newbies and directing them to RTFM, which IMO, and for the most part, is badly written and lack clear and precise instructions for newcomers; to them, we are drooling morons, I guess “priests seldom remember when they were altar boys”.
Gee, is that why I more or less single-handedly supported a community forum for over 10,000 NEWBIE Linux users for the span of several years?
Besides, none of you are addressing the main point at all. The point is that generic kernel compile tutorials exist all over the place. If you are going to make one specifically tailored for a distribution, you should use all the resources that were designed specifically for building kernels in that distribution. In this case, that includes things like the kernel source packages, and this tutorial (which isn’t a bad one by any means) leaves those out where it would be better served including them.
Considering you can install the kernel source via apt, and basically just untar, copy a config files, run make oldconfig, and then run the make-kpkg stuff … this tutorial is more like a generic kernel install than it needs to be. Plus the kernel sources gotten via apt have been patched for cramfs support so you can use the nice initrd option that is standard in debian kernels, which you don’t get from vanilla sources.
OK, I’m an experienced Windows user (6 years) who has built his own PCs and installed the MS OSes many times. However, I’m a complete noob when it comes to linux, but I’m planning on becomeing a linux user – and therefore perhaps can offer a perspective. OK – FWIW:
Strike’s paragraph above means jack sh|t to me. Sorry buddy, but the article was way, way, way, more helpful to a noob than your snobby little text that basically may as well have been written in greek. Now, you can go ahead and call me names, MS drone and whatever other snobby little junk you can come up with, but it is funny for you to think that somehow YOUR text is superior to the one you are criticizing – as a noob, I can tell you it absolutely is not… and I’m not computer-illiterate.
Basically, it comes across as if your beef is that the author addressed complete noobs in too simple a language, and so somehow tread on your sacred ground, and you advocate making things harder for the “uworthy masses”. Thanks, but no thanks.
Anyhow, I do not intend to throw myself out there with a bunch of questions. My first course of action will be to get a primer text on Linux and read it, then use google to read some more, and then try working it out on my own. Only if I absolutely cannot find out stuff on my own would I turn to a forum. And when I do, I’ll try hard to completely ignore the RTFM types such as you.
One piece of advice – if for some reason you think the question is stupid (rightly or wrongly), and you don’t feel like answering PLEASE SHUT YOUR MOUTH and resist the impulse to say “RTFM” (to which I’d answer GFY). Tellings someone RTFM is plain rude and most importantly UNHELPFUL. If you can’t say anything helpful, don’t say anything at all, certainly silence is prefereable to “RTFM”.
….make-kpkg is the bomb diggity, on the same level as apt, IMHO.
I did not submit my comment as the intended REPLACEMENT to this article, now did I? I know how to write tutorials as I’ve been writing them for years, many of which have been extremely popular and well-received.
Would you morons please learn the difference between what is criticism of an article and what is an article itself? I’m not going to defend my perfectly sound position any more, the number of people who have supported it as well is proof enough that my points stand to reason on their own in spite of my arguments.
Sure, there are those who support you and maybe even not all of them are linuxistas with similar attitudes, but that’s not the point – there are also those who did NOT support you. If you are going to go the popularity route, that’s no measure of truth – there are those who are universally liked, and those who are not, and the burden is on the other side… if even 3 out of a hundred women you date cry “rape”, it puts a blemish on YOU, never mind the other 97 who said “never did it to me”. But this is silly, arguing over such things.
More to the point is your attitude. You like calling people “morons” – well, mister know-it-all linux guru, it is attitudes like those that people don’t like – even if some other linuxfascists support you. Why do you call people morons?
And on point of merit, about how your comment was not meant to replace the article, well, that was not the point – it was that your text was obscure to a noobie, and you claimed it was NOT, that in fact YOUR way of describing was just fine and dandy:
Besides, I did provide the basic instructions right there in my post. No, they aren’t a step-by-step process, but it’s a starting point. Anyone who is semi-familiar with APT can figure out how to apt-cache kernel source. And from there, it’s relatively easy to figure out.
Sorry, but my point (and other’s said the same) stands – your text was obscure, and since many noobs are not familiar with APT it is not OK to say “and from there it is relatively easy to figure out”. Ridiculous. You say it is not step by step, but hey, that’s what a noob often needs, so your bagging the article is pointless in the context of your far inferior text (from the noob understanding perspective). So you are wrong there – what was the point of your saying that you are giving instructions that are not step by step if it was meant for noobies? Seems irrelevant, or don’t you understand the concept of “noob” – so who is the moron here? So go ahead and call people morons, but the funny thing is, you are still wrong.
Why don’t you roll up your attitude and stuff it deep. I repeat, if you cannot say anything nice or helpful, why say anything at all? Just so you can act superior? Just so you can insult people by calling them morons? Silence is golden here – nobody benefits by your snobbism or insults – thanks, but no thanks. Oh, I know you’ll never appologize for saying “morons” – just goes to show what you are made of… wonderful.
First of all respect to Mr. De Young for his work (though your a day late, because i compiled my kernel yesterday. would have spared me the Reading Of Fine Manuals ) !
People who are in need of compileing a kernel on a debian based system allready installed a, at least to some degree, working kernel, the Woody kernel (remark). As far as i see its config file is placed in /boot (for exapmle in my case config-2.4.18-bf2.4). Why not start from this config file, use it as “guide”. Are the differences between 2.2 and 2.4 based kernel-configs too big, to load it to menuconfig directly an customize?
All I have to say is that Strike is one of the people who helped me the most when I first started using linux. I used to post on linuxnewbie.org and he was probably the one who answered most of my questions and helped the most (not to mention he was probably the nicest one there, never once told me to RTFM). I think you are all being unfair to Strike, he never once said anything about reading TFM or that newbies suck. ALL he said was that the article could have included more about how easy Debian makes updating the kernel, namely using apt to install the source instead of downloading it yourself from kernel.org. Of course a newbie isn’t going to understand what he wrote because HE DID NOT mean to sound elitist nor mean to replace the article. Are you all so big headed that you can’t see he was merely showing a way the article could be improved. This was indeed a great article (excellent in fact), but it is obviously easier to use apt to install the kernel source than download it yourself. If we are trying to help newbies like me, wouldn’t it make sense to include that in a tutorial such as this?
Anyway, you all need to lighten up and not misquote Strike. Realize that all he was saying was that Debian offered more ways to make installing kernels easier than the article suggested. He wasn’t criticizing it, he wasn’t trying to replace it and sound “l337”. Get over yourselves.
Thanks once again for all your help on linuxnewbie.org Strike
Same Anonymouse as above ^^
Strike wasn’t calling newbies morons, he was calling the people who can’t realize what his first post was actually about morons. YOU are a moron for not realizing that his “obscure text” was NOT meant as a replacement for the tutorial. Of course it isn’t going to make sense to newbies, I’m sure he knows that very well and I’m sure he could write a step by step tutorial about it if he wanted to. YOU are a moron for trying to make him seem like a bad guy without knowing anything about him. YOU are a moron for trying to make him sound like an elitist linuxfascist as you said.
‘Basically, it comes across as if your beef is that the author addressed complete noobs in too simple a language, and so somehow tread on your sacred ground, and you advocate making things harder for the “uworthy masses”. Thanks, but no thanks.’
Sorry but this just really annoys me. His beef (if it was even that) was that more could have been included about making kernel updating EASIER under Debian through apt. Notice the word EASIER, yes despite what you might want others to believe, Strike wanted to make the tutorial EASIER for newbies.
I apologize for this wasted space but personal attacks such as this are just ridiculous (especially when those who make them have no idea what they are saying)
Hey guys, we can sit here and debate why the author chose to highlight the subject the way he did and call each other names, but why not just wait until tomorrow and ask him directly? I work with the author and would have asked him directly for you all, but he wasn’t at work today.
I don’t know his reasoning, but there are a thousand different ways to obtain, configure and compile a kernel. Perhaps he just didn’t want to write a book here. Who knows? We all will tomorrow if we ask him. Can we all agree not to kill each other until then?
As someone who is relatively new to linux i found this article and Clinton’s previous one on installing debian very helpful and useful.
After using lycoris for awhile i decided to have a go at debian, mainly because of the good things users said about apt-get and issues i had with rpms, make install, etc.
Because of warnings about potential problems with installing debian i closely read both the official (and substantial) manual on installing debian from their web site and Clinton’s article on this site.
Personally, i found Clinton’s article easier to understand and follow and i used it as a guide when i installed the official (and paid for!) Woody CD of debian.
After a few attempts everything was working as i wanted.
So, IMHO what Clinton is trying to do in such articles as this is very useful and helpful for me, and presumably other noobs.
Good on ya, Clinton.
The first installation walkthrough was a dream for me, I had installed Debian before, but I didn’t think much of the defaults that I had to start with. Clinton’s walkthrough gave me an *OS* rather than a bloated piece of trash.
I will definately try out this latest tutorial too, but the one comment I would have to make is:
How come a discussion about a kernel install for Debian can erupt into a flamewar? Only in a Linux forum?
‘scuse me for stirring
Although this was a good article I prefer the real Debianized kernel compilation guide on SourceForge – http://newbiedoc.sourceforge.net/system/kernel-pkg.html
Somebody take sthe time to write a helpful article for newbies and all you guys do is argue about it! Cmon guys grow up. Just to clue you long time linux guys in here but configuring linux is a VERY daunting task for most windows users who are not used to having to do anything more difficult than click on a checkbox. Most man pages seem to be written with the experienced user in mind and will mean nothing to many newbies. People do need some handholding for a while until they get there feet wet. Yeah some people are just plain lazy. If you can’t or don’t want to explain it to them just say that it’s too much to post and advise them of newbie friendly help site and maybe give them a hint what to google for
Good one Clinton, but I admit I was quite amazed that there are needs for beginners stuff for Debian users. Without being an expert by any means, I have used Linux since 1992 (starting with Slackware, via RedHat and SuSE) compiled a dozen kernels, and I now try to invoke courage to use Debian. For, as a matter of fact, most people warn me against Debian because it is a nightmare to install, they tell me.
So if you gave me anything, it is that if newbies can use Debian, so can I…
Thanks.
Clinton’s article is excellent. I read it with some interest, as I”m making a presentation on building kernels at my LUG meeting in a couple of days.
A few observations:
1. I too was curious about why the author didn’t advise downloading the kernel source from Debian archives. Perhaps it’s because the 2.4.20 source package isn’t in the stable repository.
It is however in testing, and the procedure for getting it is relatively simple:
a) Tell apt to get package lists from testing. Open /etc/apt/sources.list with your favorite text editor. In the first line change the word “stable” to “testing”. Comment out the other lines by inserting “#” for the first character (this saves time downloading package lists you won’t be using after this anyway).
b) Do “apt-get update”.
c) Do “apt-get install kernel-source-2.4.20”.
d) Edit sources.list again. This time uncomment all the lines, and change “testing” back to “stable” in the first line.
e) Do “apt-get update” again.
2. Debian kernel sources are compressed with bzip2, but tar can handle these using -j for bzip2 instead of using z for gzip, as follows:
tar jxvf kernel-source-2.4.20
In any event, you can simply “apt-get install bzip2” along with the other packages Clinton lists.
3. At the kernel.org site, the hyperlink to “2.4.20” is indeed a patch, but to the right of it the “F” is a link to the Full kernel source. The links further right are interesting, as they show how many changes to each file in the source tree are applied by the patch. (In other words, where and how many changes took place since the last stable kernel).
4. I always check “Prompt for development and/or incomplete” in the kernel configuration. There are many items in this category that are really quite stable and have been for some time, but for some reason they’re still classified as “incomplete/development”. A good example is VESA framebuffer console support. (There are others, I just can’t think of them now.) There are plenty of “Don’t check this unless you really know what you’re doing” warnings to scare newbies away from the stuff that really belongs in this category. And anyway, isn’t the entire kernel still incomplete and under development?
5. It is not necessary to answer “Y” to “Sound support” to enable sound; “M” works just fine. I also use a module to support my sound card.
6. Kernel-package is da bomb. Use it once and you’ll never go back to make… make… make…
7. When invoking make-kpkg, using the “–append-to-version” option allows you to have more than one 2.4.20 kernel without them stepping all over each other. I use this instead of “–revision”, as follows:
“make-kpkg –append-to-version=.20030304 kernel_image”
Note the dot beginning the revision. I use the date as my argument; this way each kernel is identified by the date I compiled it. Each 2.4.20 kernel will have a different name in /boot, and its modules will be installed in a separate subdirectory of /lib/modules.
8. The grub boot loader is da bomb. Check out the Linux Journal’s web archive for “Boot With Grub”. Then install it. Run “update-grub” to generate a boot menu.
9. After you’ve installed grub, add the following lines to /etc/kernel-img.conf:
postinst_hook=/sbin/update-grub
postrm_hook=/sbin/update-grub
Now whenever you add or remove a kernel package your boot loader’s menu is automatically updated. No more editing /etc/lilo.conf, and no more needing to remember to run /sbin/lilo every time you make a new kernel. (A sample kernel-img.conf file is in the documentation, under /usr/share/doc/kernel-package.)
10. To enable your CD-ROM burner, you don’t need to enable SCSI disk support (in fact, the help for this option explains what it’s for). And all of the SCSI stuff can be modules, including “SCSI Support” itself.
11. In the what if something goes wrong section, if you’ve installed a kernel image .deb and the kernel doesn’t boot, you need to remove the .deb using dpkg:
“dpkg -P kernel-image-2.4.20.20030304”
This will remove the kernel, its System.map, and its config file in /boot, and it’s module tree under /lib/modules. It will also let the package system know the files aren’t there anymore; if you just delete these the package system won’t know about it.
If you followed my suggestion to use grub, deleting the kernel image deb will also update the boot loader menu.
Once you’ve purged the kernel package you can delete the .deb file in /usr/src.
If you use the “–append-to-version” argument you don’t need to worry about how may kernels you have of the same version. They will all have different names and won’t conflict.
That’s all I can think of now. Please understand that despite my lengthy comment I thought Clinton’s article was *excellent*. If I’d had this kind of tutorial available when I started using Debian I’d have more hair now.
Kevin
I intended to help new Linux (and specifically Debian) users with this article. Not start a holy war. Sheesh.
Well, to answer a few questions and make a couple of statements here:
First of all, there are several reasons that I chose NOT to use the kernel source off of the Debian servers, but rather download a generic kernel off of http://www.kernel.org . The first reason is that the topic has already been covered (as some have mentioned), whereas the method I used has not (well at least not much, there was a very good article about it in Linux Journal last year which chose the same route I did, only it was specific to a certain model of Dell laptop). I feel that choice is a good thing, so I chose to cover the topic from a different angle than most. There are some benefits to using a kernel from the Debian servers, but in reality, new users probably don’t care about those things right now. They just want their sound and CD-Rs to work. There are also some benefits to using a generic kernel. I will leave those choices up to new users.
Secondly, the kernel source on the Debian stable servers does not include the latest 2.4.20 kernel (at least it didn’t last time I looked). I had many requests after my previous article to show people how to install the latest kernel or development kernels; which are also not available on the Debian stable servers. I am not willing to instruct new users to go to unstable or testing to aquire these things. I figure they can venture into those branches as soon as they are ready (in my mind, knowing what those branches are and that they exist is the first step in determining readyness. I don’t want people doing it just because I say so, I want them to do it when they know how to do it and why they want to).
I did not mention my intentions because I felt it would confuse new users(which is after all who this is written for). In fact, I feel that many of the comments regarding my article are confusing and incapacitating to new users. There are many ways to install a new kernel. Why muddy the waters for a new user by bombarding them with information describing all these various ways? How then would a new users choose the best way for them? In my opinion, it is best to teach one way clearly and concisely, and as thoroughly as possible, and then let new users choose for themselves the methods they will use as they aquire new knowledge and experience.
Another reason that I did not use a Debian kernel is that I wanted the article to be useful to users who wanted to try and compile a kernel on a non-Debian machine. Sure, the make kpkg stuff is Debian specific, but Eugenia has written a very good, although short, description of the generic way of installing the kernel on any Linux system. I felt that between the two articles, everybody would be benefited.
The truth of the matter is that anyone who can read and is not mentally impared, can install and make good use of Linux (or any other OS for that matter). More than information, what new users need is to feel that something is possible. Once they accomplish something for themselves, through good instruction or otherwise, they will have the confidence to explore new methods and such. The key is for them to feel that they can do it the first time.
There are many “tutorials” that say do this and do that, but if a new user types a command wrong, or accidentally skips a section, then they fail in their first attempt, and many are unwilling to try again. That is why I try to describe the scenery, so to speak, as we go along. I want people to be able to look around and say, “yep, that’s exacly where I’m at so things must be going well”. I want them to have that confidence in themselves and in their guide; my article in this case. That is why I write the way I do.
There are many tutorials and books, such as <product name> for Dummies, or <product name> for Complete Idiots, but I find them insulting to new user’s intelligence before they ever open the book. This same insulting attitude is commonplace in Linux forums as well.
I feel that new users are intelligent human beings who just need to be shown what to do; and not be insulted in the process. That is why I use the phrase “very verbose”. It indicates that the information will be extremely plentiful, which is something I think benefits new users. I also don’t feel the phrase is insulting in any way.
One last comment while I’m thinking about it. Somebody was upset because I had new users go through the entire kernel instead of opening the config file for the current kernel. My response is that opening an existing config file teaches new users how to open a file (something that most of them are probably good at already). Since my intent was to teach them how to configure the kernel, I instructed them to read each help screen as they go through the entire kernel. What better way to learn a topic than to actually do it?
Anyway, if you all have more questions or complaints, feel free to ask. I will respond to them.
Well, I wrote explaining why I chose to do things the way I did, but they never showed up here. If they don’t appear later today, I will rewrite it in order to put and end to the holy war.
http://www.linuxjournal.com/article.php?sid=5656
http://www.linuxjournal.com/article.php?sid=5676
Should’ve at least referenced this LJ article from Dec 2001.
I would have, but I couldn’t find it. I read it in the print version anyway I believe, but it’s been too long ago.
Thanks for the links.
Just a suggestion.
Instead of all those line dedicated on “how to get the latest kernel”, the author should indicate ppl to click on the “F” by the side of the wanted kernel version. F for FULL source.
I originally did, but when I had somebody go through my article before posting it, they had a hard time finding the ‘f’. Since this is for new users, I changed the article in order to avoid confusion.
A nice description. I’ve a question. Why, are you compile a kernel under root and why you don’t use the fakeroot envearonment? The kernel-source package has a long term REAME with description of its.
Because, I didn’t want to I guess. I feel that adding descriptions of such things takes longer to explain, and I also think it clouds the true intention of the document. I don’t mind writing a document to thoroughly explain fakeroot and how to use it though.
I just noticed that I posted a comment under Iconoclast name last night. That is not me. As many of you know, I work with Iconoclast and Camel at Altiris (I feel stupid calling them that, but they would rather remain anonymous, and I can respect that).
Last night my wife and I were invited to Iconoclast’s home to watch American Idol. I don’t normally watch TV, but I find that an interesting show. Anyway, he pointed out some comments that were directed at me, and I answered one from his machine. Sorry, I forgot to change the “Your Name” section.
I mention this since Iconoclast is a bit rough around the edges, and I don’t want to receive hate mail for the things he sometimes says.
Anyway, I hope new users found the article useful. Once you are all comfortable with the things I wrote, expand out and try some of the other suggestions. They work too.
Mr De Young,
I just wanted to let you know how helpful instructions are. I have also read and in the process of installing Debian 3.0. I have read “The very verbose Debian 3.0 installation walkthrough” and setting up a dedicated box for it. Your instructions are quite helpful especially for a newbie like myself. Also this new article you wrote, “Very verbose guide to updating and compiling your Debian kernel” is quite helpful. Please continue writing “How To” articles. Thank you!
I think it would be useful to add a warning about debian’s default lilo.config, which does not prompt for which kernel to boot, which will have you cursing and swearing badly if your new kernel for some reason does not boot and you must go to a rescue disk. Just un-comment out the “prompt” statement and all will be OK.
Nice article.
“basically just untar, copy a config files, run make oldconfig, and then run the make kpkg stuff…” The above states the problem new users face with Linux veterans. They use the jargon; it comes easily off their tongues. They add words like “just” and “basically” to make you think you’re a simpleton to not know what they’re talking about. RTFM might be an adequate answer if the FM’s were written in clear standard English. Sadly, they’re not. Therefore, thanks to Clinton, to Iconoclast (for clarifying our position), and to Strike for providing us with a bad example of Linux tech support.
Bob
I have been using Debian for quite some time, and I wouldn’t dare compile my own kernel right now. It is too hard.
Use the STOCK KERNEL (e.g. kernel-image-2.4.20-k7 – Linux kernel image for version 2.4.20 on AMD K7) packages, and modconf the bits and pieces in or out.
This is a good howto, however the wrong approach imo for newbies and probably Debian users alike.
Thanks for a great article. I have been using linux for quite a while, and debian for a couple of months – but I’ve never compiled a kernel before.
Hopefully this will help me when I go home and try it tonight.