-
Notifications
You must be signed in to change notification settings - Fork 12
create mmc sd storage user partition
Art Nikpal edited this page Mar 25, 2019
·
1 revision
/opt/storage_setup1
- create partition and format as fat fs
#!/bin/sh
## hyphop ##
DEV=/dev/mmcblk0
OFF=81920
NAME=`cat /proc/sys/kernel/hostname`
check() {
fdisk -l /dev/mmcblk0 -L=never -o device,start|tail -n1|grep $DEV
}
[ -b "$DEV" ] || {
echo "[i] not found dev $DEV" >&2
exit 1
}
## fdisk
check && {
echo "[i] formated already" 2>&2
exit 0
}
echo "n
p
1
$OFF
t
e
w
q
" | fdisk $DEV
mkfs.fat ${DEV}p1 -n $NAME -i DEADBEEF