top image
home  /  pages  /  tech tips  /  contact about

Migrating to Linux Kernel 2.6

Introduction

I spent a whole day migrating my GNU/Linux RedHat 9 system to a 2.6 kernel today. This document is all but complete, but here is the outline of the trouble I had. Issues I dealt with: sysfs, QM_MODULES, rpm, module-init-tools, Hotplug, Wireless, linux-wlan-ng, prism2_pci, USB, sound, realplay, VMware, and ACPI vs. APM.

This information is vastly incomplete. I apologize. Please send comments, corrections, suggestions, etc., provided they are nicely phrased.

Also take a look at HowTo Upgrade To The 2.6 Kernel at kerneltrap.org. Nick Warne also wrote up a page about things to do after following the instructions below.

Hardware / Software

I have an IBM ThinkPad T30. I did all this with kernel version 2.6.0-test2, but I think it applies to 2.6.0-test3, 2.6.0-test4, 2.6.0-test5, 2.6.0-test6, 2.6.0-test7, 2.6.0-test8, 2.6.0-test9, 2.6.0-test10 as well.

Here's my kernel configuration file.

Kernel 2.6.0-test{2,3,4,5,6,7,8,9,10}

If you get weirdo interrupt errors when running your new kernel, try compiling it with GCC 2.95.3.

RPM (and realplay)

rpm stops working once you're running kernel 2.6. It sits there, doing nothing, and then prints error messages:

rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
no packages

Fredrik Rambris emailed me, saying that enabling BSD process accounting in the kernel solves this problem.

Alternatively, you can fix this by first doing:

 export LD_ASSUME_KERNEL=2.2.5 
(or your shell's equivalent) and then doing the rpm command again. According to Stéphane Raimbault, you can also download and use the latest rpm, but I didn't verify this.

I had the same problem with realplay and fixed it the same way.

Here's what Penelope Fudd had to say about this problem:

The original RH9 glibc has the problem, the updated RH9 glibc is fine:

ftp://ftp.rpmfind.net/linux/redhat/updates/9/en/os/i386/glibc-2.3.2-27.9.i386.rpm

And when you update that, you need to update these:

ftp://ftp.rpmfind.net/linux/redhat/updates/9/en/os/i386/glibc-common-2.3.2-27.9.i386.rpm
ftp://ftp.rpmfind.net/linux/redhat/updates/9/en/os/i386/glibc-devel-2.3.2-27.9.i386.rpm
ftp://ftp.rpmfind.net/linux/redhat/updates/9/en/os/i386/glibc-utils-2.3.2-27.9.i386.rpm

I tried rpm -Uvh glibc*, but it was not a pain-free process, as rpm
choked halfway through.  I had to rpm -e the old one and rpm -Uvh --force
the new one.  That got it working.

Modutils / module-init-tools

You need a new modprobe, insmod, rmmod, etc. If you don't, you'll get errors about "QM_MODULES: Function not implemented." Download the latest version of module-init-tools. Read the README. I ran:

./configure --prefix=/
make moveold
make
make install

Now translate your old /etc/modules.conf into /etc/modprobe.conf with the ./generate-modprobe.conf script that comes with module-init-tools:

./generate-modprobe.conf /etc/modprobe.conf
Look at the result, especially at the bottom of the file.

For the sake of completeness, here's my copy of /etc/modprobe.conf.

Hotplug

Hotplug needs to work for wireless to work properly. Enable CONFIG_HOTPLUG in the kernel configuration. Then replace all occurrences of "/proc/ksyms" by "/proc/kallsyms" in /etc/rc.sysinit.

For the sake of completeness, here's my copy of /etc/rc.sysinit.

Sysfs file system

Step 1:

Create directory /sys.


Step 2:

Where it says:

mount -f /proc
in /etc/rc.sysinit, add:
mount -f /sys
on the next line.


Step 3:

Where it says:

action $"Mounting proc filesystem: " mount -n -t proc /proc /proc
in /etc/rc.sysinit, add:
action $"Mounting sysfs filesystem: " mount -n -t sysfs /sys /sys
on the next line.


Step 4:

Add:

none    /sys  sysfs   defaults  0 0
to /etc/fstab.


Step 5:

In function halt_get_remaining in file /etc/init.d/halt, change

awk '$2 ~ /^\/$|^\/proc|^\/dev/{next}
into
awk '$2 ~ /^\/$|^\/proc|^\/sys|^\/dev/{next}

For the sake of completeness, here's my copy of /etc/rc.sysinit. And here's my copy of /etc/init.d/halt.

USB

The names for the USB modules are different. This affects /etc/modprobe.conf (look for "usb-controller") and, once again, /etc/rc.sysinit. I had to rename all instances of "keybdev" into "usbkbd" and "mousedev" into "usbmouse". In addition, I replaced all instances of "/proc/bus/usb" with "/sys/bus/usb". (Also do this last part in /etc/init.d/halt.)

Look for "needusbstorage" in /etc/rc.sysinit. I changed that section into:

needusbstorage=
if [ $usb = "1" ]; then
    needusbstorage=`LC_ALL=C grep -e "^I.*Cls=08" /sys/bus/usb/devices 2>/dev/null`
    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
fi

For the sake of completeness, here's my copy of /etc/rc.sysinit.

Wireless (linux-wlan-ng, prism2_pci)

I use the linux-wlan-ng prism2_pci driver, which turns out to rely on Hotplug (see above) to work nicely. I was using version 0.1.16-pre9, but had to switch to 0.2.1-pre9. The /etc/wlan/shared script is broken, however. This may have to do with the fact that I use WEP. Here's my copy of /etc/wlan/shared. It contains minor fixes. Use diff, if you really want to know what I changed. I believe all the other config files (in /etc/wlan) can just remain unchanged.

I now use Debian with the hostap driver.

Sound

The IBM ThinkPad T30 comes with an Intel 810 + ac 97 sound card. The new name for the modules is "snd-intel8x0". Here's the relevant section out of my /etc/modprobe.conf.

alias char-major-14 soundcore
alias sound-slot-0 snd-intel8x0
alias snd-card-0 snd-intel8x0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
install sound-slot-0 /sbin/modprobe --ignore-install sound-slot-0 && { /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1; /bin/true;  }
remove sound-slot-0 { /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1; /bin/true; }; /sbin/modprobe -r --ignore-remove sound-slot-0

For the sake of completeness, here's my copy of /etc/modprobe.conf.

VMware

Update: The latest version of VMware works fine with a 2.6 kernel. No tricks required.

First of all, replace all occurrences of "/proc/ksyms" with "/proc/kallsyms" in /usr/bin/vmware-config.pl.

Running vmware-config.pl will give you compilation errors. Untar vmnet.tar in /usr/lib/vmware/modules/source. This creates a vmnet-only directory. In that directory, edit bridge.c. Around line 368, change:

atomic_add(skb->truesize, &sk->wmem_alloc);
into:
atomic_add(skb->truesize, &sk->sk_wmem_alloc);
and, similarly, around line 618 and line 817, change protinfo into sk_protinfo. Then tar the vmnet-only directory, replacing the old version of vmnet.tar, and rerun vmware-config.pl. Make sure vmware-config.pl uses the same compiler that you used to compile the kernel. I suggest you use GCC 2.95, but you may be lucky with GCC 3.

José Luis Domingo López (thanks!) emailed me the following:

[...]
And second, a recent change in struct task_struct makes the compilation of
vmware net modules fail. The workaround is simple: untar vmmon.tar, edit file
vmmon-only/linux/driver.c and substitue any occurrence of: current->uid,
current->euid, current->fsuid, current->egid, current->gid and
current->fsgid
                                                                                
for
                                                                                
current->__uid, current->__euid, current->__fsuid,
current->__egid, current->__gid and current->__fsgid, respectively.
                                                                                
PS1: the change in struct tast_struct took place in 2.6.0-test6-mm1, but
is not present in 2.6.0-test6.
                                                                                
PS2: kernel and VMware modules compiled with gcc 3.2.3 from Debian Sid

Nick Atkins wrote me an email saying that there's someting out there to get vmware-config.pl to run against the kernel using GCC 3.x. It's available at http://ftp.cvut.cz/vmware/. He says the latest tarball (named vmware-any-any-updateXX.tar.gz) needs to be untarred and run instead of the usual vmware-config.pl. I didn't try this myself, though. (Thanks to José Luis Domingo López for the hints.)

A word on ACPI and APM

The ThinkPad T30's BIOS is broken, which affects ACPI. You can download BIOS upgrades from IBM's website. Once I installed those, I could get ACPI to work, but only partially. Eventually I decided to switch back to APM because the battery status wasn't correct.

Me

This is my favorite part. My name is Thomer M. Gil [], I'm a Ph.D. student in Computer Science at MIT. I have a s-s-s-speech problem and a home page.

URL: http://thomer.com/linux/migrate-to-2.6.html
Copyright © 1994-2011 by Thomer M. Gil
Updated: 2007/07/15