calin radoni's humble web presence

homedocstoolboxabout

Multi-boot iPAQ (hx4700)

Table of Contents

Objective

I really wanted to run some flavor of Linux on my PDA but without loosing the Windows CE (which now I am using it just for a navigation system application).

Prerequisites

Here is what you need:

and here is what you have to download:

Formating the SD card

I have made the following partitions on the SD card:

then I have removed and reinserted the SD card.

Now is the time to put the file systems in place. Assuming that your SD card is /dev/sdb (if you are not sure execute: cat /proc/partitions), you have to:

# put the ext2 filesystem on /dev/sdb1
mke2fs /dev/sdb1
# remove filesystem periodic checking and label it
tune2fs -c 0 -i 0 -L FamiliarGPE /dev/sdb1

# put the ext2 filesystem on /dev/sdb2
mke2fs /dev/sdb2
# remove filesystem periodic checking and label it
tune2fs -c 0 -i 0 -L FamiliarOPIE /dev/sdb2

# put the FAT filesystem on /dev/sdb3
mkdosfs /dev/sdb3
        

GPE Root Filesystem

Mount the /dev/sdb1 partition in a directory of your choise, let's say /mnt/rootfs, and extract the Familiar's GPE rootfs there:

mount /dev/sdb1 /mnt/rootfs
tar -jxpf gpe-image-v0.8.4-ipaq-pxa270.rootfs.tar.bz2 -C /mnt/rootfs
        
To run from the SD card, you have to modify the /mnt/rootfs/etc/fstab file. It should look like this:
/dev/mmcblk0p1   /             ext2    defaults                          1 1
proc             /proc         proc    defaults                          0 0
sys              /sys          sysfs   defaults                          0 0
/dev/hda1        /media/cf     auto    defaults,noauto,noatime,exec,suid 0 0
/dev/mmcblk0p3   /media/card   auto    defaults,noauto,noatime,exec,suid 0 0
tmpfs            /var          tmpfs   defaults                          0 0
tmpfs            /media/ram    tmpfs   defaults                          0 0
        
Now, unmount /mnt/rootfs:
umount /mnt/rootfs
        
The Familiar's GPE rootfs is now copied and configured.

OPIE Root Filesystem

Mount the /dev/sdb2 partition in a directory of your choise, let's say /mnt/rootfs, and extract the Familiar's OPIE rootfs there:

mount /dev/sdb2 /mnt/rootfs
tar -jxpf opie-image-v0.8.4-ipaq-pxa270.rootfs.tar.bz2 -C /mnt/rootfs
        
To run from the SD card, you have to modify the /mnt/rootfs/etc/fstab file. It should look like this:
/dev/mmcblk0p2   /             ext2    defaults                          1 1
proc             /proc         proc    defaults                          0 0
sys              /sys          sysfs   defaults                          0 0
/dev/hda1        /media/cf     auto    defaults,noauto,noatime,exec,suid 0 0
/dev/mmcblk0p3   /media/card   auto    defaults,noauto,noatime,exec,suid 0 0
tmpfs            /var          tmpfs   defaults                          0 0
tmpfs            /media/ram    tmpfs   defaults                          0 0
        
Now, unmount /mnt/rootfs:
umount /mnt/rootfs
        
The Familiar's OPIE rootfs is now copied and configured.

Populating the FAT partition

Mount the /dev/sdb3 partition in a directory of your choise, let's say /mnt/tmp, create a directory there, let's say linux, and copy some required files:

mount /dev/sdb3 /mnt/tmp
mkdir /mnt/tmp/linux
cp haret-0.4.7.exe /mnt/tmp/linux
cp zImage-2.6.15-hh2-ipaq-pxa270-20060923034420 /mnt/tmp/linux/zImage
        
For HaRET to launch one of the two distributions (Familiar with GPE or Familiar with OPIE) you have to create two startup files in /mnt/tmp/linux.

The Familiar-GPE startup file, /mnt/tmp/linux/startGPE.txt, should be like this:

set KERNEL "zImage"
set MTYPE 562
set CMDLINE "root=/dev/mmcblk0p1 mem=64M console=tty0"
bootlinux
        

The Familiar-OPIE startup file, /mnt/tmp/linux/startOPIE.txt, should be like this:

set KERNEL "zImage"
set MTYPE 562
set CMDLINE "root=/dev/mmcblk0p2 mem=64M console=tty0"
bootlinux
        

Now, unmount /mnt/tmp:

umount /mnt/tmp
        

Booting

Take the SD card from the card reader and insert it in your hx4700. Next, you have to hard reset the PDA.

Warning

By doing a hard reset, the ENTIRE content of PDA's memory will be lost, and when I say entire, I mean it. This means that every document and every installed application will be lost!

You may want to backup your documents before doing a hard reset!
You may want to backup your documents before doing a hard reset!
You may want to backup your documents before doing a hard reset!

Hard reset the PDA (press Contacts + iTask + Reset). Launch haret-0.4.7, tell it what file do you want to run, startGPE.txt or startOPIE.txt, and press the Run button. If everything has been done as outlined in the previous paragraphs, the selected Familiar distribution should start.

GPE configuration


Familiar v.0.8.4 GPE screenshoots

Theme and Fonts

At first, you may want to change the font size and/or the theme.
Go to Settings -> Look and Feel and change them as you like. I am using the "Industrial" theme, size 10 Sans font for Desktop and Application and size 12 Monospace font for Terminal.

USB Networking

To start USB networking, go to Settings -> Network Setup and select the usb0 tab.
Change the mode to static and fill the Address, Netmask, Broadcast and Gateway fields.
I am using 10.0.0.2, 255.255.255.0, 10.0.0.255, 10.0.0.1.
Set the DNS (edit the /etc/resolv.conf). Mine is nameserver <the-IP-address-of-my-DNS-server>.

Configuring a Fedora Core 6 PC for USB Networking.
You need to have the file /etc/sysconfig/network-scripts/ifcfg-usb0 with the proper content. Mine is:

DEVICE=usb0
IPADDR=10.0.0.1
NETMASK=255.255.255.0
NETWORK=10.0.0.0
BROADCAST=10.0.0.255
ONBOOT=no
          

Connect the cradle to the Linux PC, and, on iPAQ, execute

ifconfig usb0 up
route add default gw 10.0.0.1
          
Now you should be able to ping the iPAQ from the Linux PC (of course your firewall has to allow it).
Fell free to ssh to the iPAQ.

For the iPAQ to "break out" the USB Network border, configure your Linux PC by executing:

echo "1" /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
          
replacing "eth0" with whatever interface yor Linux PC have external connectivity.

Upgrade

Is as simple as executing:

ipkg update
ipkg upgrade
          
... in theory, at least.
I had to edit the ipkg's configuration because some the first command was unable to download some package informations.
But, it worked.

OPIE configuration

Theme and Fonts

At first, you may want to change the font size and/or the theme.
Go to Settings -> Appearance and change them as you like. I am using the "Phase" theme, and the DejaVu_Sans font, style Regular, size 12.

USB Networking

Go to the Applications -> Console and change the root's password.

To start USB networking, go to Settings -> Network, select Ethernet (usb0) and click the Configure button.
Set the fields (IP Address, Subnet Mask, Gateway and First DNS) and click the OK button.

Note

I have set different IP addresses for the GPE and for OPIE. Your ssh client from the Linux PC will complain otherway (there are different keys in case you are curious).

Configuring a Fedora Core 6 PC for USB Networking.
It should be configured from the previous step (GPE configuration)!

Connect the cradle to the Linux PC, and, on iPAQ check the statuts of the usb0 interface and the routes. If the status is not right, execute:

ifconfig usb0 up
route add default gw 10.0.0.1
          
Now you should be able to ping the iPAQ from the Linux PC (of course your firewall has to allow it).
Fell free to ssh to the iPAQ.

For the iPAQ to "break out" the USB Network border, (remember, this step was done in the GPE configuration), configure your Linux PC by executing:

echo "1" /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
          
replacing "eth0" with whatever interface yor Linux PC have external connectivity.

Upgrade

Is as simple as executing:

ipkg update
ipkg upgrade
          
... really.

History

Copyright and License

This document is copyrighted (c) 2007 by Calin Radoni. Permission is granted to copy and/or distribute this document.

Disclaimer

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies that could be damaging to your system. Proceed with caution, the author do not take any responsibility.

All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.


Copyright © 2005 - 2009 Calin Radoni Hosted on http://www.geocities.com/calinradoni Last page modification is 21 March 2007
Hosted by www.Geocities.ws

1