- 论坛徽章:
- 0
|
Before you compile, strongly suggest you read the README under your source_code_root and modules.txt under source_code_root/Documentation.
Here, I only give the sample for GRUB, if you are using LILO, please read the files I mentioned above.
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
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
Backup config in kernel source root to another file if you want to recompile
bash # cp config myconfig
6. Compile Kernel
bash # make install
7. Compile and install modules
bash # make modules
bash # make modules_install
8. Copy new kernel bzImage to /boot/bzImage.myker
9. Change grub.conf
bash # cat grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdb6
# initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8.img
change the line: kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
to: kernel /bzImage.myker ro root=LABEL=/ hdc=ide-scsi
Because not sure the new kernel works well, suggest you keep two files, one is grub.conf.orig, another is grub.conf.new
grub.conf.orig:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdb6
# initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8.img
grub.conf.new
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdb6
# initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
root (hd0,0)
kernel /bzImage.myker ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-8.img
regarding to your needs, you just copy the proper file to grub.con
10. reboot the system
bash # reboot |
|