summaryrefslogtreecommitdiff
path: root/mac80211/ti-utils/scripts/mkcard.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mac80211/ti-utils/scripts/mkcard.sh')
-rwxr-xr-xmac80211/ti-utils/scripts/mkcard.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/mac80211/ti-utils/scripts/mkcard.sh b/mac80211/ti-utils/scripts/mkcard.sh
new file mode 100755
index 0000000..e00779e
--- /dev/null
+++ b/mac80211/ti-utils/scripts/mkcard.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+DRIVE=$1
+
+dd if=/dev/zero of=$DRIVE bs=1024 count=1024
+
+SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
+
+echo DISK SIZE - $SIZE bytes
+
+CYLINDERS=`echo $SIZE/255/63/512 | bc`
+
+echo CYLINDERS - $CYLINDERS
+
+{
+echo ,9,0x0C,*
+echo ,,,-
+} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
+
+mkfs.vfat -F 32 -n "boot" ${DRIVE}1
+mke2fs -j -L "rootfs" ${DRIVE}2
+