- 论坛徽章:
- 0
|
Kernel Compiling (redhat 9, Kernel 2.4.20-
1. Get the kernel version
bash # rpm –q kernel
2. Download appropriate kernel source on RHN
3. Install kernel source
4. If you are recompiling, you’d better to run:
bash # make mrproper
to clean all configurations and the files created last compiling
5. Configure kernel
In xWindows, start terminal
bash # cd /usr/src/linux2.4.20.8
bash # make xconfig
if you are using remote terminal, run:
bash # make menuconfig
Must be Enabled
File System ->; Ext3
Block Device ->; Loopback Device Support
Recommend
Don’t build in Network Device Driver and USB driver, I got trouble when I did that, esp., I have two different NIC
Backup config in kernel source root to another file if you want to recompile
6. Check dependance and prepare to compile your kernel
bash # make dep
bash # make clean
7. Compile and install modules
bash # make modules
bash # make modules_install
if you don’t do this, when you reboot your computer, you will see errors.
8. Compile Kernel
bash # make install
if you want to trace the compiling history, you can use nohup to output the log to file as:
bash # nohup make install &
bash # tail –f nohup.out
9. Now it is time to reboot your computer. You will see boot loader menu, by default, it starts the old kernel. If you want the new one, you can edit grub.conf
bash # vi /etc/grub/grub.conf
and change the line:
default=1
to:
default=0
10. Trouble Shooting
If your kernel didn’t work properly, you can check from the following aspects (my personal experience, only as reference):
10.1 config
Normally, the kernel source is OK, if you made wrong configuration, you get problems, just keep patience to tune up your configuration, and keep a copy.
10.2 modules
Check /lib/modules/versioncustom whether the library has been updated, i.e. NIC driver in /lib/modules/2.4.20-8custom/kernel/drivers/net
10.3 boot loader (applicable to grub)
Check /boot and /boot/grub/grub.conf to make sure the links are correct. |
|