Linux Space Station Raven - SSR-04

(C) Graham Swallow version -1b, gen 1996-07-29 00:37, gps@trix.dircon.co.uk

Issue 04

1 Raven Issue Four

This is Raven, Issue-4 (preview). It is £3 shareware, see Issue-One for more details.

This issue is about upgrading your kernel to 2.0.0, either from 1.2.13 or from whatever you have on your CDROM’s.

1.1 Out of date update ...

If you are reading this on CDROM, the CDROM probably contains more recent files than are mentioned in Raven. However, other people may have older CDROMS, which didn’t have the 2.0 series on them.

Many packages got renamed to ”2.0” to match the kernel, and maybe a few minor bug fixes, but there are many CDROM’s with usable packages (modules PPP etc), with the older numbers.

Packages intended for Linux 1.3.nn are ”correct” for Linux 2.0, but may be hard to find on older CDROM’s. To assist thoses with older CDROM’s I have not updated the version numbers in Issue-4. Instead I shall simply delete it, when everyone has moved to 2.0.

IE If you can find these packages, they should work with Linux 2.0. If you can find more recent versions, good.

1.2 Yet to come

I am putting out this preview of Issue-Four, in the hope that it may be of use, to people upgrading.

I hope to be adding sections that are more specific to actual current distributions, eg RedHat-3.0.3, but you will have to compare your favourite distribution with the current version levels, and ask your supplier what they think they are up to.

#### quoted from /usr/src/linux-2.0.0/Documentation/Changes ####
- Kernel modules         Stable: 1.3.57, Exp: 1.3.69k
- PPP daemon             Stable: 2.2.0f
- Dynamic linker (ld.so) 1.7.14
- GNU CC                 2.7.2
- Binutils               2.6.0.14
- Linux C Library        Stable:  5.2.18, Beta:  5.3.12

- Linux C++ Library      2.7.1.4
- Termcap                2.0.8
- Procps                 0.99a
- Gpm                    1.09
- SysVinit               2.62
- Util-linux             2.5

1.3 GCC 2.7.2

I have an older Slackware with GCC 2.7.0, and it all compiles ok, (settings for i486). You may need to upgrade to 2.7.2, and if you do, you should check that everything that used to compile and run, still does.

2 upgrade to Linux 2.0

Linux 2.0 is vastly different from Linux-1.2.13, but is much the same as Linux-1.3.100+.

Other system components (such as libc) have also changed, so you should spend a few hours upgrading the various components.

Distributions of the 1.3.90+ era, didn’t really follow the changes, and used 1.2.13 as the base of their distributions, the result being that you have to.

If your distribution is already configured for Linux 2.0, great!

2.1 Scratch build

If you are at home, and only have one machine, you should still have a second disk to buid the new system on. If you don’t, you only have yourself to blame. However, boot diskettes may be enough.

If you are in an office, you really MUST have a second machine, for a week or so. The cost of your services being down may be much more! When the process is finished, you will be able to use that second machine as a general backup, or as your personal workstation.

Offices should have a general approach to backup systems (as well as backup tapes). There will always be a new kernel to test, or a new configuration to play with, and there is always the risk of a disk developing a fatal error.

The benefit of scratch building, is that you know what went into the system, and are starting from nothing. When you have tested your new machine, you can rename it, change the IP address and swop out the system being upgraded.

This does add to the cost, in that you need a spare machine, AND you may need to upgrade each machine twice!

The loss (and gain) of scratch building, is that a lot of rubbish on the disks gets dropped. Just hope that the runnish didn’t contain any gems!

2.2 Beware!

There are several interconnected components, that need to be changed together, and some of the components are the ground that you are standing on!

For example, libc is needed by virtually every program on the disk, if it doesn’t exist, you won’t be able to put it back! Unless you have a boot disk, or other bootable partition, or you have statically linked mv or cp program.

The first thing you should do is locate a boot-disk-set, and use it to see what it look like. You might also like to try booting to single user mode, by adding ”single” to the LILO boot line.

You should also locate and save all configuration files that might be lost during the process (/etc/passwd, /etc/hosts and many many others).

You should also be careful when connecting a machine with a broken sendmail, to the internet. You don’t want any gaps in service, but you certainly don’t want any email to actually be lost!

2.3 Fetching the components

This is one of the reasons for having a second working machine! I fetched what I wanted from the Internet, but you might only have the CDROM’s for company. Be lucky.

Collect the list of things from this document. Don’t be supprised if more recent versions are available. Be optimistic.

3 Kernel

Firstly save your old kernel source, and be careful NOT to install the new source over the old. One way is to rename the top dir to something else, eg linux-1.2.13-old. Make sure that the directory /usr/src/linux DOESN’T EXIST.

You should ftp a recent kernel, untar it, and rename the directory, to something like /usr/src/linux-2.0.0. Create a symbolic link so that it appears to be /usr/src/linux

        cd /usr/src
        ls -l
        rm linux
        tar -zxf /tmp/linux-2.0.tgz
        mv linux linux-2.0.0
        ln -s linux-2.0.0 linux
        less linux/README

You should also check that the links from else-where are correctly set. Once done, they will still be valid next time. Use ls and ln so that:

        /usr/include/linux      -> /usr/src/linux/include/linux

        /usr/include/asm        -> /usr/src/linux/include/asm-i386

You should browse linux/README and linux/Documentation/*

3.1 /etc/lilo.conf

You should have the choice of which kernel to boot, and which root partition to boot with. You will need to edit /etc/lilo.conf for every new kernel version. When you run make zlilo, or make install, the last action will be to call lilo to install it as bootable. Make sure that all the necessary partitions are mounted! See Issue-One for more details.

You should run it first to see that it isn’t broken.

Note that modules can have their parameters in /etc/conf.modules, and not the LILO line (or parameters in /etc/lilo.conf).

3.2 Kernel - Configure

The kernel is made of several drivers, and components. You decide which components go into your system, and what flags are needed for them. You do this by running make config, or make menuconfig, or make xconfig. I did make menuconfig, which offers a nice menu interface, and runs on a plain console.

Every option has a help text (taken from Documentaion/Configure.help) which may help.

Basically you should include the absolutely necessary drivers, needed to run the hard disk during boot time. You should also set standard options, such as SYSV-IPC and networking. For you they are essential, but someone somewhere sees them as optional, and Linus supports that.

Other drivers, which you could then load from the hard disk (or network, or cdrom, or floppy, ... ) should then be flagged as modules, and will be built seperately. Most drivers can be configured as modules.

Getting to grips with the configure options isn’t easy, and familiarity helps. eg it is hard to find the NE2000 driver option, unless you know that it appears under ”Other ISA Cards”, and that selecting that option has no effect, other then making more options available on the screen.

When you are more familiar with Linux, you will probably want to recompile with a new parameter set, to play with a particular driver. Or maybe you forgot to compile the LP support, and you want it as a module. Chances are, that by then there will be a new kernel version available, and you may wish to fetch it, or the patches.

Some development kernels ARE development ones, so beware. But don’t do what many distributors do, and put it off until everything has changed.

The result of running menuconfig is /usr/src/linux/.config. It may be worth saving this file for comparing it when compiling the next release.

3.3 Kernel - Compile

        make dep

        make zlilo # or make install
        make modules
        make modules_install
        depmod -a 2.0.0 # or depmod between reboots

Building the modules will take a while. It may be a bit quicker, if you exit X11, and all large applications, to make more memory available to the cache.

3.4 /sbin/installkernel

If you have configured lilo to use /vmlinuz, you don’t have to do this, but I prefer to archive my kernels and keep access to older versions. I also have a disk bigger than 1024 cylinders, so I use a seperate partition for all the boot files (/dev/hda4). This is described in Issue-One.

Having the installkernel script, allows you to run make install, instead of make zlilo. Remember to chmod 755 it.

#!/bin/sh
# /sbin/installkernel
        DIR1=${4:-/hda4/boot_raven}
        [ -f $DIR1/vmlinuz    ] && mv $DIR1/vmlinuz    $DIR1/vmlinuz.old
        [ -f $DIR1/System.map ] && mv $DIR1/System.map $DIR1/System.old
        cat $2 > $DIR1/vmlinuz-$1
        cat $2 > $DIR1/vmlinuz
# OR #  cat $2 > $DIR1/vmlinuz-$1 # or both!
        cp  $3   $DIR1/System.map-$1
        cp  $3   $DIR1/System.map
        lilo

If you rebuit the kernel, but there was an error in your /etc/lilo.conf, simply fix the error, and run lilo again. It is the last command run, so if it fails there is no need to run make install again. However, doing so won’t take as long as most things have already been done.

4 Modules

You get to recompile all the modules with every new kernel release. It may be possible to keep them across versions, but it is cleaner to recompile every time. See /lib/modules/2.0.0/*

If you have a binary module, eg from a thrid party supplier, you want to compile the kernel with CON-FIG MODVERSIONS=y, so that the kernel will try to adjust for different versions.

It is possible to pre-load modules to a ram disk, that is how some distributions boot from CDROM, but you probably don’t do it.

Modules get loaded after the kernel has booted, by commands (insmod), or automatically (kerneld). They must reside on a readable disk, and kerneld must have the correct map. To make this work you must have installed the correct modules package and configured it.

4.1 modules-1.3.69f

This package adds /sbin/kerneld, and support for modules. Don’t worry about the 1.3.69f label (unless a more recent version is available), that was the time when the previous version became out of date. Linux-2.0 is a progression from 1.3. Version 1.3.57 is semi-usable, but a sign that your distribution isn’t totally updated.

Un-tar it in /usr/src, and follow the instructions.

4.2 /sbin/kerneld

This comes with modules-1.3.69f. It cleverly detects when the kernel attempts to use a module that isn’t loaded, and automatically loads it for you.

You will need to edit /etc/rc.S, or some other system startup file, so that /sbin/kerneld is started before the first module is needed. The documentation says to add depmod -a to an rc file, but this isn’t necessary, and takes several seconds.

I start kerneld after the fsck stuff, before the mount -avt nonfs line. It doesn’t need an ampersand, because the designer guessed that someone would forget!

4.3 /etc/conf.modules

This file defines any aliases needed by the system, and options that you used to pass on the LILO line. I have an ne2000 ethernet card, so mine contains the following two lines. If you have two cards, you would have something similar. Note that ’grope-ing’ the IO ADDR, is not always ”safe”, and it only takes a minute to get it right. The IRQ is still groped.

        alias eth0 ne
        options ne io=0x300
        # alias eth1 de620
        # options lp irq=7
        # alias char-major-14 sound

4.4 depmod -a

You need to run this command ONCE, every time you install a new kernel version. It does get some information from the running kernel, so it is best to reboot with the new kernel, then run this command.

You can run it before rebooting, with the version number, eg depmod -a 2.0.0 Then it knows which directory to look in, and where to place it’s output file. Just to be safe, run at again after rebooting.

It creates the file /lib/modules/2.0.0/modules.dep, which you should not edit.

4.5 insmod

You should not need to use this command, but it helps whilst getting the other configurations sorted. It loads the named module, into a running kernel. Since kerneld didn’t load it, kerneld won’t unload it. When you have it working, get it to work with kerneld, and remove all insmod lines from your scripts.

rmmod name removes a module from the kernel. Again you don’t need it in scripts. It will only mess up other scripts that still need that module.

4.6 lsmod

lsmod, lists the modules currently loaded in the kernel. It’s how you know that the mount command is outputting the wrong diagnostic, when it tells you that iso9660 (isofs) is not a valid filesystem type. You can also use cat /proc/modules.

4.7 linux/.config

This is the output from running make menuconfig, check that it includes:

        CONFIG_MODULES=y
        CONFIG_MODVERSIONS=y
        CONFIG_KERNELD=y

4.8 Still not working?

Oh dear, go through the list again.

Remember that modules are modular, and if the compilation blows up during a module, try configuring it always in, or never in. Most modules have been tested in 100’s of different circumstances, but occasionally bugs creep in.

5 Other Upgrades

5.1 ppp-2.2.0f

If you upgrade from 1.2.13 to 1.3 or 2.0, you MUST upgrade ppp (if you use it). If you dont, you get:

        Sorry: PPP not available on this system

It’s easiest to upgrade the kernel first, then install ppp-2.2. Un-tar it under /usr/src, and follow the instructions. It just builds and installs out of the box.

The 2.0.0+ kernal sources already contain the correct code, so you can build the kernel first, then build PPP, then later build a new kernel from clean sources. You need this package to build the (non-kernel) pppd command. The 2.2.0e version on the CDROM’s is OK.

Your PPP configuration should be much the same as it ever was, but there is a new ”persist”, option, that will automatically redial if the phone line gets cut (ie pppd got a SIGHUP from the modem losing carrier-detect). Note that pppd will NOT redial, if the chat script fails (phone BUSY). Then you should try diald, or your own cron job.

If you find the line disconnects after 15 minutes of inactivity, look in /var/log/messages, for pppd reporting that the remote pppd requested a disconnect. Then try ping -i60 remote to spoof activity on the line.

You  should  also  locate  dial ppp,  from  Raven  Issue-3,  or  as  a

package on http://sunsite.unc.edu/pub/Linux/system/Network/Serial/ It works for me (static IP ADDR) and allows non-root users to establish a particular link.

5.2 procps-0.99a

This is on sunsite, in system/Status/ps.

Basically the new kernels have a new /proc format, which makes the old ps and top commands fail (segmentation fault). Most systems will run without this upgrade, but it is nice to be able to run the ps command, so upgrade as soon as you can.

5.3 lilo-19

The old LILO is still OK, but if you want to play with initrd, you want the new LILO and LOADLIN.EXE

This compiles and installs quite easily, and uses the same /etc/lilo.conf file.

Don’t forget that modules take their parameters from /etc/conf.modules instead of the LILO prompt line, so that is where you put the NE2000 IO ADDR (or whatever devices and parameters you need).

5.4 sendmail.8.7.5

You need to recompile sendmail without the flock option. Now is a good time to locate the original package and rebuild it.

You might want to edit the Makefile to say:

  DBMDEF=              -DNEWDB  # YES
# DBMDEF=       -DNDBM -DNEWDB  # NO

5.5 libc-5.3.12

This might break your ’man’ command, or other programs that have an alloc/free bug. If so, you can use MC to view man pages (but it is a hassle to have to do so).

When upgrading, be very careful when changing the symbolic link over. I created the new link then used the mv command to delete the old and install the new, without getting caught without any libc file at all!

If that happens to you, you won’t be able to run any commands, as they ALL need libc.so.5 to run! The system won’t boot, because init needs it! Use a boot disk or second root partition.

It would be nice to have a statically linked ln command, but by the time I needed it, it was too late. I couldn’t even CTRL-ALT-DEL, because the reboot program needed libc. sync-sync-click.

5.6 make 3.74

Upgrading libc, kills make (it fixes a bug that make expected). To recompile make without the make command, run the ./configure –prefix=/usr command, and run the build.sh script, and use ./make to run ./make install.

If you don’t have make 3.74 around, you can try pmake (Slackware called it that anyway).

6 Happy Now ?

This list is not exhaustive, but I hope that having it, saves you a days work, or a downed machine. You should also check elsewhere for other lists of things that you need. eg SYS-V-INIT ?

Now you should be able to build a new system, and immediately upgrade it, so that you can use the new Linux-2.0 kernel.

What special goodies does that bring you? I don’t know. I’m so miffed with upgrading those naff distributions that I have not had the time or energy to find out!

Basically, if you have been using 1.2.13 a lot has changed. Many more things are modules, and kerneld is rather nifty! New devices are supported, and new code may be better then old code. Userfs now expects a 1.3 or 2.0 kernel, and it is rather sweet (though the old userfs ran on 1.2 ok).

Some new devices and ideas include initrd, which is an optimised ramdisk, that can have modules loaded into it, so that you can then access the CDROM (eg SCSI module + isofs module) and boot from a CDROM. The loopback-disk is new, it converts a file to a block device, maybe with encryption. And of course the kernel is now very similar to those on other architectures.

All very nice, but why is it 2.0 and not 1.4 ?? Maybe it’s a race to reach 3.1, when customers will be able to identify it as mature, and distant from 0.99. Who knows? Who cares? It’s excellent!

6.1 Other places

You already know about /usr/src/Linux/Documentation/Changes, you might also want yo try 6. Happy Now ? 10

• http://www.announce.com/hallow/linux/2.0.html