Previous INDEX Next
SSH and DNS Docbook and XHTML

Upgrading Debian Stable to Sarge

System Upgrade

In this journal entry, I intended to document the trials of upgrading the backup web server on chrome from Debian woody to sarge. The upgrade was required as sarge was the new stable release (Debian 3.1). To my great astonishment, and entirely to the Debian release team's credit, the upgrade was a hassle-free experience.

All I had to do was to follow the instructions in the Debian Upgrading notes. For my installation, the instructions in the release notes are boiled down to this:

  1. Logon as root and back up etc, /var/lib/dpkg and the output of dpkg --get-selections "*".
  2. As root, issue apt-get update.
  3. Remove anything in /etc/apt/sources.list related to sources other than stable (A couple of the packages on chrome were from testing i.e. emacs and python, which was no longer necessary). See the previous journal entry.
  4. Install aptitude, which is the preferred way of upgrading, via apt-get install aptitude.
  5. Run aptitude to upgrade: aptitude -f --with-recommends dist-upgrade.

And that was it. Everything worked perfectly.

Kernel Upgrade

Once it was obvious that the system upgrade had worked, I then decided to upgrade to the latest 2.6 kernel from Debian. This was only slightly more troublesome. Advice on this process is documented in the release notes.

Upgrading the kernel was achieved by apt-get install kernel-image-2.6.8-2-386. Before I could boot the new kernel, my /etc/lilo.conf file had to be modified to add initrd=/initrd.img to the image=/vmlinuz stanza. The installation process will remind you to do this, unless you add the line do_initrd=Yes to the file /etc/kernel-img.conf.

After rebooting, there were two small issues to deal with. The first was that I had to add the following module names to /etc/modules to ensure that the mouse worked under X:

  mousedev
  psmouse

The other area that needed attention related to CD burning. I had used cdrecord as the cd burning tool, which required SCSI emulation under 2.4. This is specified via the ide-scsi argument, given by an append directive in the image stanza in the /etc/lilo.conf file. The ide-scsi option must be removed from /etc/lilo.conf (as well as the ide-scsi entry in /etc/modules). In 2.6, ide-scsi is replaced by the ide_cd module, which must be added to /etc/modules. Use cdrecord with the following command (/dev/hdd is the CD-RW device):

  cdrecord -v dev=/dev/hdd speed=24 -data data.img

You can ignore all the rantings from cdrecord. I also linked /dev/cdrom to /dev/hdd, and changed the entry in /etc/fstab to:

  /dev/cdrom  /cdrom  iso9660 ro,user,noauto    0    0

Another Kernel Upgrade

Following chrome's kernel upgrade, I decided to do the same on gold, my desktop development machine. gold runs the Debian testing distribution. I chose to build from source, rather than using a supplied Debian kernel-image. This meant using apt-get install kernel-source-2.6.8-2-i386 to acquire the source code. So that I could base the new 2.6 config on my old 2.4 version, I copied the 2.4 .config file to the new kernel source directory and ran make oldconfig, which just asks questions related to new options. Be warned, there are still an awful lot of questions. Once that was complete, I wanted to finalise the configuration using the menu capability. However, in 2.6, make xconfig needs the QT libraries, so I had to apt-get install libqt3-dev before I could run the X-based menu configurator.

The 2.6 kernel includes support for the ALSA drivers, which meant that I no longer had to build them separately for the Hoontech DSP24 sound card. One step less required for a new kernel build.

The Debian documentation warns you to install module-init-tools if you compile the kernel from source. However, this was already present on my machine. Note that on gold, I don't bother with ram disks, so the initrd stuff is not required.

I built the kernel using the Debian method. I ran /sbin/lilo and re-booted. First problem was that my graphic boot screen was incorrect (see below). However, the new kernel came up fine. The slight problems I encountered with the new kernel version are documented below.

Problems

New module names

Linux 2.6 has renamed some of the modules; this affected me in relation to the USB mouse and sound, which needed the following new entries in /etc/modules:

  uhci_hcd
  usbhid
  usbmouse
  snd_ice1712

Once I no longer need a 2.4 kernel as backup, I must remember to remove the unneeded 2.4 modules from /etc/modules.

TTY saved state

The startup script etc-setserial was complaining that /dev/ttyS0 did not exist:

  /dev/ttyS0: No such device or address

This was because I had omitted to include serial support in the new 2.6 kernel. Once I'd added the right option (Device Drivers+Character Devices+Serial Drivers+8250/16550 and compatible serial support) to my kernel configuration and booted a new kernel, the saved state of the tty devices was loaded OK.

NFS warnings

I'd noticed the boot-time message:

  nfs warning: mount version older than kernel

for a while, but kind of expected that an upgrade would eliminate these messages. I was wrong, as the message was still emitted under 2.6. After a little digging around in the source code, it seems that the Linux 2.6 kernel is running at an NFS_MOUNT_VERSION version of 6, while the latest source code for the mount program I could find on the web (via searching for the Linux mount source code on Simple LSM Search) was in util-linux-2.12a.tar.gz, with an NFS_MOUNT_VERSION of 4. Hence the error message is issued by the kernel when mounting exports from crimson (a FreeBSD box).

The other NFS related error message:

  NFS: NFSv3 not supported.

was issued because I had not compiled support for NFS V3 into the kernel (FreeBSD NFS is at V3).

UK Keyboard

A problem I only noticed a little later was that the keyboard, when in console mode, was not working as a UK keyboard. This was rectified by running dpkg-reconfigure console-data and setting the keyboard to the standard UK layout. However, this did not cure the problem with Shift 3 (British pound key), which just emitted a # character and seemed to kill any input. This can be worked around as described in this article, which involves adding the line:

  Meta-#: "\C-v£"

to ~/.inputrc (or to the global /etc/inputrc file).

It occurred to me later that this might have something to do with the locale I have set (POSIX). I'll have to try some experiments later.

Addendum 7th March, 2009

Investigation took some time. It wasn't until after I installed Lenny, that I looked at this again. This real issue, I think, was that rxvt was not unicode-aware. However, there is an version of rxvt, rxvt-unicode that, as it's name suggests, is very capable of handling non-POSIX locales. After installing this version and removing the original rxvt, I could delete the ~/.inputrc file and still get GBP characters.

Lilo Graphical Boot Screen

Now to fix up the lilo graphical boot screen. It had been so long since I had last done this that I could only vaguely remember what to do. I was using the sarge.bmp file as the graphical background. I remembered editing the locations of the text menus via /sbin/lilo -B sarge.bmp, a painful exercise. It was this text menu position information that seemed to be forgotten. I recalled that last time, I squirrelled away a copy of /boot/sarge.dat (which contains the menu position settings) in my home directory, for just this eventuality.

I tried copying the locations defined in sarge.dat into sarge.bmp using the /sbin/lilo -E sarge.dat command. However, lilo complained that the bmp-table line contained an invalid value. However, it gave me a clue that a valid value was between 2 and 20 inclusive. Since this used to work, I can only assume a new version of lilo had been installed that had changed the permitted values. The bmp-table definition in sarge.dat specified 25 as the length of the text menu, so I changed it to 20. Now /sbin/lilo -E sarge.dat worked. And on reboot the menu and timer were correctly positioned.

This is such a pain to remember that I am going to put the bmp settings in the /etc/lilo.conf file.

Kernel compilation problems with GCC 4.0

Following a couple of apt-get upgrades, I attempted to change some kernel configuration parameters via make xconfig. This caused a compilation error:

scripts/kconfig/mconf.c:91: error: static declaration of 'current_menu' follows non-static declaration
scripts/kconfig/lkc.h:63: error: previous declaration of 'current_menu' was here
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [xconfig] Error 2

This turned out to be caused by the new gcc 4.0 compiler. By linking /usr/bin/gcc to gcc-3.3 the problem went away.

You can also tell make which compiler to use via the command line:

  make HOSTCXX=/usr/bin/gcc-3.3 xconfig
Previous INDEX Next
SSH and DNS Docbook and XHTML