@@ -44,7 +44,8 @@ convert_android_img()
4444 simg2img $SYSIMG $WORKDIR /system.img.raw
4545 mkdir $TMPMOUNT
4646 mount -t ext4 -o loop $WORKDIR /system.img.raw $TMPMOUNT
47- make_ext4fs -l 160M $WORKDIR /system.img $TMPMOUNT
47+ IMAGE_SIZE=` wc -c < $SYSIMG `
48+ make_ext4fs -l $IMAGE_SIZE $WORKDIR /system.img $TMPMOUNT
4849 SYSIMAGE=$WORKDIR /system.img
4950 else
5051 SYSIMAGE=$SYSIMG
@@ -53,8 +54,8 @@ convert_android_img()
5354
5455check_mounts (){
5556 MOUNTS=$( do_shell " cat /proc/mounts" )
56- if ! echo $MOUNTS | grep -qs ' /cache ' ; then
57- do_shell " mount /cache "
57+ if ! echo $MOUNTS | grep -qs ' /data/recovery ' ; then
58+ do_shell " mount /data/recovery "
5859 fi
5960 if ! echo $MOUNTS | grep -qs ' /data' ; then
6061 do_shell " mount /data"
@@ -67,8 +68,8 @@ prepare_halium_system()
6768 do_shell " rm -f /data/rootfs.img"
6869 do_shell " dd if=/dev/zero of=/data/rootfs.img seek=500K bs=4096 count=0"
6970 do_shell " mkfs.ext2 -F /data/rootfs.img"
70- do_shell " mkdir -p /cache /system"
71- do_shell " mount -o loop /data/rootfs.img /cache /system/"
71+ do_shell " mkdir -p /data/recovery /system"
72+ do_shell " mount -o loop /data/rootfs.img /data/recovery /system/"
7273}
7374
7475cleanup ()
@@ -84,8 +85,9 @@ cleanup()
8485cleanup_device ()
8586{
8687 [ -e $WORKDIR /device-clean ] && return
87- do_shell " umount /cache/system/ && rm -rf /cache/system"
88- do_shell " rm -f /recovery/$TARBALL "
88+ do_shell " umount /data/recovery/system/ && rm -rf /data/recovery"
89+ do_shell " rm -f /data/$TARBALL "
90+ do_shell " sync"
8991 [ -e $WORKDIR ] && touch $WORKDIR /device-clean 2> /dev/null || true
9092}
9193
@@ -171,13 +173,13 @@ WORKDIR=$(mktemp -d /tmp/halium-install.XXXXX)
171173TMPMOUNT=" $WORKDIR /tmpmount"
172174
173175echo " transfering rootfs tarball ... "
174- adb push $TARPATH /recovery /
176+ adb push $TARPATH /data /
175177echo " [done]"
176178
177179if [ ! -z " $CUST_TARPATH " ]; then
178180 CUST_TARBALL=$( basename $CUST_TARPATH )
179181 echo -n " transferring custom tarball"
180- adb push $CUST_TARPATH /recovery /
182+ adb push $CUST_TARPATH /data /
181183 echo " [done]"
182184fi
183185
@@ -186,8 +188,8 @@ prepare_halium_system
186188echo " [done]"
187189
188190echo -n " unpacking rootfs tarball to system-image ... "
189- do_shell " cd /cache/ system && zcat /recovery /$TARBALL | tar xf - "
190- do_shell " [ -e /cache/ system/SWAP.swap ] && mv /cache /system/SWAP.swap /data/SWAP.img"
191+ do_shell " cd /data/recovery/ system && tar xf /data /$TARBALL "
192+ do_shell " [ -e /data/recovery/ system/SWAP.swap ] && mv /data/recovery /system/SWAP.swap /data/SWAP.img"
191193echo " [done]"
192194
193195echo -n " adding android system image to installation ... "
0 commit comments