qube3 Red Hat Linux on the Cobalt Qube 3

 

Installing Red Hat Linux on the Cobalt Qube 3 Appliance

The following is a technical recipe or "howto" document for one successful procedure to install the Red Hat Linux distribution onto a Sun Cobalt Qube 3 model internet appliance.

Warning! Use this procedure at your own risk.

Inside the Cobalt GenIII Kernel RPM, Part 3: Building to Spec

The experimental kernel provided by the Cobalt engineering team has not been compiled with support for the ext3 journalling filesystem. While this feature is the default standard for Red Hat Linux 7.2 users, and has generally been found to be a very robust feature for that distribution, it is still not tested enough on the Qube 3 architecture for the Sun folks to have enabled that filesystem in their kernel.

ext2: To use the experimental Cobalt kernel as-is, which supports ext2 but not ext3, then the steps outlined in the remainder of this section are not required. Proceed to Installing Red Hat Linux, Part 1: Stock Distribution.

ext3: To use the experimental Cobalt kernel, rebuilt to support ext3 journalling, continue this section.


As mentioned previously, the main guide for the RPM build process is the spec file deposited in the sandbox SPECS/ area. Among other things, the spec file scripts the unpacking of any source files and patch files.

The main task in producing a new binary RPM from its source RPM, assuming that the source code is mostly available and ready to compile, is to edit the .spec file appropriately. This document will make a series of independent changes to the Cobalt-supplied .spec file.

Make the RPM buildable in a general standard sandbox, rather than relying on the internal Sun/Cobalt build directory assumptions. The diff-style - and + notation in the box below indicates that the first line should be found and removed, and the second line should be added in its place.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
- BuildRoot: /home/tmp/kernel
+ BuildRoot: %{_tmppath}/%{name}-%{version}-root

Add any expected patch files to the manifest of sources in the spec file. Again, the diff-style notation below indicates to find the first line, leave it alone, then add the second line following it. In the previous section, the single patch name chosen was ext3fs.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
  Source: cobalt-linux-%{version}.tar.gz
+ Patch0: cobalt-linux-2.4.16C2_III-ext3fs.patch

(If additional patches are included, they should be led with consecutively numbered keywords Patch1, Patch2, and so on.)

Specify which patches the RPM building process should apply, and how, in the spec file's %setup section.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
  %setup -c -q
+ cd linux-%{version}
+ %patch0 -p0 -b .ext3fs
+ cd ..

(If additional patches are included, they should be led with matching numbered command keywords %patch1, %patch2, and so on. The -p0 indicates the diff is relative to the root of the tarball contents; -p1 would be useful for diffs made one level higher, just outside the tarball's directory.)

Remove all chown commands in the spec file's %install section so that non-root users can build the RPM file. An RPM should not include commands which a non-root user cannot perform, such as setting ownership of files to the root account.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
- chown -R root.root linux-%{version}
    [...]
- chown -R root.root[root cobalt]#RPM_BUILD_ROOT/usr/include/asm
    [...]
- chown -R root.root[root cobalt]#RPM_BUILD_ROOT/usr/include/linux

Specify default attributes instead, in the spec file's %files section. This causes RPM to perform the equivalent chown and chmod commands at the time the three resulting binary packages (kernel, kernel-source, and kernel-headers) are installed, rather than during the rebuilding of the source code rpm file.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
  %files
+ %defattr(0644, root, root)
    [...]
  %files source
+ %defattr(0644, root, root)
    [...]
  %files headers
+ %defattr(0644, root, root)

Assign root ownership to the /dev/lcd device which is created in the %post section. Since Red Hat Linux doesn't create a group called httpd, the Cobalt default settings are meaningless. The %post section is executed when the resulting binary package is installed, creating the device for the Qube's LCD screen.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
- chown root.httpd /dev/lcd
+ chown root.root /dev/lcd

Lastly, increment the release number at the top. Differentiating your original files from the ones you produce is very valuable. If the old rpms were of version 2.4.16C2_III-1, then the output versions will be marked with a -2 in their names instead.

[me@desk:~/cobalt/rpm]$ vi SPECS/kernel-2.4.16C2_III.spec
- Release: 1
+ Release: 2

Now everything should be ready:

Build the source RPM to regenerate the three binary rpm files. This also repackages a new renumbered source rpm file for your convenience. This will take many minutes, or even an hour or more, depending on the desktop machine's available hardware.

[me@desk:~/cobalt/rpm]$ rpm -ba SPECS/kernel-2.4.16C2_III.spec
     [...]
Wrote: /home/me/cobalt/rpm/SRPMS/kernel-2.4.16C2_III-2.src.rpm
Wrote: /home/me/cobalt/rpm/RPMS/i386/kernel-2.4.16C2_III-2.i386.rpm
Wrote: /home/me/cobalt/rpm/RPMS/i386/kernel-headers-2.4.16C2_III-2.i386.rpm
Wrote: /home/me/cobalt/rpm/RPMS/i386/kernel-source-2.4.16C2_III-2.i386.rpm
     [...]
+ exit 0

If you're new to RPM, you may want to watch the whole process, scanning for any obvious error conditions. However, the key things to watch are the lines shown above: the output of the final .rpm files and the + exit 0 result for the whole process. (RPM can still create those files erroneously after some types of minor errors occur, but none of those cases are expected in this procedure.)


Next Section: Installing Red Hat Linux, Part 1: Stock Distribution


Text and artwork are Copyright © 1996-2002 Ed Halley.
Linux is a registered trademark of Linus Torvalds.
Red Hat, and Red Hat Linux is a registered trademark of Red Hat, Inc.
Sun, Cobalt, and Qube are registered trademarks of Sun Microsystems, Inc.
Many thanks to Dax Kelson of Guru Labs, and to Tim Hockin of Sun Microsystems for their assistance and tools.
Copying in whole or in part, with author attribution, is expressly allowed.