CompaqT1500-Linux HOWTO

Thomas Chiverton

falken@bigfoot.com
Revision History                                                             
Revision 1.01            2002-03-17            Revised by: gea               
Conversion to Docbook format                                                 
Revision 1.0             2002-03-11            Revised by: tjc               
LDP release                                                                  
Revision 0.85            2001-12-13            Revised by: tjc               
Security hints. XFree.                                                       
Revision 0.8             2001-12-13            Revised by: tjc               
Kernel transfer problem fix (NFS null). General tidy.                        
Revision 0.7             2001-09-11            Revised by: tjc               
Much FLASHing and mounting notes added                                       
Revision 0.61            2001-08-20            Revised by: tjc               
Tweak debian unpack notes. Add URL. Notes on re-FLASH                        
Revision 0.6             2001-07-28            Revised by: tjc               
Add example syslog output. Add in securetty changes                          
Revision 0.5             2001-07-28            Revised by: tjc               
Initial release for feedback, comments from community                        


Lists the procedures and tools needed to boot the Compaq T1500, using a
Netboot of both the native file system and a generic Linux installation.

-----------------------------------------------------------------------------
Table of Contents
1. About this guide
    1.1. Purpose and scope
    1.2. Latest update
    1.3. Feedback
   
   
2. Introduction
3. The Compaq way
4. The one true way
5. Editing FLASH image and other tools
    5.1. Editing Flash image
    5.2. Mounting FLASH
   
   
6. XFree86
7. Trouble Shooting
    7.1. Intermittent kernel transfer problems (NFS null)
   
   
8. Pending projects
9. Contributors and thanks

1. About this guide

1.1. Purpose and scope

This document is aimed at the Linux enthusiast with an average level of
knowledge. In particular you must be happy with configuring, restarting (or
installing) new services.You will need a Linux server and (of course) a
T1500.
-----------------------------------------------------------------------------

1.2. Latest update

The most up to date copy of this document can be found at [http://
www.compsoc.man.ac.uk/~falken/T1500/] www.compsoc.man.ac.uk/~falken/T1500/
-----------------------------------------------------------------------------

1.3. Feedback

Comments and feedback should go the the author listed at the head of the
document.
-----------------------------------------------------------------------------

2. Introduction

The T1500 is a Linux based diskless thin client, able to boot off internal
FLASH RAM into X. It will acquire TCP/IP information from DHCP, and includes
telnet and a WWW browser. In this configuration, the T1500 is useful as a
small Internet access device.However, the T1500 can also operate as a
diskless client, acquiring it's initial kernel and root file system from a
remote machine (this uses 'TFTP' for the 1st stage, and 'NFS' for the
latter). Compaq provide a CD with a kernel image and root file system, along
with management tools, but these tools are not needed, and have been found to
fail on some systems. This will be discussed in the 'Compaq Way' section.

It is also possible to use the Compaq kernel to boot a normal Linux based
distribution. We use [http://www.debian.org] Debian as an example, but the
process is fairly generic, and discussed in the 'One True Way' section.

We will assume: A working DNS server on 192.168.1.1 (bookcase) and that this
machine will serve the kernel and file system The T1500 is to be installed as
192.168.1.52 (box). The domain is 'house'. No special routing is needed. In
the examples a RedHat server is used, but the specifics should apply to any
GNU based system.
-----------------------------------------------------------------------------

3. The Compaq way

Create the directories for the kernel and file system on your server, mount
and copy the files from the Compaq CD. Unpack the file system:
+---------------------------------------------------------------------------+
|mkdir /exports/T1500                                                       |
|mkdir /exports/T1500/root                                                  |
|mkdir /exports/T1500/tftpboot                                              |
|mount /cdrom                                                               |
|cp /cdrom/product/vmlinux /exports/T1500/tftpboot                          |
|cd /exports/T1500/root                                                     |
|tar xvf /cdrom/product/netboot.tar                                         |
+---------------------------------------------------------------------------+

Configure DHCP by adding a section like this to your /etc/dhcpd.conf

Change the ethernet address to that of your T1500.
+---------------------------------------------------------------------------+
|group {                                                                    |
|   #little black box                                                       |
|   host box {                                                              |
|         hardware ethernet 00:80:64:10:1d:1c;                              |
|     fixed-address box.house;                                              |
|     option host-name "box";                                               |
|     server-name "192.168.1.1";                                            |
|     filename "/exports/T1500/tftpboot/vmlinux";                           |
|     option root-path "192.168.1.1:/exports/T1500/root";                   |
|     }                                                                     |
|   }                                                                       |
+---------------------------------------------------------------------------+

Configure a new host in DNS
+---------------------------------------------------------------------------+
|db.192.168.1.1:                                                            |
|52 in ptr box.                                                             |
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
|db.house:                                                                  |
|   box in a 192.168.1.52                                                   |
+---------------------------------------------------------------------------+

Export the root file system by adding
+---------------------------------------------------------------------------+
|/exports/T1500/root box(rw,no_root_squash)                                 |
+---------------------------------------------------------------------------+

to
+---------------------------------------------------------------------------+
|/etc/exports                                                               |
+---------------------------------------------------------------------------+

Configuring tftp by adding/altering a line to /etc/inetd.conf
+---------------------------------------------------------------------------+
|tftp dgram udp wait root /usr/sbin/tcpd in.tftpd /exports/T1500/tftpboot   |
+---------------------------------------------------------------------------+

Now restart inetd,dhcpd,nfs and named Select the 'netboot' option on the
T1500, and reboot. The T1500 will now boot into something very similar to its
normal O/S. You may want to add
+---------------------------------------------------------------------------+
|exec /nor/Xbin/xterm &                                                     |
+---------------------------------------------------------------------------+

as the penultimate line in
+---------------------------------------------------------------------------+
|/exports/T1500/root/root/.xinitrc                                          |
+---------------------------------------------------------------------------+

and then logout and back in again, to get an xterm.
-----------------------------------------------------------------------------

4. The one true way

We use the debian 'potato' (2.2) release as an example. The procedure should
be similar no matter which distribution you choose, providing it will run on
a 2.0.35 kernel.

Create the directories for the kernel and file system on your server, mount
and copy the files from the Compaq CD. Unpack the file system (Here I use
some pre-made tar balls of the debian release, here is not the place to
discuss further):
+---------------------------------------------------------------------------+
|mkdir /exports/T1500                                                       |
|mkdir /exports/T1500/root                                                  |
|mkdir /exports/T1500/tftpboot                                              |
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
|mount /cdrom                                                               |
|cp /cdrom/product/vmlinux /exports/T1500/tftpboot                          |
|CD /exports/T1500/root                                                     |
|tar zxvf /tmp/base2_2.tgz                                                  |
|tar zxvf /tmp/telnetd*.tgz                                                 |
+---------------------------------------------------------------------------+

Configure DHCP by adding a section like this to your /etc/dhcpd.conf Change
the ethernet address to that of your T1500.
+---------------------------------------------------------------------------+
|Group {                                                                    |
|   #little black box                                                       |
|   host box {                                                              |
|         hardware ethernet 00:80:64:10:1d:1c;                              |
|     fixed-address box.house;                                              |
|     option host-name "box";                                               |
|     server-name "192.168.1.1";                                            |
|     filename "/exports/T1500/tftpboot/vmlinux";                           |
|     option root-path "192.168.1.1:/exports/T1500/root";                   |
|     }                                                                     |
|   }                                                                       |
+---------------------------------------------------------------------------+

Configure a new host in DNS
+---------------------------------------------------------------------------+
|db.192.168.1.1:                                                            |
|   52 in ptr box.                                                          |
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
|db.house:                                                                  |
|   box in a 192.168.1.52                                                   |
+---------------------------------------------------------------------------+

Export the root file system by adding
+---------------------------------------------------------------------------+
|/exports/T1500/root box(rw,no_root_squash)                                 |
+---------------------------------------------------------------------------+

to /etc/exports

Configuring tftp by adding/altering a line to /etc/inetd.conf
+---------------------------------------------------------------------------+
|tftp dgram udp wait root /usr/sbin/tcpd in.tftpd /exports/T1500/tftpboot   |
+---------------------------------------------------------------------------+

Now restart inetd,dhcpd,nfs and named

Configure the file system by setting the root password to 'pass', exposing
telnetd

/exports/T1500/root/etc/passwd, alter 1st line: root:Z/U2u32VhNJoA:0:0:,,,:/
root:/bin/bash

/exports/T1500/root/etc/inetd.conf, add: telnet stream tcp nowait root /usr/
sbin/tcpd in.telnetd

Append remote terminals to /etc/securetty to allow remote root access.
+---------------------------------------------------------------------------+
|tty1                                                                       |
|tty2                                                                       |
|tty3                                                                       |
|tty4                                                                       |
|tty5                                                                       |
|tty6                                                                       |
|tty7                                                                       |
|tty8                                                                       |
|tty9                                                                       |
|tty10                                                                      |
|tty11                                                                      |
|tty12                                                                      |
|ttyp0                                                                      |
|ttyp1                                                                      |
|ttyp2                                                                      |
|ttyp3                                                                      |
+---------------------------------------------------------------------------+

Select network booting on the T1500 and reboot it.

Once it has booted, you should be able to telnet into the T1500. At ths
point, you shoudl configure SSH, and close the telnet hole in inetd.
-----------------------------------------------------------------------------

5. Editing FLASH image and other tools

5.1. Editing Flash image

The T1500s come with a utility called 'makeflash' (which lives in /sbin and
also comes on the CD). You can use this to generate a flash filesystem image
from a tar.gz, which can either be local, or an NFS / SMB file. This utility
generates all the necessary checksums too.

1. Flashing with a Slackware 8.0 image doesn't work, even with the calculated
checksum. This suggests to me that there is a further check made on vmlinux
itself.

2. Having dissected the leo.boot and vmlinux files supplied with the unit, I
suspect that leo.boot checks vmlinux for the string "xxxxyyyyWYSEwysexxxx"
which is duly included in the custom kernel they use.

3. Leo.boot is in fact a Win CE related thing, with a queer bolt-on to allow
linux boots. The normal Win CE leo.boot is about half the size. It uses the
Eboot protocol for both ethernet and parallel port flash programming. There
are some free Linux tools available to format images correctly for replacing
leo.boot and also the OS image, but they rely on you supplying a suitably
compiled object version of the bootrom.

Be careful when running it though - it is possible to flash the thing to a
state in which the only way to get it booting again is to use the
Wyse-provided DOS util / laplink cable setup.

Also, if anyone manages to get makeflash running on something which isn't the
terminal, could you let me know how? AFAICT, it's trying to link with a very
old glibc and libforms.You should be able to flash-update the T1500 a few
100,000 times.

Apparently the T1500 is a Wyse WT3X15, based on what they call the 'Leo
Board'. You can download a DOS reflashing util, and some docs for it from the
UK Wyse website, in the Customer Support section's firmware page. It requires
a parallel laplink cable.
-----------------------------------------------------------------------------

5.2. Mounting FLASH

After running the mknod commands below, you can then mount /dev/fnand and /
dev/fnand1, which are both 16Mb flashfs partitions. You can also mount /dev/
fram, and write to it, however the data disappeared after umounting &
remounting. It may have use as swap space.
+---------------------------------------------------------------------------+
|mknod /dev/fcard b 63 0                                                    |
|mknod /dev/fcard.fmt b 63 128                                              |
|mknod /dev/fcard1 b 63 1                                                   |
|mknod /dev/fcard1.fmt b 63 129                                             |
|mknod /dev/fnand b 62 0                                                    |
|mknod /dev/fnand.fmt b 62 128                                              |
|mknod /dev/fnand1 b 62 2                                                   |
|mknod /dev/fnand1.fmt b 62 120                                             |
|mknod /dev/fnor b 65 0                                                     |
|mknod /dev/fnor.2m b 65 128                                                |
|mknod /dev/fram b 64 128                                                   |
+---------------------------------------------------------------------------+
-----------------------------------------------------------------------------

6. XFree86

To boot up into XFree86, grab and install the normal XFree packages. Grab and
install the XF86Config file from [http://www.compsoc.man.ac.uk/%7Efalken/
T1500/XF86Config] http://www.compsoc.man.ac.uk/~falken/T1500/XF86Config. Use
a line like
+---------------------------------------------------------------------------+
|xinit -- -bpp 16 &                                                         |
+---------------------------------------------------------------------------+

In rc.local (or your distributions equiv.) to start it up automaticly. To do
the safe thing and run X as a user, create the user and use something like
the following to start and stop it (I placed this in the init.d dir. and
linked from rc.4). Change 'mplayer' on line 5 to your username.
+---------------------------------------------------------------------------+
|#! /bin/sh                                                                 |
|case "$1" in                                                               |
|start)                                                                     |
|        echo -n "Automatically logging into X"                             |
|        su -c 'cd ~mplayer && xinit -- -bpp 16' - mplayer &                |
|        echo "."                                                           |
|        ;;                                                                 |
|stop|restart)                                                              |
|        ;;                                                                 |
|*)                                                                         |
|        echo "Usage: /etc/init.d/mplayer {start|stop|restart}"             |
|        exit 1                                                             |
|esac                                                                       |
|                                                                           |
|exit 0                                                                     |
+---------------------------------------------------------------------------+
-----------------------------------------------------------------------------

7. Trouble Shooting

The servers log file (/var/log/messages) should contain hints as to where
you've got to in the boot process, as it should log TFTP transfers, NFS
mounts etc. If not, add
+---------------------------------------------------------------------------+
|*.* /var/log/messages                                                      |
+---------------------------------------------------------------------------+

to
+---------------------------------------------------------------------------+
|/etc/syslogd.conf                                                          |
+---------------------------------------------------------------------------+

and restart syslog

tcpdump allows you to see what packets are being transfered, and their NFS
filenames.
+---------------------------------------------------------------------------+
| tcpdump -i eth0 -s 500 host box                                           |
+---------------------------------------------------------------------------+

Your output from syslog should resemble:
+-------------------------------------------------------------------------------------------------+
|Jul 24 21:37:00 bookcase dhcpd: DHCPDISCOVER from 00:80:64:10:1d:1c via eth0                     |
|Jul 24 21:37:00 bookcase dhcpd: DHCPOFFER on 192.168.1.52 to 00:80:64:10:1d:1c    via eth0       |
|Jul 24 21:37:04 bookcase dhcpd: DHCPREQUEST for 192.168.1.52 from 00:80:64:10:1d:1c    via eth0  |
|Jul 24 21:37:04 bookcase dhcpd: DHCPACK on 192.168.1.52 to 00:80:64:10:1d:1c    via eth0         |
|Jul 24 21:37:04 bookcase tftpd[5003]: tftpd: trying to get file: /exports/T1500/tftpboot/vmlinux |
|Jul 24 21:37:24 bookcase mountd[4853]: authenticated mount request from box:600                  |
+-------------------------------------------------------------------------------------------------+

Your tcpdump output should look like (when idle):
+------------------------------------------------------------------------------+
|17:31:41.450000 box.8022008 > bookcase.nfs: 116 lookup fh Unknown/1 "initctl" |
|17:31:41.450000 bookcase.nfs > box.8022008: reply ok 128 lookup fh Unknown/1  |
+------------------------------------------------------------------------------+
-----------------------------------------------------------------------------

7.1. Intermittent kernel transfer problems (NFS null)

There is a known problem which occasionally causes the T1500 to fail to
reboot, apparently because it fails to tftp the kernel after the reboot. A
tcpdump of this happening will resemble:
+---------------------------------------------------------------------------------------------+
|12:04:38.506153 box.2049 > bookcase.house.tftp: 39 RRQ "/exports/T1500/tftpboot/vmlinux"     |
|12:04:38.556153 bookcase.house.1199 > box.2049: udp 516                                      |
|12:04:38.556153 box.2049 > bookcase.house.1199: udp 4                                        |
|12:04:38.556153 bookcase.house.196610 > box.nfs: 516 null                                    |
|12:04:38.556153 box.2049 > bookcase.house.1199:    udp 4                                     |
|12:04:38.556153 bookcase.house.196611 > box.nfs: 516 null                                    |
|12:04:38.556153 box.2049 > bookcase.house.1199: udp 4                                        |
|12:04:38.556153 bookcase.house.196612 > box.nfs: 516 null                                    |
|12:04:38.556153 box.2049 > bookcase.house.1199:    udp 4                                     |
|12:04:38.566153 bookcase.house.196613 > box.nfs: 516 null                                    |
|12:04:38.566153 box.2049 > bookcase.house.1199: udp 4                                        |
|12:04:38.566153 bookcase.house.196614 > box.nfs: 516 null                                    |
|12:04:38.566153 box.2049 > bookcase.house.1199:    udp 4                                     |
|12:04:38.566153 bookcase.house.196615 > box.nfs: 516 null                                    |
+---------------------------------------------------------------------------------------------+

You will then see a syslog entry from tftp indicating that it is sending the
kernel, but no packets are exchanged. ARP requests go unanswered.

This can be resolved, but if you have your T1500 headless in a corner, is a
PITA. Connect a monitor, keyboard and PS/2 mouse if not present. Reboot the
T1500, and press 'L' after the 1st beep. The T1500 will now boot focally.
Change the boot mode to 'Local' (Start->System menu) and reboot. Change the
boot mode back to 'Network'
-----------------------------------------------------------------------------

8. Pending projects

Edit / re-flash FLASH

PCMCIA usage - probably needs the next item :-)

Custom kernel (TFTP loader looks at checksum / WYSE string)

Text mode console

SSH / SSHd / gcc for Compaq file system (should be easy to copy once compiled
on custom FS)
-----------------------------------------------------------------------------

9. Contributors and thanks

[incomplete, real names needed too]

Cez

John Topper

Grapham Wood <rauxon@compsoc.man.ac.uk>

Mike Sparks

James Mulcahy
