• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2
3DRIVE=$1
4
5dd if=/dev/zero of=$DRIVE bs=1024 count=1024
6
7SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
8
9echo DISK SIZE - $SIZE bytes
10
11CYLINDERS=`echo $SIZE/255/63/512 | bc`
12
13echo CYLINDERS - $CYLINDERS
14
15{
16echo ,9,0x0C,*
17echo ,,,-
18} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
19
20mkfs.vfat -F 32 -n "boot" ${DRIVE}1
21mke2fs -j -L "rootfs" ${DRIVE}2
22
23