Some notes on trouble with transforming a PocketPC handheld to a Linux gadget using USB connectivity to a
Debian GNU/Linux box. For details familiarize ;) yourself with the swell installation
documentation for Familiar on handhelds.org first. By the way, take your time and have a look at
GPE as well; for me the more integrated approach and the synergies with the
Zaurus/
OpenZaurus platform were determinant for choosing
Opie (I prefer Gnome/GTK on the desktop, on a handheld I prefer Qt - that's fair, isn't it ?).
Setting up the iPAQ:
- I was not using the Compaq USB cradle that came with my used iPAQ but rather a USB sync and charge cable I obtained off eBay (much better suited for installation, as the reset button can be reached without unplugging - I was glad for it due to the USB problems described below)
- Use Bootloader 2.20.3 for USB console to work (you might still need to fiddle around with it to make to display
boot> in minicom - for me replugging the USB cable numerous times was needed for Linux 2.4.27 to recognize the iPAQ usbserial device (press the big central cursor key while resetting, press USB console then and check it stays hilighted !) but I was not able to obtain the USB console in minicom with a SiS 748 USB2 hub, Linux 2.6.8 and a Intel 830M USB 1.1 hub worked a lot better though.
- I had to reissue
load root a few times until the ymodem transfer of "bootopie-v0.7.2-h3600.jffs2" with minicom actually worked flawlessly, so don't despair…
- Something must be wrong with the usbnet module in Familiar 0.7.2 (Linux 2.4.19) - Google research shows that plugging in USB freezes the iPAQ, the remedy is to bring up the usb0 usbnet interface on the Host PC via ifconfig. From there on I worked on the linux console via ssh from the Host PC.
- Change your /etc/ipkg/opie.conf for the latest in Opie development:
src opie http://opie.handhelds.org/feed/testing/familiar/gcc2
Use /etc/init.d/opie stop, ipkg update, ipkg upgrade, /etc/init.d/opie start to get the latest upgrade (Opie 1.1.4 at the time of writing).
- A brilliant place for finding apps not provided by handhelds.org (e.g. a time tracking application from www.timesleuth.org): http://www.killefiz.de/zaurus/showdetail.php?app=35
- Check p2z for migrating data from PalmOS to Opie: P2Z. Multisync still seems to have problems when syncing a Palm to Opie (missing adresses for contacts, no umlauts, no note sync). Of course beaming vir IrDA is always an option, albeit a tedious one (you will need to
ipkg install openobex for OBEX transfers to work, Opie seems to miss a dependency here).
- Problems with booting in could be solved by dumping the flash to a file via USB with minicom (using save root, see bootldr FAQ), mounting that, fixing the defect file, stripping the jffs2 filesystem and reflashing:
- Recompile your kernel with MTD modules, if needed.
insmod mtdcore
insmod mtdram total_size=32768 erase_size=256 (that's for a 32MB flash part, see the handhelds.org Wiki)
insmod mtdram2 total_size=32768 erase_size=256 (optional, make a copy of mtdram.o for that to work - used this to mount my jffs2 filesystem and the original from handhelds.org for comparison)
insmod mtdblock
modprobe jffs2 (uses zlib_inflate/zlib_deflate modules)
- Probably you don't have the right devices set up on your machine (like me), look for an appropriate MAKEDEV script or do it manually:
mkdir /dev/mtdblock
mknod /dev/mtdblock/0 b 31 0
mknod /dev/mtdblock/1 b 31 1
mknod /dev/mtdblock/2 b 31 2
- and so on…
- Fill the block device with
dd if=/tmp/root.jffs2 of=/dev/mtdblock/0 (that's the flash dump from the iPAQ, optionally dd if=bootopie-v0.7.2-h3600.jffs2 of=/dev/mtdblock/1 as well for comparison)
- Ready to
mount -t jffs2 /dev/mtdblock/0 /mnt/myiPAQ (optionally mount -t jffs2 /dev/mtdblock/1 /mnt/origiPAQ also and run diff -r /mnt/myiPAQ /mnt/origiPAQ to compare)
- Replaced
/mnt/myiPAQ/bin/tar (which was broken and the reason for not booting) and then recreated a defragmented jffs2 image by mkfs.jffs2 --root=/mnt/myiPAQ/ --eraseblock=262144 --pad --output root_stripped.jffs2 (see this mail)
- The last step is needed because the ymodem transfer of that image in minicom consitently failed at around 24.5 MB, so I had to make sure it is smaller than that (also deleted
/tmp/myiPAQ/opt/QtPalmtop/j2me to make space, had to reinstall afterwards).
- There seems to be the alternative of splitting the flash dump in two (or more pieces):
- In the case of 16MB and the rest, the appropriate bootldr commands would be
load flash 0x40000 for the first 16MB and load flash 0x1040000 for the remainder.
- For splitting use dd:
dd if=root.jffs2 of=root.jffs2_1 bs=16M count=1 skip=0 and dd if=root.jffs2 of=root.jffs2_2 bs=16M count=2 skip=1 (count=2 is just to ensure we don't cut off anything unwillingly).
- Backup: Either I tar my home directory
/root via ssh root@ipaq "tar cvzf - /root" > backup.tgz or I do a full backup of the ROM using ssh root@ipaq "dd if=/dev/mtd/1ro" > root.jffs2 after making sure that I did a modprobe mtdchar on the PDA.
- Restore: Easy to do using a CF sleeve and the examples provided here:
boot> sleeve insert
boot> pcmcia insert
boot> vfat mount 0
boot> vfat read 0xc2000000 root.jffs2
boot> program root 0xc2000000 0x01fc0000
That's for an iPAQ with 64MB, as I have found the restore to be more reliable when using the upper 32 MB (0xc2000000) of DRAM for transferring the image…
Packages on my iPAQ:
All downloaded via the handhelds.org feeds mentioned above using
ipkg install <ipkname> (some apps from Opie
unstable), unless stated otherwise.
A general port of call is
IpkgFind.
- Use
ipkg install opie-handwriting-graffitiset to keep your good old Palm-style bruhstrokes…
- Replaced
opie-showimg with opie-eye, much more convenient.
ipkg install microkbd-modules for my iConcepts micro keyboard.
ipkg install opie-zsafe for storing passwords securely using RC2.
timesleuth helps me keeping track of time spent on projects.
opie-mail is an amazingly powerful mail and news app, which even supports IMAP (depends on libetpan) and SSL/TLS (depends on libssl/libcrypto, had to use ipkg --force-depends due to wrong numbering of libcrypto package) - way rad !
cvm is a J2ME implementation from SUN, primarily needed for the Hafas timetables I came to love so on PalmOS. A dependeny on libfloat.so has to be resolved manually. There's a lot more Java apps for the Z and J2ME mobiles out there, as befits a good platform for development… Unfortunatley the provided cvm binary does no longer work with Familiar 0.8, due to the switch to a new build process - see below as well…
- Replaced the very nifty
dropbear with openssh to allow syncing via SFTP with Multisync.
opie-reader allows for carrying Oracle and DB/2 references as e-books with me, wheeee !
qpdf2 seems the more sophisticated PDF viewer for me (compared to opie-qpdf).
- My wife's the chemist, but it can never hurt to have the periodic table of elements with you:
opie-oxygen
- An app I used occasionally on the Palm - allright, the recipies may be different:
opie-bartender
- Don't you just hate imperial units in the 21st century ?
zuc helps lighten that load.
- No Linux palmtop is complete without
opie-kbill ;) !!!
- Not packaged but extremely useful:
uclx helps saving space by compressing applications in your precious flash.
- A real swiss army knife is
curl, helping you with all kinds of networking protocol needs.
opie-mediaplayer2 may be nice for taking videos with you on the road; for my basic MP3 and OGG audio needs I found otrplayer much better suited (and a lot more stable). The sf.net otrplayer binary no longer works with Familiar 0.8, due to the switch to gcc3…
less (a more sophisticated more) and mc (i.e. Midnight Commander), a file manager with well known ancestors) are tools only helpful for work on the console, I use them frequently when docking the iPAQ at home an working on it via ssh.
- The there's the ultimate tool for the road warrior:
opera, courtesy of IBM which provides the WebSphere Everyplace Multimodal Environment (for Sharp Zaurus SL-5600/6000 with Embedix). Search for "zaurus" on ibm.com, get multimodal_arm.ipk, unpack it and look for opera_arm.ipk inside. Before installation a few links have to be prepared: ln -s /opt/QtPalmtop/opera /usr/share, ln -s /root /home/zaurus and ln -s /opt/QtPalmtop /home.
Unfortunately this package does no longer work, since Familiar switched to OE with 0.8, and Opera was built using gcc2…
zot allows underclocking the StrongARM 1100 processor for longer battery life (good when taking notes the whole day…).
- Thanks to Clem's work on libopiesecurity2 there is now
opie-lockapplet, which ensures I can leave my iPAQ briefly unattended.
iPAQ Hardware:
- As that USB console seemed a little flakey, I obtained a serial cradle second hand - slow but rock solid when flashing.
- Unfortunately I did find the battery life a little lacking (it seems Familiar is not quite as good at suspending the hardware as PocketPC 2002), so I replaced the stock 1000 mAh Lithium Ion (Danionics DLP 305590, Part No. 167648) with a 1600 mAh part off eBay. All it needed was a T6 Torx driver and a little patience. The battery is simply pasted to the back cover using double sided sticky tape and connects to the main board using a plug that comes attached to the battery (there seem to be naked ones as well, with which you have to solder the old connector on…).
- At the same time I replaced that silly latch lock for the stylus (spare part for a couple € from eBay again), so the stylus locks in place reliably now.
- Finally, I got myself an assortment of expansion sleeves to try out (guess where from…). Good for restoring OS images (see above) - it's faster than via serial console.
Recommended Reading