Hi,

Since the website is down, I'm going to submit this here and copy it over to the wiki later.

Title: Gumstix CF boot
Time: This took me a few days, but it should only take an hour or so.

Prerequisites:
  1. Gumstix (preferably xm, im not sure if its required)
  2. Serial connection to computer (tweener or otherwise, you must be able to access uboot)
  3. compact flash board and a card
  4. patience
Why: I wanted to boot of of a cf card, so that i could have more root, and so that if I messed up the root file system I wouldn't have to reload it in uboot. Now I just have to copy it over to the cf card (which is much faster).

In order for linux to be able to boot, the cf card must not have a fat fs on it (its possible, i think, but not recommended). The first thing you should do is format the cf cad as ext2 or ext3. If you cant do ext3, its because the card is too small to have journaling on it. Format the card by downloading the build root, compiling, running mak menuconfig. nce in menu config, you must install the ext2fs programs. Next, you need to configure the kernel (this is the really hard part).
To configure the kernel, cd into build_*/linux*/ then run make menuconfig. In men config, I disabled certain things based on my hardware. you MUST enable pcmcia, compact flash, and the file system (ext2) support into the kernel. Next I would disable mmc support. Now that the kernel is modified  you need to build this. Unfortunately for me,  this always failed. to fix this  copy the .config file to target/device/Gumstix/basix-connex/linux.config. In order to compile the kernel, I had to run rm -R build_* tooichain_* .

If you were to try to make the system now it would boot, but you would not be able to run any programs. This is because of a bug in the mm. To fig this you MUST apply a patch (which was not made for the current kernel version). Unfortunately, I was not able to copy the patchfile into kernel-patches/ , and so I had to edit the files manually. This is the patch that was posted to the mailing list:
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c

index f14b2d0..95273de 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -376,7 +376,7 @@ #endif
               ecc_mask = 0;
       }

-       if (cpu_arch <= CPU_ARCH_ARMv5TEJ) {
+       if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) {
               for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
                       if (mem_types[i].prot_l1)
                               mem_types[i].prot_l1 |= PMD_BIT4;
@@ -631,7 +631,7 @@ void setup_mm_for_reboot(char mode)
               pgd = init_mm.pgd;

       base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;
-       if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ)
+       if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
               base_pmdval |= PMD_BIT4;

       for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 95b3abf..7c9568d 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -127,6 +127,12 @@ static inline int cpu_is_xsc3(void)
 }
 #endif

+#if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3)
+#define        cpu_is_xscale() 0
+#else
+#define        cpu_is_xscale() 1
+#endif
+
 #define set_cr(x)                                     \
       __asm__ __volatile__(                           \
       "mcr    p15, 0, %0, c1, c0, 0   @ set CR"       \
Onc ethis patch is applied and the config is set, make the thing.
Mow that the buildroot has been made, load it ont the gumstix (loadb a2000000) and write it to the flash.
Boot to the new build image with the cf card connected.

While boothign the gumstix, it whould recodnize and create the /dev/hdax nodes.
fdisk /dev/hda and partition it how you like (i did one partition for everything)
When I created two partitions, the /dev/hda2 device node did not show up so you might have to do a reboot.

run mke2fs /dev/hda1 -v
mkdir /new_root
mount /dev/hda1 /new_root
cp -R /bin /new_root
cp -R /sbin /new_root
cp -R /boot /new_root
cp -R /tmp /new_root
cp -R /var /new_root
cp -R /etc /new_root
cp -R /home /new_root
cp -R /lib /new_root
cp -R /mnt /new_root
cp -R /opt /new_root
cp -R /root /new_root
mkdir /sys
mkdir /proc
mkdir /dev
cd /dev
mknod console
mknod mem
mknod ttyS0
(I dont know what the major and minor numbers are of the three above)

Now that the new file system is poulated, you can boot it. In uboot you need to change the vars
setenv bootargs console=ttyS0,115200n8 rootdelay=3 root=301 rootfstype=ext2 reboot=cold,hard
a breakdown of the args is follows:
console: this arg is teh default one used, it lets you login to uboot from the uart
rootdelay: I neeeded to add this because the kernel did not detect /dev/hda1 by the time it was ready to boot. This allowed for the kernel to settle and detect the device.
root: this is the major and minor number of /dev/hda1 in hex.
rootfstype: this tells the kernel that we are booting off of an ext2 file system

Once you ran that command you can boot (it will use the kernel in the jffs2 fs) but will the boot the cf card.

Have any suggestions, clarifications or modifications?
Evan