NetWinder kernel installation

This document is outdated and will be removed soon. Please see the Kernel-HOWTO (available here) for newer information.

This page describes how to go about installing and booting a new kernel on the NetWinder. It is geared towards machines with 2.0 or better firmware, though there is a section down below about use of older firmware.

Overview

Updating a kernel on a NetWinder is a fairly straightforward operation. Precompiled kernels and their associated dynamic modules can be downloaded from ftp://ftp.netwinder.org/pub/ccc/kernel, consult the README file in that directory for details on the specific kernel versions. Or you can build your own kernel and install that.

Installation

For each kernel, there are three files of relevance: the kernel itself (vmlinux-YYMMDD.gz), the kernel modules (modules-YYMMDD.tar.gz) and the header files (includes-YYMMDD.tar.gz). The first two must be installed to properly update a kernel, while the third is needed if you want to compile any programs with the new kernel. Here is the recommended proceedure for updates.

  1. Switch to the /boot directory on your NetWinder and obtain (via FTP or otherwise) the three files (vmlinux, modules, includes) of the new kernel. Be sure you've got a matching set (ie. all the YYMMDD dates must be the same).
  2. Uncompress the kernel, and make a symbolic link to it (replace YYMMDD with the actual version you have downloaded)
    	gzip -d vmlinux-YYMMDD.gz
    	rm vmlinux
    	ln -s vmlinux-YYMMDD vmlinux
    
  3. Install the kernel modules. You can either delete the old modules, or move (rename) the directory so that the old versions are still on the disk.
    	cd /lib
    	mv modules modules.old		# or just delete it
    	tar zxf /boot/modules-YYMMDD.tar.gz
    
  4. (Optional) Install the kernel header files. Again the old contents are first removed, then the new tarball is expanded in its place.
    	cd /usr/src
    	rm -rf linux-2.0.3X		# or move (rename) it
    	tar zxf /boot/include-YYMMDD.tar.gz
    
    You should also check that the /usr/src/linux symbolic link is pointing correctly at the newly installed headers (if you switch between Linux versions, ie. 2.0.31 to 2.0.35, it will need to be fixed).

Changes for kernels after 981211

There is a minor change planned for new kernel releases: instead of having a separate vmlinux, modules and include tar files, there will be just a single tarfile containing all of these pieces. The System.map file will also be included from now on. To install the binary kernel using the new method, follow these steps:

  1. Download a binary kernel (filename nwkernbin-YYMMDD.tar.gz) from the ftp site and put it somewhere on your system (such as in /root).
  2. Rename the include and modules directories:
    	mv /lib/modules /lib/modules.old
    	mv /usr/src/linux/include /usr/src/linux/include.old
    
  3. Untar the new image from the filesystem root:
    	cd /
    	tar zxf /root/nwkernbin-YYMMDD.tar.gz
    
  4. In the /boot directory, create symbolic links for the freshly installed vmlinux and System.map files:
    	cd /boot
    	rm vmlinux
    	ln -s vmlinux-YYMMDD vmlinux
    	rm System.map
    	ln -s System.map-YYMMDD System.map
    
  5. Optionally, you may delete the old include and modules directories:
    	rm -rf /lib/modules.old
    	rm -rf /usr/src/linux/include.old
    
    Note that you may wish to wait until after you have successfully rebooted using the new kernel before you delete these files.

Firmware settings

Once the kernel and modules are installed on the disk, simply rebooting the machine will generally activate the new kernel (if the firmware variables are set at their default values). There is a separate page of booting notes that are particularly of relevance for people who are upgrading to an ELF kernel for the first time.

Failing that, there are three variables in the firmware that relate to the kernel (surprisingly enough, they all begin with kern...)

Things to avoid

Using older (pre-2.0) firmware

First off, don't confuse the firmware version with the disk image version - they are not necessarily related. The firmware version is the first thing you will see when the machine boots, it shows up right after the white fade completes.

If you have firmware before 2.0 (typically, version 1.3) then your options with regards to kernel booting are rather limited. This firmware only knows how to load a.out kernels, so none of the distributed kernels (other than the June 29 a.out shipping kernel) can be used directly. You will need to use the vmelf utility program that is included in the source code with the older 2.0.31 kernels. This program will magically make an ELF kernel look like an a.out kernel (enough to boot anyways). Then the resulting kernel can be used to boot the NetWinder.

There is an additional complication, since the old firmware doesn't support loading a kernel from an arbitrary file on the disk - instead, it expects a dedicated kernel partition on /dev/hda1 from which it will fetch the kernel. If you've got older firmware then your disk is already set up like this. All you need to do is copy the kernel onto this partition:

	dd if=your_kernel of=/dev/hda1 seek=1
with the obvious disadvantage that if your newly written kernel fails for some reason, you have no means of recovery other than fetching a kernel from a TFTP server on the network. (The seek=1 is needed because the partition table is stored on the first cylinder... if you omit it, then your drive will be in really sad shape).


Ralph Siemsen / ralphs@corelcomputer.com