Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Situation: I'm trying to upgrade a RedHat 9 box's kernel from 2.4.20-8 to 2.6.11.7. Let me start out with a request that no one suggest I switch to a different distribution. Thanks!
I went through a few kernel upgrade articles, read the CHANGES document in the kernel source, and added/upgraded the modules suggested.
I followed the procedures to:
- extract my kernel source to /usr/src/linux-2.6.11.7
- make mrproper
- coped my config file to /usr/src/linux-2.6.11.7
- make oldconfig
- make menuconfig
- make dep (it responded that it wasn't necessary)
- make bzImage
- make modules
- make modules_install
- copied bzImage to /boot and renamed it to vmlinuz-2.6.11.7
- changed the symbolic link vmlinuz to point to vmlinuz-2.6.11.7
- copied System.map from my source directory to /boot/System.map-2.66.11.7
- changed the symbolic link System.map to point to System.map-2.66.11.7
- ran mkinitrd initrd-2.6.11.7 2.6.11.7
- edited /etc/lilo.conf and added a new section, copying the syntax from the existing section and changing the references to the kernel and initrd files.
- ran lilo which happily reported adding WinXP, RedHat9, and NewKernel
- REBOOT!
- chose "NewKernel" from my list of choices.
At which point my box booted straight into the old kernel. Merde!
Ran thru all my changes to double check for syntax and spellnig erorrss. Nope, everything's correct.
Look in /boot to discover my symlinks to System.map had been changed back to point at the old System.map. I changed it back to point to the 2.6.11.7 map and did ls -l to check that it was pointing to the new map file. Yep, it is! So once again it's time to...
REBOOT! and choose NewKernel.
Same result. Boots back into the old kernel... Checked in /boot again and, sure enough, my System.map symlink had again been hijacked.
I found one thing I think my be contributing to my problem: the module-info symlink, which is pointing to module-info.2.4.20-8 and I have no newer module-info file to replace it with. (yes, that sentence ends in a proposition!) If there should be a newer module-info file somewhere to which the symlink should point, please post that information!
hmm... Since it keeps going back to my old kernel, what would happen if I take the old kernel options out of lilo.conf and try again? My menu offered me NewKernel and WinXP. Upon choosing NewKernel, the boot process started and died quickly in a kernel panic with the message:
VFS: Cannot open root device "LABEL=/" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
And it was this point that I turned to that most knowledgable of all sources, the Internet. Apparently the terms involved in my problems are generic and ubiquitous enough that I can't sort out a solution with Google, talented with it though I may be...
According to my notes, make modules_install && make install will
generate an initrd (if necessary), and add entries to your lilo.conf or grub.conf file.
Unless you have a need to modify the kernel, I would use yum or apt to install a new kernel.
Also, for Redhat/Fedora I found that using rpm sources to be very easy and painless. I'll post my notes on doing a kernel for Fedora so you will need to modify the url but should be similar otherwise.
Tarball method
Code:
1. Download the latest stable kernel tarball (currently it's linux-2.4.20.tar.bz2, but that could be different as you read this). Save it in the /usr/src directory.
2. Extract/uncompress the kernel tarball. After extracting the kernel source, change your directory to the kernel source directory. (/usr/src)
tar xjf linux-2.4.20.tar.bz2
cd linux-2.4.20
3.Enter the following command make mrproper which will remove all the stale .o files in the source repository. This will also remove all previous kernel configurations. Another command make clean is less thorough.
make mrproper
4. To use the existing configuration perform the following steps:
cp /boot/config-2.4.18-14 config
make oldconfig
5. Configure your kernel. You may do so by doing a make config, make xconfig, or make menuconfig, or make oldconfig, which are explained below.
make config will require you to modify the default kernel configuration (which is the .config file included in the source tarball).
make xconfig is a better way to configure your kernel from a GUI menu. This requires an X server in order to run.
make menuconfig will let you configure your kernel using curses. It's like a GUI but runs on top of the terminal/console.
make oldconfig will let you configure your kernel by answering yes, no, or module.
make xconfig
6. Compile your kernel. This will involve three easy steps: compile all the dependencies, create a compressed kernel image, and compile all the kernel modules.
make dep && make bzImage && make modules
7. Install the kernel and the kernel modules. You have be root to do this.
make modules will install the kernel modules in your new kernel. make install, on the other hand, will automagically modify your grub.conf or lilo.conf file using the '/sbin/installkernel' script via '$KERNEL_SOURCE/arch/i386/boot/install.sh', which will in turn use the scripts in '/usr/share/loader' to install the kernel in the boot partition, generate an initrd (if necessary), and add entries to your lilo.conf or grub.conf file.
make modules_install && make install
8.If you're using LILO, don't forget that you need to run /sbin/lilo -L before rebooting.
If you're using Grub, you shouldn't need to run grub before rebooting.
Check the /etc/lilo.conf or /etc/grub.conf files to make sure they are setup correctly.
reboot
RPM source method
Code:
http://download.fedora.redhat.com/pu...dates/3/SRPMS/http://download.fedora.redhat.com/pu...lopment/SRPMS/
1. Download and install the kernel source rpm
rpm -ivh kernel-2.6.10-1.766_FC3.src.rpm
2. Change to your rpmbuild dir and patch it with fedora's kernel patches:
cd /usr/src/redhat/SPECS
rpmbuild -bp --target=i686 kernel-2.6.spec
3. Change to the build dir and config or add more patches to your kerenl
cd /usr/src/redhat/BUILD/kernel-2.6.10/linux-2.6.10
vi Makefile ## edit "EXTRAVERSION = -prep" replace with something unique like "EXTRAVERSION = -100_FC3"
4. Enter the following command make mrproper which will remove all the stale .o files in the source repository. This will also remove all previous kernel configurations. Another command make clean is less thorough.
make mrproper
5. To use the existing configuration perform the following steps:
cp /boot/config-2.6.10-1.667_FC3 config
make oldconfig
Notes: Configure your kernel. You may do so by doing a make config, make xconfig, or make menuconfig, or make oldconfig, which are explained below.
make config will require you to modify the default kernel configuration (which is the .config file included in the source tarball).
make xconfig is a better way to configure your kernel from a GUI menu. This requires an X server in order to run.
make menuconfig will let you configure your kernel using curses. It's like a GUI but runs on top of the terminal/console.
make oldconfig will let you configure your kernel by answering yes, no, or module.
6. Build the kernel with rpm
time make rpm
7. Install your new kernel
cd /usr/src/redhat/RPMS/i386
rpm -ivh kernel-2.6.10prep-1.i386.rpm
8. You may need to create the initrd file.
mkinitrd /boot/initrd-2.6.10-prep.img 2.6.10-prep
9. Check the grub.conf to make sure the new kernel and initrd info is there.
Don't delete the old kernel until you are sure the new one works ok.
Thanks, that's all good info. However the idea of completing this upgrade is more of a learning exercise, so I need to slug my way through it.
I didn't do a "make install" since that wasn't listed in the procedure I was reading, but I'll go through it again try that. It may be the missing link!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.