PDA

View Full Version : Upgrading to Kernel 2.6 on Fedora Core 1 HOWTO


xyklopz
2004-05-14, 01:35 PM CDT
Okay!

So, I've spent the past few days playing around with Fedora Core 1. I installed it and before I began playing around I immediately wanted to attempt to migrate to 2.6. At the time of this writing, the latest was 2.6.6 so I chose it and that is what this HOWTO will use. I'm going to attemp to make this as specific and clear as I can to aid in anyone else's troubles they may encounter.

Obviously the first step I did was download & extracted the kernel sources from kernel.org into my /usr/src directory:

$ cd /usr/src
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
$ tar -jxvf linux-2.6.6.tar.bz2


I then navigated into the linux-2.6.6 directory and copied my 2.4.22 kernel configuration file from the /boot directory:

$ cd linux-2.6.6
$ cp /boot/config-2.4.22 .config


Then I initiated the 2.6.6 kernel configuration process:

$ make menuconfig


Now, here is where this HOWTO maybe a little sketchy. I compiled most of my support including USB into my kernel. This specific computer is going to be used as a server and there's not going to be much that changes on the system that another recompile wouldn't hurt so I did 90% of my config built right into the kernel.

*EDITED: 15-05-2004*

Regarding USB, I've browsed numerous sites and howtos on how to get USB working. I'm going to walk through how I got it working and hopefully aid in your troubles. For my specific machine I made sure the kernel configurations where compiled as follows:

Device Drivers -> USB Support -> ...

<M> Support for Host-side USB Support
<*> USB device filesystem
<M> EHCI HCD support
<M> UHCI HCD support
<M> USB Human Interface Device (full HID) support
<*> HID input layer support


Device Drivers -> USB SUpport -> USB HID Boot Protocol drivers -> ...

<M> USB HIDBP Keyboard (simple Boot) support
<M> USB HIDBP Mouse (simple Boot) support


After I did my configuration I did:

$ make bzImage && make modules && make modules_install && make install


Finally, I edited my /etc/modprobe.conf & /etc/rc.sysinit files to reflect my usb settings. I appended the following lines to my /etc/modprobe.conf file:

alias usb-controller uhci-hcd
alias usb-controller1 ehci-hcd


I modified the following lines in /etc/rc.sysinit file:

LC_ALL=C fgrep 'hid' /proc/bus/usb/drivers || action $"Initializing USB HID interface: " modprobe hid 2> /dev/null
action $"Initializing USB keyboard: " modprobe usbkbd 2> /dev/null
action $"Initializing USB mouse: " modprobe usbmouse 2> /dev/null

to

action $"Initializing USB HID Interface: " modprobe usbhid 2> /dev/null
action $"Initializing USB keyboard: " modprobe usbkbd 2> /dev/null
action $"Initializing USB mouse: " modprobe usbmouse 2> /dev/null


At this point, you can reboot and hopefully 2.6.6 will boot successfully. However, there is one other minor issue that at this point I'm still working on and will update as appropriate. The problem is outlined below (feel free to help out! - unless I'm just a n00b and this problem has already been expressed many times before)

-----

After all of the above, I discovered one more issue related to iptables in Fedora Core 1 running 2.6.6. This is more of an advanced topic here.

If you attempt to restart iptables you will get a FAILURE notice when iptables attempts to unload it's modules from the kernel:

$ /etc/init.d/iptables restart
...
Unloading iptables modules: [ FAILURE ]
...


From examining the /etc/init.d/iptables file, I notice how it is setup to recursively. Now, it begins to remove to modules, ip_tables (or ipv6_tables) & ip_conntrack (or ipv6_conntrack) and their referring modules. Now, examing the following line it appears this is the problem:

# Get referring modules
lsmod | grep ^${mod} | cut -d "[" -s -f 2 | cut -d "]" -s -f 1


In short, it's finding the supporting modules off the output of lsmod. The only thing is, the code snipet above to get the referring modules will not work because of the new output format is lsmod for 2.6.6. If one compares the output of lsmod on a 2.4.22 box to 2.6.6 box you'll understand why it doesn't work.

Now what we have to figure out, what's the patch to this. I'll keep updated on my findings, I just discovered this a mere 30 minutes ago.

-----

Best of luck to all and I hope this HOWTO can be of some assistance to somebody.

--xyklopz

Ug
2004-05-15, 10:26 AM CDT
Great tutorial!

FC2 will be out shortly though, so I'm a bit saddened that it may be lost on some. But nevertheless keep up the good work.

xyklopz
2004-05-15, 12:38 PM CDT
Yeah, I know :-(

However, I'm providing this for people who may only tackle FC1 for now. Believe me, I'll be writing a tutorial on how to migrate to 2.6 after FC2 is released. I'm going to begin tackling FC development I believe :-)

franciscallo
2004-05-17, 03:24 PM CDT
you dont need to do "make bzImage" in 2.6. "make" will automatically make bzImage. Saves you of tying 8 chars ;)

Nefarious
2004-05-19, 10:31 AM CDT
I'm givin' it a shot, figure that while I wait on downloading FC2, I could put your tutorial to use. After all, you went through the trouble of writing it for people like me. And since I'm a people like me, I figured I might aswell give it a shot. Ne?

Anyways, this looks like it could take a while, so after things are all said and done, I'll let you know how it went. :-D

Thanks for the tutorial by the way. :-) Without it, I might not have even figured to try 2.6.6 with FC1.

Nefarious
2004-05-19, 10:58 AM CDT
Wow. You know, that went a lot smoother than any of my other re-compiling attempts. I configured, compiled, installed and then when I booted up, things were exactly as I left them... working. :-)

Thanks for the tutorial, although I didn't need it for the help, it put the idea into my head.

Actually, a few things seem to be better than they were before. Thanks. :-)

mohan73
2004-07-07, 07:29 PM CDT
Hi there, thanks for the tutorial. I followed your steps but hit some errors when i type the makeconfig command. I have included the errors below.

[root@localhost linux-2.6.4]# make menuconfig
HOSTCC scripts/fixdep
/bin/sh: line 1: gcc: command not found
make[1]: *** [scripts/fixdep] Error 127
make: *** [scripts/fixdep] Error 2
[root@localhost linux-2.6.4]#


Pls. help to shed some light on this.

Mohan


Okay!

So, I've spent the past few days playing around with Fedora Core 1. I installed it and before I began playing around I immediately wanted to attempt to migrate to 2.6. At the time of this writing, the latest was 2.6.6 so I chose it and that is what this HOWTO will use. I'm going to attemp to make this as specific and clear as I can to aid in anyone else's troubles they may encounter.

Obviously the first step I did was download & extracted the kernel sources from kernel.org into my /usr/src directory:

$ cd /usr/src
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
$ tar -jxvf linux-2.6.6.tar.bz2


I then navigated into the linux-2.6.6 directory and copied my 2.4.22 kernel configuration file from the /boot directory:

$ cd linux-2.6.6
$ cp /boot/config-2.4.22 .config


Then I initiated the 2.6.6 kernel configuration process:

$ make menuconfig


Now, here is where this HOWTO maybe a little sketchy. I compiled most of my support including USB into my kernel. This specific computer is going to be used as a server and there's not going to be much that changes on the system that another recompile wouldn't hurt so I did 90% of my config built right into the kernel.

*EDITED: 15-05-2004*

Regarding USB, I've browsed numerous sites and howtos on how to get USB working. I'm going to walk through how I got it working and hopefully aid in your troubles. For my specific machine I made sure the kernel configurations where compiled as follows:

Device Drivers -> USB Support -> ...

<M> Support for Host-side USB Support
<*> USB device filesystem
<M> EHCI HCD support
<M> UHCI HCD support
<M> USB Human Interface Device (full HID) support
<*> HID input layer support


Device Drivers -> USB SUpport -> USB HID Boot Protocol drivers -> ...

<M> USB HIDBP Keyboard (simple Boot) support
<M> USB HIDBP Mouse (simple Boot) support


After I did my configuration I did:

$ make bzImage && make modules && make modules_install && make install


Finally, I edited my /etc/modprobe.conf & /etc/rc.sysinit files to reflect my usb settings. I appended the following lines to my /etc/modprobe.conf file:

alias usb-controller uhci-hcd
alias usb-controller1 ehci-hcd


I modified the following lines in /etc/rc.sysinit file:

LC_ALL=C fgrep 'hid' /proc/bus/usb/drivers || action $"Initializing USB HID interface: " modprobe hid 2> /dev/null
action $"Initializing USB keyboard: " modprobe usbkbd 2> /dev/null
action $"Initializing USB mouse: " modprobe usbmouse 2> /dev/null

to

action $"Initializing USB HID Interface: " modprobe usbhid 2> /dev/null
action $"Initializing USB keyboard: " modprobe usbkbd 2> /dev/null
action $"Initializing USB mouse: " modprobe usbmouse 2> /dev/null


At this point, you can reboot and hopefully 2.6.6 will boot successfully. However, there is one other minor issue that at this point I'm still working on and will update as appropriate. The problem is outlined below (feel free to help out! - unless I'm just a n00b and this problem has already been expressed many times before)

-----

After all of the above, I discovered one more issue related to iptables in Fedora Core 1 running 2.6.6. This is more of an advanced topic here.

If you attempt to restart iptables you will get a FAILURE notice when iptables attempts to unload it's modules from the kernel:

$ /etc/init.d/iptables restart
...
Unloading iptables modules: [ FAILURE ]
...


From examining the /etc/init.d/iptables file, I notice how it is setup to recursively. Now, it begins to remove to modules, ip_tables (or ipv6_tables) & ip_conntrack (or ipv6_conntrack) and their referring modules. Now, examing the following line it appears this is the problem:

# Get referring modules
lsmod | grep ^${mod} | cut -d "[" -s -f 2 | cut -d "]" -s -f 1


In short, it's finding the supporting modules off the output of lsmod. The only thing is, the code snipet above to get the referring modules will not work because of the new output format is lsmod for 2.6.6. If one compares the output of lsmod on a 2.4.22 box to 2.6.6 box you'll understand why it doesn't work.

Now what we have to figure out, what's the patch to this. I'll keep updated on my findings, I just discovered this a mere 30 minutes ago.

-----

Best of luck to all and I hope this HOWTO can be of some assistance to somebody.

--xyklopz

friez
2004-07-08, 01:25 AM CDT
make sure you hvae the development tools need to compile first

ilja
2004-07-08, 01:27 AM CDT
the shell called sh seems not to be installed

S.D.Willie
2004-07-16, 06:02 PM CDT
this works on fedora core 1, but i DO think you need to edit grub.conf before you attempt to boot to the new kernel or you will probably get a kernel panic like i did. ill have to do some research on how to resolve this now.