Handhelds.org splash banner Handhelds.org logo by Chrysovalandes Sophocleous
iPAQ Cluster Setup

Hardware

The iPAQs in the handhelds.org cluster consist of the following:

  • iPAQ 3870 with USB/serial cradle
  • dual PCMCIA sleeve
  • Socket Ethernet CF card with CF-to-PCMCIA adapter
  • Addonics IDE PCMCIA card with external 40G drive

Each iPAQ sits in its cradle atop the IDE drive, with the short IDE cable arcing from the sleeve back and down to the drive. You can view this setup through the handhelds.org cluster camera.

For the system to access the IDE disk, it is sometimes necessary to perform the following power-up sequence:

  1. Insert the PCMCIA card into the sleeve.
  2. Power up the disk.
  3. Remove the PCMCIA card from the sleeve.
  4. Insert the PCMCIA card back into the sleeve.

Operating System

The cluster iPAQs run a snapshot of Intimate Linux, which is essentially Debian ARM Linux plus install scripts on top of Familiar Linux.

We use a snapshot of Intimate Linux because it makes it easier to administer our cluster, not because there's anything special about the snapshot. The snapshot is available here and here; see /etc/apt/sources.list on any iPAQ in the handhelds.org cluster for the precise APT sources.

Installation instructions for Familiar Linux and Intimate Linux are available at their respective web sites, http://familiar.handhelds.org and http://intimate.handhelds.org.

To simplify the task of setting up a large number of iPAQs for the cluster, we found it useful to collect some of the Familiar and Intimate instructions into a single document and augment them with additional steps. Here is the result of that effort:

Install Familiar Linux

  1. If necessary, activate the battery switch through the little door at the bottom of the iPAQ, then close the door. Not all iPAQ models have such a switch.

  2. Follow the instructions on the iPAQ screen to calibrate the touchscreen etc.

  3. If ActiveSync PC isn't already installed on a nearby Windows PC, install it by inserting the iPAQ Pocket PC Companion CD-ROM into the PC's drive and following the ensuing instructions.

  4. Plug the iPAQ cradle into an AC power outlet.

  5. Connect the USB connector from the cradle to the Windows PC.

  6. Slide the iPAQ into its cradle. Choose "No" in the "Set Up a Partnership" screen that appears on the PC, then click Next.

  7. Install bootldr on the iPAQ by performing the following steps, which were taken from http://familiar.handhelds.org/releases/v0.6/install/install-bootldr.html:

    1. Download to the Windows PC the latest BootBlaster package, which as of this writing is BootBlaster_1.18.exe. Check its md5sum against BootBlaster_1.18.exe.md5sum.

    2. Download the latest bootldr package, which as of this writing is bootldr-2.18.54.bin, and check its md5sum against bootldr-2.18.54.bin.md5sum.

    3. Copy BootBlaster_1.18.exe and bootldr-2.18.54.bin to the default folder on the iPAQ by clicking Explore in ActiveSync and dragging their icons there. Ignore any "may need to convert" messages.

    4. Run BootBlaster by selecting Start -> Programs on the iPAQ touchscreen, then running File Explorer, then tapping on BootBlaster.

    5. Optionally make a backup copy of WinCE by choosing Flash -> Save Bootldr .gz Format and Flash -> Save Wince .gz Format. This is a slow operation.

    6. Install bootldr by choosing Flash -> Program. Pick bootldr, then wait about 15 seconds for it to finish.

    7. Double-verify by choosing Flash -> Verify.

  8. Press the little recessed reset switch on the bottom edge of the iPAQ while holding down the big center joypad button at the bottom of the front panel, then press the calendar button to the left of the joypad button to keep bootldr from starting WinCE.

  9. Connect the serial cradle to a system with a terminal emulator, such as minicom on Linux or HyperTerm on Windows. Start the terminal emulator and set its communication parameters to 115200 baud, 8N1, no flow control.

  10. Slide the iPAQ with optional sleeve into the cradle, press ENTER to see the bootldr boot> prompt.

  11. Enter partition reset.

  12. Download to the PC the latest Familiar JFFS2 boot image with networking support, e.g. task-bootnet.jffs2, as instructed on http://familiar.handhelds.org. Check its md5sum.

  13. At the boot> prompt, run load root, then send task-bootnet.jffs2 to the iPAQ using the xmodem protocol. If you're running minicom on a Linux PC, you can start sx directly from minicom. The download takes about 15 minutes.

  14. At the boot> prompt, run boot.

  15. At the Linux login prompt, login as root with password rootme.

  16. Set up networking so that the iPAQ can talk to the outside world. This can be done for example with PPP over serial, with USB, or with an Ethernet card inserted into the iPAQ's PCMCIA sleeve.

  17. Edit /etc/resolve.conf and /etc/hostname to taste.

  18. ipkg install_pending

Familiar Post-Installation

The following steps aren't all strictly needed, but they make the Familiar installation more useful during the Intimate installation and during later system maintenance.
  1. ipkg update
    ipkg install ssh
    mkdir /root/.ssh
    chmod 700 /root/.ssh

  2. Set /root/.ssh/authorized_keys and/or /root/.ssh/authorized_keys2 as desired to give you root ssh access.

  3. Set /etc/localtime appropriately for your timezone, e.g. scp /etc/localtime root@ipaq:/etc from a nearby Linux PC.

  4. ipkg install ntpdate

  5. Run date -s time where time is the output from date on your Linux PC.

  6. Run ntpdate -b ntphost where ntphost is your favorite NTP server.

  7. Edit /etc/pcmcia/network.opts to taste.

  8. In /etc/ssh/sshd_config, set X11Forwarding to no to avoid spurious xauth error messages, and set other parameters like Protocol 2,1 to taste.

  9. /etc/init.d/ssh keygen1
    for p in fdisk e2fsprogs portmap diff procps; do ipkg install $p; done

  10. Determine the name of the current reiserfs-modules package by running ipkg list | grep reiserfs-modules, and then run ipkg install name where name is the reiserfs-modules package name.

  11. Likewise for the ext2-modules package.

  12. Run reboot and login as root.

  13. Run fdisk /dev/hda and create a large /dev/hda1 reiserfs partition for the root Intimate filesystem, a suitably-sized /dev/hda2 swap partition, and a suitably-sized /dev/hda3 ext2 partition for the /tmp filesystem. /dev/hda1 and /dev/hda2 are required by the Intimate installation procedure; /dev/hda3 is optional. We use the following layout on the 40G iPAQ cluster disks:

        /dev/hda1: /    (36G)   to cylinder 76777 (or 77033 if omitting /dev/hda3)
        /dev/hda2: swap (256M)  to cylinder 77289
        /dev/hda3: /tmp (128M)  remainder of disk
    

Install Intimate Linux

Or, install Debian Linux by using the instructions following this section. Here's how to install Intimate Linux:

  1. Install a non-Busybox version of mkswap, because Busybox mkswap thinks large (256M) swap partitions are less than 40k. Also install a non-Busybox version of cp, because Busybox cp doesn't understand -r or -v, which are used in the Intimate installer. Also install bash and point /bin/sh to it, because the Intimate linuxrc doesn't work with Busybox's sh.

  2. mkdir /tmp/intimate
    cd /tmp/intimate

  3. Get the Intimate installer. To install from the current Intimate distrubution, run:
       wget http://intimate.handhelds.org/installer/installer

    To install from the Intimate snapshot used on the iPAQ cluster, run:
       wget http://lorien.handhelds.org/ipaqcluster/installer

  4. Kill all sshd processes.

  5. Start a root console shell in its own window (not an Emacs buffer) if you don't already have one running.

  6. cd /tmp/intimate

  7. Run sh installer, and answer the questions as follows:

    • N to fdisk
    • Y to mkreiserfs
    • Y to mkswap
    • N to reiserfs-module
    • Y to mount
    • Y to rsync
    • control-z to .debs install, edit /mnt/hda1/etc/apt/sources.list to taste, fg, enter Y to install .debs, answer ensuing prompts
    • Y to intimateboot
  8. mv /linuxrc /linuxrc.familiar
    mv /linuxrc.intimate /linuxrc
    cp /linuxrc /mnt/hda1/tmp
    chroot /mnt/hda1 /bin/bash

  9. In /tmp/linuxrc:

    • set SUSPEND_PAUSE to Y
    • maybe set ROOTFS to reiserfs (needed on some systems to avoid FAT: bogus logical sector size 0 error during startup)
    • change SYSPEND_PAUSE to SUSPEND_PAUSE
    • insert this line:
         action=intimate
      before this line:
         until [ "$action" != "" ]; do
    Update: For H3900 iPAQs and perhaps later Familiar versions, several lines need to be copied from /etc/init.d/pcmcia and inserted after the SUSPEND_PAUSE conditional, /etc/pcmcia/ide.opts needs to be changed to mount /mnt/hda1, the mount command in /linuxrc needs to be commented out, and the following $? check needs to be omitted. See /linuxrc on ipaq1 for details. The long-term solution is to dispense with the Intimate script and use straight Debian with a shorter custom /linuxrc.
  10. Edit /etc/fstab so that it contains these entries:

        /dev/ide/host0/bus0/target0/lun0/part3  /tmp        ext2      defaults 1 2
        /dev/mtdblock/1                         /boot       jffs2     defaults 1 2
    
  11. mke2fs /dev/hda3
    exit
    cp /mnt/hda1/tmp/linuxrc /
    umask 0
    cp -rp /root/.ssh /mnt/hda1/root
    cp /etc/hostname /mnt/hda1/etc
    reboot

  12. Login as root on the console with password rootme.

  13. Change the root password to your preference by running passwd.

  14. /etc/init.d/ssh2 stop

  15. The previous command doesn't always work, so kill off sshd2 processes manually if there are any still running.

  16. Run dselect:

    1. Choose Update, follow prompts.

    2. Choose Select, select openssh in favor of ssh2, select hdparm, accept other defaults, follow prompts. About 40M of updates (compressed) should be selected.

    3. Choose Install, answer configuration questions. We used the following responses for the iPAQ cluster:

      • console: don't touch keymap
      • exim: local mail only, root mail goes to root ('none')
      • man-db: don't install man and mandb suid man
      • ispell: American dictionary
      • iptables: don't enable init.d script
      • ssh: support protocol 1, don't suid

  17. If you don't want X to start automatically at boot time, run update-rc.d -f x remove.

  18. update-rc.d -f ssh2 remove
    update-rc.d -f lpd remove

  19. Set boot-time hdparm parameters on /dev/hda to -m16 -u1.

  20. chmod 1777 /tmp

  21. Clear the guest password in /etc/shadow.

  22. If you plan to login to the system using Kerberos:

    1. Run dselect and install krb5 packages.
    2. Run kadmin and enter the following commands:
      • addprinc -randkey -clearpolicy host/ipaq-host.domain
      • ktadd host/ipaq-host.domain

Install Debian Linux

This is an alternative to installing Intimate. It's a few more steps than an Intimate installation, but it allows more pinpoint control, and it avoids a few current problems due to Intimate being out of date.

  1. Decide what root filesystem you want to use, install the appropriate modules using ipkg, and create the filesystem on /dev/hda1. For example, on a recent iPAQ I set up, I did the following:

    1. ipkg list | grep ext3
    2. Found that ext3-modules-2.4.18-rmk3 matches uname -r output.
    3. ipkg install ext3-modules-2.4.18-rmk3
    4. ipkg install e2fsprogs-libuuid1
    5. mkfs.ext3 -j /dev/hda1

  2. Install and run debootstrap to populate /dev/hda1. The bash step is needed because debootstrap won't work with the default busybox shell.

    1. cd /
    2. umask 0
    3. ssh host-with-debootstrap 'ar p /tmp/debootstrap-udeb_0.1.17.13_arm.udeb data.tar.gz' | tar xzvf -
    4. ipkg install bash
    5. rm /bin/sh
    6. ln -s bash /bin/sh
    7. mount -t ext3 -o data=writeback /dev/hda1 /mnt/hda
    8. cd /mnt/hda
    9. debootstrap --verbose --arch arm woody . http://rock/Debian-snapshot/Debian

    Unless you happen to be setting up a system at CRL, you'll need to change the URL in the debootstrap command line to point to your favorite Debian mirror. You can also change "woody" to some other distribution name.

  3. Install a /linuxrc to boot from the Debian partition.

    1. mv /linuxrc /linuxrc.familiar
    2. scp host-with-linuxrc:/tmp/linuxrc.debian /linuxrc
    3. chmod a+x /linuxrc
    4. ipkg install util-linux-pivot-root

    I use the following /linuxrc, derived from the Intimate /linuxrc and some trial and error:

      #!/bin/sh -x
    
      PATH=/bin:/sbin
      export PATH
      mount -n /proc
      mount -n /mnt/ramfs
      mkdir -p /mnt/ramfs/var/run /mnt/ramfs/tmp
      depmod -a
      for m in h3600_generic_sleeve pcmcia_core ds h3600_ts; do modprobe $m; done
      cardmgr -q -o -c /etc/pcmcia
    
      mount -n -t ext3 -o data=writeback /dev/hda1 /mnt/hda
      mount -n -t devfs none /mnt/hda/dev
      umount -n /mnt/ramfs
      pivot_root /mnt/hda /mnt/hda/boot
      cd /
      exec /sbin/init
    
  4. Configure the Debian installation.

    1. Set DHCP etc. to "n" in /etc/pcmcia/network.opts.
    2. Likewise, set DO_MOUNT etc. to "n" in /etc/pcmcia/ide.opts.
    3. chroot /mnt/hda /bin/bash
    4. In /etc/inittab, comment out ids 1 through 6, and add a line like this:
      T0:23:respawn:/sbin/getty -L ttySA0 115200 vt100
      On h3900 iPAQs and perhaps later Familiar versions, ttySA0 in the above line should be changed to tts/0.
    5. Add this to /etc/securetty:
        # iPAQ serial console
        ttySA0
      
    6. Edit /etc/apt/sources.list to taste.
    7. Change /etc/fstab to look something like this:
        #                              
        /dev/hda1        /              ext3     defaults,data=writeback 1      1
        /dev/hda2        swap           swap     defaults                0      0
        none             /proc          proc     defaults                0      0
        none             /dev/pts       devpts   mode=0622               0      0
      
        # Optional - Disabled for extra ram.
        ramfs            /mnt/ramfs     ramfs    defaults,noauto         0      0
        /dev/mtdblock/1  /boot          jffs2    defaults                1      2
      
    8. mkdir /dev/mtdblock
    9. mknod /dev/mtdblock/0 b 31 0
    10. mknod /dev/mtdblock/1 b 31 1
    11. mount /boot
    12. (cd /boot/lib/modules; find * | sort | cpio -puvdm /lib/modules)
    13. umount /boot; exit; umount /mnt/hda; reboot
    14. Log in as root.
    15. Edit /etc/resolv.conf, /etc/hostname, and /etc/network/interfaces to taste, then run ifup eth0.
    16. Run dselect.

Maintenance

To do a hardware reset of the iPAQ

  1. Lift the iPAQ out of its cradle.
  2. Press the little recessed reset switch on the bottom edge while holding down the big center joypad button at the bottom of the front panel.
  3. To stop the reboot sequence at the boot> prompt instead of booting Linux, press the calendar button to the left of the joypad button.
  4. Put the iPAQ back into its cradle.

Some boot> prompt commands

help
Displays a big list of commands.
show linuxargs
Shows the Linux kernel boot arguments.
set linuxargs=args
Sets the Linux kernel boot arguments to args, which will persist until the next reset. To boot into Familiar instead of Intimate, set args to the output from show linuxargs with init=/linuxrc changed to init=/linuxrc.familiar.
boot
Boots into Linux.

To repair the root reiserfs filesystem

  1. Boot into Familiar as described above.
  2. mount -r -t reiserfs /dev/hda1 /mnt/hda1
  3. mount -t ext2 /dev/hda3 /mnt/hda3
  4. cp /mnt/hda1/sbin/fsck.reiserfs /mnt/hda3
  5. umount /mnt/hda1
  6. /mnt/hda3/fsck.reiserfs --check /dev/hda1
  7. reboot

If the fsck.reiserfs --check command above doesn't fix the filesystem, it may be necessary to run these commands as well before the reboot step:

  1. /mnt/hda3/fsck.reiserfs --rebuild-tree /dev/hda1
  2. /mnt/hda3/fsck.reiserfs --fix-fixable /dev/hda1

touch /forcefsck followed by reboot forces a root filesystem check, but it doesn't do any repairs.



$Id: ipaqsetup.html,v 1.5 2003/04/07 18:39:13 duffekn Exp $