LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-19-2005, 10:49 PM   #1
Gersen
LQ Newbie
 
Registered: Oct 2003
Location: Indiana, USA
Distribution: RedHat 9, Knoppix 3.4
Posts: 18

Rep: Reputation: 0
newb wrestling with kernel upgrade


howdy all,

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...

My current lilo.conf:

prompt
timeout=50
default=WinXP
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.20-8
label=RedHat9
initrd=/boot/initrd-2.4.20-8.img
read-only
append="hdd=ide-scsi root=LABEL=/"

image=/boot/vmlinuz-2.6.11.7
label=NewKernel
initrd=/boot/initrd-2.6.11.7.img
read-only
append="hdd=ide-scsi root=LABEL=/"

other=/dev/hda1
optional
label=WinXP


Lil help?


Gersen
indytech at att dot net
 
Old 04-19-2005, 11:21 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 60
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.
 
Old 04-19-2005, 11:44 PM   #3
Gersen
LQ Newbie
 
Registered: Oct 2003
Location: Indiana, USA
Distribution: RedHat 9, Knoppix 3.4
Posts: 18

Original Poster
Rep: Reputation: 0
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!


G.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
still wrestling with gcc Gersen Linux - Software 2 04-17-2005 03:16 PM
Slack Upgrade Wreaks Havoc - Newb in Trouble! davatar Slackware 4 03-13-2005 12:04 PM
Wrestling with getting sound working MDesigner Linux - Software 10 03-04-2005 01:08 AM
Kernel Newb markopolox Linux - Newbie 2 10-16-2003 11:01 AM
Wrestling with X Windows PaulC24 Linux - Software 13 04-14-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration