Hello all !!!
I have Some issues while formatting my SD Card that too with only one partition, of type vfat...I hope u can help me in this case..
I have used below shown script to format my SD Card..On Executing this script it works fine.It will format the SD Card with One partition of
type vfat...After that i copied all my binary images such as MLO u-boot.bin boot.scr to that partition..
The problem occurs when i try to boot up the omap4 based board, in my console i was able to see some graphical characters printing..
I changed my UART then i tried ,then also i was able to see the same... I doubts in my code ....Can u help in resolving this...
#! /bin/bash
#
# Licensed under terms of GPLv2
#
# Parts of the procudure base on the work of Denys Dmytriyenko
# http://wiki.omap.com/index.php/MMC_Boot_Format
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
export LC_ALL=C
if [ $# -eq 2 ]; then
if [ "$2" == "vfat" ] ; then
echo "Script to format SD Card with VFAT "
else
echo "Usage: $0 <Drive> <file system type>"
exit 2
fi
fi
DRIVE=$1
function format_drive_vfat (){
echo "Formatting drive with vfat "
if [ -b ${DRIVE}1 ]; then
umount ${DRIVE}1
mkfs.vfat -F 32 -n "boot" ${DRIVE}1
else
if [ -b ${DRIVE}p1 ]; then
umount ${DRIVE}p1
mkfs.vfat -F 32 -n "boot" ${DRIVE}p1
else
echo "Can't find boot partition in /dev"
fi
fi
}
function create_drive(){
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | grep bytes | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`
echo CYLINDERS - $CYLINDERS
{
echo ,$CYLINDERS,0x0C,*
echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
sleep 1
}
if [ $# -eq 2 ]; then
create_drive;
if [ "$2" == "vfat" ]; then
format_drive_vfat;
fi
fi
Thanks for ur Co-operation..