logo
Published on KernelTrap (http://kerneltrap.org)

Feature: HowTo Upgrade To The 2.6 Kernel

By Jeremy
Created Aug 29 2003 - 23:59

Anyone who's been following Linux kernel development for the past several months has heard about one exciting feature after another being merged into the still un-released 2.6 kernel. New features that noticeably affect user experience include Robert Love's [interview [0]] preemptible kernel work [story [0]], Ingo Molnar's [interview [0]] O(1) Scheduler [story [0]], Rik Van Riel's [interview [0]] reverse mapping VM [story [0]], Nick Piggins' [interview [0]] Anticipatory I/O scheduler [story [0]], and much, much more...

Having some spare time a few nights ago, I decided to give the latest kernel, 2.6.0-test4, a trial run on my aging 550Mhz PIII desktop computer, and the result was nothing short of spectacular. As the final 2.6.0 release approaches, it is important that an increasing number of users (aka testers) give this kernel a try, especially as currently it's still a sexy task for developers to track down kernel bugs and stabalize their work. Once work starts on the 2.7 development tree, inevitably much talent will again be focusing on new features.

The purpose of this document is to provide some helpful tips to readers that currently compile their own 2.4 kernels, but haven't yet made the leap to 2.6. This is still a development kernel, so you may run into problems, but overall stability and performance is quite impressive and I can't recommend enough that you try it today.


Target Audience:
This article is targeted towards Linux users that are already comfortable with compiling their own 2.4 kernels. If you've never compiled a kernel before, I suggest that you start here:

Beyond that, it's also highly recommended that anyone new to the 2.6 kernel review Dave Jones' post-halloween document [2] (aka "2.5 - what to expect").

http://kernel.org/ [3]. It is highly encouraged that you find the fastest local mirror to spread out the load among willing kernel source hosts. Find the kernel.org mirror list here: http://kernel.org/mirrors/ [4].

At the time of this writing, the current version of the 2.6 kernel is 2.6.0-test4, a development version. The next release will be -test5, then -test6, and so on, until Linux creator Linus Torvalds decides that it's time to release 2.6.0, the first official release of the much-anticipated stable 2.6 tree.

Having downloaded the source, it's also a very good idea to download the GnuPG [5] signature and use it to verify the authenticity and validity of your new kernel source. For more information, go to: http://www.kernel.org/signature.html [6].

README [6] refers to itself as being for the 2.5 development kernel, as 2.6.0-test is still part of the development phase. (2.6.0, without a -test extension, will be the first 2.6 kernel) You'll find lots of good tips in this document regarding how to successfully compile a Linux kernel. The document begins:

"These are the release notes for Linux version 2.5. Read them carefully, as they tell you what this is all about, explain how to install the kernel, and what to do if something goes wrong."

The Documentation/Changes [6] file lists the new requirements of the 2.5 development kernel, providing a list of software that must be upgraded to work properly with the new kernel. It begins:

"This document is designed to provide a list of the minimum levels of software necessary to run the 2.5 kernels, as well as provide brief instructions regarding any other 'Gotchas' users may encounter when trying life on the Bleeding Edge."

Gnu C Compiler [7] 2.95.3 gcc --version Gnu Make [8] 3.78 make --version binutils [9] 2.12 ld -v util-linux [10] 2.10o fdformat --version module-init-tools [11] 0.9.9 depmod -V procps 2.0.9 ps --version [procps 2.x [12]] [procps 3.x [13]]

The following utilities are filesystem specific. If you're running ext2 or ext3, be sure to update your e2fsprogs, if you're running jfs, be sure to update jfsutils, etc...

    Name:              Minimum version:    How to find version:
     e2fsprogs [14]          1.29                tune2fs
     jfsutils [15]           1.0.14              fsck.jfs -V
     reiserfsprogs [16]      3.6.3               reiserfsck -V 2>&1 | grep reiserfsprogs
     xfsprogs [17]           2.1.0               xfs_db -V
     nfs-utils [18]          1.0.5               showmount --version

And a handful of other utilities that you'll want to update if you use them:

    Name:              Minimum version:    How to find version:
     pcmcia-cs [19]          3.1.21              cardmgr -V
     quota-tools [20]        3.09                quota -V
     PPP [21]                2.4.0               ppd --version
     isdn4k-utils [22]       3.1pre1             isdnctrl 2>&1 | grep version
     oprofile [23]           0.5.3               oprofiled --version     

If you're going to be running ALSA for the first time, also be sure to visit http://www.alsa-project.org/ [24] to grab the latest alsa-lib and alsa-utils.

story [24]]. The old Tk/Tcl 'xconfig' build method no longer exists, replaced by a new QT based 'xconfig'. Non-QT fans will be happy to find that a GTK based 'gconfig' is also available for their use.

2.6 build methods include:

This appears to be identical to 'config' in the 2.4 kernel. As the most simplistic configuration method, it simply asks you about each configuration option, one at a time... Requires the 'bash [25]' shell.

  • make menuconfig

    [25]
  • This appears to be identical to 'menuconfig' in the 2.4 kernel. A simple curses based configuration method.

  • make xconfig

    [25]
  • This new default graphical configuration system uses the QT libraries. I found it to be quite functional and easy to use.

  • make gconfig

    [25]
  • This option is a clone of the new xconfig, however using the GTK libraries instead of the QT libraries. Unfortunately, in my brief testing I found it to be somewhat buggy. While running, it spews out the same error over and over, and crashed rather quickly. Here [Array]'s a log to show you what I'm talking about.

  • make oldconfig

    This build option will prove extremely useful to you as you upgrade to newer and newer 2.6 kernels. At first glance it looks identical to the plain 'make config', however 'oldconfig' reads your current .config settings and automatically answers for you based on these settings, only prompting you for new configuration choices. To use, simply copy in your old .config file, then type 'make oldconfig'.

  • When configuring your 2.6 kernel for the first time, keep in mind the following tips from the top-level README file that came with your Linux source:

    ALSA:
    For many people upgrading from 2.4 to 2.6, this will be your first time using the Advanced Linux Sound Architecture (ALSA) which has replaced OSS. Though it may be tempting to simply enable the deprecated OSS and go about your life as normal, it's probably worth your time to get ALSA working. Thanks to ALSA's OSS API Emulation, it's really not that hard. When configuring your kernel, be sure to enable the OSS emulation options (SND_OSSEMUL, SND_MIXER_OSS and SND_PCM_OSS) Also be sure to enable the appropriate sound driver (in PCI devices) - I compiled mine directly into the kernel. Finally, be sure to download and install the latest alsa-lib [26] and alsa-utils [27].

    [27]Actually building the kernel is one step easier than in 2.4, as you no longer have to type 'make dep'. To build a new kernel, type 'make bzImage'. If you've chosen to compile any modules, you'll also need to 'make modules' and 'make modules_install'. Or, you can string it all together like 'make bzImage && make modules && make modules_install'.

    When the build starts, you'll notice that the default build process is much quieter than it was in 2.4, providing simple summaries as opposed to all the compiler output.

    grub [28] [manual [29]] or lilo [30] [howto [31]], refer to the appropriate documentation if you're unsure how your boot loader works.

    [31]

    Once you've tried out your new 2.6 kernel, I'd love if you'd post a comment here with your reflections. I'm also open to suggestions on how to make the above directions more useful.

    If you run into problems with your new kernel, once again refer to the top-level 'README' that came with your kernel source which has a useful section titled "IF SOMETHING GOES WRONG". Additionally, refer to the top-level 'REPORTING-BUGS' file if the need arises. Prior to posting problems to the high-traffic Linux kernel mailing list [32], be sure to search one [33] or more [34] of the many [35] online lkml archives to see if someone else has already reported the problem, and better yet if someone else has already posted a fix. Last but not least, you may also try asking for help in the KernelTrap 2.6 kernel forum [35].

    Additional tips/FAQs:
    Thanks to a significant amount of reader feedback in the form of comments below and personal emails, I'm going to add a few random but hopeful useful tips to the end of this document. If you have additional tips, please feel free to send me an email [36]. (If you've already sent a comment and I've note yet replied, please be patient...)

    I'm already running 2.6.x, how can I easily upgrade to the next release?
    The process is described here [36].

    Does GCC 3.x work for compiling the Linux kernel?
    Personally, I compiled the 2.6.0-test4 kernel that I'm currently using with gcc 3.2, and I'm not having any problems. The general consensus appears to be that this will work in most cases, but if you run into any compilation problems then try again with the preferred gcc 2.95.3.

    Where can I learn more about ALSA?
    There's a wealth of information on the Advanced Linux Sound Architecture home page: http://www.alsa-project.org/ [37]

    Does the NVidia driver work with 2.6?
    It has been pointed out that a working NVidia driver with 2.6 can be found at http://www.minion.de/ [38].

    How can I install and use the reiser4 filesystem?
    The makers of reiser4, namesys [39], have a brief 'getting started [40]' document.

    Are there any special tips for RedHat 9 users?
    You're in luck. I've been pointed to a couple of documents that walk you through the specific issues you may run into when upgrading RedHat 9 to the 2.6 kernel, here [41] and here [42].

    Are there any special tips for Debian users?
    Several readers have pointed towards this article [43] by linmagau.org [Array], though it refers to compiling a 2.4 kernel. At this time, there's a debian package for 2.6.0-test2 here [44]. adds, "A Debian Woody system will have module problems. But people running Debian Sid (and Sarge) can just 'apt-get install module-init-tools'. I was pleased that Debian figures out at boot time whether to use the new module-init-tools or the older modutils, though perhaps all distros do this.".

    Why didn't you warn me about the problem with <xx>?
    Actually, I didn't run into any problems or gotcha's when I upgraded to 2.6.0-test4. But as I learn of more issues (and solutions), I'll post them here.

    Article translations:


    Source URL:
    http://kerneltrap.org/node/799