a Sat Feb 17 15:33:37 PST 2001

I came across this article and thought it useful enough to make a local copy, mainly to simplify the version-checking of the various tools needed to upgrade to the 2.4.x Linux kernel; then I thought I'd annotate it relative to what I found and thought about the process; then I thought I'd actually document my adventures in upgrading the kernel inline within the document, and put it up at www.finchhaven.com

I'm going to put my comments inline via the <tt> </tt> tags to render them differently from the article.

Having said that, on with the show...

Upgrading to the 2.4.x kernel

From the article at freeos.com

By Amit Chattopadhyay <amitc@technologist.com>
Posted: ( 2001-02-14 12:22:11 EST by FreeOS )

The 2.4.x kernel packs a completely revised networking core and support for cutting edge technology. Let's see what's new and useful here and then move on to upgrading your system to the 2.4.x kernel from the 2.2.x kernel that you're likely to be running.

The Linux kernel is the heart of the operating system. It is important that it is kept up to date and working properly for your system to work at its optimum potential. The stable 2.4.0 kernel is a conglomeration of patches and additions that have been made throughout the experimental 2.3.x series of the kernel.

Upgrading from 2.0.x to 2.2.x had been a tricky affair as many of the supporting tools had to be upgraded before the kernel could be compiled and booted into. Fortunately this time, the transition from 2.2.x to 2.4.x is simpler, assuming that your system was 2.2.x ready. Since the 2.4.x kernel is a hefty 23mb download, it would be worthwhile reading over the improvements and changes that have been made to the kernel to find out whether or not you really need it.

OK: so I've currently got a fresh install of Red Hat 6.2 that's almost one year old, running on a Pentium 150 classic, 48mb ram-powered box that's my firewall. That's what I'm going to work on, first.

No X; CLI only...

[root@sparky /home/jsage]# uname -a
Linux 2.2.14-5.0 #1 Tue Mar 7 20:53:41 EST 2000 i586 unknown

What's New?

The biggest addition comes in the form of the much-publicized support for the Itanium, Intel's 64bit processor. While the processor itself is slated for release later this year, the present support allows users to easily migrate to a 64bit processor and take full advantage of the processor's architecture. For home users, the IA64 support doesn't mean much as it will take time for prices to come down and become affordable. Additionally, support for IBM S/390 systems has also been added.

Itanium? well..

PNP support for ISA devices has finally become stable. Also support for USB devices has been improved and PCMCIA/PC Card support has become mature. These may very well be some of the good reasons why you may want to upgrade the kernel.

OK: this is good. PNP/ISA support has been an occasional issue. And I do have USB ports over in another box, an AMD K6-2 500, so that looks promising..

As far as file systems are concerned, the inclusion of UDF will benefit DVD and CD-RW users. Don't get too excited though, as DVD video playback support under Linux still remains flaky. ReiserFS is available in the 2.4.1 kernel release but is having some stability problems.

DVD? OK: interesting, later, on the other box...

Another good reason for upgrading to 2.4.x would be to make use of the highly improved networking core, which was optimized for speed and completely revised. The NFS code has been improved and should cause lesser headaches and it even supports the latest revision of NFS namely NFSv3.

Bingo! That's what I want. I've become highly interested in ipchains firewalling on the Pentium 150 box, and I've heard a lot about netfilter/iptables, the replacement for ipchains in the 2.4.x version kernel.

One of the notable changes with this kernel is the inclusion of Device Filesystem or DevFS. Unlike the large list of device nodes in the /dev directory which point to the devices, DevFS cleans up some of the clutter by created device nodes on the fly when a specific driver is loaded. The structure of /dev will also change with device nodes placed inside different categories. DevFS is not installed by default.

OK: of some technical interest...

It is very clear that most of the improvements are for non-i386 users. If you need to use the improved ISA PNP, USB or faster networking core or the new sound/video/video4linux drivers it would be a good idea to go for the upgrade. However, if you don't find anything useful in the new features and do not want to tinker with your already well setup machine, you should probably stick on to your older kernel for some more time.

Oh heck, let's do it!

Still plan to upgrade your kernel?


The latest kernel available in the 2.4.x series is available from www.kernel.org/pub/linux/kernel/v2.4/ . After you have downloaded the kernel, move the kernel source into the /usr/src directory.

OK: this directly contradicts what is said in /linux/README of the 2.4.2 kernel sources I've downloaded and untarred. *That* says to untar the kernel sources *away* from /usr/src/linux. I'm doing that...

Now you need to make sure that supporting tools for the kernel are sufficiently up to date.

From /linux/README: "Compiling and running the 2.4.xx kernels requires up-to-date versions of various software packages. Consult /linux/Documentation/Changes for the minimum version numbers required and how to get updates for these packages."

OK: let's check it out:

(If we need to fix something, I'll <b> </b> bold it...)

* Gnu C
# gcc --version
Should be at least version 2.91.66

[root@sparky /home/jsage]# gcc --version


* Gnu make
# make --version
Should be at least version 3.77

[root@sparky /home/jsage]# make --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for i386-redhat-linux-gnu


* binutils
# ld -v
Should be at least version

[root@sparky /home/jsage]# ld -v
GNU ld version 2.9.5 (with BFD


* util-linux
# fdformat --version
Should be at least version 2.10o

[root@sparky /home/jsage]# fdformat --version
fdformat from util-linux-2.10f

hmm.. gotta fix that.

* modutils
# insmod -V
Should be at least version 2.4.0

[root@sparky /home/jsage]# insmod -V
insmod version 2.3.10-pre1

hmm.. so we gotta fix that.

* e2fsprogs
# tune2fs --version
Should be at least version 1.19

[root@sparky /home/jsage]# tune2fs --version
tune2fs 1.18, 11-Nov-1999 for EXT2 FS 0.5b, 95/08/09

OK.. gotta do that..

* pcmcia-cs
# cardmgr -V
Should be at least version 3.1.21

[root@sparky /home/jsage]# cardmgr -V
cardmgr version 3.1.8

I don't have any immediate need for pcmcia stuff, but I've been dreaming about 802.11b wireless, so let's do it right.

# pppd --version
Should be at least version 2.4.0

[root@sparky /home/jsage]# pppd --version
pppd version 2.3.11

OK.. gotta fix *that*

* isdn4k-utils
# isdnctrl 2>&1|grep version
Should be at least version 3.1beta7

[root@sparky /home/jsage]# isdnctrl 2>&1|grep version
isdnctrl version 3.1beta7

and Check..

The article continues:

If you find that you have an older version of any of the following software, you can download the latest version from http://www.freshmeat.net. In most cases, if you already have a 2.2.x kernel, you won't require any additional downloading with the exception of a newer version of modutils.

Well, despite having a relatively new Red Hat install (2.2.14-5.0 kernel, built about March 2000), we've got work to do.

(And, actually I went beyond freshmeat.net and got most of these off kernel.org)

We need at least:

util-linux 2.10o, modutils 2.4.0, e2fsprogs 1.19, pcmcia-cs 3.1.21, and ppp 2.4.0


(Let's put a coupla <hr>'s in, right now, because some time is gonna pass, here...)

OK: at kernel.org - util-linux version 2.10s -- that'll do: we need at least 2.10o

"Util-linux is a suite of essential utilities for any Linux system. Its primary audience is system integrators and DIY Linux hackers. Util-linux is attempting to be portable, but the only platform it has been tested much on is Linux i386."

And again, at kernel.org, let's go ahead and get ver 2.4.3: modutils

"The modutils package contains utilities that are intended to make a Linux modular kernel manageable for all users, administrators, and distribution maintainers."

e2fsprogs version 1.19 -- we need 1.19

"The ext2fsprogs package contains essential ext2 filesystem utilities which consists of e2fsck, mke2fs, debugfs, dumpe2fs, tune2fs, and most of the other core ext2 filesystem utilities."

pcmcia-cs version 3.1.24 -- we need at least 3.1.21

"Card Services for Linux is a complete PCMCIA or PC Card support package. It includes a set of loadable kernel modules that implement a version of the Card Services applications program interface, a set of client drivers for specific cards, and a card manager daemon that can respond to card insertion and removal events, loading and unloading drivers on demand. It supports hot swapping of most card types, so cards can be safely inserted and ejected at any time."

And ppp version 2.4.0 -- which is what we need

"PPP Daemon for Linux, Solaris 2, *BSD, SunOS 4, Digital Unix, SVR4, NeXTStep, and Ultrix. This allows Unix machines to connect to the internet through dialup lines, using the PPP protocol, as a PPP server or client. Works with 'chat', 'dip', and 'diald', among (many) others. Supports IP, TCP, UDP and (for Linux) IPX (Novell)."

OK: So let's say right here that I'm a little leery of what's next. I have re-compiled my existing kernel several times, and I've installed lots of app's from source, but here we'll be tinkering with the very stuff that makes Linux run, or at least do as much as it can.

So let's do a little research, rather than just tarx'ing all these downloads blindly..

The kernel HOWTO (this is html single-page format, which allows me to search the whole thing..) is a good reference.

And, an interesting find at the Linux Documentation Project is "Linux from Scratch", which now has it's own web site: Linux from Scratch (which just became my *next* project..)

Linux from Scratch gives a tremendous amount of information about installing Linux from scratch (hence the name ;-) -- particularily all the packages needed to build a system from zero..

And once you download the kernel source, untar it somewhere and read /linux/README, and /linux/Documentation/Changes

Hey! RTFM, huh? Read everything! Don't come running to me if ya don't...

OK: So we got all the parts. Let's dig in. I moved all the support utilites off into a new directory where I've got lots of disk space, and untarred 'em.

tarx e2fsprogs-1.19.tar.gz
(see page 176 of "Running Linux" for the bash scripts tarx, tarc and tart...)

cd ./e2fsprogs-1.19

lynx .

And read README and INSTALL and all the other stuff..

mkdir build

cd build


and time passes..


make check

make install

OK: Check for preformatted man pages, and delete..

Check the syntax of /etc/fstab

It's just that easy ;-)

And, let's do the rest of 'em..

Time passes...

OK: modutils 2.4.3 was a little confusing: ./INSTALL suggests ./configure --help to see the command line switches; after some lengthy pondering about --exec-prefix, and looking at where stuff was, and what ./configure --help seemed to be saying, I decided to ignore the command line switches and just dive right in...



And then cd'ing into ./insmod ./genksyms and ./depmod and doing

make install

...in each of them seemed to work just fine, so then I got smart and decided to repeat the

insmod -V

to confirm the new version, and the output scrolls off the top of the screen and I can't see what version I've got...

...but adding the -V switch to all the other commands in this package returns ver 2.4.3, so I'm not gonna sweat it.

I even rebooted (Damn! my uptime was 76 days..) and got no problems with anything finding or loading any modules, so it must be ok...

hmm.. Ya know, I'm gonna skip the pcmcia stuff.

Don't need it.

Nope: don't need it at all.

OK: ppp ver 2.4.0..

cd ./ppp-2.4.0

And read everything.. (most of this is about setting up and using pppd, which, I hope, [hehehe..] won't get munged-up by what I'm about to do, since I do have a working ppp dialup setup).



make install

OK: hmm.. pppd --version yeilds "pppd version 2.4.0"

Cool.. wonder if the dialup scripts still work..


Real cool..

We're rollin'...

OK: util-linux ver 2.10s...


OK: I like this.

(This is why you RTFM, right?)

From the README:

"...the stuff in the subdirectories mount, fdisk, disk-utils, text-utils, misc-utils, sys-utils, getopt-* should be rather distribution-neutral, and installing it does no harm.

On the other hand, the stuff in login-utils defines initial boot-time stuff, things that are done in different ways by different distributions. If you install it, your machine may not boot anymore."


We'll be sure to avoid *that* like the plague...

OK: actually this util-linux thing is *rather* hard to get real information about. INSTALL says "...4) edit MCONFIG..."


And MCONFIG has a bunch of flags in it that have to do with PAM, and passwd, but since I'm *not* going to install anything under ./login-utils I'm hoping that I'm gonna be OK, here...

And the Kernel HOWTO says:

"7.2.  util-linux

  Rik Faith (faith@cs.unc.edu) put together a large collection of linux
  utilities which are, by odd coincidence, called util-linux. These are
  now maintained by Andries Brouwer (util-linux@math.uio.no).  Available
  via anonymous ftp from sunsite.unc.edu in /pub/Linux/system/misc, it
  contains programs such as setterm, rdev, and ctrlaltdel, which are
  relevant to the kernel. As Rik says, do not install without thinking;
  you do not need to install everything in the package, and it could
  very well cause serious problems if you do."

So I'm going to press on regardless, and hope that I can *not* install the ./login-utils when I get to that point...

And, basically what I did was delete the line in the initial section of the Makefile, *after* I'd done make, that said "SUBDIRS=login-utils" so there was *seemingly* no subdirectory and that bad, bad stuff never got installed..

Check it:

[root@sparky /home/jsage]# fdformat --version
fdformat from util-linux-2.10s

OK: good to go..

Before you jump into compiling the kernel, move your older linux source kernel into a different directory to ensure that when you untar the 2.4.x kernel source, it doesn't overwrite your older kernel. For example,

# cd /usr/src
# mv linux linux-2.2.12
# tar xzpvf linux-2.4.1.tar.gz

This will move your older linux source into linux-2.2.12 directory and untar the downloaded kernel into the /usr/src/linux directory...

Once again, this directly contradicts what's said in ./linux/README:

"If you have the full kernel sources, put the tarball in a directory where you have permissions (e.g. your home directory), and unpack it...

Do NOT use the /use/src/linux area! This area has a (usually incomplete) set of kernel headers that are used by the library header files. They should match the library, and not get messed up by whatever the kernel-du-jour happens to be."

Good enough for me: I'll do this on the partition where I've got lots of space...

and that's as far as I am..

Events just kinda overran this project; I only have so many hours in the day, and far too many interests, particularily network intrusion detection and analysis...

But the article continues, even if I didn't:

Rename your older vmlinuz and System.map, in case they are files and not symlinks, and create a new entry in lilo to allow you to boot into your older kernel for last minute bail out, in case the 2.4.x kernel bombs out!

# cd /boot
# mv vmlinuz vmlinuz-2.2.12
# mv System.map System.map-2.2.12
# cd /etc

Edit your lilo.conf to add a new entry

image = /boot/vmlinuz-2.2.12

For a quick guide to compiling kernels, read Mayank Sarup's article on compiling the Linux kernel.

Now you are ready to configure the kernel settings and compile the kernel.

# make menuconfig
# make xconfig

to open the configuration tool. Try to compile support as modules as this ensures a smaller size of the kernel.

Finally, get a cup of coffee (the compile takes a long time) and sit back and watch as the kernel compilation proceeds,

# make install

This will compile the kernel, copy the vmlinuz/System.map into your /boot directory and update lilo.conf. The next time you boot, selecting Linux will boot you into kernel 2.4.x

Linux software/tools at Freshmeat
Compiling the Linux kernel

Other articles by Amit Chattopadhyay

Last modified: Sun Feb 24 10:03:02 2002

at www.FinchHaven.com