Setup and configuration of base 2G SD card


What you need

In order to build the file system on the SD card I assume that you are working on a Linux box with a working USB subsystem and are able to mount an SD card in the reader. On my system the SD card mounts at /dev/sdb.

Files

To begin with you need to grab the following files from the Technologic Systems ftp server. They consist of the SD image which is a complete Debian Linux distribution, a default compiled 2.4.26 kernel, and the pre compiled modules.

SD Card Image sdimage.dd.bz2
TS-7400 Default Image ts7400-default
TS-7400 Modules tskernelmodules-2.4.26-ts11-7400.tar.gz

SD System Installation

Uncompress the SD card image.

	bunzip2 sdimage.dd.bz2
	
"dd" the image to your SD card.	(This will take a while.)

	dd if=sdimage.dd of=/dev/sdb

After the "dd" operation is complete you now have an SD card with a 512MB file system. In the next steps
you will tar up the file system.  Re-fdisk the file system to use the remainder of the partially used 
partition and then re-lay down the file system.

Mount the SD card on your Linux system. The SD card had three partitions. The first being where the Linux
kernel resides, the second is the initrd (ram disk), and the third is the Debian file system.  In the step
you will mount and make a tar of the file system.

	mount /dev/sdb3 /flash
	
	cd /flash

	tar -cvf /home/arm/SDBase.tar *
	
	cd /
	
	umount flash
	
Run fdisk and resize the 3rd partition.	 When you run fdisk and print the current partition table notice that 
the third partition starts at cylinder 20.  When you recreate the partition it must start at 20 also.
	
	fdisk /dev/sdb

Here is a sample of one of my sessions:

The number of cylinders for this disk is set to 7544.
There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p	

Disk /dev/sdb: 1977 MB, 1977614336 bytes
16 heads, 32 sectors/track, 7544 cylinders Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           6        1520   da  Non-FS data
/dev/sdb2               7          10        1024   da  Non-FS data
/dev/sdb3              20        7544      479692   83  Linux

Command (m for help): d
Partition number (1-4): 3

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)	p

Partition number (1-4): 3
First cylinder (11-7544, default 11): 20 
Last cylinder or +size or +sizeM or +sizeK (20-7544, default 7544):	  Hit Enter to use last
Using default value 7544

Command (m for help): p

Disk /dev/sdb: 1977 MB, 1977614336 bytes
16 heads, 32 sectors/track, 7544 cylinders Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           6        1520   da  Non-FS data
/dev/sdb2               7          10        1024   da  Non-FS data
/dev/sdb3              20        7544     1926400   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


Now format the resized partition.	
		
	mkfs.ext2 /dev/sdb3

Next you will mount the resized partition and untar the original tar'd up file system.	

	mount /dev/sdb3 /flash

	cd /flash

	tar -xvf /home/arm/SDBase.tar
 
Now install the modules.

	cd /flash/lib/modules

	tar -zxvf /home/arm/tskernelmodules-2.4.26-ts11-7400.tar.gz
 
	cd /
	
	umount /flash
	
Last you will "dd" the Linux kernel onto the first partition of the SD card.
	
	dd if=ts7400-default.dd of=/dev/sdb1
	

Once all of this is done you are ready to insert the newly created SD file system into your TS-7400 and boot it up. Please note that the SD card does not boot from the kernel you just installed on the SD card just yet. To make that happen you need to follow the instructions under fast boot.


Copyright 2010 by TMD Innovations and Len Bayles


Updated July 28, 2010