moving dalvik-cache to /cache ??? - G1 Android Development

saw this over here...
http://andblogs.net/2009/05/quick-hack-save-tons-of-space/#more-1660
Quick Hack: Save Tons of Space
Posted on May 8th, 2009 in Android Hacking by Disconnect Tagged cupcake, customize, G1 & ADP1, hacking, howto, kernel, space
So I was looking at my phone, and under 1.5 my dalvik cache was 31 megs (!!!). Rather than move apps to SD (I use my sd card for other stuff, and my apps are only 15 megs anyway) I began thinking.. what else could I move? Aha!
Here are the directions for moving dalvik-cache to /cache, which is unused on these images anyway (it is only for OTA updates.)
There is no fancy installer or much support, and there may be bugs (I only just did this today.)
Its pretty easy. And, so far, works well for me This walkthrough isn’t going to be particularly handholding, but if you need more help try the comments.
Just boot up a capable recovery image (such as JF’s) and mount up /cache and /data.
view sourceprint?
1.# cd /cache
2.# mkdir dalvik-cache
3.# chown 1000 dalvik-cache
4.# chgrp 1000 dalvik-cache
5.# chmod 771 dalvik-cache
6.# cd /data
7.# mv dalvik-cache dalvik-cache-orig
8.# ln -s /cache/dalvik-cache dalvik-cache
The other thing you need is a new boot.img. This one is tuned for JF’s 1.5 adp1 image, and it may or may not work with anything else. Boot Image Cache to Cache JF1.5-ADP1 (71)
(All it does is create the /cache/dalvik-cache dir if it is missing and make sure the perms on /cache are 771 instead of 770.)
Tadah! If everything works, you can remove dalvik-cache-orig. If not, just flash the backup (you did take a backup, right?)
Enjoy!
(Big thanks to JF for helping with the boot image since I have no dev tools right now, and for testing it out for me too.)
any one try it yet? be nice to free up 70meg more on the phone...

Has anyone tried this?
I tried to follow it, but I dont know what to do with the boot.img.gz file.
I did everything else but I got an unbootable phone afterwards and was forced to do a wipe.
I'm running JF 1.5 ADP1 image.
Any help is welcome.
THanks

this is potentially dangerous. /cache may be cleared under many occasions, so if a modified init.rc is not used, you may have a loop on boot.
even if you have such init.rc file, it would be painful to boot after /cache is cleared.
the ultimate solution is to use haykuro's new spl.

M0E-lnx said:
Has anyone tried this?
I tried to follow it, but I dont know what to do with the boot.img.gz file.
I did everything else but I got an unbootable phone afterwards and was forced to do a wipe.
I'm running JF 1.5 ADP1 image.
Any help is welcome.
THanks
Click to expand...
Click to collapse
if you do not flash the modified boot.img file then you CANNOT move the stuff to /cache .. each time you boot it is mounted non-executable .. the modified boot.img makes it executable each time you boot .. if dalvik-cache cannot execute then your phone doesn't load

LucidREM said:
if you do not flash the modified boot.img file then you CANNOT move the stuff to /cache .. each time you boot it is mounted non-executable .. the modified boot.img makes it executable each time you boot .. if dalvik-cache cannot execute then your phone doesn't load
Click to expand...
Click to collapse
Is this the boot.img.gz linked in that howto up top?
If so, how do I go about flashing it?
I really need a solution. I do a lot of online radio streaming and my memory runs out quick. I'd really like to keep my jf 1.5 setup as I have become quite confortablle with it

M0E-lnx said:
Is this the boot.img.gz linked in that howto up top?
If so, how do I go about flashing it?
I really need a solution. I do a lot of online radio streaming and my memory runs out quick. I'd really like to keep my jf 1.5 setup as I have become quite confortablle with it
Click to expand...
Click to collapse
that boot.img.gz file is an archive .. extract the boot.img file out of it to the SD card and then it's something like:
flash_image boot /sdcard/boot.img
or something like that in Terminal .. and then just reboot

And is this done in just terminal or do I need to boot the recovery console?

M0E-lnx said:
And is this done in just terminal or do I need to boot the recovery console?
Click to expand...
Click to collapse
i can't even justify that line of questioning

LucidREM said:
i can't even justify that line of questioning
Click to expand...
Click to collapse
That is the most eloquent response of that nature I've ever seen. I wish I could +1 rep you for that

I gave it a shot, keep getting an error " cannont rename 'dalvik-cache': No such file or directory!
Using RA 1.2.3

ROM
prophetz said:
I gave it a shot, keep getting an error " cannont rename 'dalvik-cache': No such file or directory!
Using RA 1.2.3
Click to expand...
Click to collapse
what ROM are you using? if you already have some form of apps2SD running your dalvik-cache may already be moved .. or you may have mistyped something

Related

[MOD][12/03/09] ADB Remount, Superuser, and Busybox

I'd been trying to figure out how to set up a few simple things in my rooted, post-MR, but otherwise stock CDMA Hero. Namely, ADB Remount permissions (/default.prop file), set up Superuser to properly manage permissions for apps that require root, and install Busybox. Ideally, I wanted to set these up manually. Turns out it's not as simple as one might hope. ADB Remount, for example, requires that you modify and repackage the boot.img/recovery.img.
So, what I've got here is a minimal update.zip file you can apply to your phone via the recovery console. Nothing crazy, it's just MoDaCo's ROM 1.1, but with everything taken out except for the aforementioned items. Once you patch your phone, just these items will be configured and your phone will still look, run, etc. the same as before. Also, a2sd will be copied to your /system/bin directory, but it's something that had to stay in the file for some reason, otherwise the phone wouldn't boot. Probably a setting Paul built into the boot.img.
In any case, here it is. It's working well for me. Hope it helps some of you out too.
****
Thanks goes to Paul of course (MoDaCo) camalot (Droid Explorer) and dagnasty for telling me about the auto-sign plugin that's available in Droid Explorer.
Instructions for manually installing Busybox over here:
http://forum.xda-developers.com/showthread.php?t=591303
****
I responded on ppcgeeks:
mercado79 said:
IAlso, a2sd will be copied to your /system/bin directory, but it's something that had to stay in the file for some reason, otherwise the phone wouldn't boot. Probably a setting Paul built into the boot.img.
Click to expand...
Click to collapse
Yup. It's a script that was added to the boot.img-ramdisk that copies all of your apps to your sd when apps2sd's requirements are met.
So if the sdcard is not partitioned correctly then ap2sd will not run, yes?
Smacky55 said:
So if the sdcard is not partitioned correctly then ap2sd will not run, yes?
Click to expand...
Click to collapse
"Correctly" is relative. If there is no EXT partition on the sdcard, then the ROM won't try to move your applications to it. But the script runs regardless.
Sorry, meant if sdcard isn't partitioned at all. Thanks for the answer.
flipzmode told me in another thread that even though this script is included, that doesn't mean that the update.zip i posted will enable apps2sd for anyone. there's more required in order to get it to work (i stripped most everything out).
A few simple questions. re -stock 1.56... rom
1) in the zip system folder, its refers to /xbin ; does that require that /system/xbin be pre-existent, or will it create it ?
2) busybox is in /system/bin on mine. Do I need to remove it?
a) if so then due to the "busybox --install -s /system/bin"
command , how do i remove the current symbolic busybox entry points?
b)have $PATH changes been applied to overwrite the current export
3) empty init.sh file?
4) google meta references?
I think I may understand the need to get bootstrap-"root" permissions established, is there another way as well?
Thanks for dealing with these noobie questions.
Thanks for this. worked out great.
willy900wonka said:
A few simple questions. re -stock 1.56... rom
1) in the zip system folder, its refers to /xbin ; does that require that /system/xbin be pre-existent, or will it create it ?
2) busybox is in /system/bin on mine. Do I need to remove it?
a) if so then due to the "busybox --install -s /system/bin"
command , how do i remove the current symbolic busybox entry points?
b)have $PATH changes been applied to overwrite the current export
3) empty init.sh file?
4) google meta references?
I think I may understand the need to get bootstrap-"root" permissions established, is there another way as well?
Thanks for dealing with these noobie questions.
Click to expand...
Click to collapse
sorry willy man. not sure what i can tell you. i'm pretty close to being a newbie myself. i never fully understood what the script was doing. i simply took the original modaco update and compared it to another script paul had posted on his forums last fall.
if you unzip the file, you should be able to see everything that's going on. the file structure is super simple, so modify it to suit your needs and give it a try. worst case, you'll need to revert to a nandroid backup. oh, and don't forget you'll need to sign the file and zip it back up in order to flash it onto the phone.
come to think of it, i guess maybe i should update the script using the latest modaco rom, though i'm not sure how helpful it'd be for everyone. to be honest, i've since bitten the bullet and moved on to flipz's rom and the gumbo kernel. runs beautifully!
Ok, so I formated the card, put the .zip file on the sdcard and tried to press home+power to enter the recovery council. When I hold home and press power I am taking to a screen that has an exclamation point and an image of the phone.
Can anyone help?
partylatino420 said:
Ok, so I formated the card, put the .zip file on the sdcard and tried to press home+power to enter the recovery council. When I hold home and press power I am taking to a screen that has an exclamation point and an image of the phone.
Can anyone help?
Click to expand...
Click to collapse
Boot the phone by holding home only. And...I'm assuming you have the recovery console installed and are rooted.
I think the problem is that a recovery boot image was not previously installed. A green screen with a set of options should've appeared.
http://forum.xda-developers.com/showthread.php?t=596879
I prefer 1.2.3
mercado79 said:
Boot the phone by holding home only. And...I'm assuming you have the recovery console installed and are rooted.
Click to expand...
Click to collapse
I did root the phone but I am not familiar with the recovery council. I tried to search for this but was unsuccessful.
I just got my Hero last week so I am still new to all of this. Can you point me in the right direction?
partylatino420 said:
I did root the phone but I am not familiar with the recovery council. I tried to search for this but was unsuccessful.
I just got my Hero last week so I am still new to all of this. Can you point me in the right direction?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=596879 explanation
code from : http://forum.xda-developers.com/showthread.php?t=583291
13:
Code:
adb push recovery-RA-heroc-v1.5.2.img /sdcard
Pushing is equivalent of copy the file to the root of your sdcard. By the time you finished reading this it should be done. You'll know its done because the ouput will say something like transferred X bytes in X secs.
14:
Code:
adb shell reboot
This will cause the phone to restart automatically. Wait till it is fully booted to continue.
http://tinyurl.com/yc96j2z
partylatino420 said:
I did root the phone but I am not familiar with the recovery council. I tried to search for this but was unsuccessful.
I just got my Hero last week so I am still new to all of this. Can you point me in the right direction?
Click to expand...
Click to collapse
Your google search didn't turn anything up on "recovery council" because the operative use would have actually been "recovery console"..
that did it!! Thanks guys!!!
um, what???
mercado79 said:
So, what I've got here is a minimal update.zip file you can apply to your phone via the recovery console.
Click to expand...
Click to collapse
Apply via the recovery console? Sorry, still very new to this. Thanks!
Recovery Console
Go to the recovery console by holding down home when you power your Android. In that menu, you should see something that says 'flash update from SD card'... or something like that... then you choose the .zip that he has so kindly provided us.
Oh, and you have to put the .zip file that he provided on the SD card if that isn't already obvious :/
I also renamed it update.zip once I copied it to my SD card. Hope this clears it up a little. I just rooted my Hero yesterday.. so I am on the same NOOB level.
Do I need to wipe before flashing this / will this wipe my phone if I flash it?
fallonjp said:
Do I need to wipe before flashing this / will this wipe my phone if I flash it?
Click to expand...
Click to collapse
You shouldn't need to wipe your phone; however I really don't think it's a good idea to use this. I put this together last year when we were still running Android 1.5 so it's WAY out of date. Just go with Nfinite's ROMs. He keeps them almost completely stock (depending on which you choose) and they can serve as great back-up / go-to ROMs.

writing update-script file

I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?
Code:
show_progress 0.200000 0
delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
diordnahero said:
I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?
Code:
show_progress 0.200000 0
delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
Click to expand...
Click to collapse
While not necessarily my forte, do you happen to be running apps2sd? My guess is that the partition on the SD card hasn't mounted yet, and thus, the file(s) can't be accessed to delete.
yes I am.
Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.
diordnahero said:
yes I am.
Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.
Click to expand...
Click to collapse
The system folder is not part of apps2sd, so that would make sense.
I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?
JsChiSurf said:
The system folder is not part of apps2sd, so that would make sense.
I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?
Click to expand...
Click to collapse
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google ****s.
zippy-man said:
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google ****s.
Click to expand...
Click to collapse
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
JsChiSurf said:
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
Click to expand...
Click to collapse
yup, I've done that before. Very handy. that'll get the job done
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcar
Click to expand...
Click to collapse
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
Click to expand...
Click to collapse
Yep. You just create whatever script you want and add that to the update script and it will run it. I have used it for many things but have not used a script to mount the sd card.
If you get a hold of the script that cm wrote you could pull out the party that mounts the sd card and use that to write to data if it its located on the sd card.
-------------------------------------
Sent from my HTC Hero
Awsome! Great stuff.
I found this but have not tried it yet as there hasn't been need to update anything lately.

Editing system.img/YAFFS2 (custom ROM creation)

Basically I just want a stock ROM base with the sprint crap taken out and unrevoked added in with some other app mods.
I've grabbed all the sources for YAFFS2/yaffs2Utils and compiled them using cygwin.
Now when I go to extract the system.img all I get is a fonts folder.
I'm setting up a virtual linux machine to try to mount the image instead, but in the meantime anyone care to assist me?
Do a search for android basic kitchen .53. Made myself a custom rom off the .6 release
Sent from my Evo 4g using Tapatalk
stroths said:
Do a search for android basic kitchen .53. Made myself a custom rom off the .6 release
Sent from my Evo 4g using Tapatalk
Click to expand...
Click to collapse
Awesome!!!
Since you claim it works, I'll take your word for it and say I can't thank you enough!
(even if it doesn't do what I need, it should one step forward nonetheless)
Neotelos_com said:
Awesome!!!
Since you claim it works, I'll take your word for it and say I can't thank you enough!
(even if it doesn't do what I need, it should one step forward nonetheless)
Click to expand...
Click to collapse
It seems to be worthless for EVO, only generates update files...I can't even use it to extract the filesystem from system.img
my experience has been working with rfs and not yaffs2 so far.
i think you'll be needing yaffs2 tools, like unyaffs2, etc.
i googled, android system.img mount. seems like a great place to start:
http://wiki.xda-developers.com/index.php?pagename=Android system.img Customization
let us know what works or doesnt work?
If you are rooted with toast, you can flash the custom roms made with that kitchen. you can add or remove apk files before recompiling to the update zip format. I am typing this from my customized rom I made with that kitchen. The kitchen can root the rom for you, add apps2sd (havent tested that) and add wifi tether. I mainly went this routw as io wanted a rooted .6 rom to use after rooting with the Toast method. I am an Android newbie but managed to do this
Sent from my Evo 4g using Tapatalk
joeykrim said:
i googled, android system.img mount. seems like a great place to start:
http://wiki.xda-developers.com/index.php?pagename=Android system.img Customization
let us know what works or doesnt work?
Click to expand...
Click to collapse
Awesome, I figured I would need linux (why I installed it)
stroths said:
If you are rooted with toast, you can flash the custom roms made with that kitchen. you can add or remove apk files before recompiling to the update zip format.
Click to expand...
Click to collapse
I already said it's useless and I said why, it generates update files...
I need to actually extract/mount the original system, that is precisely what the thread title is about.
From the command line you can create a system dump using the following command
tar -cvf /sdcard/system.tgz /system
assuming both /sdcard and /system are mounted. you may have to use "busybox tar" instead.
You can run it from recovery mode.
To mount the filesystems while in adb shell use
"mount /dev/block/mtdblock4 /system" to mount system
and
"mount /dev/block/mmcblk0p1 /sdcard" to mount sdcard
if needed
As for making an update.zip you can take an existing one and replace the system directory inside it with your own custom one. Rezip it, no need to resign it for the EVO recovery, and flash away. Oh, and you'll have to delete any symlinks from the /system/bin directory inside the zip before flashing.

Remove APK thats stalling boot

I'm using Fresh Rom 2.1 and I accidentally used Fresh Kitchen to install a 1.5 version of Sprint TV and the Sprint TV Widget on my Hero. After the automatic reboot, it goes to a black screen and never finishes booting.
After talking with fresh, i used adb to remove the Sprint_TV.apk and Sprint_TVWidget.apk from the system/app directory but the phone still does not boot.
Do the apk's need to be unregistered somewhere? Is there anything I can do to get this to boot without using a nandroid restoration? (my last one is two months old :/ )
re:
have you tried also removing the .odex of those files. I dunno if it would acttally make the .odex's during boot but worth a try right?
where are the odex files located? sorry for still being a little noob at the FS
In my honest opinion, this is why noobs shouldn't learn how to mod their phones with 1-click solutions. You learn more about the phone doing it the manual way.
But to answer your question, the .odex files are in the same directory that the app itself was. For example, Cats.apk and Cats.odex are both in /system/app. The commands to remove them would be:
adb shell
cd system/app
rm Cats.apk
rm Cats.odex
Please note that I'm only using Cats.apk and .odex as an example
Check /data/app and /data/app-private for any thing to do with the apps.
Try to wipe dalvik cache and reboot first.
@mrinehart - all us noobs have to start somewhere but thank you for the location of the odex files. After doing an ls determining the name of the apk file the first time, no odex files were listed in that directory.
@Jus10o - There was a second copy of Sprint_TV.apk in the data/app-private. I removed this file and the phone still did not want to come up. At this point i'm assuming its not necessarily the app that corrupted the boot but the way it was installed. I'm doing a factory reset and starting over tonight.
Thank you both for your time!
savesheep said:
@mrinehart - all us noobs have to start somewhere but thank you for the location of the odex files. After doing an ls determining the name of the apk file the first time, no odex files were listed in that directory.
@Jus10o - There was a second copy of Sprint_TV.apk in the data/app-private. I removed this file and the phone still did not want to come up. At this point i'm assuming its not necessarily the app that corrupted the boot but the way it was installed. I'm doing a factory reset and starting over tonight.
Thank you both for your time!
Click to expand...
Click to collapse
I hope I didn't come off as rude but before you RUU (if thats what you mean by factory reset), try clearing your dalvik-cache and wipe DATA.
It's alright, you had a valid point.
Unfortunately I didn't see the first post about clearing the dalvik-cache folder It's been almost a day without the phone so I had to go ahead and RUU it.
HOWVER, I DID do a nandroid backup of the system while it was in its reboot loop phase. I'm very curious as to what caused it and if clearing the dalvik-cache folder would fix it or not so I may revert to that nandroid backup at a later time just to attempt a solvent. I'll update you if I do.
Thanks again

[Q] .apk file install not working?

So I flashed the MikShift ROM onto my phone a few days ago, but I noticed that sprint tv, and also sprint navigator are missing. I found the .apk files in the mikshift folder, but when I try to install them, it says application not installed. I also tried installing it using the android sdk with no luck.
My next thought, which I am afraid to try (unless its right) is to unzip the rom on my comp, copy the sprint tv and navigator .apks into the system folder, re-compress is, then try flashing that rom. (I can't copy the files with it compressed)
What is the correct way to do this? I know it can be done, or the .apk wouldn't still be in the file, right?
Please help a noob out.
7zip will allow you to move files into the archive without extracting. Not 100%, but on my moment files needed to be zipped in a special way. If you absolutely have to extract it then I'm pretty sure you have to change compression settings to no compression. I'm also fairly sure that if you mess up CWM won't let you flash it.
Mount your /system as rw
Download terminal emulator and type
Su
Mount -o rw,remount -t ext3 /dev/block/mmcblk3p26 /system
Then install
Sent from my PG06100 using XDA App
i believe i did everything as instructed, but the file still didn't install.
I can't get the files moved with 7zip either. I'm pretty sure thats not the correct way of doing it anyway.
Follow the remount command above, then copy it to system, don't install
cp /sdcard/whateverFolder/blah.apk /system/app/
Sent from my PG06100 using XDA App
IT LIVES!!! Thank you very much.
I understand the the copy command that I did through terminal emulator, but what is the first command? I can at least figure out that i'm telling the emulator to mount the phone as r/w, then remounting it for edit i think, but i'm not sure what the "ext3 /dev/block/mmcblk3p26 /system" part means. Could someone explain that? I really want to get more involved in my phone, so i'm trying to learn all I can.
I'll walk you through it.
mount = the base command
-o = with options
rw, remount = add the read/write option, and remount
-t = using file system type
ext3 = the file system type
/dev/block/mmcblk0p26 = the absolute path to the special device file that points to that partition
/system = when you mount that partition call it /system (which it already was, hence the remount option earlier)
Sent from my PG06100 using XDA App
Awesome, thank you very much.
Where did you find the mikshift folder you are talking about on here? I would like to install Sprint TV as well. Thanks.
J_Mod45 said:
So I flashed the MikShift ROM onto my phone a few days ago, but I noticed that sprint tv, and also sprint navigator are missing. I found the .apk files in the mikshift folder, but when I try to install them, it says application not installed. I also tried installing it using the android sdk with no luck.
My next thought, which I am afraid to try (unless its right) is to unzip the rom on my comp, copy the sprint tv and navigator .apks into the system folder, re-compress is, then try flashing that rom. (I can't copy the files with it compressed)
What is the correct way to do this? I know it can be done, or the .apk wouldn't still be in the file, right?
Please help a noob out.
Click to expand...
Click to collapse
Sorry about that wished I'd seen this post earlier. Was busy most of the morning . But if your on MikShifted and want the Stock Sprint apps, go HERE. The thread should have the ones your looking for .

Categories

Resources