-
-
Save hansstimer/4950249 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Quelle: http://omappedia.org/wiki/Minimal-FS_SD_Configuration, 06.06.2012 | |
if [ ! "$1" = "/dev/sda" ] ; then | |
unset LANG | |
DRIVE=$1 | |
if [ -b "$DRIVE" ] ; then | |
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 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment