EDIT: 2010-05-13
a note on this modded a2sd and CM5
This mod is *not* required , cm5 has a newer/better way of implementing a2sd
but it will do no harm, it just simply won't do anything
Firerat Patch - a2sd for MT3G users
NOTE My Modified a2sd is intended for both G1s and MT3Gs, one a2sd suits both MT3G's and G1s
Ok, I thought it was about time I gave a full explanation on my mt3g-a2sd patch
why MT3G users should not use an ext partition
why MT3G users who have just 2 Parttions ( FAT / SWAP ) get failed boots
How my modifications reslove this situation
Why should MT3G users not use an ext partition?
the answer is quite simple really, they don't need it.
a2sd was designed with G1s in mind, the G1's /data partition has a limited amount of space available, just over 74mb or 89mb with 'DangerSPL' whereas the MT3G has just over 295mb around 3 or 4 times the G1's.
Although I have not 'benchmarked' the 'speeds' of internal vs sdcard , I belive it is widely accepted that the internal memory is significantly faster than sdcards, and therefore if an MT3G can use it, it should.
So I hope we are all now agree that the MT3G's internal memory should be used for apps/dalvik-cache
Why do MT3G users who have just 2 Parttions ( FAT / SWAP ) get failed boots?
the problem is within the a2sd script, here is a section of the code, with my annotations in blue
Code:
[COLOR="Blue"]Here the script checks for second partition[/COLOR]
if [ -e /dev/block/mmcblk0p2 ];
then
[COLOR="Blue"]it exists so it does a fsck on it [/COLOR]
# fsck the sdcard filesystem first
e2fsck -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
[COLOR="Blue"] an error is returned ( it is swap not an extfs ) error no. is just stored, no action [/COLOR]
# mount and set permsd
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
[COLOR="Blue"] The above mount command fails, it is swap
<snip some link clean ups>[/COLOR]
# move apps and dalvik cache from internal memory to sdcard
for i in app app_s app-private dalvik-cache;
do
[COLOR="Blue"] here directories are normally created on sdcard
but as sdcard isn't mounted it tries to put them on the /system partition,
since /system is mounted read only , it fails[/COLOR]
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
[COLOR="Blue"] the next line tries to copy files from internal memory to /system/sd,
which is read only, it fails[/COLOR]
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
[COLOR="Blue"] BANG , that line above just deleted all your apps,
your system will not boot[/COLOR]
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
[COLOR="Blue"] its just removing empty directories,
and creating a link to none existent directories in /system/sd/[/COLOR]
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
How my modifications reslove this situation
Quite simply by skipping the above code, with this.
Code:
# check if not a G1 ( assuming mt3g ) - Firerat 2010-03-23
rohardware=`getprop ro.hardware`
if [ "$rohardware" != "trout" ];
then
FindSwap
ReturnAppsToData
$SETPROP_CMD cm.filesystem.ready 1;
exit 0;
the != is not equal to, getprop ro.hardware will return sapphire, not trout,
so this code will run my findswap, and ReturnAppsToData Functions
you can find the ReturnAppsToData Function in my next post
Code:
FindSwap ()
{
if [ "`sed -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
for isitswap in `ls /dev/block/mmcblk0p*` ; do
swapon $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
busybox mount -o rw,remount /system
sed s~/dev/block/mmcblk0p.~$isitswap~ /system/bin/user.conf -i
busybox mount -o ro,remount /system
break
else
echo "$isitswap is not swap"
fi
done
fi
return
}
next post contains my full modified a2sd
New Version 2.1
FireratModified-a2sd-2-1_S.zip
This one has the functions in the right place, so they *will* do something
################
Older versions
################
are a bit broken
Full Firerat Modified a2sd Code
It actually does a little more that just be friendly to MT3G, it will attempt to keep Dalvik-cache on /data
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen) Thanks Cy! & ccyrowski
# modified by Firerat 2010-03-24
# Skip a2sd functions if not a G1 ( mt3g in mind )
# Conditional added to location of Dalvik-cache, keep in internal memory where possible
# Firerat 2010-03-30 - added moving apps back to data for mt3g's
# Firerat-TODO - echo for when ran on terminal
#############################################################
RM_CMD="busybox rm"
MV_CMD="busybox mv"
CP_CMD="busybox cp"
LS_CMD="busybox ls"
LN_CMD="busybox ln"
MKDIR_CMD="busybox mkdir"
MOUNT_CMD="busybox mount"
UMOUNT_CMD="busybox umount"
SWAPON_CMD="busybox swapon"
# nb the df sticks out, toolbox df output is easier to cut up
DF_CMD="toolbox df"
DU_CMD="busybox du"
SED_CMD="busybox sed"
GREP_CMD="busybox grep"
CUT_CMD="busybox cut"
GETPROP_CMD="getprop"
SETPROP_CMD="setprop"
E2FSCK_CMD="e2fsck"
CHMOD_CMD="busybox chmod"
CHOWN_CMD="busybox chown"
SYNC_CMD="sync"
rohardware=`$GETPROP_CMD ro.hardware`
#############################################################
echo "+++ Welcome to Android `$GETPROP_CMD ro.build.version.release` / `getprop ro.modversion`";
sysctl -p
# check if not a G1 ( assuming mt3g ) - Firerat 2010-03-23
if [ "$rohardware" != "trout" ];
then
FindSwap
ReturnAppsToData
$SETPROP_CMD cm.filesystem.ready 1;
exit 0;
elif [ -e /dev/block/mmcblk0p2 ];
then
MountExt
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
$RM_CMD /data/$i;
fi
if [ ! -d /data/$i ];
then
$MKDIR_CMD /data/$i;
$CHOWN_CMD 1000:1000 /data/$i;
$CHMOD_CMD 771 /data/$i;
fi
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
$CP_CMD -a /system/sd/data/* /data/data/;
$RM_CMD -rf /system/sd/data;
fi
# move apps and dalvik cache from internal memory to sdcard
# when possible keep dalvik-cache on internal memory Firerat 2010-03-23
# for i in app app_s app-private dalvik-cache;
# Firerat-TODO in the same way I try to keep Dalvik-Cache on internal, do same for apps
# therefore keeping things as fast as possible
# and if I get my head round aufs then can maybe do some moving based on priority list
# hell, could even build list based on useage if it's recorded in the dbs
for i in app app_s app-private ;
do
if [ ! -d /system/sd/$i ];
then
$MKDIR_CMD /system/sd/$i;
fi
$CHOWN_CMD 1000:1000 /system/sd/$i;
$CHMOD_CMD 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
$CP_CMD -a /data/$i/* /system/sd/$i/;
$RM_CMD -f /data/$i/*;
fi
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
$RM_CMD -rf /data/$i;
$LN_CMD -s /system/sd/$i /data/$i;
fi
done;
# bind mount dalvik-cache so we can still boot without the sdcard
# when possible keep dalvik-cache on internal memory Firerat 2010-02-24
# $MOUNT_CMD -o bind /system/sd/dalvik-cache /data/dalvik-cache;
# $CHOWN_CMD 1000:1000 /data/dalvik-cache;
# $CHMOD_CMD 771 /data/dalvik-cache;
DalvikCache
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then $RM_CMD -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
$RM_CMD -f /system/sd/app/*.odex
# Firerat 2010-03-30 , not looked at this , but wrapper dexopt to ignore *.odex ?
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
$RM_CMD -f /data/$i;
$MKDIR_CMD /data/$i;
$CHOWN_CMD 1000:1000 /data/$i;
$CHMOD_CMD 771 /data/$i;
fi
done;
fi
$SYNC_CMD;
FindSwap
#Set Fifo - King Klick - thanks Wes Garner!
for i in ` $LS_CMD -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo 1 > $i/queue/iosched/fifo_batch
done
# Firerat 2010-03-30 ^ should be in init.rc , or some other post boot script
$SETPROP_CMD cm.filesystem.ready 1;
# for now this can stay
if [ -e /data/fix_permissions.sh ];
then
sh /data/fix_permissions.sh
$RM_CMD /data/fix_permissions.sh
fi
### Firerat - Begin functions
MountExt ()
{
# Firerat Check /dev/block/mmcblk0p2 is mounted , so script can be run in terminal
if [ `$MOUNT_CMD |$GREP_CMD -q "/dev/block/mmcblk0p2";echo $?` != "0" ];
then
# fsck the sdcard filesystem first
$E2FSCK_CMD -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
$SETPROP_CMD cm.e2fsck.errors $?;
# mount and set perms
$MOUNT_CMD -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
$CHOWN_CMD 1000:1000 /system/sd;
$CHMOD_CMD 771 /system/sd;
$SYNC_CMD
fi
return
}
FindSwap ()
{
if [ "`$SED_CMD -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
for isitswap in ` $LS_CMD /dev/block/mmcblk0p*` ; do
$SWAPON_CMD $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
$MOUNT_CMD -o rw,remount /system
# Firerat 2010-03-30 - check for cache hack
if [ -d /system/csys ]; then
$MOUNT_CMD -o rw,remount /system/csys
fi
$SED_CMD s~/dev/block/mmcblk0p.~$isitswap~ /system/bin/user.conf -i
$MOUNT_CMD -o ro,remount /system
# Firerat 2010-03-30 - check for cache hack
if [ -d /system/csys ]; then
$MOUNT_CMD -o ro,remount /system/csys
fi
break
else
echo "$isitswap is not swap"
fi
done
fi
return
}
DalvikCache ()
{
# doubt they are going to change, but shoud set the 'paths' as variables
DataTotal_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f2|$SED_CMD s/K//`
DataFree_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
DataDalvik_K=`$DU_CMD /data/dalvik-cache/|$CUT_CMD -f1`
# Pickup min free on data from config in future
Min_Data_Free_MB=10
Buffer_K=`expr $Min_Data_Free_MB \* 1024`
DataApp_K=`$DU_CMD /system/app/|$CUT_CMD -f1`
System_App_K=`$DU_CMD /data/app/|$CUT_CMD -f1`
if [ -d /system/sd/dalvik-cache ];
then
SD_Dalvik_K=`busybox $DU_CMD /system/sd/dalvik-cache|$CUT_CMD -f1`
else
SD_Dalvik_K="0"
fi
# Firerat-TODO - I'll finish these some other time
#echo "Data Partition size : ${DataTotal_K}K"
#echo "Free on Data Partition : ${DataFree_K}K"
#echo $DataDalvik_K
#echo $Min_Data_Free_MB
#echo $Buffer_K
#echo $DataApp_K
#echo $System_App_K
#echo $SD_Dalvik_K
if [ ! -d /system/sd/dalvik-cache ] && [ "$DataDalvik_K" -lt "1024" ] && [ "`expr \( $DataApp_K + $System_App_K \) \/2`" -lt "$DataFree_K" ];
then
DalvikToIntMem
else
# if DalvikCache + a bit is too big, move to SD card
if [ "`expr $DataDalvik_K + $Buffer_K`" -gt "`expr $DataFree_K + $DataDalvik_K`" ];
then
DalvikToSdCard
else
if [ "`expr "$SD_Dalvik_K" + "$Buffer_K"`" -lt "$DataFree_K" ];
then
DalvikToIntMem
fi
fi
fi
DalvikComplete
return
}
DalvikToIntMem ()
{
if [ -d /system/sd/dalvik-cache ];
then
# hmm, I should be not lazy look before I leap
$MKDIR_CMD /data/dalvik-cache-temp
$CHOWN_CMD 1000:1000 /data/dalvik-cache-temp
$CHMOD_CMD 771 /data/dalvik-cache-temp
$CP_CMD -a /system/sd/dalvik-cache/* /data/dalvik-cache-temp/
$UMOUNT_CMD /data/dalvik-cache
$RM_CMD -rf /data/dalvik-cache
$MV_CMD /data/dalvik-cache-temp /data/dalvik-cache
$RM_CMD -rf /system/sd/dalvik-cache
else
if [ ! -d /data/dalvik-cache ];
then
$MKDIR_CMD /data/dalvik-cache
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache
$CHMOD_CMD 771 /data/dalvik-cache
fi
return
}
DalvikToSdCard ()
{
$MKDIR_CMD /system/sd/dalvik-cache/
$CP_CMD -a /data/dalvik-cache/* /system/sd/dalvik-cache/
$RM_CMD /data/dalvik-cache/*
return
}
DalvikComplete ()
{
if [ -d /system/sd/dalvik-cache ] && [ "`$MOUNT_CMD |$GREP_CMD -q "/data/dalvik-cache";echo $?`" != "0" ];
then
$MOUNT_CMD -o bind /system/sd/dalvik-cache /data/dalvik-cache;
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache;
$CHMOD_CMD 771 /data/dalvik-cache;
return
}
ReturnAppsToData ()
{
# Firerat 2010-03-30
# only running this for none G1s, like mt3g
# allows this patched a2sd to be used on existing install that emulates G1 with broken keyboard
# will only move apps / dalvik i\f there is enough space on /data
# I can probably use this to move apps an a G1, but for now only calling if not g1
if [ -e /dev/block/mmcblk0p2 ] && [ "$isitswap" != "/dev/block/mmcblk0p2" ];
then
Min_Data_Free_MB=10
Buffer_K=`expr $Min_Data_Free_MB \* 1024`
DataFree_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
TotalAppsOnSD="0"
MountExt
# check to make sure apps on sd are not too large
for i in app app_s app-private dalvik-cache; do
if [ ! -d /system/sd/$i ];
then
SizeOnSD$i=`busybox $DU_CMD /system/sd/$i|$CUT_CMD -f1`
else
SizeOnSD$i="0"
fi
TotalAppsOnSD=`expr "$TotalAppsOnSD" + "SizeOnSD$i"`
done
if [ "$TotalAppsOnSD" -lt "`expr "$DataFree_K" - "$Buffer_K"`" ];
then
# Firerat 2010-03-30 NB, I'm not moving Dalvik-c here , as I already have a function for that
for i in app app_s app-private; do
if [ -d /system/sd/$i ] && [ -L /data/$i ];
then
# Firerat 2020-03-31 - Copy to temp, then remove link and move temp in place
$CP_CMD -a /system/sd/$i /data/$i-temp
$RM_CMD /data/$i
$MV_CMD /data/$i-temp /data/$i
if [ "$?" = "0" ];
then
$RM_CMD -rf /system/sd/$i
fi
fi
done
DalvikToIntMem
$UMOUNT_CMD /dev/block/mmcblk0p2
return
else
DalvikComplete
return
fi
else
return
fi
}
Original Code
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen) Thanks Cy! & ccyrowski
#
echo "+++ Welcome to Android `getprop ro.build.version.release` / `getprop ro.modversion`";
sysctl -p
if [ -e /dev/block/mmcblk0p2 ];
then
# fsck the sdcard filesystem first
e2fsck -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
#busybox mount /sdcard;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps and dalvik cache from internal memory to sdcard
for i in app app_s app-private dalvik-cache;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chown 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
fi;
sync;
setprop cm.filesystem.ready 1;
this is for if I need some more space
great job again firerat.... alot of us appreciate your hard work and thoroughness!!!!!!!!!!!!!!!!!!!!!!! looking forward to add to my mt3g.... ive been experiencing many boot failures.....
dangambino said:
great job again firerat.... alot of us appreciate your hard work and thoroughness!!!!!!!!!!!!!!!!!!!!!!! looking forward to add to my mt3g.... ive been experiencing many boot failures.....
Click to expand...
Click to collapse
the Flash update in the OP should convert an MT3G emulating a G1 with broken keyboard back into an MT3G with a spare ext partition, for a chroot linux or something, or just fix it up before messing about re-partitioning
but I have to say, I have not tested the apps back to data part, it should check if there is room, it did cross my mind that some may have hundreds of apps and it they would be too big to fit, so I try to check
Lovely, thanks! I'm going to try this now, as I'm just re-flashing King's Legend2g1
Would this be able to run properly once a ROM is already established? Like a ROM I've had for a couple days? Or would this need to be flashed on a ROM that's recently installed. For instance:
Code:
Flash ROM
Flash a2sd
reboot
nolimit78 said:
Would this be able to run properly once a ROM is already established? Like a ROM I've had for a couple days? Or would this need to be flashed on a ROM that's recently installed. For instance:
Code:
Flash ROM
Flash a2sd
reboot
Click to expand...
Click to collapse
yes, my latest will copy app, app_s, app-private and dalvik-cache from the ext partition to /data
( unless it finds that they are all too big, in which case you are still g1 with broken keyboard but your gota have *a lot* of apps before that happens )
But as I only have a G1 I have not been able to test it properly, but the logic is straight forward so fingers crossed I have not missed a typo...
Hmm. I'm having a problem with it. Well, maybe with it. So the first time I wiped, repartitioned with just a swap (190mb) and the rest as fat32. I flashed Rom, then flashed your patch, then flashed the vega kernal patch. Booted up, it all worked, past the HTC quietly brilliant screen, but then sat there on the black HTC bit. If I let the screen sleep, it looked like Sense had loaded, but when I unlocked it it was still sitting there on the black HTC screen with Clock repeatedly FC'ing. So I wiped, reflashed this time just the Rom and the Patch and this time it's getting to the setup screen. It was working fine. I connected to wifi, then signed into my google account (still on the setup) and then onto the next screen about google using my location, and then Settings FC'd. Since then I've been in a loop of going back to the start of the Setup menu, never getting further than the language screen again. I will reboot and see if that helps. Failing that, I'll re-flash with JUST the rom, and see if it sets up ok. If so, I suppose I won't need the patch afterall!
I'll keep you updated.
Firerat said:
yes, my latest will copy app, app_s, app-private and dalvik-cache from the ext partition to /data
( unless it finds that they are all too big, in which case you are still g1 with broken keyboard but your gota have *a lot* of apps before that happens )
But as I only have a G1 I have not been able to test it properly, but the logic is straight forward so fingers crossed I have not missed a typo...
Click to expand...
Click to collapse
I flashed it as I was typing, just outta curiosity, and its seeming to work properly. Good work sir!
Thanks!! I'll try it out on superD and tell you how it goes
DanGrover said:
Hmm. I'm having a problem with it. Well, maybe with it. So the first time I wiped, repartitioned with just a swap (190mb) and the rest as fat32. I flashed Rom, then flashed your patch, then flashed the vega kernal patch. Booted up, it all worked, past the HTC quietly brilliant screen, but then sat there on the black HTC bit. If I let the screen sleep, it looked like Sense had loaded, but when I unlocked it it was still sitting there on the black HTC screen with Clock repeatedly FC'ing. So I wiped, reflashed this time just the Rom and the Patch and this time it's getting to the setup screen. It was working fine. I connected to wifi, then signed into my google account (still on the setup) and then onto the next screen about google using my location, and then Settings FC'd. Since then I've been in a loop of going back to the start of the Setup menu, never getting further than the language screen again. I will reboot and see if that helps. Failing that, I'll re-flash with JUST the rom, and see if it sets up ok. If so, I suppose I won't need the patch afterall!
I'll keep you updated.
Click to expand...
Click to collapse
Further to this, I rebooted and let it sit for a while, then tried again. I got as far as the Facebook sync bit on the Setup but no dice, FC settings and back to the start. So I wiped and re-flashed just the rom, which has now been sitting on the HTC Quietly Brilliant screen for about 15 minutes. The only option I haven't tried yet is installing Legend2g1 + the Vega patch, booting and seeing if it works.
DanGrover said:
Further to this, I rebooted and let it sit for a while, then tried again. I got as far as the Facebook sync bit on the Setup but no dice, FC settings and back to the start. So I wiped and re-flashed just the rom, which has now been sitting on the HTC Quietly Brilliant screen for about 15 minutes. The only option I haven't tried yet is installing Legend2g1 + the Vega patch, booting and seeing if it works.
Click to expand...
Click to collapse
try one of my Legend for NoneDangerSPLs
link in my sig
they are using an MT3G friendly a2sd out of the box, but without the apps back to data part
Firerat! This is AWESOME!!!!! I've needed this for a while, but my experience of bash scripting is less than mediocre.
I have 3 questions:
1) To make this usable on g1, I can just remove the ro.getprop section, correct? or do I need to change it instead of removing it?
2) To guess whether or not my /data folder will even fit on the g1, can I simply extract the zip and look at the file size of "data" folder inside, or is there something more? and if that barely fits, will dalvik-cache still go on sd?
3) If I am installing a bunch of apps and it fills up /data (assuming I am using this script), then will the "move apps and dalvik-cache to sd" option in amon_ra work?
Thanks man!
jcarrz1 said:
Firerat! This is AWESOME!!!!! I've needed this for a while, but my experience of bash scripting is less than mediocre.
I have two questions:
1) To make this usable on g1, I can just remove the ro.getprop section, correct? or do I need to change it instead of removing it?
Click to expand...
Click to collapse
Out of the box it will work with G1s and MT3Gs, that's the idea One Script two phones.
jcarrz1 said:
2) To guess whether or not my /data folder will even fit on the g1, can I simply extract the zip and look at the file size of "data" folder inside, or is there something more? and if that barely fits, will dalvik-cache still go on sd?
Thanks man!
Click to expand...
Click to collapse
with a G1 I let everything go to sd,
but if I work out that dalvik-cache will fit on data , leaving 10mb free I keep it on data
I do need to tweak it a little, the Legend Cache Hacks I have done need a reboot to push dalvik-cache to sd
And , in future ( providing DEVs adopt it ) all system apps can go to system
check my Eris / Legend on NoneDangerSPL in sig for more info
I can recommend the ErisCacheHack, and Legend for NoneDanger
( DangerLegend is still wip, but I'm hoping my latest works )
jcarrz1 said:
3) If I am installing a bunch of apps and it fills up /data (assuming I am using this script), then will the "move apps and dalvik-cache to sd" option in amon_ra work?
Thanks man!
Click to expand...
Click to collapse
yeah, it should do, the a2sd will move the dalvik-cache back if it thinks there is enough space, but at the moment it won't touch the apps
I am going to develop the a2sd a little more, and get it to auto move apps between data/sd depending on size
I kind of hint at that in the comments in the last function
but one of my goals is to get unionfs going, having some apps on internal and some on SD
it will also make the cache hack much easier
I'd just flash a linux base, the android being a tarball, and extract the android on first boot into a unionfs, if I'm right, the files will automagicaly go to where space is available
failing that, I have other ideas
Firerat said:
but one of my goals is to get unionfs going, having some apps on internal and some on SD
Click to expand...
Click to collapse
If working unionfs for a2sd search XDA (in particular, this forum) first. It's been done but was found wanting from a performance standpoint--you may as well build on that experience. You might also see if you get better results from aufs.
Firerat said:
yeah, it should do, the a2sd will move the dalvik-cache back if it thinks there is enough space, but at the moment it won't touch the apps
I am going to develop the a2sd a little more, and get it to auto move apps between data/sd depending on size
I kind of hint at that in the comments in the last function
but one of my goals is to get unionfs going, having some apps on internal and some on SD
it will also make the cache hack much easier
I'd just flash a linux base, the android being a tarball, and extract the android on first boot into a unionfs, if I'm right, the files will automagicaly go to where space is available
failing that, I have other ideas
Click to expand...
Click to collapse
Thanks for the quick response. In regard to #1, if I wanted to make the script do what it usually does on mt3g happen on my g1, can I simply remove those lines?
Also, I'm testing the legend patch right now ON DANGER, but fyi the 4shared links for the prepatched rom don't work... that's why I did it myself. flashing.
hmm.. Ill flash this over the current rom im using i guess and ill see how it goes. using that SuperEclair 2.3. should i wipe before flashing or its unnecessary?
Shaquiel Harris said:
hmm.. Ill flash this over the current rom im using i guess and ill see how it goes. using that SuperEclair 2.3. should i wipe before flashing or its unnecessary?
Click to expand...
Click to collapse
this isn't something you flash, it's something you stick into /system/bin when you're cooking a rom... as far as I know...
Hello folks,
ive bought this cheap android based console like 1 year ago for my son to play android games on it. In last few weeks ive figured that many apps are lost due some reason and i can see them with 0 kb in applications list. Ive bought new SD card from Kingston to test it with but still the same issue. After moving application to SD card with A2SD III, application disapears from console and from SD card. After several days spent on google ive found possible fix but im not able to apply it since i dont have in system file where this fix can be applied. I hope somebody can help me to locate or advice what file should be possibly modified. If you have any ideas, feel free to post them (except those to throw that crap out of window)
https://github.com/nadlabak/android...mmit/e5b9b3195687e04af7a7929f8637e77e1efae9a1
Thanks alot for any helpful comments.
Aiki
Please, some Android guru help me out with this
I presume noone has any single idea?
Aikimaniac said:
Hello folks,
ive bought this cheap android based console like 1 year ago for my son to play android games on it. In last few weeks ive figured that many apps are lost due some reason and i can see them with 0 kb in applications list. Ive bought new SD card from Kingston to test it with but still the same issue. After moving application to SD card with A2SD III, application disapears from console and from SD card. After several days spent on google ive found possible fix but im not able to apply it since i dont have in system file where this fix can be applied. I hope somebody can help me to locate or advice what file should be possibly modified. If you have any ideas, feel free to post them (except those to throw that crap out of window)
https://github.com/nadlabak/android...mmit/e5b9b3195687e04af7a7929f8637e77e1efae9a1
Thanks alot for any helpful comments.
Aiki
Click to expand...
Click to collapse
Format you're mem card (in your console itself ) then factory reset it....
Sent from my K-Touch W719 using XDA Premium 4 mobile app
shreygadikar said:
Format you're mem card (in your console itself ) then factory reset it....
Sent from my K-Touch W719 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
didnt help..im still looking for the file where i can set that parameter to avoid that services start before mounting of SD card is finished..
i think the problem is the "A2SD III". take another one like my script and test.
mildwild said:
i think the problem is the "A2SD III". take another one like my script and test.
Click to expand...
Click to collapse
have been out of country for some days..will test this asap and let you know...weird is that i removed SD card and installed game from market and it happened even without app was moved to SD card..i just lost it...looks like the ROM from factory is pretty messed up as well.. will let you know how this went..thanks alot
Not sure where to place this script..or if its necessary to modify some other already existing script... btw..this the original ROM if anyone experienced is willing to check it.. http://www.jxd.hk/download.asp?id=1152&selectclassid=020001 for what i would be very grateful :fingers-crossed:
Please gurus...help me out with this issue...here is the script and i have no idea where to put it... thanks in advance
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# Original Apps2SD script by [email protected] (cyanogen)
# Fixed for slow detection of SD cards by _thalamus and output a bit more debugging info so we can see where problems are arising.
# execute any postinstall script then kill it
enablea2sd () {
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /sd-ext;
busybox chown 1000:1000 /sd-ext;
busybox chmod 771 /sd-ext;
# clean up any old symlinks, create data directories
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /sd-ext/data ];
then
busybox cp -a /sd-ext/data/* /data/data/;
busybox rm -rf /sd-ext/data;
fi;
# move apps from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /sd-ext/$i ];
then
mkdir /sd-ext/$i;
fi
busybox chown 1000:1000 /sd-ext/$i;
busybox chmod 771 /sd-ext/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /sd-ext/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app-private dalvik-cache;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /sd-ext/$i ]; then rm -f /sd-ext/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /sd-ext/app/*.odex
echo "+++ Apps-to-SD successfully enabled";
}
disablea2sd() { # replace symlinks with directories so we can boot without sd
for i in app app-private dalvik-cache;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
}
if [ -e /dev/block/mmcblk0p1 ]; # We check for the presence of the FAT partition first to see if the SD has initialised.
then
echo "SD Card has been initialised...checking for ext partition.";
if [ -e /dev/block/mmcblk0p2 ]; # If false, it isn't there so we don't have to sleep the script and delay the boot.
then
enablea2sd;
else
echo "No ext partition present, apps2sd disabled";
disablea2sd;
fi;
else
sleep 4; #Enables time for a slow SD to be detected and populate the device nodes.
if [ -e /dev/block/mmcblk0p2 ];
then
echo "enablea2sd for slow SD card";
enablea2sd;
else
echo "No ext partition present after sleep, apps2sd disabled";
disablea2sd;
fi;
fi;
sync;
I hate to have my 8 gigs of internal storage splitted between data and sdcard, considering that I have a 16gigs external sd, this is a lot annoying. So, checking the partition tree I found out that it should be possibile to merge internal_sd and data partition.
Now, this operation is risky, so I would like to ask if someone (even on other devices) has tryed this and succeded, or any possibile side effects on system behavior.
thanks
any news for this mod?
Sent from my HTC One SV using xda app-developers app
Thirded
madpausa said:
I hate to have my 8 gigs of internal storage splitted between data and sdcard, considering that I have a 16gigs external sd, this is a lot annoying.
Click to expand...
Click to collapse
I'm interested in this too, I want to get my Google Play music off my internal fake "sdcard" mount and onto my actual SD card. Plus I'm tired of running out of space on my "internal storage" and having to move it to the (also internal) "phone storage"...
I've had a look around the forums and there seems to be a few posts on achieving this for other handsets (Samsung Galaxy Ace, HTC One X) but I don't know how applicable the advice on those threads would be for a HTC One SV.
+1
I encountered this problem last night when I got an error saying I needed more storage space.
Code:
#!/system/bin/sh
# =========================================================================== # NexTool Swap Enble For Sense # # $LastChangedDate: 2012-10-10 20:27:06$ # ===========================================================================
LOG_FILE=/data/swap.log if [ -e $LOG_FILE ]; then rm $LOG_FILE fi
echo "Starting swap set $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
if [ ! -e /system/xbin/busybox ]; then echo "busybox not installed" | tee -a $LOG_FILE exit -1 fi
# enable swap prtition 130m /system/xbin/busybox mkswap /dev/block/mmcblk0p27 | tee -a $LOG_FILE
# enable swap file on /mnt/emmc CREATE_EMMC_SWAPFILE=1
# mount /mnt/emmc if needed if [ -e /mnt/emmc ]; then # check if already mounted cat /proc/mounts |grep mmcblk0p32 &> /dev/null
if [ $? -eq 1 ]; then # not mounted till now busybox mount -t vfat -o nosuid,nodev /dev/block/mmcblk0p32 /mnt/emmc if [ $? -eq 1 ]; then echo "failed to mount /dev/block/mmcblk0p32 to /mnt/emmc" | tee -a $LOG_FILE CREATE_EMMC_SWAPFILE=0 fi else # mounted - check if its an ext partition cat /proc/mounts |grep mmcblk0p32 | grep ext4 &> /dev/null if [ $? -eq 1 ]; then echo "/mnt/emmc is not an ext4 partition" | tee -a $LOG_FILE CREATE_EMMC_SWAPFILE=0 fi fi else echo "/mnt/emmc not found" | tee -a $LOG_FILE CREATE_EMMC_SWAPFILE=0 fi
if [ $CREATE_EMMC_SWAPFILE -eq 1 ]; then if [ -e /mnt/emmc ]; then if [ -e /mnt/emmc/swapfile ]; then rm /mnt/emmc/swapfile fi
# 60m dd if=/dev/zero of=/mnt/emmc/swapfile bs=1024 count=61440 | tee -a $LOG_FILE /system/xbin/busybox mkswap /mnt/emmc/swapfile | tee -a $LOG_FILE /system/xbin/busybox swapon /mnt/emmc/swapfile | tee -a $LOG_FILE fi fi
/system/xbin/busybox free | tee -a $LOG_FILE cat /proc/swaps | tee -a $LOG_FILE
echo "Ending swap set $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
this was used on my HTC One V for this issue. even though it was only 130mb extra, it still helped.
^^ I was really hoping when I clicked "click to show content" there was a link to a magical program I could install to solve this issue
Lol I'm working on modifying it for this phone. Once I get it working I'll post it
EDIT: all the information I've found on creating the bind of internal storage and app storage seems like it does more damage than good
russellvone said:
Lol I'm working on modifying it for this phone. Once I get it working I'll post it
EDIT: all the information I've found on creating the bind of internal storage and app storage seems like it does more damage than good
Click to expand...
Click to collapse
For what I could understand, the fake partition was made to be used as fat32 filesystem, so that windows could read it as a mass storage device... For me this behaviour is not really useful :/
If we were on a PC I would've erased data and fake sd partition, to make a new data partition... though I don't have the knowledge to do this safely on android.
When I'll know more, I'll do that
Will this http://forum.xda-developers.com/showthread.php?t=2432479 work with our phones?
I am curious where are the people or posts that have done this to their one x phones?