[TUT + ROM] Using s-off to Maximize ROM Efficiency - Desire Android Development

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is a picture of the memory layout of a regular HTC Desire running an RCMIxHD derivative (SupeROM) with the speed and responsiveness of a Desire HD.​
Premise:
1. Performance degradation with HD roms (and regular ones as well) occur when essential parts of the device's operation are from the sd card, instead of working as much as possible from the internal memory.
2. Deodexed roms render a substantial part of the /system partition into a bloated archive, since no apk or jar file is actually used. Everything is odexed and copied into the dalvik-cache, which leads to -
3. The dalvik-cache of a deodexed rom is much larger than that of an odexed rom. So now we have large portions of the system partition that are not used, and a clogged data partition.
4. So we use a2sd, a2sd+, d2ext or d2we - and essentially, what we get is that almost nothing is being run from the internal memory. What a waste.
This post will be a guide for both devs and advanced users on a process that utilizes s-off'ed devices' ability to change partition layouts in order to maximize the efficiency of the device.
For devs:
0. Require the target device to be s-offed and have an hboot in accordance with the following ideas:
1. Instead of using d2ext, d2we or even a2sd+ - use a regular a2sd script, and move only /data/app to the sd card. This will act as the apk archive of downloaded apps, while the dalvik-cache, from which the apps actually run, will remain on the data partition.
2. Symlink the entire /system/app folder and /system/fonts folder to sd-ext. Symlink everything in /system/framework to sd-ext, except framework-res.apk and possibly framework.jar (for theme modding and rtl fixes, if necessary).
The result - a regular Sense FroYo rom will take only 89mb of the /system partition. RCMixHD will take 180mb - and that is after returning the VR lib folder and some other libs to the /system partition.
In other words - you can use the oxygen hboot for normal Sense FroYo, and the data++ hboot for HD-based roms. All the files will run from the dalvik-cache on the data partition, and all the user data will be there as well.
Fixing market downloads
If you wish to bypass the problem of the small cache partition limiting market downloads, then do the following steps:
1. Use the wonderful dsixda kitchen to unpack your boot.img
2. Edit the init.rc. In the exports section add the following:
Code:
export DOWNLOAD_CACHE /mnt/asec/download
and add the following right under the section titled "# Secure container public mount points":
Code:
# Market downloads
mkdir /mnt/asec/download 0777 root system
mount tmpfs tmpfs /mnt/asec/download mode=0777,gid=1000
This will place all market downloads into a temporary ram disk, which will be deleted upon the completion of the installation.
3. Repack your boot.img and place it in the rom.
You can see an example of an edited init.rc here:
http://wbss.ro/coolexe/Extra/init.rc
Note: The users of your rom will still have to flash radio updates through fastboot.
(Thanks, coolexe and baadnewz, for this idea!)
The result is maximal device responsiveness, as well as battery conservation.
An example for a modified rom (SupeROM) can be downloaded here. This one requires the data++ hboot. baadnewz's newest iNserCoinHD rom also uses it - see here.
The following post is a guide for advanced users on how to achieve the same effect on an already running rom.

For Advanced Users:
Any advanced user can turn his or her currently flashed rom into a faster rom, and gain additional space on the data partition.
Please read everything in the first post so you know what you're about to do.
Prerequisites:
adb on your system, and you know how to use it.
An ext3 or ext4 partition after the fat partition on your sd card (512mb minimum).
Your rom is an a2sd or a2sd+ rom (not d2ext or d2we).
YOU MADE A NAND BACKUP.
1. Reboot into recovery and connect your phone to the computer. Mount system, data and sd-ext. Use adb to move files from /system to /sd-ext:
Code:
adb shell
mkdir /sd-ext/system
mkdir /sd-ext/system/app
mkdir /sd-ext/system/framework
mkdir /sd-ext/system/fonts
mv /system/app/* /sd-ext/system/app/
mv /system/framework/* /sd-ext/system/framework/
mv /system/fonts/* /sd-ext/system/fonts/
2. Now we have to symlink all the files we moved. This was a trial and error process for me, since I am not a programmer. But it works.
First of all, we create files that list all the names of the files we moved:
Code:
ls /sd-ext/system/app > /tmp/sysapp
ls /sd-ext/system/framework > /tmp/sysframe
ls /sd-ext/system/fonts > /tmp/fonts
Now we check how files are already symlinked to the ext partition in our rom (so we know how to symlink ours):
Code:
ls -all /data
This will show you the symbolic links. In my case, for instance, they were pointing at /system/sd, which is common.
Now we use arrays to create all the symlinks we need. Replace /system/sd if necessary:
Code:
c=0; while read line; do array[c]=`ln -s /system/sd/system/app/"$line" /system/app/`; let c=$c+1; done < /tmp/sysapp
c=0; while read line; do array[c]=`ln -s /system/sd/system/framework/"$line" /system/framework/`; let c=$c+1; done < /tmp/sysframe
c=0; while read line; do array[c]=`ln -s /system/sd/system/fonts/"$line" /system/fonts/`; let c=$c+1; done < /tmp/fonts
This will give you a nice output of errors, but will get the job done. Just to make sure, run these commands:
Code:
ls -all /system/app
ls -all /system/framework
ls -all /system/fonts
If all is well, you just viewed your newly created symlinks.
You can run the command
Code:
df
in order to see your new memory usage.
Now you can reboot your device. If all went well, you will notice absolutely no difference from before. If this is the case, make a second nand backup (without deleting the first one).
3. So now we have a nand backup of our rearranged rom. It is time to go to http://alpharev.nl, if you have not done so already, and follow the instructions there in order to s-off your device. If you are modifying a regular Sense rom (or anything without Sense) then choose to flash the oxygen hboot. For HD roms, choose the data++ hboot.
4. Restore your second nand backup.
5. If you used a2sd+, you need to move the dalvik-cache back to your internal memory, on the /data partition (that has plenty of space for it now).
If your a2sd is darktremor's script, you can simply enter
Code:
adb shell a2sd nocache
while your device is running (NOT in recovery) and reboot.
If you have a different a2sd script, you need to reboot to the recovery, and use adb to find out where it is:
Code:
adb shell mount /system
adb shell ls /system/etc/init.d
This will show you what's the name of your script. Mine was the usual 40a2sd.
Pull this file from your device:
Code:
adb pull /system/etc/init.d/40a2sd
Open the file in a text editor, search for every occurrence of "dalvik-cache" and "app-private" and delete them, without harming the command's syntax. Save the file (don't forget to back it up as well), push it back to the device and restore its owner and permissions:
Code:
adb push 40a2sd /system/etc/init.d
adb shell chown root:shell /system/etc/init.d/40a2sd
adb shell chmod 755 /system/etc/init.d/40a2sd
Now all we have to do is to move the actual dalvik-cache and app-private.
Code:
adb shell mount /data
adb shell mount /sd-ext
adb shell rm /data/dalvik-cache
adb shell mv /sd-ext/dalvik-cache /data/
adb shell rm /data/app-private
adb shell mv /sd-ext/app-private /data/
That's it. Reboot, and you'll notice an increase in performance, as well as in storage space on the data partition.
Remember: from now on you cannot flash new themes with the usual recovery zips (unless you opted to leave the file framework-res.apk inside the original /system/framework folder). You have to push the files through adb.
Also, if you use the data++ layout, you have to use fastboot to flash new radios, and you may have trouble installing very large apps.
There is a way to enable the installation of large apps from the market, but this is for EXTREMELY advanced users, so I will not even go into details. Simply follow the section "Fixing market downloads" in the first post and flash your new boot.img using fastboot flash boot boot.img.

very nice tut

ClassicalDude said:
...
Now all we have to do is to move the actual dalvik-cache and app-private.
Code:
adb shell rm /data/dalvik-cache
adb shell mv /sd-ext/dalvik-cache /data/
adb shell rm /data/app-private
adb shell mv /sd-ext/app-private /data/
That's it. Reboot, and you'll notice an increase in performance, as well as in storage space on the data partition.
Click to expand...
Click to collapse
Everything went well for me on Cool Z v8 A2SD, thanks a lot!
Only one thing: you should edit the 2nd post just before the section I'm quoting, adding "adb shell mount /data" and "adb shell mount /sd-ext" before trying to move dalvik back to NAND, otherwise it won't work

Amazing.... just when you think thought of it all... a new bright idea pops up
Nicely done mate

nice idea, if i understand this correctly this looks like something that could help with sd speeds.
because currently even a fast sd card with a2sd/data2sd/data2ext chokes when /sd-ext/dalvik is read and /sdcard being written to.
is that about right ?

@grooltor - thanks. I fixed it. I have a few more additions that will be incorporated soon, such as coolexe's idea to increase the cache partition.
@nerdo - thanks. Like all good ideas, it came in the shower.
@ciukacz - that's the idea, and it is working indeed. You can check out the rom I posted, or the newest iNsertCoin rom, which is based on this method. Every rom, including HD and Z roms, runs smoothly this way.

Anyone tested this guide on Leedroid 2.3d? I'd do it, but i am currently overwhelmed by my final exams...

Bobuscho said:
Anyone tested this guide on Leedroid 2.3d? I'd do it, but i am currently overwhelmed by my final exams...
Click to expand...
Click to collapse
Worked perfectly on modaco r10. See no reason why it should not work on LeeDroid.

so this is basically a way of trimming up /system by relocating it and symlinking so you can reallocate the space using an alpharev table / Custom mtd layout?
Suppose for sense roms, that makes sense (forgive the pun). Cool

@ClassicalDude: thanks for the reply, i will definitely try that and post back.
however i am fairly new to all things android and need to read up before i try.

Will try that on Al-Maisan ROM (Arabic version of Starburst) tomorrow and see how it will go.

I have a problem with Titanium backup... wan't have a download a busybox.

mexxxico said:
I have a problem with Titanium backup... wan't have a download a busybox.
Click to expand...
Click to collapse
I did not encounter this problem, so I cannot help. Like it is said in the beginning of this thread - this process is for very advanced users, who know what they are doing, and who can google their way to a solution to such problems, or figure it out themselves. I will help as much as I can, but I will not do the research for you.

Thanks to baadnewz and coolexe, I added a section called "Fixing market downloads" to the first post. It's a very elegant way of placing market downloads into a temporary ram disk, which self-deletes after the app is installed.

ok,tnx. I'll tray to find a solution
swyped from my HTC Desire using XDA Premium App

wollyka said:
Will try that on Al-Maisan ROM (Arabic version of Starburst) tomorrow and see how it will go.
Click to expand...
Click to collapse
Just to report it works on Al-Maisan. (with modified boot.img for market fix too)
Thanks for the tut

I've just tried this guide on Leedroid 2.3d, here's my experience:
After sticking closely to the Guide in the 2nd post, i am getting LOADS of FCs as i boot up the device. Sense crashes, the IME crashes...everything fcs immediately.
I analysed everything but i've entered the correct commands...
So maybe the integrated A2SD script is the problem? I've cleaned it from all content saying "app-private" and "dalvik cache", as advised in the 2nd post.
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
# Adapted by Teknologist
#Removed this as there is no /etc/sysctl.conf as of now in MCR
/system/bin/strt
# execute any postinstall script then kill it
if [ -e /dev/block/mmcblk0p2 ];
then
# 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;
# 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 /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps from internal memory to sdcard
for i in app;
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;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# 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
setprop cm.a2sd.active 1;
echo "+++ Apps-to-SD successfully enabled";
else
# replace symlinks with directories so we can boot without sd
for i in app;
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;
setprop cm.a2sd.active 0;
fi;
sync;

Your a2sd script is fine. Probably some other small thing you did not notice.

how much internal memory would I have on cool z v8 after applying all those steps?

Related

something up with my shell scripts.

I seem to be frequently flashing or messing up my G1 so I decided to write some shell scripts to help out but they seem to only half work if at all. Actually I'm not sure what they did because they displayed no output.
This script is supposed to backup the default init.rc and mountd.conf files then replace the existing ones with the modified ones.
Though it does not work.
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkdir /system/sd
busybox cp -a /system/etc/mountd.conf /sdcard/recovery/mountd.conf.bak
busybox cp -a /system/init.rc /sdcard/recovery/init.rc.bak
busybox cp -a /sdcard/recovery/mountd.conf /system/etc/mountd.conf
busybox cp -a /sdcard/recovery/init.rc /system/init.rc
then this is the next set to move the apks and the program caches which doesn't work.
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
busybox cp -a /data/app /system/sd
rm -r /data/app
ln -s /system/sd/app /data/app
busybox cp -a /data/app-private /system/sd/app-private
rm -r /data/app-private
ln -s /system/sd/app-private /data/app-private
rm -R /data/data/com.android.browser/cache/webviewCache
ln -s /sdcard/cache/webviewCache /data/data/com.android.browser/cache/webviewCache
rm -R /data/data/com.android.vending/cache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
rm -R /data/data/com.google.android.street/cache
ln -s /sdcard/cache/streetCache /data/data/com.google.android.street/cache
reboot
Plus both run and output no errors either. Who knows what problems I'll run into because I have no idea what they actually did.
Anyone see anything wrong here?
Well I'll help you.
1-) After you back up the mount and stuff and put the other back, you MUST reboot before keep going.
2-)After boot then you can copy the files or make the symlink. I suggest you dont copy the app to the sdcard on teh scrip since they should be there already. so do that manually once then the script just delete the folders and then crate the symlinmks.
I have a menu that does that and I have got some experience as why it works one day and not the other.
Rafase282 said:
Well I'll help you.
1-) After you back up the mount and stuff and put the other back, you MUST reboot before keep going.
Click to expand...
Click to collapse
I took the reboot out after the mountd.conf and init.rc did not appear to copy due to the lack of /dev/mmcblk0p2 hoping to see some sort of output why it did not run. Unfortunately it runs and backs up the files but does not replace them with the modded ones.
Rafase282 said:
2-)After boot then you can copy the files or make the symlink. I suggest you dont copy the app to the sdcard on teh scrip since they should be there already. so do that manually once then the script just delete the folders and then crate the symlinmks.
Click to expand...
Click to collapse
Not copying the apps is a good idea, modified the script to not do so.
Rafase282 said:
I have a menu that does that and I have got some experience as why it works one day and not the other.
Click to expand...
Click to collapse
Does Android require that you do a chmod on all shell scripts first?
On Debian I usually just use sudo sh ./ and it runs the script w/o changing anything on the file permissions so I figured Android would be similar if I just ran them as root. Still I see a lot of people requiring a chmod 777 on any guide referring to running shell scripts.
I will try that and report back with my findings. Thanks for replying.
Does Android require that you do a chmod on all shell scripts first? I just have to type m oon anywhere in the androud shell and my scripts run, for that i put it on /system/bin and do a chmod 4755 to the file. it is still needed to type su before you run the script.
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mkdir /system/sd
cp /sdcard/media/Data/mountd.conf /system/etc/mountd.conf
cp /sdcard/media/Data/init.rc /system/init.rc
Thats my code for copying the modified files to the right place. So maybe you should try that.
Oh for androoid you dont unless you put it on /system/bin then you will have to use sude and sometiems it still wont run due to lack or permisions so is better to do a chmod 4755
Well I made the changes suggested and did a chmod on all the files prior to running but with no luck.
The odd thing is if I use the shell scripts as a guide list it works perfectly but if I try to launch them as a shell script all sorts of strange undesirable things happen to my phone.
The time consumed trying to use the scripts and recover from what happens from what they do out weight the effects of typing everything in.
joshtheitguy said:
Well I made the changes suggested and did a chmod on all the files prior to running but with no luck.
The odd thing is if I use the shell scripts as a guide list it works perfectly but if I try to launch them as a shell script all sorts of strange undesirable things happen to my phone.
The time consumed trying to use the scripts and recover from what happens from what they do out weight the effects of typing everything in.
Click to expand...
Click to collapse
you can only run the script once .. when the "ln -s" has already been done it has to be undone before trying to run the script again .. otherwise you would be copying the files onto themselves .. not sure if you've tried running it more than once
LucidREM said:
you can only run the script once .. when the "ln -s" has already been done it has to be undone before trying to run the script again .. otherwise you would be copying the files onto themselves .. not sure if you've tried running it more than once
Click to expand...
Click to collapse
These scripts were intended for my usage after a system restore from a update.zip file which wipes /system in the process.
My intentions were to:
1. remount the fs rw
2. copy the original init and mountd files to the sd then copy the modified to their respective places in the system folders then reboot
3. reboot then create the sym links appropriately then move my caches too
Well unfortunately the only thing that works is the backing up of the original init and mountd files.
joshtheitguy said:
These scripts were intended for my usage after a system restore from a update.zip file which wipes /system in the process.
My intentions were to:
1. remount the fs rw
2. copy the original init and mountd files to the sd then copy the modified to their respective places in the system folders then reboot
3. reboot then create the sym links appropriately then move my caches too
Well unfortunately the only thing that works is the backing up of the original init and mountd files.
Click to expand...
Click to collapse
yes .. but you can't create the sym links when they already exist .. running the update.zip only wipes the /system .. not /data .. if the links were there before the update.zip they will be there after

[HACK][ROM][BOOT.IMG][CACHE]-Stk SPL ROMs with Danger SPL size & extra 30mb! any SPL!

[HACK][ROM][BOOT.IMG][CACHE]-Stk SPL ROMs with Danger SPL size & extra 30mb! any SPL!
###########################
EDIT: 2010-06-24
This is totally out of date now
new easier and much better way of doing things can be found here
http://forum.xda-developers.com/showthread.php?t=704560
###########################
Hi All,
Just wanted to 'get out' what I have been working on the last couple of days, and give back to the community.
Introduction
This is an intro of my Cache 'Hack'
it was inspired by Speedysilwady's thread [HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
What follows should be considered BETA or even ALPHA.
I don't belive there is any risk of permanent damage to your phone, worst that will happen is a bootloop.
However, any ROM or Hack carries a risk, there could be something I have missed which will destroy your phone after 2 days.
I can't think what that would be, maybe I missed it
So... If your wife is due to go into labour anytime soon, or you need your phone for work/alarm to get up for work.
Don't do it.
Not my fault if it messes up your phone or life..
OK, disclaimer over with...
The Primary goal was to give the guys with 'Stock'SPLs ROMs which normally require 'DangerSPL'
The DangerSPL basically chops /cache down a bit and shares it between /system and /data,
but this is operating on the phones firmware at a lower level, and is risky so people are reluctent to do it.
I have a solution, and as a bounus the 'DangerSPL' guys get an extra 30mb on /system.
The Idea is very simple, utilise the space available on /cache
Below I detail a way of using *all* of /cache in a ROM, without risking a 'brick' ( softbricks excluded )
So, how do we do it?
Well, intially ( in recovery ) I was just moving directories from /system into /cache and symlinking them
This didn't work all that well because of the way the init.rc mounts cache
Code:
mount yaffs2 [email protected] /cache [b]nosuid nodev[/b]
chown system cache /cache
chmod 0770 /cache
nosuid nodev, resrticts what it can be used for
so,,
Code:
mount yaffs2 [email protected] /cache
mount yaffs2 [email protected] /cache ro remount
got around that, basically I mount /cache in the same way as system
Next problem,
I found out what cache is used for
The Market uses cache to save 'incoming' apks, you could say it uses /cache as a cache, lol..
maybe other things use it, I didn't look to hard.
anyway, this is what we do to solve that
Code:
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected]ystem /system
mount yaffs2 [email protected] /system ro remount
# Firerat 2010-03-22 - Mount Cache in the same way as system
# Firerat 2010-03-24 - Market uses /cache, if its full it fails, so...
# Firerat 2010-03-24 - mount mtdblock4 on /system, and bind mount to cache in userland script
# Firerat 2010-03-24 - /system/bin/data-cache.sh
mount yaffs2 /dev/block/mtdblock4 /system/csys
chmod 0770 /system/csys/lost+found
mount yaffs2 /dev/block/mtdblock4 /system/csys ro remount
and here is the userland script ( be sure to get init.rc to execute it )
Code:
#!/system/bin/sh
# bind mount /data/cache to /cache - Firerat 2010-03-24
# check /data/cache exists, if not create
if [ ! -d /data/cache ];
then
mkdir /data/cache
fi
# check cache is not already mounted
if [ "`mount |grep -q \/cache;echo $?`" = "0" ];
then
echo "/cache is already mounted.. exiting"
exit 1;
else
busybox mount -o bind /data/cache /cache
fi
hmm, I should check permisions on that, could have sworn I had a chmod in it
I could of course do this in the init.rc, but this offers greater flexibility
for instance we could check for ext partition and use that.
ref
(cyanogen) Thanks Cy! & ccyrowski
in the a2sd script which does this with Dalvik-cache
Oh, nearly forgot, since /system/csys is now the new /cache you have to fix your symlinks
Da Dar!, it boots and you can download from the Market ( as long as you have space on data )
Above via a 'ROM flash'
OK, so it's all well and good moving stuff around in recovery,but how do we do this with a 'ROM' flash?
because I can't flash a Requires DangerSPL I can't move things in recovery Grrrr..
Within the ROM package I created a new Directory, cache with sub directory system
i.e. cache/system
and moved things into it, stuff like system/media system/bin system/xbin
upto a Max of 28mb ( ish ) see Partiton table below
I'm linux , so I use a script to quickly show me the sizes
Code:
for i in `find $1 -maxdepth 1 -type d|sed -e :a -e '$!N; s/\n/ /; ta'`
do
du -hs $i
done
then in the update-script
Code:
format CACHE:
copy_dir PACKAGE:cache CACHE:
show_progress 0.2 0
symlink csys/system/bin SYSTEM:bin
symlink csys/system/etc SYSTEM:etc
symlink csys/system/media SYSTEM:media
symlink csys/system/usr SYSTEM:usr
symlink csys/system/xbin SYSTEM:xbin
symlink csys/system/fonts SYSTEM:fonts
symlink toolbox CACHE:system/bin/start
symlink toolbox CACHE:system/bin/getevent
< snip >
symlink toolbox CACHE:system/bin/renice
symlink toolbox CACHE:system/bin/setconsole
symlink /system/csys/system/xbin/busybox CACHE:system/bin/sh
symlink busybox CACHE:system/xbin/zcip
symlink busybox CACHE:system/xbin/zcat
symlink busybox CACHE:sys< snip >
set_perm_recursive 0 0 0755 0644 SYSTEM:
set_perm_recursive 0 0 0755 0644 CACHE:system
set_perm_recursive 0 2000 0755 0755 CACHE:system/bin
set_perm 0 3003 02755 CACHE:system/bin/netcfg
set_perm 0 3004 02755 CACHE:system< snip >
symlink /system/csys/system/bin SYSTEM:bin
is probably easier to 'see'
Zip it up and sign
and well, thats it really...
flash it, find it won't boot, go to recovery , fix it, boot it , fix package, zip, sign, flash it..
Eventually it boots
Partition Tables
I have to admit , I have DangerSPL, and I'm reluctant to revert to stock
Speedysilwady of the thread which inspired me
[HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
has given me some sizes
Code:
/system: 67.5M
/data: 74.7M
/cache: 67.5M
and here are the totals for mine, DangerSPL'd
Code:
/system: 90M
/data: 89.7M
/system/csys: 30M
Further movement
hmm, we have lots of space in cache on a 'none danger spl' and we probably have some room on /system on a 'dangerSPL'
we can move things on firstboot, keeping the 'ROM' compatible with both 'Danger' and 'NonDanger' SPLs
here is an extended version of the mount cache I hastily put together for King's Eris Port
DangerSPL , the 'framework' gets moved to the system partition
NoDanger the 'framework' gets moved to the 'cache' partition
Code:
###################
# What follows is specific to King Eris Port 1.x.x
# mind you the logic will work in any rom
###################
if [ -d /system/system-framework ] || [ ! -L /system/framework ];
then
exit 0;
fi
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`
if [ -d /data/system-framework ] && [ ! -L /data/system-framework ];
then
CsysFree_K=`$DF_CMD|$GREP_CMD \/csys\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
SysFree_K=`$DF_CMD|$GREP_CMD \/system\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
SysFramework_K=`$DU_CMD /data/system-framework/|$CUT_CMD -f1`
if [ $SysFramework_K -gt "1024" ] && [ $CsysFree_K -gt $SysFramework_K ];
then
$MOUNT_CMD -o rw,remount /system
$MOUNT_CMD -o rw,remount /system/csys
$CP_CMD -a /data/system-framework/ /system/csys/system-framework
# being very lazy here, I should look before I leap
$RM_CMD /system/framework
$LN_CMD -s /system/csys/system-framework /system/framework
$SYNC_CMD
$MOUNT_CMD -o ro,remount /system
$MOUNT_CMD -o ro,remount /system/csys
$RM_CMD -rf /data/system-framework
exit 0;
elif [ $SysFramework_K -gt "1024" ] && [ $SysFree_K -gt $SysFramework_K ];
then
$MOUNT_CMD -o rw,remount /system
$CP_CMD -a /data/system-framework/ /system/system-framework
# being very lazy here, I should look before I leap
$RM_CMD /system/framework
$LN_CMD -s /system/system-framework /system/framework
$SYNC_CMD
$MOUNT_CMD -o ro,remount /system
$RM_CMD -rf /data/system-framework
exit 0;
else
exit 0
fi
fi
I actally use this same free space checking logic in my modified a2sd when it comes to moving dalvik-cache
I try to keep dalvik-cache on Data, I hope to expand this to both system and user apps.
and with unionfs ( or aufs ) maybe set up something to handle priority apps on internal memory
Backups
Currently the Recovery Backups ignore /cache, so after a restore it aint going to boot.
Speedysilwady did say Bart worked for him, not tried it myself
a while back I had a look at the nandroid-mobile.sh in Amon's RA-1.5.2
I think I did see that cache was an option
anyway, I don't think it would take much to 'turn it on'
Edit : 2010-04-16
[UTIL] BART-1.2.0 Backup and Restore Tool
Now has cache backup!
not sure if its packed in a recovery.img yet
Coming soon
Example ROMs
CaNNon's Complete Eclair 1.2
King's Eris Port 1.1.2 - ( Warez removed - afaik its just the QuickOffice )
Pre Flash Patch
I have played with this before, you can see how I do it in Speedysilwady's thread
[HOW-TO] Flash *MOST* ROMs on Stock/Any SPL
so , my idea is the update script just formats /system and /cache and sets up symlinks from system to cache
making sure we have everything mounted ( mount -a ) we flash the ROM
we then flash a second Patch which re-creates the links, and flashes the boot.img along with supporting scripts.
I'm even toying with the idea of Pathcing a pre-installed system ( to get the extra 30mb )
Not tried this yet, but I think something like this will work
Code:
copy_dir SYSTEM:bin CACHE:/system/bin
delete SYSTEM:bin
symlink csys/system/bin SYSTEM:bin
copy_dir PACKAGE:cache CACHE:
symlink < all them links >
format BOOT:
write_raw_image PACKAGE:boot.img BOOT:
So, Enjoy
and I'll post the ROMs I modded a little later, I shoud check a few things first
Firerat
Cache Hack Modded ROMS ( demo )
As Promised a couple of Modded ROMs to showcase my 'Hack'
Please note the disclaimer in the OP under introduction
Full Credit for these ROMs goes to the Original DEVs , namely CaNNon202 and King
First up we have CaNNoN's Complete Eclair
original link CaNNoN202 Complete Eclair [v1.2]
as I'm sure many of you will know this was the ROM I made the 3D YouTube Patch for,
This is that ROM , Repackaged in Full
i.e. 3D Kernel, HQ Youtube/ mp4 along with the fixes for the WiFi FC and Facebook contact sync.
This should work fine as a *no wipe* update to a current CE12
if you have problems then do a wipe
Change log
system apps now on system
Gallery3D
New Camera.apk
The Camera.apk removes duplicate Gallery Icon in the Tray, and I have disabled video recording, since it didn't work anyway and most of the time cause freeze and FC )
new (rw/ro)system scripts
they know about the new cache thing
data-cache.sh
bind mount cache, runs on boot
modified a2sd
MT3G friendly, will skip apps to SD and setup swap automagically
additionally will keep Dalvik-cache on data if space available* keeping apps fast
oem-reset script
I neglected to mention, data wipe in recovery will kill the ROM (it wipes cache) , so I made a script to clear personal data
* if you get space low messages, try a cache cleaner from the Market
if you still have problems delete apps you don't need
still not enough space? either reboot phone, or run a2sd from terminal
but a Reboot / a2sd run will move cache to SD if available
Guys, I have left Launcher2 in this, but I really wouldn't recommend using it with 3D
################################
### Download ### since CE2.0 is now CacheHack AnySPL link has been removed
################################
MD5SUM = 97dfb9756bb553cf3cb42519483da3cc
################################
NOTE this is *not* CE 2.0
Second up Yet another King's Eris Port Mod
original link King's Eris2G1 v1.1.2
Change Log
2010-03-28 12:40 gmt - bug fix
fixed the issue with the framework not being moved on NoneDangerSPL
no more space warning, and Market works
system apps now on system
new (rw/ro)system scripts
they know about the new cache thing
data-cache.sh
bind mount cache, runs on boot, additonally moves system framework when 'SPL Known'
modified a2sd
MT3G friendly, will skip apps to SD and setup swap automagically
additionally will keep Dalvik-cache on data if space available* keeping apps fast
QuickOffice removed (Warez)
( FAO Mods, I hope I'm right in thinking that QO was the only Warez )
* if you get space low messages, try a cache cleaner from the Market
if you still have problems delete apps you don't need
still not enough space? either reboot phone, or run a2sd from terminal
but a Reboot / a2sd run will move cache to SD if available
tbh I haven't tested this as a no wipe,
Data is 66MB so you might get away with it if you are on DangerSPL
################################
### Download ###FR-KingErisP-112-CacheHack_S.zip
################################
MD5SUM = 735cde1f21e14b91ad20d65a7009c569
################################
Its probably going to get all confusing with two ROMs in one thread
These are intended as examples of what can be done with cache
we know that things like footprints don't work so try to keep on topic with posts
i.e. relating to the using cache for system files
if it does get too confusing I will perhaps give each its own thread.
but again, on topic would be nice
Cheers
Very Quick install instructions ( Danger Only, sorry NoneDanger, manual patching further down post )
First install Vega's Legend 0.9.0, boot that, then flash the You Tube Fixes, boot that
Then Flash
FR-VegaLegend091-CH_S.zip
You can try flashing all three at once, but for some reason you don't get a mobile data connection, no idea why.
As well as being CacheHack the above includes Loccy's KB Lights
http://forum.xda-developers.com/showthread.php?t=661343
be sure to drop by and thank them all
They are also working on a better solution, I believe the final solution will be within the system framework
But for now a while loop script will do
Edit : [UTIL] BART-1.2.0 Backup and Restore Tool
Now has cache backup!
Patching a fresh Vega Legend 0.9.1 DangerSPL
Fresh flash of Vega's Legend 0.9.0 with the 0.9.1 fixes over the top
Code:
Filesystem Size Used Available Use% Mounted o
n
/dev/block/mtdblock3 90.0M 89.5M 560.0K 99% /system
/dev/block/mtdblock5 89.8M 48.4M 41.4M 54% /data
/dev/block/mtdblock4 30.0M 1.2M 28.8M 4% /cache
Click to expand...
Click to collapse
a quick size up tool
Code:
[quote]
adb push Patch/cache/system/bin/qdu.sh /sbin/
[/quote]
Code:
chmod 755 /sbin/qdu.sh
its setup with a sha bang for an android ROM, to get it to work in recovery
Code:
sed s~system/~s~ /sbin/qdu.sh -i
now qd<tab><enter>
will show you the size of the directories of the directory your in
or
qd<tab>/syst<tab>
will show you the size of everything in /system
in an other term on your PC
Code:
[quote]adb shell watch "busybox df -h"[/quote]
will let you keep an eye on the space being used and avalilabe to you
ok, so lets begin
mount everything
Code:
mount -a
first we need to create a mount point for mtdblock4
Code:
mkdir /system/csys
and then we need to bind mount /cache to it
Code:
busybox mount -o bind /cache /system/csys
ok, lets start moving stuff
Code:
/ # qdu.sh /system/
86.3M /system/
89.5K /system/csys
1.3M /system/xbin
2.1M /system/usr
1.0K /system/sd
2.8M /system/media
[COLOR="Red"]44.4M /system/lib [/COLOR]
19.6M /system/framework
5.3M /system/fonts
2.6M /system/etc
2.8M /system/customize
5.3M /system/bin
2.0K /system/lost+found
Click to expand...
Click to collapse
lib is too big for DangerSPL
lets just move some of the other stuff and see what happens
Code:
cd /system/
mkdir csys/system
for i in usr/ xbin/ media/ fonts/ etc/ customize/ bin/;do
mv $i csys/system/
done
Code:
Filesystem Size Used Available Use% Mounted on
/dev/block/mtdblock3 90.0M 65.7M 24.3M 73% /system
/dev/block/mtdblock5 89.8M 48.4M 41.4M 54% /data
/dev/block/mtdblock4 30.0M 24.9M 5.1M 83% /system/csys
Click to expand...
Click to collapse
were still short of space on system
Code:
qdu.sh /data/
46.9M /data/
46.0M /data/app_s
954.0K /data/app
Click to expand...
Click to collapse
Code:
mv framework/ /data/
lets stick a few apps on /system/csys
after using
ls /data/app_s/ -Slh
I'm going to pick these
Code:
mv /data/app_s/Phone.apk csys/system/app/
mv /data/app_s/Mail.apk csys/system/app/
then move the system apps to system
Code:
mv /data/app_s/ app
and now, before we forget create links
Code:
ln -s csys/system/* .
cd app/
ln -s ../csys/system/app/* .
cd ../
ln -s /data/framework .[code]
now get the boot.img onto the phone and use
Code:
flash_image boot /sdcard/boot-cachehack.img
don't forget the kernel modules
Reboot, and you done.......
Patching Vega Legend 0.9.1 NoneDanger SPL
you guys have a harder and at the same time easier task in getting a sense ROM onto your phone, essentially you have more space available, but you can't flash direct.
you going to need to unzip the ROM on your PC , and have a look at the sizes
Decide what you need to put on cache, and make links
see lib and framework in the DangerSPL Walkthrough?
44.4M /system/lib
19.6M /system/framework
1.3M /system/xbin
65.3 mb right there
so in recovery
Code:
mount /system
rm -r /system/*
mkdir /system/sd
mount -a
mkdir /system/csys
mount -o bind /cache /system/csys
for i in lib framework xbin ;do
install -d /system/csys/system/$i
done
ln -s /system/csys/system/* /system/
now, on your PC zip up the ROM, don't sign it
get it onto your sdcard
Code:
unzip /sdcard/rezippedROM.zip system data -d /
that will unzip everything beginning with system and data to the / directory
when lib, framework xbin hit the links we made, they will end up on cache
links, a messy business
but I have a script for that
Code:
unzip /sdcard/rezippedROM.zip META-INF -d /data/
now, attachced is NoneDangerDIY-linksandperms.txt
( Edot 2010-04-19 Fixed the script so it works in recovery )
get that onto your sdcard and
Code:
sh /sdcard/NoneDangerDIY-linksandperms.txt
( Tip sh /sd<tab>/None<tab> )
this will translate the ROM's update-script links and permissions into unix commands, it spits them to screen and should save them in memory
do
Code:
cat /dev/install.sh
to make sure its there
then
Code:
sh /dev/install.sh
Ok, next is kernel Modules
the zip above ( FR-VegaLegend091-CH_S.zip ) contains the directories
sdcard/kernels/
and in that are 3D and RamHack kernels
choose one and
cp -a /sdcard/kernels/<kernel>/system to /system/
flash_image boot /sdcard//kernels/<kernel>/boot.img
other files, in cache/system/bin are
a2sd
rwsystem
rosystem
data-cache.sh
qdu.sh
Do not install a2sd, its modified to patch Danger, it might do strange things, I didn't think about NoneDanger when I was doing it
copy the others to /system/bin/
an then
Code:
chmod 755 /system/bin/*system
Last thing, system app_s
Code:
df
du /data/app_s
hopefully the du for app_s is less than the df of /system
if so
Code:
mv /data/app_ /system/app
if not, then use the same trick as I did for DangerSPL , and link an app from /system/csys/system/app to /system/app/
I think you will be ok though
Oh, nearly forgot , in cache/system of the zip is a file called patch
cp that to /system/
its Loccy's KB lights
yeay , woo hoo, were done
Code:
reboot
Hope that this is useful,
I know its still awkward for NoneDanger, soon I will try to make it a doddle for a dev zip up a ROM which is truly ready for AnySPL, and maybe optimise for mt3g
Coming sometime in the future..
I will do some more work on NoneDanger Sense I'm hoping to do a generic Patch to detect which SPL and install optimised for Danger, NoneDanger , and maybe I figure out something that will improve things for MT3G
So im trying to do something a little different. I am trying to transfer my Dalvik-cache from /cache to /system. Is there a way to do it after the rom is installed and functioning?
bubonik said:
So im trying to do something a little different. I am trying to transfer my Dalvik-cache from /cache to /system. Is there a way to do it after the rom is installed and functioning?
Click to expand...
Click to collapse
in a word, no
at the moment a2sd puts dalvik-cache on the SD card partition 2 ( if ext2,3,4)
via a bind mount
if no ext2,3,4 partition it remains on data
the above hack will not affect /data/dalvik-cache or the bind mount
but the partition /dev/block/mtdblock4 ( /cache now /system/csys )
will be 'full'
Anything going into /cache will go into the bind mount instead
in the original post I bind mount to /data/cache
but as I mentioned, we can bind mount any directory to /cache
I didn't look at what else uses cache, as far as I know nothing else does
putting dalvik-cache on /system is going to cause a few problems.
/system is mounted (ro) by init.rc , and tbh it should stay ro unless we really need to do something to the system files, Dalvik-cache needs to be writable
I mentioned my modified a2sd and Dalvik-cache
I commented out this
Code:
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chmod 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
and insterted this
Code:
DalvikCache
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
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
$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
}
oh, in the 'header' I have things like
MKDIR_CMD="busybox mkdir"
DF_CMD="toolbox df"
you can see that while we have space I keep the dalvik-cache bytecode on the fast internal memory, unless space is limited, in which case bind mount to sd partition2 as per Cyanogen's original script
if we get space back, move dalvik-cache back
Thats my bad, I should have been more specific. I have a G1 and I dont use a2sd. Currently sd 1.10.2 uses /cache/dalvik-cache, but with 1.33.2005 that leaves only 3500 kb available for downloading apps. A huge problem.
So im trying to dump it somewhere else, the /data partition would be fine since I only have about 15 apps. I tried doing a symlink to /data/dalvik-cache after it was functioning but got boot loops. Which is why im here.
Just wondering when the ErisPort rom will be available, also could you try this with the Legend Port
M..N said:
Just wondering when the ErisPort rom will be available, also could you try this with the Legend Port
Click to expand...
Click to collapse
soon, I'm uploading now
and yes, you can use it with any rom
I had a quick look at Vega's Legend port,
Bold should be linked to system
Code:
29M ./cache
65M ./system
53M ./data
data/:
app app_s fix_permissions.sh [B]fonts[/B]
system/:
bin build.prop csys etc fonts lib sd usr xbin
cache/system/:
[B]customize framework media[/b]
all apps are going to go to sd here,
but around 30mb worth can be put back, to either /system or /system/csys
after boot, when we know how much space we have and where
so around 18mb on SD
leaving plenty of space for Dalvik-Cache
should be fast, no matter what SPL you have
Links to Modded ROMs added in second post
bubonik said:
Thats my bad, I should have been more specific. I have a G1 and I dont use a2sd. Currently sd 1.10.2 uses /cache/dalvik-cache, but with 1.33.2005 that leaves only 3500 kb available for downloading apps. A huge problem.
So im trying to dump it somewhere else, the /data partition would be fine since I only have about 15 apps. I tried doing a symlink to /data/dalvik-cache after it was functioning but got boot loops. Which is why im here.
Click to expand...
Click to collapse
ahh, sorry I nearly missed your follow up post
I wasn't aware that Dalvik-cache ever ended up on /cache, which tbh that has always confused me a little
if you look at Cyanogen's a2sd , he does mention in the comments that a bind mount is used so the system will still boot, even when no SD card ( since you don't have a dead link )
so I think the solution to your problem is to bind mount something to /cache/dalvik-cache
you should do this early in the boot process, else it will just get filled up
for instance a2sd is executed by init.rc , so it happens before the Android system kicks in, it doesn't matter if it fails to bind mount as you still have the directory available
Do i just wipe and install the droideris, also has anyone tested it.
M..N said:
Do i just wipe and install the droideris, also has anyone tested it.
Click to expand...
Click to collapse
full wipe is your best bet
as for testing.. lets just say I've flashed it more than a few times
but I am on Danger, would love some feedback from None DangerSPLs
it loads ok. although when im presented with low memory notification. i try downloading an app from the market, but it stays on the start downloading. Do you think you could make a port of the Legend Rom?
It would be nice if Htc, Tmo, google could use this to make larger updates but I doubt they'll bother.
M..N said:
it loads ok. although when im presented with low memory notification. i try downloading an app from the market, but it stays on the start downloading. Do you think you could make a port of the Legend Rom?
Click to expand...
Click to collapse
Maybe my script isn't moving the framework
That's around 30mb
( script is
/system/csys/system/bin/data-cache.sh
If anyone wants to have a look )
I'm not at home right now, but will have a proper look later
In the meantime if you reboot the dalvik cache should get moved to the sdcard
Giving you some space back.
I forgot the hero doesn't have term
so for danger spl ppl, ROMs will now be quicker (system apps), also roms which could not before be done now can?
So the 2 modded roms you posted above should work for us with Stock SPLS and if that is proven true, you have pretty much made any rom flashable on a Stock SPL'd G1. Is that correct? If so, you have just made a lot of people very happy. Great work, although that entire initial post was foreign language to me!
thank you...
I haven't tried this yet, but I am super excited to see this is being worked out. I don't have the danger spl, and I can't wait to see this work with some of the new eclair 2.1 roms. Thanks for your hard work.
hopefully this can make our roms faster with more apps on system.
FatBoyExtraordinaire said:
So the 2 modded roms you posted above should work for us with Stock SPLS and if that is proven true, you have pretty much made any rom flashable on a Stock SPL'd G1. Is that correct? If so, you have just made a lot of people very happy. Great work, although that entire initial post was foreign language to me!
Click to expand...
Click to collapse
yes theoretically any rom should fit any spl but as you can see in the first post,
it takes a lot of work to port a rom to stock using this method, but wow its very well put together and firerat def knows what he's doing with this, i was shocked to be the first to have a 2.1 Eclair Sense on a G1 with Hard/Stock/Engineering SPL thanks to Firerat who implemented the idea very well and lbcoder who suggested the general idea on my thread a while back.
Also Firerat as mentioned earlier, the script to move framework seems to have some kinda kink cuz the low spaace error exists on the eris port. Also google sync is still broken.

Telstra T-Touch Tab aka Huawei S7 root

Hey guys, just got my hands on one of these suckers, it runs 2.1
Can anyone point me in the right direction to get root?
Im also looking for froyo, however dont expect it soon, manufacturer is working on it.
Sent from my S7 using XDA App
I second davidcampbell! We need froyo here
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
S7 Bootloader?
Has anyone figured out how to get into the bootloader for this device?
Havent been able to through any apps \ commands. Just go to a black screen and thats it, and recovery sends you into factory settings for your device
I only know that pressing back key and call\send key when when powering on the device puts it into update mode.
alexisprz said:
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
Click to expand...
Click to collapse
Zomg, nice, thank you alexisprz, it's rooting time
I really wish Android had a better term for rooting, it sounds like I'm either breaking it, or trying to cram my man bits into it some how.
Will this affect my ability to use the manufacturers update to froyo in the future?
UPDATE: z4root worked great, I installed busybox no problemo, very happy forum member here
sir i just bought one telstra touch tab can you plz help me to debrand it and unlock it i also have jtag too
pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
download z4root from market and root
copy 3 files to sd
run App-2-sd.sh
File 1 "App-2-sd.sh"
#!/bin/sh
# untitled.sh
#
#
# Created by Andew Blazely on 5/02/11.
# Copyright 2011 SOFTHOUSE. All rights reserved.
#
# un Hash data if you wish but it will slow the S7 down and cause lots of waiting problems
# pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
# mount the file systems
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
busybox mkdir /system/sd
mount -t ext2 /dev/block/vold/179:2 /system/sd
# archive dirs (easier than copying)
cd /data/
busybox tar -cvf /system/sd/app.tar app
busybox tar -cvf /system/sd/app-private.tar app-private
# busybox tar -cvf /system/sd/data.tar data
busybox tar -cvf /system/sd/dalvik-cache.tar dalvik-cache
# unpack arcives in correct place
cd /system/sd
busybox tar -xvf app.tar
busybox tar -xvf app-private.tar
# busybox tar -xvf data.tar
busybox tar -xvf dalvik-cache.tar
# cleanup
busybox rm *.tar
# copy and set system files
busybox cp /sdcard/install-recovery.sh /system/etc
busybox cp /sdcard/init-sd.sh /system/etc
busybox chmod 755 /system/etc/install-recovery.sh
busybox chmod 755 /system/etc/init-sd.sh
# un Hash whatis needed if you intend NOT to remove SD
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
# binding mount of new file structure
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
# mount -o bind /system/sd/data /data/data
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
reboot
File 2 "init-sd.sh"
#!/system/bin/sh
#
MYLOG=/sdcard/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
# un Hash whatis needed if you intend NOT to remove SD
#echo "$(date) Erasing system files..." >> $MYLOG
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
#echo "$(date) Erased system files..." >> $MYLOG
mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app-private /data/app-private 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't moved /data/data
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't move /data/dalvik-cache
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG
File 3 "install-recovery.sh"
#!/system/bin/sh
#
/system/etc/init-sd.sh&
And BOB's your uncle.. this has worked many times for me give it a try

[Q] Bootloop when trying to odex my ROM

I'm running out of space in /data and I have some space left in /system. So I figured I might try odexing my ROM to get some of that space in /data back.
First, I got zip, zipalign, and dexopt-wrapper from an XDA thread somewhere. I then mkdired a temporary folder in /, pushed the tools to it and chmodded them 755, added the folder to $PATH, and ran this script on the live android system:
Code:
#!/system/bin/sh
set -e
[ -d /odexes ] && rm -r /odexes
mkdir -p /odexes/system/framework /odexes/system/app
dexopt_success=
#for i in $(echo $BOOTCLASSPATH | busybox sed -r -e 's/:/ /g') /system/framework/*.jar /system/app/*.apk
for i in /system/app/*.apk
do
[ -f /odex ] && rm /odex #delete odex from any failed previous run
noext=`echo $i | busybox sed -r -e 's:\...$::'`
if [ ! -f $noext.odex ] && dexopt-wrapper $i /odex $BOOTCLASSPATH
then
dexopt_success="$dexopt_success $i"
busybox mv /odex /odexes/$noext.odex
chmod 644 /odexes/$noext.odex
fi
done
for i in $dexopt_success
do
# remove classes.dex
zip -d $i classes.dex || true
# zipalign the apk
zipalign 4 $i /`basename $i`
rm $i
busybox mv /`basename $i` $i
done
# move odex into place
#busybox mv /odexes/system/framework/* /system/framework/
busybox mv /odexes/system/app/* /system/app/
As you can see from the commented lines in my script, I first tried to odex both /system/framework and /system/app. This did not work - I got into a bootloop, with Dalvik complaining that there were no valid framework files in /system/framework. I thought this was strange, but I didn't think much of it - I'm running a Sense ROM (SVHD) and perhaps they do things that interfere with odexing, I thought. So I restored my nandroid and retried, this time only odexing /system/app. Surprisingly, the same problem occurred. That is, I get into a bootloop. Specifically, the system server segfaults because it can't find a settings provider. Furthermore, even though logcat said 'file /system/app/<any apk>.apk changed, collecting certs', it continued on to say 'app /system/app/<any apk>.apk was deleted, removing data'. This looks to be the same problem as I had with the framework - for some reason, after I odex a file it is no longer recognized as valid.
So, um, what am I doing wrong? My first guess would be that the apks (and also jars) become invalid once I remove classes.dex from them; this file contains the definitions of all executable Java code. But the whole point of odexing is to delete this file so that its contents are read from the precompiled odex file. Thus, it would seem that my real problem is that Dalvik isn't looking at the odex files. But why not - they're right there with the same name as the apks and they're chmodded 644, just like the apks?
Check the lib link in my sig, you can find it usefull. And BTW SVHD cannot be odexed due to not proper modification of the framework which affects the bootclasspath and screws the process. Try another ICS ROM
Thank you for your information! While it was not the answer I was hoping to get, it did inspire me to do something else entirely. Since SVHD does not use the lib partition, I unpacked my boot image and added these lines to init.saga.rc:
Code:
devwait [email protected]
mount ext4 [email protected] /data/dalvik-cache noatime nosuid nodev nodelalloc
Repacked my boot image, flashed it in fastboot, rebooted to recovery and wiped dalvik-cache to reclaim the space from my /data partition, rebooted into Android, and my dalvik-cache is now living in the system_lib partition
So, my problem is solved, in that my dalvik cache is no longer eating up space in /data. I'd still like to know though, just out of curiosity, do you know what exactly is so wrong with the SVHD framework then, and whether it might be repairable? Just asking out of academic interest
Edit: Never mind... my solution failed to work after all, because the system_lib partition is too small to hold all of my dalvik-cache. Some apps failed to launch and when I looked at logcat I saw 'no space left on device' messages while it was running dexopt

Lollipop 5.1.1 won't use the bind mounted folders

Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Miche1asso said:
Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount [color=red]--bind[/color] /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Click to expand...
Click to collapse
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
HypoTurtle said:
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
Click to expand...
Click to collapse
Well, I used "busymox mount" because it automatically detects that being two directories they get mounted as a bind. Or so i supposed. Still i doubled checked, now. Same thing.
Not sure what you mean about redirecting to a .sh. Anyway, I also tried (the old) mounts2sd for testing. Same thing. it's like if something in Android gets hold of /data and its subdirectory and mounting over it doesn't matter. This with zygote dead. It's driving me mad.
Well, I believe it is related to selinux and the mount namespaces. I disabled the option in SuperSU to have individual name spaces and something different did happen: the whole ART crashed, rebooting the phone (not just Android, I think even the kernel restarts).
As they usually say.. let's forget about it. Link2SD doesn't help much either, since it must keep the system dalvik caches (more than 500GB) in the internal memory.

Categories

Resources