HOWTO install Linux on Compaq Evo T20


Copyright © 2007 by Grzegorz Świt

This text explains how to install Linux on Compaq Evo T20 thin client. Procedure described in this document is known to work on 16/32 T20 (16MB Flash) with WinCE .NET, and should also work on other T20's with WinCE .NET (16MB and 32MB Flash) and WinCE 2.12 (16MB Flash). For Evo T20 with NTe (48, 64, 96 or 128 MB Flash) you should look at DEvoSL - DSL on Evo T20 HowTo or Linux and LTSP on Evo T20
I chose Linux kernel 2.4.31, because there are available patches for geode framebuffer, and Debian sarge distribution, because I have some experience with it. Naturally, any kernel 2.4 based distribution will work. If you like, you can also experiment with 2.6 kernel, however I tried it and failed.

If you used this howto and achieved success, or encountered some problems, notice some errors in this text, or simply have some questions - write to me

And also, the first place where you should look for help is Open Evo T20 sourceforge page and mailing list.

Credits


Things you need:


How to download new firmware into your Evo

T20 has firmware update mechanism called NETXFER. To use it you need to connect Evo to your network and configure dhcp and tftp server on your pc. To do this I used script from Karl's site Copy this script to /home/<username>/evo20/, make sure that this file has checked in Properties 'Allow executing file as program', copy original firmware to this folder, and rename firmware file to bootp.bin then:
cd /home/<username>/evo20
sudo ./netxfer.sh
(on my computer sudo ./netxfer.sh -i eth1 )

NOTE: In my case it didn't work and i needed to modify script a little. If you get from netxfer.sh errors like this:
dhcpd: Can't open /tmp/t20_dhpcd_conf_tmp.N19422: Permission denied !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! netxfer.sh: FATAL ERROR
you should try to download modified netxfer.sh, find lines:
DHCPD_PID_TMP="/home/<username>/evo20/t20_dhpcd_pid_tmp" DHCPD_LF_TMP="/home/<username>/evo20/t20_dhpcd_lf_tmp" DHCPD_CONF_TMP="/home/<username>/evo20/t20_dhpcd_conf_tmp"
and change <username> to your login, now netxfer should work

If you press 'p' key during reboot of your T20 it will try to flash itself. If it works you can proceed to the next steps. If you have T20 with 16MB flash and you simply want to have linux on your terminal without getting your hands dirty, you can download this firmware file from my page, put it in evo20 folder, flash it into your Evo and proceed to step 'Installing debian to pendrive'

Preparing new firmware

Download necessary tools and script from my site. This is a modified script from winterm-images.gaast.net/~winterm/dsl/ site. Put fw_builder.tar.gz in evo20 folder and
tar -xvzf fw_builder.tar.gz
Put file with WinCE firmware in fw_builder folder and rename it to orig.bin You can replace bzImage with your own kernel, however for the first try I suggest to use kernel prepared by me, you can also modify the poweron logo located in fwbase subdirectory. Kernel boot options are located in make-nk/boot.S file. To build the firmware type:
cd fw_builder
./createfw
Script will create bootp.bin file in evo20 directory, which you can flash into your Evo. If you want to know how the script works or do it by hand, look into script source. If you want compile your own kernel, look at the section 'How to compile linux kernel for Evo T20' of this text.

Installing Debian on pendrive

This text is modified howto Howto install Debian Linux onto a USB thumb drive with the root partition encrypted
1) First step: get debootstrap
sudo apt-get install debootstrap
2) Identify your pendrive device
fdisk -l
fdisk will list your disks - find your pendrive's device name - this text assumes that it is /dev/sda Now unmount your pendrive.
3) Create linux partition
This sequence of commands will delete all existing partitions and create one linux partition with maximum size on the disc
fdisk /dev/sda
d
n
p
1
[enter]
[enter]
w
4) Format pendrive as ext2
mkfs.ext2 /dev/sda1
5) Mount pendrive to /mnt/buildroot folder
sudo mkdir /mnt/buildroot
sudo mount -t ext2 /dev/sda1 /mnt/buildroot
6) Install base Debian system
sudo debootstrap --arch i386 sarge /mnt/buildroot http://ftp.debian.org/debian/
7) Temporary bind /dev and /sys to the build directories.
sudo mount -o bind /dev/ /mnt/buildroot/dev
sudo mount -o bind /sys /mnt/buildroot/sys
8) Chroot into pendrive filesystem
sudo chroot /mnt/buildroot /bin/su -
9) Make sure that debootstrap created tty1,tty2, ... files
cd /dev ls cd ..
If you don't see files like tty1, tty2 do as follows:
mknod dev/tty1 c 4 1
mknod dev/tty2 c 4 2
mknod dev/tty3 c 4 3
mknod dev/tty4 c 4 4
mknod dev/tty5 c 4 5
mknod dev/tty6 c 4 6
mknod dev/tty7 c 4 7
10) Create /etc/fstab file
nano /etc/fstab
and add these contents to it:
# /etc/fstab
/dev/sda1       /               ext2            defaults,noatime        0 1
none            /proc           proc            defaults                0 1
tmpfs           /tmp            tmpfs           defaults,noatime        0 0
tmpfs           /var/lock       tmpfs           defaults,noatime        0 0
tmpfs           /var/log        tmpfs           defaults,noatime        0 0
tmpfs           /var/run        tmpfs           defaults,noatime        0 0
Then mount all the filesystems:
mount -a
11) Set Hostname
nano /etc/hostname
In this file enter hostname for your evo - for example 'evo' ;)
nano /etc/hosts
Set basic network configuration
127.0.0.1 localhost.localdomain localhost <hostname>
12) Edit /etc/apt/sources.list
nano /etc/apt/sources.list
and add these contents to it:
deb http://ftp.debian.org/debian sarge main non-free contrib
deb-src http://ftp.debian.org/debian sarge main non-free contrib
deb http://mirrors.kernel.org/debian/ sarge main non-free contrib
deb-src http://mirrors.kernel.org/debian/ sarge main non-free contrib
13) Recreate subdirectories for tmpfs mounted directories.
Using Tmpfs to save space has one side effect, and that is since it deletes everything when you unmount it, it causes some applications to lose their log directories. So we need to recreate them when the system boots. The easiest way to do that is to create a initialization file in /etc/rcS.d/S37tmpfs-init.sh.
#!/bin/sh

case "$1" in
    start)
        echo "-Recreating required subdirectories on /var/log (tmpfs)"

        # /var/log subdirectories.
        mkdir -p /var/log/fsck
        mkdir -p /var/log/ksymoops
        mkdir -p /var/log/news

        # Example for the mixmaster anonymous remailer
        if [ -f /usr/bin/mixmaster ] ; then
            mkdir -p /var/log/mixmaster
        fi

        # Example for the Tor proxy
        if [ -f /usr/sbin/tor ] ; then
            mkdir -p /var/log/tor
        fi

        # Example for Privoxy
        if [ -f /usr/sbin/privoxy ] ; then
            mkdir -p /var/log/privoxy
        fi

        # Apt archive subdirectories.
        mkdir -p /var/cache/apt/archives/partial

        echo "-done."
        echo
        ;;
    *)
        exit 1
        ;;
esac
14) Update apt database
apt-get update
Remove apt's cached files
apt-get clean
Now you can install any software you want.
15) Create user account
adduser <username>
If you want you can create password for root user:
passwd
16) Exit pendrive filesystem
umount -a
umount /proc
exit
17) Unmout
sudo umount /mnt/buildroot/dev
sudo umount /mnt/buildroot/sys
sudo umount /mnt/buildroot
NOTE: sometimes linux doesn't want to unmount it, so you may need to reboot your PC.
18) You have ready Debian pendrive - plug it to your Evo and have fun.

EXTRA: How to compile linux kernel for Evo T20

This part of text describes how to prepare 2.4 kernel for your Evo, if you want include to kernel something that I turn off, its for you. We will be working on version 2.4.31 of linux kernel, so we need to download kernel sources
1) Put this archive in evo20 directory and extract
tar -xvjf linux-2.4.31.tar.bz2
It will create linux-2.4.31 directory
2) Install gcc version 2.95 - you may encounter errors when compiling with newer versions of gcc
sudo apt-get install gcc-2.95
3) Modify makefile
cd linux-2.4.31
nano Makefile
Change "gcc" to "gcc-2.95" in the following lines:
HOSTCC = gcc
and
CC = $(CROSS_COMPILE)gcc
4) Download Geode Framebuffer patch form winterm.gaast.net site, put it in linux-2.4.31 directory and apply it.
gunzip linux-2.4.31-geodefb.patch.gz
patch -p1 < linux-2.4.31-geodefb.patch
5) Clean sources
make mrproper
6) Configure kernel
make menuconfig
or if you prefer X Window interface
make xconfig
For start you should use my configuration file and modify it to your needs.
NOTE: for pendrive you need following options compiled into kernel: SCSI Support, SCSI Disk Support, Support for USB, UHCI Alternate driver support, OHCI support, USB Mass Storage support
7) Compile kernel
make dep
make clean
make bzImage
make modules
sudo make modules_install
NOTE: if you encounter errors like:
gcc-2.95 -D__KERNEL__ -I/home/thor/dane/test/linux-2.4.31/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i586 -nostdinc -iwithprefix include -DKBUILD_BASENAME=process -c -o process.o process.c
{standard input}: Assembler messages:
{standard input}:805: Error: suffix or operands invalid for `mov'
{standard input}:806: Error: suffix or operands invalid for `mov'
{standard input}:902: Error: suffix or operands invalid for `mov'
{standard input}:903: Error: suffix or operands invalid for `mov'
{standard input}:955: Error: suffix or operands invalid for `mov'
{standard input}:956: Error: suffix or operands invalid for `mov'
{standard input}:958: Error: suffix or operands invalid for `mov'
{standard input}:970: Error: suffix or operands invalid for `mov'
make[1]: *** [process.o] Error 1
make[1]: Leaving directory `/home/thor/dane/test/linux-2.4.31/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2
then you should apply this patch. Put this file in linux-2.4.31 directory and
patch -p1 < linux-2.4-seg-4.patch
8) If everything went ok, you can find your newly compiled kernel (bzImage file) in /arch/i386/boot/ subdirectory.