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:
- Insert the PCMCIA card into the sleeve.
- Power up the disk.
- Remove the PCMCIA card from the sleeve.
- 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
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.
Follow the instructions on the iPAQ screen to calibrate the
touchscreen etc.
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.
Plug the iPAQ cradle into an AC power outlet.
Connect the USB connector from the cradle to the Windows PC.
Slide the iPAQ into its cradle. Choose "No" in the "Set Up a
Partnership" screen that appears on the PC, then click Next.
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:
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.
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.
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.
Run BootBlaster by selecting Start -> Programs on the iPAQ touchscreen,
then running File Explorer, then tapping on BootBlaster.
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.
Install bootldr by choosing Flash -> Program. Pick bootldr, then wait
about 15 seconds for it to finish.
Double-verify by choosing Flash -> Verify.
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.
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.
Slide the iPAQ with optional sleeve into the cradle, press ENTER to see
the bootldr boot> prompt.
Enter partition reset.
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.
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.
At the boot> prompt, run boot.
At the Linux login prompt, login as root with password
rootme.
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.
Edit /etc/resolve.conf and /etc/hostname to taste.
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.
ipkg update
ipkg install ssh
mkdir /root/.ssh
chmod 700 /root/.ssh
Set /root/.ssh/authorized_keys and/or
/root/.ssh/authorized_keys2 as desired to give you root ssh
access.
Set /etc/localtime appropriately for your timezone,
e.g. scp /etc/localtime root@ipaq:/etc from a nearby Linux PC.
ipkg install ntpdate
Run date -s time where time is the output from
date on your Linux PC.
Run ntpdate -b ntphost where ntphost is your
favorite NTP server.
Edit /etc/pcmcia/network.opts to taste.
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.
/etc/init.d/ssh keygen1
for p in fdisk e2fsprogs portmap diff procps; do ipkg install
$p; done
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.
Likewise for the ext2-modules package.
Run reboot and login as root.
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:
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.
mkdir /tmp/intimate
cd /tmp/intimate
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
Kill all sshd processes.
Start a root console shell in its own window (not an Emacs buffer) if
you don't already have one running.
cd /tmp/intimate
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
mv /linuxrc /linuxrc.familiar
mv /linuxrc.intimate /linuxrc
cp /linuxrc /mnt/hda1/tmp
chroot /mnt/hda1 /bin/bash
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.
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
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
Login as root on the console with password rootme.
Change the root password to your preference by running
passwd.
/etc/init.d/ssh2 stop
The previous command doesn't always work, so kill off sshd2 processes
manually if there are any still running.
Run dselect:
Choose Update, follow prompts.
Choose Select, select openssh in favor of ssh2, select hdparm, accept
other defaults, follow prompts. About 40M of updates (compressed) should be
selected.
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
If you don't want X to start automatically at boot time, run
update-rc.d -f x remove.
update-rc.d -f ssh2 remove
update-rc.d -f lpd remove
Set boot-time hdparm parameters on /dev/hda to -m16
-u1.
chmod 1777 /tmp
Clear the guest password in /etc/shadow.
If you plan to login to the system using Kerberos:
- Run dselect and install krb5 packages.
- 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.
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:
- ipkg list | grep ext3
- Found that ext3-modules-2.4.18-rmk3 matches uname -r output.
- ipkg install ext3-modules-2.4.18-rmk3
- ipkg install e2fsprogs-libuuid1
- mkfs.ext3 -j /dev/hda1
Install and run debootstrap to populate /dev/hda1. The bash step is
needed because debootstrap won't work with the default busybox shell.
- cd /
- umask 0
- ssh host-with-debootstrap 'ar p
/tmp/debootstrap-udeb_0.1.17.13_arm.udeb data.tar.gz' | tar xzvf -
- ipkg install bash
- rm /bin/sh
- ln -s bash /bin/sh
- mount -t ext3 -o data=writeback /dev/hda1 /mnt/hda
- cd /mnt/hda
- 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.
Install a /linuxrc to boot from the Debian partition.
- mv /linuxrc /linuxrc.familiar
- scp host-with-linuxrc:/tmp/linuxrc.debian /linuxrc
- chmod a+x /linuxrc
- 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
Configure the Debian installation.
- Set DHCP etc. to "n" in /etc/pcmcia/network.opts.
- Likewise, set DO_MOUNT etc. to "n" in /etc/pcmcia/ide.opts.
- chroot /mnt/hda /bin/bash
- 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.
- Add this to /etc/securetty:
# iPAQ serial console
ttySA0
- Edit /etc/apt/sources.list to taste.
- 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
- mkdir /dev/mtdblock
- mknod /dev/mtdblock/0 b 31 0
- mknod /dev/mtdblock/1 b 31 1
- mount /boot
- (cd /boot/lib/modules; find * | sort | cpio -puvdm /lib/modules)
- umount /boot; exit; umount /mnt/hda; reboot
- Log in as root.
- Edit /etc/resolv.conf, /etc/hostname, and /etc/network/interfaces to
taste, then run ifup eth0.
- Run dselect.
Maintenance
To do a hardware reset of the iPAQ
- Lift the iPAQ out of its cradle.
- 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.
- To stop the reboot sequence at the boot> prompt instead of
booting Linux, press the calendar button to the left of the joypad button.
- 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
- Boot into Familiar as described above.
- mount -r -t reiserfs /dev/hda1 /mnt/hda1
- mount -t ext2 /dev/hda3 /mnt/hda3
- cp /mnt/hda1/sbin/fsck.reiserfs /mnt/hda3
- umount /mnt/hda1
- /mnt/hda3/fsck.reiserfs --check /dev/hda1
- 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:
- /mnt/hda3/fsck.reiserfs --rebuild-tree /dev/hda1
- /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.
|