aboutsummaryrefslogtreecommitdiff
path: root/util/part
blob: a57f3e53b3fd5a9bc68e1696f02ae643cd8ec924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
SDCARD_DISK="$1"
if ! [ -n "$SDCARD_DISK" ] ; then
	cat << EOF >&2
ERROR: could not automatically detect an SD card. Please insert an SD card of
approx. 8GB, or manually set SDCARD_DISK in ./makefile
EOF
	exit 1
fi
if ! [ -w "$SDCARD_DISK" ] ; then
	echo "ERROR: cannot not write to $SDCARD_DISK. Are you root?" >&2
	exit 1
fi
if ! [ -b "$SDCARD_DISK" ] ; then
	echo "ERROR: $SDCARD_DISK does not appear to be a block device" >&2
	exit 1
fi

set -e

sfdisk "$SDCARD_DISK" << 'EOF'
label: dos
,64M,0E,*
,+  ,83,
EOF