格式化sd卡的命令

移动开发 waitig 661℃ 百度已收录 0评论

使用时; make fm_sd_1G

Makefile文件的内容为:

SDCARD=/dev/sdc

TOPDIR:=$(shell pwd)

fm_sd_1G:
-umount ${SDCARD}1
-umount ${SDCARD}2
echo fdisk $(SDCARD)
-for i in d 1 d 2 x h 255 s 63 c 120 r n p 1 1 +360M n p 2 50 120 t 1 c a 1 p w q; \
do echo $${i}; done | fdisk $(SDCARD)
mkfs.vfat -F 32 -n boot ${SDCARD}1
mkfs.ext3 ${SDCARD}2
mkdir -p /media/mmc1
mkdir -p /media/mmc2
mount ${SDCARD}1 /media/mmc1
mount ${SDCARD}2 /media/mmc2
echo "format sdcard done!"

fm_sd_2G:
-umount ${SDCARD}1
-umount ${SDCARD}2
echo fdisk $(SDCARD)
-for i in d 1 d 2 x h 255 s 63 c 242 r n p 1 1 +640M n p 2 100 242 t 1 c a 1 p w q; \
do echo $${i}; done | fdisk $(SDCARD)
mkfs.vfat -F 32 -n boot ${SDCARD}1
mkfs.ext3 ${SDCARD}2
mkdir -p /media/mmc1
mkdir -p /media/mmc2
mount ${SDCARD}1 /media/mmc1
mount ${SDCARD}2 /media/mmc2
echo "format sdcard done!"

fm_sd_16G:
-umount ${SDCARD}1
-umount ${SDCARD}2
echo fdisk $(SDCARD)
-for i in d 1 d 2 x h 64 s 32 c 14772 r n p 1 2048 +640M n p 2 1312768 30253055 t 1 c a 1 p w q; \
do echo $${i}; done | fdisk $(SDCARD)
mkfs.vfat -F 32 -n boot ${SDCARD}1
mkfs.ext3 ${SDCARD}2
mkdir -p /media/mmc1
mkdir -p /media/mmc2
mount ${SDCARD}1 /media/mmc1
mount ${SDCARD}2 /media/mmc2
echo "format sdcard done!"

fdisk-boot:
-umount ${SDCARD}1
-umount ${SDCARD}2
echo fdisk $(SDCARD)
-for i in d 1 d 2 x h 255 s 63 c 242 r n p 1 1 242 t 1 c a 1 p w q; \
do echo $${i}; done | fdisk $(SDCARD)
mkfs.vfat -F 32 -n boot ${SDCARD}1
mkdir -p /media/mmc1
mount ${SDCARD}1 /media/mmc1
echo "format sdcard done!"

fm_eject:
umount ${SDCARD}1
umount ${SDCARD}2
eject ${SDCARD}
echo "make sdcard done!"


本文由【waitig】发表在等英博客
本文固定链接:格式化sd卡的命令
欢迎关注本站官方公众号,每日都有干货分享!
等英博客官方公众号
点赞 (0)分享 (0)