summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Stiffler2017-06-07 13:20:57 -0500
committerJason Reeder2017-06-09 09:36:15 -0500
commit759299cafaf86601b1a0230972d9a8a20bf78e6f (patch)
tree1e3e58df72ae7f27c790dd9554f63a317510f414
parentc19db3755c5331d0b8ee322c36ab65d57ebb0429 (diff)
downloaddevice-ti-am57xevm-759299cafaf86601b1a0230972d9a8a20bf78e6f.tar.gz
device-ti-am57xevm-759299cafaf86601b1a0230972d9a8a20bf78e6f.tar.xz
device-ti-am57xevm-759299cafaf86601b1a0230972d9a8a20bf78e6f.zip
am57xevm: fastboot: resize userdata.img in PRODUCT_OUT directory
* Use the same abstraction for resizing the userdata.img as is used for flashing. Change-Id: I29ad39217fe325ca8a8b3bbcf5aa5c5b27d43c01 Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
-rwxr-xr-xfastboot.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/fastboot.sh b/fastboot.sh
index d5428f1..caa1dec 100755
--- a/fastboot.sh
+++ b/fastboot.sh
@@ -197,7 +197,7 @@ fi
197 197
198echo "Resizing userdata.img" 198echo "Resizing userdata.img"
199resizefail=0 199resizefail=0
200userdatasize=`./fastboot getvar userdata_size 2>&1 | grep "userdata_size" | awk '{print$2}'` 200userdatasize=`${FASTBOOT} getvar userdata_size 2>&1 | grep "userdata_size" | awk '{print$2}'`
201if [ -n "$userdatasize" ]; then 201if [ -n "$userdatasize" ]; then
202 while [ 1 ];do 202 while [ 1 ];do
203 echo Current userdata partition size=${userdatasize} KB 203 echo Current userdata partition size=${userdatasize} KB
@@ -209,17 +209,17 @@ if [ -n "$userdatasize" ]; then
209 fi 209 fi
210 fi 210 fi
211 mkdir ./data 211 mkdir ./data
212 ./simg2img userdata.img userdata.img.raw 212 ./simg2img ${userdataimg} ${userdataimg}.raw
213 mount -o loop -o grpid -t ext4 ./userdata.img.raw ./data || resizefail=1 213 mount -o loop -o grpid -t ext4 ${userdataimg}.raw ./data || resizefail=1
214 if [ $resizefail -eq 1 ]; then 214 if [ $resizefail -eq 1 ]; then
215 echo "Mount failed" && break 215 echo "Mount failed" && break
216 fi 216 fi
217 ./make_ext4fs -s -l ${userdatasize}K -a data userdata.img data/ 217 ./make_ext4fs -s -l ${userdatasize}K -a data ${userdataimg} data/
218 sync 218 sync
219 umount data 219 umount data
220 sync 220 sync
221 rm -rf ./data 221 rm -rf ./data
222 rm userdata.img.raw 222 rm ${userdataimg}.raw
223 break 223 break
224 done 224 done
225else 225else