old-www/LDP/LG/issue01to08/upgrade.html

577 lines
24 KiB
HTML

<HTML>
<!-- BEGIN HTML HEAD ==================================================== -->
<HEAD>
<TITLE>Experiences with Linux Kernel 2.0 Upgrade</TITLE>
</HEAD>
<!-- END HTML HEAD ====================================================== -->
<!-- BEGIN HTML BODY ==================================================== -->
<BODY>
<H1><IMG ALIGN=MIDDLE SRC="../gx/lg_logo.gif">Kernel Upgrade!</H1>
<H2>A Member of the Linux Documentation Project</H2>
<H4>&quot;The Linux Gazette...<I>making Linux just a little more fun...!</I>
&quot;</H4>
<H5>Copyright (c) 1996 John M. Fisk <I>fiskjm@ctrvax.vanderbilt.edu</I><BR>
The LINUX GAZETTE is a member of the LINUX DOCUMENTATION PROJECT.<BR></H5>
<HR>
<!-- ==================================================================== -->
<!-- ARTICLE ============================================================ -->
<H2><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Experiences with Kernel 2.0 Upgrade
</A></H2>
<P>
<B>by John M. Fisk &lt;fiskjm@ctrvax.vanderbilt.edu&gt;</B>
<H3>So, you think you want to upgrade...?</H3>
If you're still running one of the 1.2.x kernels then you probably should
seriously consider the 2.0 upgrade. Now, there's nothing that says that you
<I>absolutely have to</I> do this and if you're using Linux in a setting where
down time isn't possible, then running a stable kernel may well be fine.
<P>
However, the improvements in the 2.0 kernel are pretty impressive, especially
for someone like me who wasn't really following the 1.3.x developement very
closely. A couple things about the 2.0 kernel that I personally REALLY liked
were:
<OL>
<LI>MUCH <B>better overall performance</B>, especially under X
<LI>The <B>kerneld module daemon</B> which autoloads the modules on demand
<LI><B>Very nice text mode, (console) menu mode, and X Window mode</B>
kernel configuration utilites that <B>include explanations</B> of the
various kernel options
<LI><B>A lot more documentation</B> right with the kernel sources
themselves
</OL>
<P>
These are just the things that I happen to like. I'm sure that for many of
you the list would be a lot longer.
<H3>And Remember: Luck Favors the Prepared Mind...</H3>
I have to admit that before embarking on this little expedition I poured over
the comp.os.linux.xxxx group postings to see how others had fared. All in
all, from the looks of things, it appeared that undertaking the upgrade would
be a bit of work, but was very much doable. I saved several of the Usenet
postings regarding various problems folks had run into and started jotting
down notes to myself in the 'ol Linux Notebook that hangs out next to my Linux
box.
<P>
But before I go any further, let me cut to the chase:
<P>
<B>IF YOU'RE USING REDHAT THEN FATE, MY FRIEND, IS SMILING ON YOU!</B>
<P>
Thanks to the wonders of modern technology (and a bit of &quot;sweat of the
brow&quot; work on the part of the guys at RedHat) all you RedHat users can
just ignore the rest of this article and toddle on down to your friendly,
neighborhood <A HREF="http://www.redhat.com">RedHat WWW Site</A> and follow
the instructions for RPM'ing your way to a (reasonably painless :-) 2.0
upgrade.
<P>
See Ya! Tell the guys at RedHat &quot;Howdy&quot; from me!
<P>
Hmmm... OK, who's left?
<P>
Seriously, this is one of the reasons I'm planning to switch over to a RedHat
system. Not to get into a bruhaha over the merits of one distrubtion over
another, but the ease of upgrade is one of the things that I really like about
RedHat. Now, before you get in a dander, I'm still running and enjoying a
seriously hacked up Slackware 3.0.0 distribution which has served me well for
the past 8 to 9 months or so.
<P>
Anyway, let's see what needs to be done to get up to speed.
<H3>Time to Roll Up Your Sleeves...</H3>
As I mentioned before, I spent a bit of time doing some reading before
plunging in with the upgrade. Mostly, because several of the Usenet postings
had mentioned serious troubles: from little things like <B>ps</B> no longer
working correctly to bigger problems such as <B>pppd</B> and <B>make</B> no
longer working. Not really wanting to have FiskHaus (the 'ol Linux box here
in Nashville) down too long, I went to the &quot;virtual library&quot; for
some more information.
<P>
The first thing I did was to <B>pick up a copy of the kernel 2.0 sources</B>
which was at my favorite Linux FTP watering hole:
<P>
<A HREF="ftp://ftp.cc.gatech.edu/pub/linux/">ftp.cc.gatech.edu/pub/linux/</A>
<P>
GA Tech always keeps a pretty up to date sunsite mirror and so I popped in one
afternoon and checked out the Incoming directory for new toys. Now, the first
thing that struck me about the new kernel was its sheer size: this 'ol Bubba
is one Big Boy! Weighing in a over 5MB I set up the download on my trusty
14.4 USR and stepped out for some Nachos and a Coke.
<P>
Here is the first of a couple <I>caveats</I>: when I went to unarchive the
2.0 kernel sources I failed to check the *.tar.gz archive before unfurling it
into /usr/src...
<P>
Bad Mistake :-(
<P>
Before unarchiving <I>ANYTHING</I> it's probably a good idea to do a listing
of it first to have a peek at what's there. You see, the 2.0 kernel is
archived under a &quot;linux&quot; top directory. That's not a problem unless
your current kernel sources are <I>also</I> under /usr/src/linux. I'd set up
the 1.2.13 sources as &quot;linux-1.2.13-ELF&quot; and then created a symlink
from that directory to &quot;linux&quot;. When I unarchived the 2.0 sources,
guess what happened to the 1.2.13 sources...
<P>
Right... they were <B>Ghandi</B> mon...
<P>
Serious Bummer... :-(
<P>
It wasn't a huge deal to reinstall the old 1.2.13 sources again and then fix
the symlinks to point back to the 1.2.13 files, but I did kick myself a couple
times for being careless.
<P>
Anyway, forwarned is forarmed.
<H3>Time To Do a Bit of Reading...</H3>
The next step was to have a look at the documentation in the
/linux/Documentation subdir. There seems to be a new emphasis on including
helpful docs actually <I>with</I> the kernel sources itself. The one that
you'll need to read is called <B>Changes</B> which basically outlines the
stuff that &quot;broke&quot; during the development of the 2.0 kernel and what
you'll need to do to successfully upgrade and keep everything working.
<P>
Do yourself a favor: READ THIS!!
<P>
The file lists several original sources for this information including:
<UL>
<LI>the linux-kernel mailing list
<LI><B>Jared Mauch's</B> Web page <A HREF="http://www2.nether.net/~jared/victim.html">
&quot;Software Victims of the 1.3 Kernel Development&quot;</A>
<LI><B>Axel Boldt's</B> <A HREF="mailto: boldt@math.ucsb.edu">
&quot;Configure.help file&quot;</A>
</UL>
<P>
There is now a Web page maintained by John Taylor at
<A HREF="http://www.cviog.uga.edu/LinuxBleed.html">
http://www.cviog.uga.edu/LinuxBleed.html</A> which includes the same material
as that in the Changes document.
<P>
I printed a copy of this and it turned out to be an invaluable guide for
anticipating where I could potentially run into trouble and what things needed
to be upgraded.
<P>
Also, there are a number of other short-to-medium length documents in the
Documentation directory that you might be interested in -- modules.txt,
ide.txt, ppp.txt, ramdisk.txt, java.txt, and so forth. After printing these
up and skimming over them I felt pretty comfortable with what needed to be
done.
<H3>Getting All the Pieces Together...</H3>
The next step, after reading through the <B>Changes</B> document, was to
create a list of all the packages I'd need to install in order to successfully
upgrade. Again, the Changes document is an absolute MUST read in order to
avoid running into any nasty surprises. My initial list of files included:
<UL>
<LI>modules-2.0.0.tar.gz
<LI>ppp-2.2.0f.tar.gz
<LI>ld.so.1.7.14.tar.gz
<LI>gcc-2.7.2.bin.tar.gz
<LI>libc-5.3.12.bin.tar.gz
<LI>libg++-2.7.1.4.bin.tar.gz
<LI>make-3.74-direntfix-elf.tgz
<LI>gdb-4.14.elf.1.bin.tar.gz
<LI>binutils-2.6.0.14.bin.tar.gz
<LI>procps-1.01.tar.gz
<LI>sendmail-8.7.5-bin.tar.gz
<LI>sysvinit-2.62.tar.gz
<LI>termcap-2.0.8.tar.gz
<LI>pine-3.94.tar.gz
<LI>kbd-0.91.tar.gz
<LI>hdparm-2.9.tar.gz
<LI>dosemu-0.63.1.36.tgz
</UL>
<P>
As you can see, the &quot;Victims of Modernization&quot; were many :-)
<P>
The good news is that, depending on whether you're a &quot;glass is
half-empty or glass is half-full&quot; kind of guy or gal, that the same
helpful Changes document also includes a listing of where to find all of these
needed programs.
<P>
So, after another afternoon spent chasing down programs from the four winds of
the earth it was just about time to start the whole upgrade affair. I should
also point out one very important thing: in order to compile the new kernel
you'll need to upgrade a number of the development tools including GCC,
binutils, libc and libg++ libraries, make, and so forth. These are available
as binaries. Unless you're the masochistic type, save yourself the hassle and
just get the binaries! Also, you'll need to do just a <I>bit</I> more reading
as the development stuff comes with release notes -- you'll probably want to
print and read these as well.
<P>
Anyway, after generating a sheaf of papers and coloring them up with Hi-Liter,
I felt reasonably ready...
<H3>Let the Games Begin...!</H3>
The first thing I started with was the development stuff. I wanted to be
certain that all this stuff was properly installed and working before trying
to compile a new kernel. As I mentioned before, the good news is that most of
this stuff -- gcc, binutils, libc, libg++, and even a &quot;fixed&quot; make
-- was available as binaries. Each of these has a <B>release note</B> which
describes how to go about upgrading. I followed the notes and within an hour
or so, had all of the development stuff install.
<P>
Phew! Got to check a few things off my list...
<P>
I went ahead and tried compiling a few small programs just to make sure that
things were working correctly. After a couple quick compiles, I also changed
the /usr/src/linux symlink to point to the new 2.0 kernel sources (for the
&quot;/usr/src/linux &amp; /usr/src/asm&quot; include files) and recompiled
the same programs. Not a hitch!
<P>
At this point, let me make an observation that just <I>might</I> be useful to
someone. When I first started using Linux a couple years ago I was often
distraught regarding how little information/documentation I could find on many
programs. Even after discovering <B>info</B> and all the stuff that got put
into <B>/usr/doc/</B> it seemed to me that I still didn't know as much as I
wanted about how programs worked. Also, a number of manual pages pointed to
files or other programs that I could never find on my system.
<P>
The bottom line is: often, if you want to find the best documentation for a
program, just pick up the sources!
<P>
I've been amazed over and over again at the (frequently) rich set of documents
that come with a program that are not necessarily included with binary
distributions. Also, most Linux distributions simply don't have the space to
include the full set of documents for every program it includes. If you have
a program that you really need documentation on:
<P>
Get the sources!
<P>
Anyway, I digress...
<P>
After installing the new development stuff I started re-compiling the programs
which would need to be upgraded before installing the 2.0 kernel. Again, this
turned out to be relatively easy. There is at least one program that you want
to be kind of careful with: <B>sysvinit</B>. You'll need to read the
documentation that comes with it carefully since this program is responsible
for initializing the system at boot up. A wayward init can cause your system
to become unbootable and that's seriously Bad Mojo!
<P>
I ended up recompiling procps, sysvinit, hdparm, the kbd package, modules 2.0,
and PINE. These compiled without much hassle. Also, the good news is that in
the process of doing so, I found that the most recent interation of PINE -
3.94 I believe, now has xterm + mouse support. I've enjoyed using the
<B>XF-Mail</B> program a lot, but when my mail got seriously backlogged I
found that it was just a bit too slow owing in part to the multiple screens
that are used for replies and such. I'm back to using PINE which, while it
won't win any beauty contests, is a sturdy, reliable, and very well proven
email client that is (on my system) pretty fast. I really like the new mouse
support in X and like the fact that it works equally well under X and at the
console. Your mileage may vary... :-)
<P>
Well, since things were going pretty smoothly I decided to take the big
plunge!
<H3>Taking the Big Plunge...!</H3>
From past experiences I knew that compiling PPP generally meant having to
patch the kernel and compile a new kernel. Since I'm dependant upon PPP for
'Net access, I wanted to do this last so that FiskHaus would be 'Netless for
as short a period as possible. Again, I found a goodly supply of helpful info
in the PPP sources and compilation was a cinch. The good news was that a new
pppd didn't &quot;break&quot; any of the PPP scripts I'd written over the past
couple months and so this went very smoothly. I should probably add that I
backed up EVERYTHING that I recompiled so that I could backtrack if necessary.
<P>
You know... luck and the prepared mind stuff... :-)
<P>
Oh, before I forget, any of you using <B>sendmail</B> will also need to
upgrade to at least version 8.7.x since another of the changes that occurred
was that a file can no longer be simultaneously locked with both 'flock' AND
'fcntl'. The good news: there is a drop-in binary available that is a simple
no-brainer fix for this.
<P>
See, this isn't so bad after all... :-)
<P>
Well, after all of this build up I have to sheepishly admit that the actual
kernel compile was unremarkable. (That's GOOD, by the way... :-). I really
wanted to try out the new configuration utilities. Those of you, like me, who
did the 'ol &quot;make config&quot; under 1.2.13 will be pleasantly surprised
by the new configuration programs. You have a choice of:
<UL>
<LI>text based &quot;make config&quot;
<LI>console based menu &quot;make menuconfig&quot;
<LI>X Window (Tk based) based &quot;make xconfig&quot;
</UL>
I decided at first to try &quot;make menuconfig&quot; and see how that looked.
I don't know if any of you tried the same thing but it hung on the initial
compilation of the menu program. Oh Well... so I tried using &quot;make
config&quot; and this went very smoothly. I was quite pleased with the help
system that is now part of the standard distribution. There have been kernel
add-on's which provided the same facility now for some time, but it's nice now
to see this build into the kernel sources. Generally, you are offered the
choice of <B>Y, N, M, ?</B> for each kernel option -- <B>Y</B>es, compile in
kernel support, <B>N</B>o, don't compile in kernel support, compile the
current selection as a <B>M</B>odule, and <B>?</B> give me a bit of
information about this option.
<P>
I went fairly conservatively at first and compiled a kernel with most
everything build into the kernel itself. This compiled without a hint of
trouble and after updating /etc/lilo.conf and adding a stanza for the new
kernel and rerunning lilo, I booted up to enjoy my shiny new kernel!
<P>
And the fans went wild...!!
<P>
Yeah, I was pretty impressed. I tried out X and it really did appear to run
much more smoothly -- currently, I've got a fairly low end graphics card and
SVGA monitor and even with this, the screen redraws were much smoother and
running several programs concurrently, including Netscape, now seemed to work
a bit more smoothly as well.
<P>
So I was impressed :-)
<P>
As I mentioned before, one of the things that has REALLY impressed me about
this new kernel is the handling of the loadable modules. I have to admit that
I've had, at best, mixed results with using modules. Some of them seemed to
work fine, but many of these seemed extraordinarily fickle and some just
frankly refused to be loaded with a barrage of &quot;undefined symbol...&quot;
messages. Still, I figured it was worth a try...
<H3>A Truly Automated Kernel...</H3>
Well, on the second kernel compile go-around I was pleasantly surprised to see
that the &quot;make menuconfig&quot; now worked! I have no idea why it
crumped the first time, but I was happy to see it in action. I'm still a bit
of a command line interface (CLI) fan and so enjoyed using the menuconfig
program. It took a bit of getting used to as I was in the habit of having a
steady stream of questions fired at me during the configuration process. This
is now MUCH more genteel :-)
<P>
The menuconfig option uses the same basic <B>dialog</B> interface that is used
for system installation by Slackware and, I think, RedHat as well. Any of you
who have installed these systems will recognize the familiar menus and
checkbuttons. This is nicely organized and the help windows are, for the most
part, REALLY QUITE helpful! You just work your way through the various menu
items and when you get to the end, fire off the command and the kernel compile
starts. I also tinkered around a bit with the X Window version:
<B>xconfig</B>. I honestly haven't tried using it to compile a kernel, but
the interface was clean and intuitive. Here's a screen dump for any of you
who are interested:
<P>
<IMG WIDTH=580 HEIGHT=550 SRC="./gx/xconfig.gif">
<P>
Well, as I mentioned above, I really wanted to give the <B>kerneld</B> daemon
a whirl. The basic premise for using this is that you compile into the kernel
only those drivers and options that you REALLY need -- IDE harddrive support,
ext2fs support, and so forth -- and then compile everything else that you
<I>might</I> need as a module.
<P>
Sounded easy enough. :-)
<P>
Again, I'd commend to you the file <B>modules.txt</B> which is included with
the rest of the files in the Documentation directory. I simply followed the
steps outlined there -- compiling in KERNELD support, compiling most drivers as
modules, adding a stanza in the rc.* files for running <B>depmod</B> at system
boot and a stanza for starting the kerneld itself -- and after updating
/etc/lilo.conf for this second 2.0 kernel and rerunning lilo, I was all set.
<P>
And do you think it actually worked...?
<P>
Yup ;-)
<P>
I was seriously impressed.
<P>
I was a bit concerned as to whether autoloading would happen smoothly or
whether I'd find that modules weren't being loaded, or other such annoyances.
I've been running this kernel now for the past few weeks and haven't had a bit
of trouble with it! Well... at least no major trouble :-)
<P>
At first, I'd occasinally fire up <B>lsmod</B> just to have a peek under the
hood to see what was happening. Sure enough, if I went to print a file, the
'lp' support module was loaded; if I mounted the /dos partition, the 'fat' and
'msdos' modules were loaded; use the mouse and the 'serial' module was loaded;
run an old a.out program and the 'binfmt_aout' module was loaded...
<P>
You get the picture.
<P>
Eventually I stopped doing checking in on things -- it REALLY does provide a
transparent layer of support for loadable modules! The one small problem that
I ran into was...
<H3>Getting DOSEMU Up and Running...</H3>
One of the things that I ran across in reading the Usenet group postings was
that DOSEMU got &quot;broken&quot; by kernel 2.0. Now, if I need to do some
serious word processing, DTP, or graphics stuff, I'll just reboot to DOS and
fire up Windows and do what I need to do. Not too long ago, I got tired of
having to do this for every little note or letter I wanted to write. I tried
using <B>LyX</B> -- an excellent front end to LaTeX -- but found that I still
was stuggling to get simple things done. This is mostly a criticism of my
lack of TeX-related skills and has nothing to do with this fine program. I
finally broke down and bought a copy of <B>Word Perfect 6.1 for DOS</B> at the
local Univ. store (nice academic discount to boot... :-) and have been using
it under DOSEMU ever since.
<P>
Well, I knew that I wanted to get this up and running quickly so I wouldn't be
constantly rebooting to DOS. I found that the basic problem with using the
previous 0.60.x DOSEMU versions is that they simply won't compile. Part of
the problem is that one of the include files -- vm86.h -- has been moved. The
most recent development version of DOSEMU (0.63.1.36 is the version I'm
currently using) now correctly finds this file. In the 0.63.1.19 verion,
there was a kernel patch that had to be applied before it would compile.
<P>
Anyway, I set up the DOSEMU sources and, after skimming through the
<B>QuickStart</B> document once more, got it to compile with little
difficulty. The only slight problem that I've encountered -- and this really
isn't much more than a minor annoyance -- is that I've got a stanza in my
autoexec.bat file for DOSEMU which loads the DOSEMU cdrom driver. If there is
a CD in the drive when DOSEMU starts, everything is cool. If there isn't a CD
in the drive, then it starts a series of repeated probings which continue even
when DOSEMU is exited. Initially, it drove me crazy to see the CD drive light
going wildly on and off over and over again and I tried to manually
<B>rmmod</B> the sbpcd module -- No Dice!
<P>
So, what I've found is that eventually, the sbpcd module &quot;times out&quot;
and gets unloaded and the annoying blinking and whirring stops. It's annoying
in part because while this is going on the CD simply won't work -- the drive
door will not open and I've not been able to unload the sbpcd module manually.
<P>
Like I said, small problem.
<P>
So, how does DOSEMU run...? Great! If you haven't tried using this program
you really ought to give it a try, especially if you have old DOS programs
that you want to run. I've been impressed at how well WP 6.1 runs. What was
really nice, too, was to discover that it also works well in
&quot;Graphics&quot; mode -- giving you a near WYSIWYG interface. I happen to
like WP and have found that while it isn't <I>quite</I> as fast as under
native DOS mode, it works acceptably well and offers a feature-rich app that
can be used under a variety of OS's -- Linux, DOS, Windows, and OS/2.
<H3>And So, In Conclusion...</H3>
Glad to see that you're still with me! :-)
<P>
As I mentioned before, this really isn't a HOWTO as much as it is a recounting
of my own experiences. Unless you're using RPM to do the upgrade you should
probably give yourself several days to go through the whole process of
upgrading as you'll be making some significant changes to your system along
the way. I'd also encourage you to READ THE DOCUMENTATION! I can't stress
this enough -- many of the cries for help in the comp.os.linux.xxxx groups
could probably have been avoided if the person had read the documentation all
the way through.
<P>
As I said before, I've been very pleased with the upgrade. Specifically, the
system really does seem to work more smoothly now and X runs better overall.
I've had absolutely no problems with the regular kernel modules (those that
come with the kernel sources) and have had little trouble with other modules.
The added documentation and the improved kernel configuration facilites make
this a significant upgrade.
<P>
Drop me a note and let me know how things have been going for you! I'd be
interested in hearing about the problems &amp; difficulties folks have been
running into as well as first impressions.
<P>
Good Luck and Happy Linux'ing!
<P>
John
<P>
<HR>
<!-- ===================================================================== -->
<!-- FOOTER ============================================================== -->
<H3><A HREF="./lg_issue8.html">Back to Linux Gazette!</A></H3>
<I>This page written and maintained by:</I><BR>
<ADDRESS>
John M. Fisk <A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu">
fiskjm@ctrvax.vanderbilt.edu</A>
</ADDRESS>
<!-- END HTML BODY ======================================================= -->
</BODY>
</HTML>