Disk Images
Overview
While the images within a series will be very similar or even the same, they differ between the various boot loaders.
Redboot
Linux as a bootloader images
TS-Bootrom
The layout for these will usually follow this for either 512MB or 2GB cards:
Partition | Description |
---|---|
1 | FAT partition |
2 | Kernel |
3 | Ramdisk |
4 | Linux Partition |
MBR
If you are creating an image from scratch, you must use our SD bootloader.
Partitions
FAT Partition
When the removable disks (SD/CF) are inserted into a Windows PC and it cannot recognize any of the filesystems it will assume the drive is uninitialized and ask the user to format it. On most 2GB images, this is the cross compiling tools. On the 512MB drives, this is usually a 4MB partition (the FAT minimum) which contains nothing.
Kernel
The kernel is loaded from the first partition type 0xda. This will show as an unknown type, but is what our bootloader will look for. This must be on a primary partition. This will have no filesystem itself, this is just the zImage written directly to the partition.
Ramdisk
The ramdisk is loaded from the second partition type 0xda. Like the kernel, this will need to be on a primary partition.
Linux partition
The Linux partition will always be the 4th partition. You can change this in linuxrc, but you will be unable to use stock images without making this modification in the future. This can be any posix filesystem, but you will need to have support in the kernel for that filesystem.
Resizing
Either way that you resize, you should create a small padding at the end of the drive. If you want to flash your image to another disk in the future, this will make sure the retired sectors do not interfere with
512MB to a larger size
Easy way (resize)
Use gparted on your host workstation and you can right click on the partition, click resize/move, and simply expand it to the desired size. Make sure you have the filesystem module loaded. On Fedora 14 for example, you need the jfsutils package and you have to manually 'modprobe jfs'.
For windows hosts, you can download the livecd.
Hard way (recreate the partition layout) Assuming this mounts to /dev/mmcblk0 (your system may mount it differently), and the sdcard image is present in /root/sdimage.dd.bzip2
bzip2 -d /root/sdimage.dd.bzip2
2GB to a smaller size
Gparted is not capable of moving the 'unknown' partition type 0xda so you will need to recreate the partition layout. Insert your sdcard to your linux workstation. Assuming this mounts to /dev/mmcblk0 (your system may mount it differently), and the sdcard image is present in /root/sdimage.dd.bzip2
bzip2 -d /root/sdimage.dd.bzip2
FAQ
Why are there unallocated sectors in between my partitions?
There is a few MB of padding on the kernel and ramdisk partitions so if you need to make minor changes (new kernel for example), you don't need to recreate the partition layout to deal with a slightly different size.
Why is there padding on the end of the drive?
SD cards tend to have a small variance in size from factory, and sectors can be retired by the SD card. The padding is to account for this.