UTC 08:55:26

June 2024
Calendar Tool


Kernel - Linux Reference

Here are some solutions to problems Linux users often encounter. If you have a better solution or
have a question please send your solutions, questions, or comments to us.
Are any of these solutions obsolete? Are they clear and easy to understand?

Compile Kernel 2.6.* series:
To compile your linux kernel in any distrubution:
It is easier to compile the Linux 2.6.* series then the older ones; There are fewer steps.
Download a kernel from and put the extracted files in /usr/src/
After extracting the files, you will see a directory that looks something like linux-
While in /usr/src/, make a symbolic link from linux- to linux.
ln -s linux- linux
cd linux
make mrproper

Now go configure the kernel. There are four ways to configure the kernel. make config is a very linear text based question and answer method. If you make one error, you would have to go through the 1200+ Q&As. make menuconfig is a menu driven text interface. This works perfectly well over a remote shell login. make xconfig will create a point and click GUI. You need to be running X Windows. The forth way is make gconfig. It's a GTK based GUI.
so: make config, make menuconfig, make xconfig, or make gconfig
make dep is no longer necessary.
make clean is no longer necessary.
make bzImage
make install
make modules
make modules_install
Manually running lilo is no longer necessary.

Compile Kernel 2.4.* series:
To compile your linux kernel in any distrubution:
For the Impatient:
make clean
make mrproper
make menuconfig (or make config or make xconfig)
make dep
make bzImage
make install
(make modules -- if you config. modules)
(make modules_install -- if you config . modules)
may need to copy ./linux/arch/i386/boot/bzImage to /boot/
may need to edit lilo.conf manually and then run lilo
cd /usr/src/linux make sure you have that symbolic link. ./linux is a sym. link to the directory containing your current kernel files. It looks something like linux-2.4.18 make config, make menuconfig, or make xconfig this will run a script that will ask about your system. this will be a long process. be sure to save your configs as a seprate file so you can retrieve it later in case something bad happens. make dep does all your dependencies make bzImage this builds your kernel. this will take a while. make install this will copy your new kernel to /boot/vmlinuz. it also attempts to run lilo. It's a good idea to edit your /etc/lilo.conf file with a text editor and run lilo. (make modules -- if you configured modules) (make modules_install -- if you configured modules) then edit /etc/lilo.conf (if you havn't already). run lilo If something bad happens, you can always copy the /boot/vmlinuz.old.

Compile Kernel 2.2.* series or below:
To compile your linux kernel in any distrubution:

cd /usr/src/linux
   make sure you have that symbolic link. ./linux is a sym. link to the
   directory containing your current kernel files. It looks something
   like linux-2.2.14
make xconfig, make config, or make menuconfig
     Each one of the three will bring up a window or prompt that
asks you many question about your system. "Make config" is the very old (but very reliable and stable)
text only way of configuring your kernel. "make menuconfig" will
present you questions with a menu driven text interface. If you are running X win, "make
xconfig" will be the easist to work with. make dep dependencies. make clean takes out left over compilation. make bzImage kernel 2.2.6 and up use bzImage. Older ones use zImage. make modules These are inserted into the kernel at bootup. make bzlilo kernel 2.2.6 and up use bzlilo. Older ones use zlilo. ---- make bzlilo does the below. dont need to repeat. But if you are using the pre 2.* kernel then you need to follow the next bunch of steps. lilo If lilo has been configured. copy zImage /vmlinuz may need this. lilo again Either way, it's a good idea to manually check the /etc/lilo.conf file I have created a script that is a quick guide to compiling your
kernel. You need to download it by right clicking and choose save link as to
download, or just click to view source code. Download Now make it excutable by typing: chmod 755 compileKernel This script will 1. go to /usr/src/linux/ 2. make config OR make menuconfig OR makexconfig This will ask you lots of questions about
your system. 3. make dep <---- this will make dependencies.
This will take a while 4. make clean 5. make bzImage <---this is the kernel. This
will take a while on older systems. It took four hours on
a 486DX, but only 10 Minutes on pentium II 500MHz or an AMD k6 - 2
500MHz, both with 100MHz SDRAM 6. make modules <---depending on how many
modules you make remember these: [Y] [M] [N] 7. make bzlilo <---This will place your new
kernel where the old one was lilo will also be run. Make sure you did not encounter any errors. Now you need to