Booting PocketPCs (and other WindowsCE-based handhelds) from external media (CompactFlash (CF), Secure Digital (SD) or MultiMedia Card (MMC)) with HaRET
- Information
- Introduction
- Preparation
- Procedure
- Partition and format the card
- Extract the ext2 filesystem onto the card
- Copy HaRET-related files to the FAT partition
- Unmount the partitions on the card
- Start Familiar-Linux on your iPAQ !
- Notes
- Appendix A: Alternate Partition Procedure (single partition and iPAQ filestore)
- Partition and format the card
- Extract the ext2 filesystem onto the card
- Unmount the partitions on the card
- Copy HaRET-related files to the iPAQ filestore
- Translations
1. Information
-
The mailinglist of your port (e.g., h2200-port@handhelds.org for h2200) will almost always have more up-to-date information. Mailinglists exist for a reason, use them! Visit page foe your port for more information.
2. Introduction
-
Familiar Linux 0.8.4 release is now available. Please help us test!
The mailinglist was very helpful in getting me sorted past my stupid mistakes and this is provided in the hopes that it will help someone else.
This procedure is meant to outline the process for booting external media with HaRET natively from Windows CE. For some handhelds, there're other ways to install Linux, for example LAB, but this method is a good way to 'test the water' without jumping in head first and will allow you to easily return to PocketPC if you so choose.
This has worked for many people, but it may not work for you. If it doesn't and you figure out why, please update this page and help others out.
If you have problems with this method, are Linux-challenged, or don't have access to a card reader you might like to try Ramdisk Rescue.
Please heed the WARNING before reading further!
3. Preparation
3.1. Get a filesystem image
-
Familiar is currently at version 0.8.4. There are few models supported for 2.6 kernel, and for other, unofficial build exists. This instructions assume that your PDA is officially supported. If not, look at your port's pages for images.
-
stable, v0.8.4
-
your hansdheld model (e.g. h2200)
-
GPE or Opie (the instructions below assume GPE, but the Opie images can be substituted with no problem)
-
Selecting Download will present you with a tarball of the latest gpe-images for the selected handheld (examples below show h2200)
The images are available as ext2 (in a bzip2 tarball) and jffs2 (which is for booting from flash) and are available at:
http://handhelds.org/familiar/releases/v0.8.4/
Go to the
installation guide and select:
-
Extract the contents of the image with:
$ tar -xpf bootgpe-v0.8.4-h2200.tar
-
Within the directory produced, you will find a few files:
-
bootgpe-v0.8.4-h2200.jffs2
-
bootgpe-v0.8.4-h2200.tar.bz2
-
zImage-2.6.15-hh2-h2200
-
The tar.bz2 is the file we need for the Procedure section below.
3.2. Create startup.txt for HaRET
-
This file defines how HaRET should boot Familiar-Linux.
-
* Where the root argument points to the partition you have extracted your ext2 filesystem to, from the ipaq's point of view, not the host you will be using to extract the filesystem image!
-
* The console=ttyS0,115200n8 argument is only necessary if you have a serial cable.
-
* The console=tty0 argument makes kernel and init dump boot messages to handheld screen, which is very helpful.
-
* Yes, there're two console parameters, and their order is important. (The last one is "default" console.)
| startup.txt for CF | startup.txt for SD/MMC |
|
set KERNEL zImage set MTYPE 341 set CMDLINE "root=/dev/hda2 rootdelay=5 console=ttyS0,115200n8 console=tty0" bootlinux |
set KERNEL zImage set MTYPE 341 set CMDLINE "root=/dev/mmcblk0p2 rootdelay=5 console=ttyS0,115200n8 console=tty0" bootlinux |
3.3. Get LINUX for your host !
-
You will need a Linux (or similar) system with a card reader/adapter (either CF or SD/MMC, depending on your media).
-
Puppy Linux - Note: I had problems with previous versions of Puppy Linux disktools (bad partitions, etc...) -- Joshua Layne
For those who are Linux-challenged, one of the following Linux LiveCDs should be sufficient:
4. Procedure
-
This is the recommended procedure for partitioning your card and getting all the files onto your iPAQ. It uses two partitions on the card and is fully self-contained, however there is an Alternate Procedure if you would prefer to use a single ext2 partition on your card and use the iPAQ filestore for HaRET-related files.
4.1. Partition and format the card
-
You should be able to determine the correct device node for YOUR card with one of
$ cat /proc/partitions # fdisk -l(my device showed up as /dev/sdb - you may have a different device node, depending on your exact setup, see output of dmesg)
-
Make 2 partitions on the card with fdisk, cfdisk, or sfdisk:
# fdisk /dev/sdb
| Recommended partition setup | ||||
| node | size | type (#) | purpose | |
| sdb1 | ~5MB | fat16 | 06 | haret, kernel & startup.txt |
| sdb2 | >40MB | ext2 | 83 | root filesystem |
* Note: To make the fat partition visible for wince make sure that it has an active flag toggled.
-
Now you need to format the partitions:
-
WARNING: Remember to substitute your own device names here!
# mkdosfs /dev/sdb1 # mke2fs /dev/sdb2
-
* Note: if formatting from Familiar, ensure
dosfstools,
kernel-module-msdos-2.6,
mke2fs,
fdisk, and the relevant codepage and language modules for the FAT filesystem are installed/loaded.
4.2. Extract the ext2 filesystem onto the card
-
Mount the partitions (make sure the folders below /mnt exist)
# mount -t vfat /dev/sdb1 /mnt/sdb1 # mount -t ext2 /dev/sdb2 /mnt/sdb2Extract the compressed image:
# tar -jxpf bootgpe-v0.8.4-h2200.tar.bz2 -C /mnt/sdb2Modify the root entry in /etc/fstab
-
The default image includes an fstab entry that specifies an incorrect root device for card-booting.
-
ie. something like "/dev/mtdblock3 / jffs2 defaults 1 1"
Check the contents of /mnt/sdb2/etc/fstab before executing the command below, as this default may change in the future.
# sed "s%/dev/mtdblock3%/dev/mmcblk0p2%;s/jffs2/ext2/" \
/mnt/sdb2/etc/fstab > /tmp/fstab && cp /tmp/fstab /mnt/sdb2/etc/fstab
-
* where /dev/mmcblk0p2 is used for SD/MMC, and /dev/hda2 is used for CF.
4.3. Copy HaRET-related files to the FAT partition
-
Copy the startup files to your fat partition:
# cp startup.txt /mnt/sdb1/startup.txt # cp zImage-2.6.15-hh2-h2200 /mnt/sdb1/zImage # cp haret.exe /mnt/sdb1/haret.exe
-
Note 2:
-
The zImage file is short, less than usual ~1.3MB
-
Booting does not proceed further than the bloodshot eyes.
-
Occasionally, there may be cases of broken kernels in install images. Symptoms:
# tar xfj bootgpe-v0.8.4-h2200.tar.bz2 # cp boot/zImage-2.6.15-hh2 /mnt/sdb1/zImage
4.4. Unmount the partitions on the card
-
Once everything has been copied to the card, the filesystems on the card need to be unmounted (umount). This ensures that any data remaining to be written is flushed to the disk. It also means that a 'dirty' flag is cleared on the ext2 filesystem, so that on booting next time, Linux will not attempt to perform a file system check (fsck) before mounting the partition.
-
* This check will fail anyway, and drop to single-user mode, as fsck does not exist on the GPE image. You will only know this if you have enabled a serial console
# umount /mnt/sdb1 # umount /mnt/sdb2
* Wait for the lights to stop flashing on your card reader/writer before removing the card.
* The command name is umount not unmount!
5. Start Familiar-Linux on your iPAQ !
-
That's it - boot up your iPaq, throw your card in and run the haret-*.exe program - it can take a few minutes, but the bloodshot penguin should disappear and be replaced by a blank screen, then by the gui. (Note: if you used "console=tty0" parameter as suggested, instead of dull blank screen you will see nicely scrolling boot log.)
| HaRET starts | Bloodshot eyes | Blank ~2 mins | GPE Splash ~3 mins |
|
|
|
|
|
see |
|||
-
If the boot procedure does not work for you, please report the exact procedure that you used to the port mailing list.
6. Notes
6.1. WARNING
-
This procedure WILL blank the RAM of your handheld.
As PPC2003 stores a lot of information (data and applications) in RAM,
you WILL need to hard-reset your PPC after running Linux on it!
You WILL lose everything stored on it (except on CF/SD cards or Ipaq Storage),
so please ensure you have made a BACKUP before attempting to run Linux.
6.2. Troubeshooting with a serial console
-
If Familiar-Linux fails to boot, it can be hard to tell what has gone wrong as the screen may be blank. The solution to this problem is to use the
To use the serial console, a serial cable is required.
7. Appendix A: Alternate Partition Procedure (single partition and iPAQ filestore)
-
This alternate procedure outlines how to use a flash card for booting without using a dual-partitioned card, by putting the files required for booting into the iPaq File Store.
7.1. Partition and format the card
-
You should be able to determine the correct device node for YOUR card with one of
$ cat /proc/partitions # fdisk -l(my device showed up as /dev/sdb - you may have a different device node, depending on your exact setup, see output of dmesg)
-
Make 1 partition on the card with fdisk, cfdisk, or sfdisk:
# fdisk /dev/sdb
| Alternate partition setup | ||||
| node | size | type (#) | purpose | |
| sdb1 | >40MB | ext2 | 83 | root filesystem |
-
Now you need to format the partitions:
# mke2fs /dev/sdb1
* Note: if formatting from Familiar, ensure
mke2fs, and
fdisk are installed.
7.2. Extract the ext2 filesystem onto the card
-
Mount the partitions (make sure the folders below /mnt exist)
# mount -t ext2 /dev/sdb1 /mnt/sdb1Extract the compressed image:
# tar -jxpf bootgpe-v0.8.4-h2200.tar.bz2 -C /mnt/sdb1
7.3. Unmount the partitions on the card
-
Once everything has been copied to the card, the filesystems on the card need to be unmounted (umount). This ensures that any data remaining to be written is flushed to the disk. It also means that a 'dirty' flag is cleared on the ext2 filesystem, so that on booting next time, Linux will not attempt to perform a file system check (fsck) before mounting the partition.
-
* This check will fail anyway, and drop to single-user mode, as fsck does not exist on the GPE image. You will only know this if you have enabled a serial console
# umount /mnt/sdb1
* Wait for the lights to stop flashing on your card reader/writer before removing the card.
* The command name is umount not unmount!
7.4. Copy HaRET-related files to the iPAQ filestore
-
You need to get the following files into your iPAQ filestore:
-
startup.txt (see Create startup.txt for HaRET above, and change the root statement to point to partition 1.)
-
zImage-2.6.15-hh2-h2200 (as 'zImage') (see kernel note)
-
HaRET.exe
-
Continue with starting Familiar above.



