fix bug where the wrong SD Card block gets partitioned. rely on the ftsab to glean the sdcard mmcblk
Change-Id: Idee8d3e147ba91c45a9f9fe91126c7b5a19ee38d
This commit is contained in:
parent
eee085415f
commit
f1bde36572
@ -546,12 +546,29 @@ TTISMSDOS=
|
||||
|
||||
SDSIZE=
|
||||
SDSIZEMB=
|
||||
if [ -z "$SDPATH" ]
|
||||
SDINFO=$(cat /etc/fstab | grep /sdcard | awk '{print $1}')
|
||||
if [ -L "$SDINFO" ]
|
||||
then
|
||||
SDPATH="/dev/block/mmcblk0"
|
||||
SDPATH=$(ls -l $SDINFO | awk '{print $11}')
|
||||
else
|
||||
echo Found SDPATH=$SDPATH
|
||||
SDPATH=$SDINFO
|
||||
fi
|
||||
# we may now have an SDPATH, let's make sure its on mmcblkX or mmcblkXp1
|
||||
CHECK_SDPATH1=$(echo $SDPATH | grep mmcblk.$)
|
||||
CHECK_SDPATH2=$(echo $SDPATH | grep mmcblk.p1$)
|
||||
if [ -z "$CHECK_SDPATH1" ]
|
||||
then
|
||||
if [ -z "$CHECK_SDPATH2" ]
|
||||
then
|
||||
echo fail1
|
||||
unset SDPATH
|
||||
else
|
||||
LEN=${#SDPATH}
|
||||
BLKLEN=$(expr $LEN - 2)
|
||||
SDPATH=${SDPATH:0:$BLKLEN}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
FATSIZE=
|
||||
FATTYPE="fat32"
|
||||
|
Loading…
Reference in New Issue
Block a user