Monday 7 April 2008

Zaurus touch screen with xserver-xorg-input-evtouch

aptitude install xserver-xorg-input-evtouch
apt-get source xserver-xorg-input-evtouch
cp xf86-input-evtouch-0.8.7/empty_cursor.xbm /
edit xorg.conf, add the following (borrowed from http://www.conan.de/touchscreen/evtouch.html):
Section "InputDevice"
Identifier "Zaurus Touch Screen"
Driver "evtouch"
Option "Device" "/dev/input/event1"
Option "MinX" "4"
Option "MinY" "234"
Option "MaxX" "4095"
Option "MaxY" "3824"
Option "ReportingMode" "Raw"
Option "Emulate3Buttons"
Option "Emulate3Timeout" "50"
Option "SendCoreEvents" "On"
Option "Rotate" "CCW"
Option "Calibrate" "1"
EndSection

Add the rest of the sections as per http://www.conan.de/touchscreen/evtouch.html
cd /usr/lib/xf86-input-evtouch
./calibrate.sh
Move mouse around all corners of the screen. Write down the max and min values given.
Kill the xserver. Edit xorg.conf and add these values in overwriting the existing Max and Min's. Comment out the calibrate line.

Start the xserver. Touch screen works but is very inaccurate... WIP.

Note if the monitor section has Rotate enabled the X server crashes.

Friday 4 April 2008

Handy Debian bits and pieces

Put OpenSSH on so we can configure the device remotely.
aptitude install openssh-client openssh-server

Set up a nice /etc/issue with coloured ASCII debian logo:

 _,met$$$$$gg.
 ,g$$$$$$$$$$$$$$$P.
 ,g$$P"" """Y$$.".
 ,$$P' `$$$.
 ',$$P ,ggs. `$$b:
 `d$$' ,$P"' . $$$
 $$P d$' , $$P
 $$: $$. - ,d$$'
 $$; Y$b._ _,d$P'  _, _, ,'`.
 Y$$. `.`"Y$$$$P"'  `$$' `$$' `. ,'
 `$$b "-.__  $$ $$ `'
 `Y$$b  $$ $$ _, _
 `Y$$.  ,d$$$g$$ ,d$$$b. $$,d$$$b.`$$' g$$$$$b.`$$,d$$b.
 `$$b.  ,$P' `$$ ,$P' `Y$. $$$' `$$ $$ "' `$$ $$$' `$$
 `Y$$b.  $$' $$ $$' `$$ $$' $$ $$ ,ggggg$$ $$' $$
 `"Y$b._  $$ $$ $$ggggg$$ $$ $$ $$ ,$P" $$ $$ $$
 `"""" $$ ,$$ $$. $$ ,$P $$ $$' ,$$ $$ $$
`$g. ,$$$ `$$._ _., $$ _,g$P' $$ `$b. ,$$$ $$ $$
`Y$$P'$$. `Y$$$$P',$$$$P"' ,$$. `Y$$P'$$.$$. ,$$.

Debian GNU/\s lenny/sid \n \l

Labels: ,

Tuesday 1 April 2008

Debian sid (armel) on SL-C3200

Notes on a "proper" Debian installation. We start with the applied-data armel-root-fs, an up to date kernel, and move to official sources.

The stuff relating to networking is specific to me, everything else is a standard install.

NAND restore to Sharp bootloader
Grab latest yonggun kernel (hda2) and modules, and updater.sh
Grab armel-root-fs
Grab spectrum 24 firmware
Uncompress (but leave as tar files), put all on root of SD
The following armel debs are needed:
console-tools and libconsole http://ftp.uk.debian.org/debian/pool/main/c/console-tools
tzdata http://ftp.uk.debian.org//debian/pool/main/t/tzdata/
libc6 http://ftp.uk.debian.org//debian/pool/main/g/glibc/
wireless-tools and libiw http://ftp.uk.debian.org//debian/pool/main/w/wireless-tools/
Boot into emergency mode (B+D), fdisk and format /dev/hda1 as swap (256MB), /dev/hda2 as ext3. Putting swap as hda1 is faster.
Untar armel-root-fs onto /dev/hda2
Untar modules
Untar firmware into /lib/firmware
Reboot into flash menu (OK). Flash kernel
Reboot twice.

Login as root (no password)

dpkg -i the debs

Set /etc/hostname to zaurus
Set 127.0.0.1 localhost zaurus in /etc/hosts

Setup /etc/network/interfaces
dhclient
route del default gw 192.168.2.1
route add default gw 192.168.2.254

date 030410412008 (MMDDHHMMYYYY)
aptitude update
cd /sbin
mv start-stop-daemon start-stop-daemon.FAKE
mv start-stop-daemon.REAL start-stop-daemon
aptitude install libc6-dev

Run aptitude, disable automatically installing recommended packages

Get spitz keymap
http://inv2004.googlepages.com/keymap-spitz.tar.bz2
Untar keymap
mkdir /usr/share/keymaps/zaurus
mv keymap.map /usr/share/keymaps/zaurus/spitz.kmap
gzip /usr/share/keymaps/zaurus/spitz.kmap
aptitude install console-common - Don't touch keymap
install-keymap /usr/share/keymaps/zaurus/spitz.kmap.gz

aptitude upgrade
aptitude dist-upgrade (asks about libsasl2. Choose n to first solution, y to second. This removes libsasl2, which isn't available in armel.)

Fix exim4 moaning:
rm /var/log/exim4/paniclog
invoke-rc.d exim4 restart

Setup fstab
proc /proc proc defaults 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 1 1
/dev/hda1 none swap pri=1 0 0
/dev/mmcblk0p1 /media/card auto defaults,sync,noauto,user 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

Correct time and timezone:
aptitude install ntpdate
dpkg-reconfigure tzdata
ntpdate uk.pool.ntp.org
hwclock -w

Strip out obselete packages
aptitude purge libdevmapper1.02 libopencdk8 slang1a-utf8

Load some modules we need that don't autoload in /etc/modules:
snd-soc-spitz
ohci-hcd

Xorg:
aptitude install xorg xserver-xorg-input-tslib xserver-xorg-input-void xserver-xorg-input-evtouch x-ttcidfont-conf xfonts-base xfonts-cyrillic xfs libts-bin libts-0.0-0

Get touchscreen working:
tslib is hardcoded to /dev/event0 at the moment, so we need to tell udev to symlink.
Do this manually:
ln -s /dev/input/event1 /dev/event0
Then add the following line to /etc/udev/links.conf to fix it on reboots
L event0 /dev/input/event1
To calibrate touchscreen:
export TSLIB_TSDEVICE="/dev/event0" && ts_calibrate



Working xorg.conf:
Section "InputDevice"
Identifier "Built-in keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "zaurus"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Touch Screen"
Driver "tslib"
Option "Device" "/dev/event0"
Option "Protocol" "Auto"
EndSection

Section "Device"
Identifier "Framebuffer"
Driver "fbdev"
Option "Rotate" "CW"
EndSection

Section "Monitor"
Identifier "LCD"
EndSection

Section "Screen"
Identifier "Zaurus Screen"
Monitor "LCD"
Device "Framebuffer"
EndSection

Section "ServerLayout"
Identifier "Sharp Zaurus"
Screen "Zaurus Screen"
InputDevice "Touch Screen" "CorePointer"
InputDevice "Built-in Keyboard" "CoreKeyboard"
EndSection


Still to do - sound!

Labels: , ,