Boot from MMC
This section describes how to boot off an MMC memory card
Contents
Partition the card
Place the card into your reader, and unmount it if it is mounted.
Assuming it is the only mmc card, run fdisk:
sudo fdisk /dev/mmcblk0
Delete any partitions on the disk, in this case there were two:
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Create the kernel partition:
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Set it to FAT16 file system:
<code> Command (m for help): t Selected partition 1 Hex code (type L to list codes): 6 Changed system type of partition 1 to 6 (FAT16)</code>
Create the root fs partition:
<code> Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (22-984, default 22): 22 Last cylinder, +cylinders or +size{K,M,G} (22-984, default 984): 984</code>
Save the partition table:
<code> Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 13: Permission denied. The kernel still uses the old table. The new table will be used at the next reboot. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. Syncing disks.</code>
Format the card
Format the kernel partition
mkfs.vfat -F 16 /dev/mmcblk0p1 -n gum-uimage
Format the rootfs partition
mkfs.ext2 /dev/mmcblk0p2 -L gum-rootfs
Remove and reinsert the card, you should have two mmc drives, one called gum-uimage and one called gum-rootfs
Enable booting from MMC in kernel
If you don't have the user.collection directory setup to change the appropriate conf file, do so like:
mkdir -p $USERBRANCH cp -r $GUMSTIXBRANCH/conf $USERBRANCH
Edit the conf file for your gumstix, eg for the verdex the file is:
$GUMSTIXTOP/user.collection/conf/machine/gumstix-custom-verdex.conf
Uncomment the line:
MACHINE_FEATURES += "mmcroot"
The kernel will now build with the necessary drivers
Save the file and rebuild the image:
bitbake -c rebuild task-base-gumstix bitbake -c rebuild gumstix-kernel bitbake -c rebuild gumstix-basic-image
Put the images on the card
Copy the uimage file from the working directory to the uimage partition on the card, eg:
cp $GUMSTIXTOP/tmp/deploy/glibc/images/gumstix-custom-verdex/uImage-2.6.21-r1-gumstix-custom-verdex.bin /media/gum-uimage/uimage
Make sure the file on the card is named uimage
Copy the gumstix-factory.script to the uimage partition as well:
cp $GUMSTIXTOP/extras/mmc-root/gumstix-factory.script /media/gum-uimage
Unpack the root file system to the rootfs partition on the card, eg:
sudo tar -xvpzf $GUMSTIXTOP/tmp/deploy/glibc/images/gumstix-custom-verdex/Angstrom-gumstix-basic-image-glibc-ipk-2007.9-test-20090212-gumstix-custom-verdex.rootfs.tar.gz -C /media/gum-rootfs/
Unmount BOTH partitions.