Use dd instead of deleting partitions

This commit is contained in:
Donald Burr 2015-02-22 01:24:54 -08:00
parent 86f92a1b64
commit 2a2114e3de

View file

@ -7,6 +7,7 @@ trap cleanup INT
function cleanup() {
rm -f /tmp/noobs.zip
umount -f /tmp/sdcard.$$ >/dev/null 2>&1
rmdir /tmp/sdcard.$$
echo "Aborted."
exit 1
}
@ -41,11 +42,12 @@ fi
echo "...done"
echo "Preparing partition table on $DEV:"
echo -e "d\n1\nd\n2\nd\n3\nd\n4\nd\n5\nd\n6\nn\np\n1\n\n\nt\nb\na\n1\nw\nq\n" | fdisk $DEV >/dev/null
dd if=/dev/zero of=/dev/sdb bs=512 count=10 >/dev/null 2>&1
echo -e "n\np\n1\n\n\nt\nb\na\n1\nw\nq\n" | fdisk $DEV >/dev/null
echo "...done"
echo "Formatting partition on $DEV:"
mkfs.vfat ${DEV}1
mkfs.vfat -F 16 -n "NOOBS" ${DEV}1
echo "...done"
echo "Mounting partition on $DEV:"