My Debian/Zaurus page

Warning

This page is pretty outdated...

I no longer use a Debian system in a chroot with the Sharp kernel as described in this page; I have switched to the 2.6 kernel from handhelds.org with a regular Debian install. Since U-Boot does not seem to be usable on the SL-C3000 (probably because of the small NAND flash compared to other Zaurii), I use kexec as a bootloader. I will document this and provide all needed files soon...

I leave the rest of this page as is, but you should probably not follow it. If you want to install Debian on your Zaurus, you should rather have a look at the OESF wiki, or use TitchyLinux.

This is my zaurus page. I have a cool Zaurus SL-C3000, and I will try to share here any usefull tips to use it

I am using a Debian system on my Zaurus, so this page will mainly speak about Debian/SL-C3000.

Disclaimer: if you happen to brick your Zaurus by following my instructions, that's sad for you, but I can't be held responsible. I am describing what I did to my Zaurus and it works really fine, but I don't what might happen to yours

[Debian/SL-C300 picture]

Debian Installation

First thing first, here is a quick HOWTO to install a debian system in your Zaurus. I will especially describe SL-C3000 specific stuff, since it based on the following docs (more SL-C700 oriented):

I assume you are running the Sharp ROM, but this should only need minor tweaks if you're using something else. Anyway I don't any alternates ROM for the SL-C3000 at the time of this writing

Making room on the microdrive

Of course, the basic idea is to put the debian on the 4G microdrive. So as to keep a working QTopia environment, and to minimize the risk of breaking everything, I decided to keep the microdrive partitions as-is. Indeed, we have a nice 3.3Go partition (/dev/hdc3), but it is FAT-formated :-(. So You'll need to install fdisk. I got one from the zaurususergroup feed : fdisk_2.11g .

This partition is mounted on /hdd3 and only contains the English/Japanese dictionary and some useless user files, QTopia runs fine without it. However you should at least backup the dictionary before reformatting it.

This partition is /dev/hdc3 on my SL-C3000, but I was told it is /dev/hda3 on some Zaurii. So check with df -h and replace if necessary.

Now run the terminal application and switch to the root user with su.

  1. First, unmount the partition with umount /dev/hdc3. You will need to kill the apps using this partition first, you can find them fuser -m /dev/hdc3 and kill them with kill -9 $PID where $PID is one the numbers returned by fuser.
  2. Change the partition type of /dev/hdc3 with fdisk /dev/hdc. Use command t on partition 3, on set it to 83. Exit with w to save changes. (If you got trouble at the next step, you might need a reboot here.)
  3. Format /dev/hdc3 to ext3 with the command mke2fs -j /dev/hdd3. Then you should be able to mount it with mount /dev/hdc3 /hdd3

Tweaking the boot process

If you try to reboot now, the Zaurus will complain about a HDD3 problem. You can make it boot anyway by hitting Ctrl-C

Indeed, this partition is mounted by the startup scripts, and the type is forced to FAT. So we'll just edit those scripts. You must first remount the root filesystem to read-write: mount -o remount,rw /dev/root /. Now you can edit /root/etc/rc.d/rc.rofilesys. Here is my modified version and a diff if you prefer.

You might notice that I have added a small line at the end: cat /home/zaurus/launch.default > /home/sharp/etc/launch.default. This will allow you to choose to boot either to QTopia or to a linux console so as to run the debian. To boot QTopia, just echo q > /home/zaurus/launch.default, and to run the linux console echo a > /home/zaurus/launch.default. At the next reboot you'll have the selected system.

So just do echo q > /home/zaurus/launch.default and reboot, you should be back to QTopia, with /dev/hdc3 mounted on /hdd3 as ext3.

Installing debian

Here we go. First, get the latest zaurus-debian-big from Klaus Weidner's site. At the time of this writing it is v0.17 . Now, create on debroot directory on the drive with mkdir /hdd3/debroot, and uncompress zaurus-debian-big in it.

  • If you have a linux box, the easiest way is to set up the network over usb, and then run zcat zaurus-debian-big-*.tgz | netcat -l -p 1234 on the linux box, and nc 192.168.129.1 1234 | tar xv on the zaurus (in the /hdd3/debroot directory)
  • Otherwise, you can put the zaurus-debian-big tarball in the zaurus and decompress it on the zaurus: zcat zaurus-debian-big-*.tgz | tar x (in the /hdd3/debroot directory)

Now exit QTopia and go to the linux console. To do this, you have to echo a > /home/zaurus/launch.default and reboot. You should see a login prompt, login as root. The zaurus console is a bit broken, you have to do clear when you are in the bottom of the screen.

cd /hdd3/debroot and run the postinst script: ./INSTALL.d/postinst.sh. It will ask you some questions, you can say yes to almost every one.

Do not you say yes when asked to start Vncserver and Fbvnc, the included fbvnc doesn't work for the SL-C3000 (at least at the time of this writing). You can add a -hw c700 switch to fbvnc invocations in /usr/local/bin/Fbvnc (which will give you a bad keyboard mapping) or replace fbvnc (see below). Then, you can login to the debian with Vncserver, then Fnvnc.

To exit from the debian, hit Fn+Shift+Q. You can go back in it with Fbvnc. To kill your session, use killall Xvnc (from outside the debian), and to launch a new one use Vncserver and Fbvnc.

Useful tidbits

At this point, the system is not very usable: the keyboard mapping is the one of the SL-C700, you are logged in as root, ... So we will edit some system files. You can do this from the debian itself (in this case replace $DEBROOT with / in the following), or from QTopia. (where $DEBROOT will be /hdd3/debroot).

First, replace $DEBROOT/usr/local/bin/fbvnc with this version, modified for the SL-C3000. This will give you a better keyboard.

If you want the ON/OFF button to be able to put the zaurus in suspend mode, replace $DEBROOT/usr/local/bin/zsuspend with #!/bin/sh
if /sbin/ifconfig | grep -q ^eth0 ; then
/sbin/cardctl eject
fi
hwclock --systohc

sync
cat /proc/sys/pm/suspend > /dev/null

sleep 2
hwclock --hctosys

If you want to be able to set the backlight on/off (with Fn+OK), add a $DEBROOT/usr/local/bin/backlight : #!/bin/sh

LEVFILE=/tmp/llevel.dat
LEVEL=0x00000000
[ -f $LEVFILE ] && LEVEL=`cat $LEVFILE`

case $LEVEL in
0x00010000) LEVEL=0x00010100 ;;
0x00010100) LEVEL=0x00010001 ;;
0x00010001) LEVEL=0x00010101 ;;
0x00010101) LEVEL=0xFFFFFFFF ;;
0xFFFFFFFF) LEVEL=0x00000000 ;;
0x00000000) LEVEL=0x00010000 ;;
*) LEVEL=0x00010000 ;;
esac

echo $LEVEL > /proc/driver/fl/corgi-bl
echo $LEVEL > $LEVFILE

I've tweaked a bit the login process, so as to log as user zaurus (create it with adduser zaurus from inside the debian, or Crd adduser zaurus from outside).

Here is my /usr/local/bin/Vncserver (it is outside $DEBROOT) #!/bin/sh

PATH=/usr/local/bin:$PATH
export PATH

exec Crd su - zaurus -c zvncserver
and my $DEBROOT/usr/local/bin/zvncserver : #!/bin/sh

PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/X11:/usr/games

DISPLAY=:1
export DISPLAY PATH

AUTH_FILE=/etc/vncpasswd
if [ -f $AUTH_FILE ]; then
AUTH="-rfbauth $AUTH_FILE"
else
AUTH="-localhost"
fi

[ ."$DISPLAY" = .":0" ] && rm -f /tmp/.X0-lock
[ ."$DISPLAY" = .":1" ] && rm -f /tmp/.X1-lock
[ ."$DISPLAY" = .":2" ] && rm -f /tmp/.X2-lock

Xvnc -geometry 640x480 \
-depth 16 -pixelformat RGB565 \
$AUTH \
$DISPLAY &

sleep 5

cd $HOME
[ -f $HOME/.xinitrc ] && . $HOME/.xinitrc
As you can see, it now calls $HOME/.xinitrc (i.e. $DEBROOT/home/zaurus/.xinitrc) #!/bin/sh

icewm & sleep 5

[ -f $HOME/.Xressources ] && xrdb $HOME/.Xressources

unclutter &

You can put X ressources in your $HOME/.Xressources file, for instance mine contains: emacs*MenuBar: off
emacs*ToolBar: 0
emacs*ScrollBars: off

All these files can be found here.

About

This is a work in progress, new items will be added soon.

If you have any problem or question, you can mail me at <firstname>.<lastname>@ens.fr, with the right thing instead of firstname and lastname.

Gaëtan LEURENT