[Q] Can You Wipe Dalvik Cache via command in update-script? - G2 and Desire Z Q&A, Help & Troubleshooting

I've searched, but most of the posts are either asking "how to wipe it via adb" and then the thread gets sent into a different direction, and isn't directly answering my question.
I have an update.zip that just does all my wipes in one click, rather than having to wipe data/cache, then system, boot, and dalvik. Instead, I just run the update, it formats them all, makes life easier for me.
anyways I want to know if I can add a command in to wipe dalvik cache? Thanks in advance for any replies!

I don't see why not; Titanium Backup has a function that can do it for you.
I don't know the partition block for dalvik cache on the g2. But the command would look something like:
su
mount -o rw /dev/block/mmcblk[xxx] /sdcard/
rm -r /sdcard/dalvik-cache/*

CWM has an option under advanced that clears the dalvik cache - if you're using an update script then you must already be using CWM, seems pointless to me but I can see not wanting to have the extra steps.
Anyway, if you really want to know what script to use then just break apart CWM and the scripts should be in there. I have one from my MT3GS (pre s-off, so it's an update.zip not an image) which should be easier to tear apart but I don't know if the partitions are the same as the G2.
You can either write this into the update-script or tell the update-script to execute a .sh file which is written with linux commands so it easier to do if you're not familiar with update scripting. Just an fyi.

i am trying to make a script for optimus one to wipe dalvik cache and cache at boot.
the dalvik is on the ext4 partition on the sd.
how can i write a working script?

This is what I use for the wipes in updater-script:
Code:
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
delete_recursive("/data/dalvik-cache");

It Worked!
discours said:
This is what I use for the wipes in updater-script:
Code:
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
delete_recursive("/data/dalvik-cache");
Click to expand...
Click to collapse
Thanks A Lot Discours... U Dont Know How Much Time You Saved Mine! :laugh:
Keep Up The Good Work! :good:

Just happy to see, it's usefull

discours said:
This is what I use for the wipes in updater-script:
Code:
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
delete_recursive("/data/dalvik-cache");
Click to expand...
Click to collapse
And I have to mount /cache and /data [run_program("/sbin/busybox", "mount"...] first?

/cache & /data mount is not necessary
Armi1P said:
And I have to mount /cache and /data [run_program("/sbin/busybox", "mount"...] first?
Click to expand...
Click to collapse
No Its Not Required...

discours said:
This is what I use for the wipes in updater-script:
Code:
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
delete_recursive("/data/dalvik-cache");
Click to expand...
Click to collapse
Why delete_recursive instead of just delete????

manu19thebest said:
Why delete_recursive instead of just delete????
Click to expand...
Click to collapse
The command delete_recursive delete folder, subfolders and files : it's my way to be sure of a total wiping :cyclops:

Armi1P said:
And I have to mount /cache and /data [run_program("/sbin/busybox", "mount"...] first?
Click to expand...
Click to collapse
I agree with you, with out it, it did not work...
I did this and it worked
;run_program("/sbin/busybox", "mount", "/data")
;delete_recursive("/data/dalvik-cache")
;unmount("/data")

He asked to clear his Dalvik cache but you are showing how to delete system, and data ? What happens if you delete "system" ? Will the phone even boot afterwards?

:cyclops:mistake

discours said:
This is what I use for the wipes in updater-script:
Code:
delete_recursive("/cache");
delete_recursive("/data");
delete_recursive("/system");
delete_recursive("/data/dalvik-cache");
Click to expand...
Click to collapse
This is a dumb question and I probably know the answer, but I'll ask anyway...
"delete_recursive("/data/dalvik-cache");" will only delete the content inside dalvik-cache folder, right?

Correct
Sent from my Nexus 4 using XDA Premium 4 mobile app

very useful, thanks

Related

[HOW-TO] Clear Dalvik Cache With Terminal

Try it out, It seems to work -- [Root Required]
All you need to do is:
-Run The Terminal and Type:
Code:
su
cd /data/dalvik-cache
rm *
exit
-Restart Your Device;
-Reboot will take a bit longer because you have cleared the cache and it has to be rebuilt.
And that's it!
TjaXanK said:
Try it out, It seems to work -- [Root Required]
All you need to do is:
-Run The Terminal and Type:
Code:
su
cd /data/dalvik-cache
rm *
exit
-Restart Your Device;
-Reboot will take a bit longer because you have cleared the cache and it has to be rebuilt.
And that's it!
Click to expand...
Click to collapse
I used something similar on my theme script:
adb shell rm /data/dalvik-cache
(And then, just in case: )
adb shell mkdir /data/dalvik-cache
Sent from my HTC Desire HD using xda premium
Quinny899 said:
I used something similar on my theme script:
adb shell rm /data/dalvik-cache
(And then, just in case: )
adb shell mkdir /data/dalvik-cache
Sent from my HTC Desire HD using xda premium
Click to expand...
Click to collapse
Ah, I didn't notice, haven't tried your theme yet
Shall I leave this post? Might be useful for someone.
TjaXanK said:
Ah, I didn't notice, haven't tried your theme yet
Shall I leave this post? Might be useful for someone.
Click to expand...
Click to collapse
Yeah, it's a nice post, leave it
Sent from my D255 using XDA App
There is no need to create dalvik-cache, if it is not present android init creates it.
Btw you may want to use rm -r -f /data/dalvik-cache
tapatalked from Archos 101 G9
TjaXanK said:
Try it out, It seems to work -- [Root Required]
All you need to do is:
-Run The Terminal and Type:
Code:
su
cd /data/dalvik-cache
rm *
exit
-Restart Your Device;
-Reboot will take a bit longer because you have cleared the cache and it has to be rebuilt.
And that's it!
Click to expand...
Click to collapse
hi
i did exactly the same but my phone is stuck with reboot logo..
its Huawei Ideos U8150-B ..
it is in reboot loop..
i did it because android was complaining low memory..
i have 4gb sd card.. and link2sd installed.. and 2 partitions on card.. ext3 and fat.. ext3 part has 900Mb free space and fat has 500 mb .. and i tried all the options in link2sd to wipe the caches but no use .. i also tried the ti backup to clear dalvik cace but it also didnt gave me a single kb .. so i tried this and now stuck at boot loop..
i have tried to boot without sd card same...
what should i do ..
i have a lot of apps and settings and dont want to loose them..
my set is rooted and aps like google play,maps,youtube etc were updated...
khankll said:
hi
i did exactly the same but my phone is stuck with reboot logo..
its Huawei Ideos U8150-B ..
it is in reboot loop..
i did it because android was complaining low memory..
i have 4gb sd card.. and link2sd installed.. and 2 partitions on card.. ext3 and fat.. ext3 part has 900Mb free space and fat has 500 mb .. and i tried all the options in link2sd to wipe the caches but no use .. i also tried the ti backup to clear dalvik cace but it also didnt gave me a single kb .. so i tried this and now stuck at boot loop..
i have tried to boot without sd card same...
what should i do ..
i have a lot of apps and settings and dont want to loose them..
my set is rooted and aps like google play,maps,youtube etc were updated...
Click to expand...
Click to collapse
Try leaving the device at the boot logo for a long time, it takes quite a long time to re-build the dalvik cache... The thing is, This tutorial is ment to be used on archos Gen9 tablets and I dont know if the dalvik cache is in the same place on your device...
TjaXanK said:
Try leaving the device at the boot logo for a long time, it takes quite a long time to re-build the dalvik cache... The thing is, This tutorial is ment to be used on archos Gen9 tablets and I dont know if the dalvik cache is in the same place on your device...
Click to expand...
Click to collapse
why don't you write it in the first post?
I know that this is such an old post..
But i need a .sh script to clean data and cache from the playstore.
Any ideas of how?

[Q] *wipe*

Hi all!!
I know it is a very very, VERY dumb question because seems that everyone knows the answer and mostly because i am in my 3rd ROM and most of then suggested/requsted a fullwipe. So I searched the forums and wiki but i don't have a clue about what is a full wipe or super wipe or *wipe*
Sorry for that quanstion and thanks if you could answer.
diassuncao said:
Hi all!!
I know it is a very very, VERY dumb question because seems that everyone knows the answer and mostly because i am in my 3rd ROM and most of then suggested/requsted a fullwipe. So I searched the forums and wiki but i don't have a clue about what is a full wipe or super wipe or *wipe*
Sorry for that quanstion and thanks if you could answer.
Click to expand...
Click to collapse
Full wipe: Format data, cache, dalvik cache. It does not touch your SDcard data.
Edit: Usually people also Wipe Battery Stats. I found it unnecessary so I forgot to include. It may also involve formatting your SDcard if you have funky stuffs in there. (apps2SD for example)
If you use ClockwordMod, for example, you would have to choose Format data/factory, then Advanced => Wipe Dalvik Cache and Wipe Battery Stats
Super wipe:
Fallen Spartan said:
Basically it does the following:
1) Call erase_image on CACHE, SYSTEM, USERDATA, and BOOT partitions
2) Mount /sd-ext (if it exists) and delete all files from it
3) Delete all files in the /sdcard/.android_secure directory which is where all the froyo apps2sd files live
4) Run e2fsck (file system repair) on the your ext partition
5) Log all output to the /tmp/wipe.log file (if you care)
You will need to power off and reboot back into recovery after running this to install a new rom....as you won't have one on device
If you forget and try to boot normally you will get stuck at splash screen, then you will have to pull battery to power off.
Click to expand...
Click to collapse
To super wipe you often need a zip file and flash it in recovery. Example:
http://forum.cyanogenmod.com/topic/19959-superwipe-for-g2-w-gps-fix/
an added note
fastboot wipe is still the cleanest wipe
<fastboot -w>
i tend to over kill so do fastboot wipe first
then boot into recovery and do a factory reset and wipe cache, dalvik cache again
then do a superwipe.
sounds like over kill? well it keeps me from having issues when changing roms - i change often so these 3minutes spent save me lots of time later
demkantor said:
an added note
fastboot wipe is still the cleanest wipe
<fastboot -w>
i tend to over kill so do fastboot wipe first
then boot into recovery and do a factory reset and wipe cache, dalvik cache again
then do a superwipe.
sounds like over kill? well it keeps me from having issues when changing roms - i change often so these 3minutes spent save me lots of time later
Click to expand...
Click to collapse
blimey...
out of interest should i be wiping anything when i restore from a backup?
Yes
Especially if there was data coruption
Sent from my HTC Vision using xda premium
Thanks
demkantor said:
an added note
fastboot wipe is still the cleanest wipe
<fastboot -w>
i tend to over kill so do fastboot wipe first
then boot into recovery and do a factory reset and wipe cache, dalvik cache again
then do a superwipe.
sounds like over kill? well it keeps me from having issues when changing roms - i change often so these 3minutes spent save me lots of time later
Click to expand...
Click to collapse
I Agree!
That's why i want to know about wipes.
Thanks a lot!

[Q]Correct way to use CWM (Install Rom)

I came from the G2X, and I'm wondering if I'm installing roms the correct way..
1. Wipe Cache
2. Wipe Partition
3. Wipe Dalvik
4. Format /System
5. Install Rom
Is that the correct way? Because that's how I did it for the LG G2X..
Wipe data and cache (both)
Wipe system
Sent from my Galaxy Nexus using Tapatalk 2
every rom i have looked at on here has this (or similar) in the updater-script:
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
that wipes system for you so that it can load the new firmware to that partition.....
and if you just do a factory reset that wipes CACHE and DATA
I am noticing dalvik is not included in a lot of updater-scripts on the GNEX stuff....i wonder why? its an easy thing to add to the script and takes one less thing off the end user...
Dalvik cache is hash signed by the rom. A different flash, a different signature. Thus, no need to wipe caches - it is rebuilt when you flash again.
Sent from my i9250
bk201doesntexist said:
Dalvik cache is hash signed by the rom. A different flash, a different signature. Thus, no need to wipe caches - it is rebuilt when you flash again.
Sent from my i9250
Click to expand...
Click to collapse
thanks, we have always included a dalvik wipe as a precautionary measure, and i keep seeing people recommend all these crazy voodoo rituals to go through prior to a rom flash....finally getting my feet wet in the nexus world...

[Q] Utilize space on /system partition for Dalvik cache or apps.

Hi guys, gonna be clear as possible,
using custom sense rom, free space /system partition will be around 700mb and AOSP rom will be around 1GB, any tick of your mind to utilize this space to install more apps?
Before this, i create new folder on /system and copy several .apk to it. then using symlink to linking them on /data/app.. however im getting tired as i need to re-create symlink everytime after flashing new rom.
Now i think its better to utilize it with moving dalvik cache directory to /system partition. Last night i try using symbolic link implementation for the idea, but its goes wrong, then I try adding script to init.d but nothing happen. - wrong script maybe.
Did anyone have the same idea??, or can you guys help me to create script to move dalvik cache to /system partition? :silly:
example : http://forum.xda-developers.com/showthread.php?t=1638962
Hello guys? might as well reply to myself

[GUIDE] Convert to f2fs

All,
Since there was no clear directions on how to convert to f2fs, I decided to make a quick guide.
This *SHOULD* be device agnostic, however, I wrote it using my T-Mobile Note 3 running LeanKernel 3.12.3.
I'm not responsible if you screw up your data/device. Do this at your own risk.
1) Make sure you're on a kernel that supports f2fs. STOCK KERNELS WILL NOT WORK!
2) Boot into TWRP (at least version 2.8.1.0)
3) Make a backup to either external_sd or an OTG USB device. **THIS STEP IS REQUIRED**
4) After the backup is complete, go back to the TWRP main menu and select wipe
5) Select Advanced Wipe
6) Select the desired partition (cache OR data) and click FS OPTIONS ** DO NOT TRY TO CONVERT ANY OTHER PARTITIONS THAN CACHE AND/OR DATA UNLESS YOUR KERNEL SUPPORTS IT**
NOTE: YOU MUST DO THESE ONE AT A TIME!
7) check f2fs and then wipe
8) Ensure when finished it says current partition type f2fs
9) Repeat steps 5-7 for each partition you are convert ** DO NOT TRY TO CONVERT ANY OTHER PARTITIONS THAN CACHE AND/OR DATA UNLESS YOUR KERNEL SUPPORTS IT**
10) Go back to the TWRP Menu and select Restore
11) Select the backup you just made, and select only the partitions you are converting and restore (ignore warnings about ext4; these are normal)
12) Once restore has completed, go back to TWRP Menu and reboot into system.
13) Profit.
I know there are other kernels that support it, but my personal preference is leanKernel 3.12.3. You'll find it here: http://forum.xda-developers.com/showthread.php?t=2488233 thanks to @Imoseyon
If you need TWRP, you'll find it here: http://forum.xda-developers.com/showthread.php?t=2467001 thanks to @bigbiff
Enjoy, and again, don't blame me if you mess up your device/lose your data/etc.
What is the advantage and disadvantage of doing this procedure? Is compulsion kernel compatible?
Sent from my SM-N900T using xda premium
derride8 said:
What is the advantage and disadvantage of doing this procedure? Is compulsion kernel compatible?
Sent from my SM-N900T using xda premium
Click to expand...
Click to collapse
This post sums it up pretty well.
As for compulsion, you'll want to check that kernels thread and/or the dev to find out.
Sent from my leanKernel 3.12 powered stock 4.4.2 (NF9) SM-N900T
Do apps take up twice as much space on f2fs? That's the only difference I can see so far after the conversion.
toastido, Thanks for the guide. I followed the directions, am on lean kernel 3.13 which has f2fs support. When I restored, I noticed that system was reformatted back to ext4, while I got the warning on the cache and data partitions. Did I miss a step or is there a way to prevent the reformat?
rmarinella said:
toastido, Thanks for the guide. I followed the directions, am on lean kernel 3.13 which has f2fs support. When I restored, I noticed that system was reformatted back to ext4, while I got the warning on the cache and data partitions. Did I miss a step or is there a way to prevent the reformat?
Click to expand...
Click to collapse
Yes, go into the settings for twrp and look for the option to use rm -rf instead of formatting during wipe. Make sure that's selected.
Sent from my leanKernel 3.13 powered stock 4.4.2 (NF9) SM-N900T
toastido said:
Yes, go into the settings for twrp and look for the option to use rm -rf instead of formatting during wipe. Make sure that's selected.
Sent from my leanKernel 3.13 powered stock 4.4.2 (NF9) SM-N900T
Click to expand...
Click to collapse
That was it, Thanks!
Thanks @toastido
I imagine dp/lk will be the same
I get an error when changing the file system from ext4 to f2fs using TWRP 2.8.7.0.
It looks like this:
E:mkfs.f2fs -t 1 -r 16384 /dev/block/mmcblk0p25 process ended with ERROR=1
E: Unable to wipe /data
E: Unknown MTP message type: 1
E: Error changing file system
I tried using TWRP 2.8.5.0 with the same result. I also tried to format data. Same result.
Gotta use 2.8.4.0 as that was the last version I was able to format data without error. Kevp75, love your rom as my daily for my note 3 but cannot use your kernel when I try this method but lean kernel 6.2/6.3 works fine.
prican25 said:
Gotta use 2.8.4.0 as that was the last version I was able to format data without error. Kevp75, love your rom as my daily for my note 3 but cannot use your kernel when I try this method but lean kernel 6.2/6.3 works fine.
Click to expand...
Click to collapse
lean works with all 3 partitions?
kevp75 said:
lean works with all 3 partitions?
Click to expand...
Click to collapse
Just Data and Cache worked, tried with system but just get loops.
prican25 said:
Just Data and Cache worked, tried with system but just get loops.
Click to expand...
Click to collapse
Right on!
System not really needed anyways as it's read-only, but the testing I've done had shown a significant boost on read
Thanks bud!
SUCCESS
Thanks for the guide. I was attempting this week following a different guide which was very similar. I have a Tmobile Note 3 and was unable to achieve this with TWRP 2.8.5 and up as those directions said to use 2.8.1.0 and up.
This time I used 2.8.1.0, the latest Lean kernel and DomPop v5. I converted Cache, Data and System. Upon Reboot it would not boot. I suspect this could be the current ROM or TWRP version I used which is just an assumption. I have not thoroughly investigated. I am going to create a new Nand, convert /System and then test the latest Dominion S6 port ROM among a few other 5.1.1 ROMs.
Note: I am not affiliated with any ROM I mentioned in this post.
Thanks again for the Guide. So far the difference is very noticeable with /Data and /Cache converted.
kevp75 said:
Right on!
System not really needed anyways as it's read-only, but the testing I've done had shown a significant boost on read
Thanks bud!
Click to expand...
Click to collapse
Have successfully get system to stick on f2fs... I have tried all but still goes back to ext4
austino pele said:
Have successfully get system to stick on f2fs... I have tried all but still goes back to ext4
Click to expand...
Click to collapse
It doesnt "mysteriously" just go back to ext4.
Something you are doing or flashing is formatting it back
kevp75 said:
It doesnt "mysteriously" just go back to ext4.
Something you are doing or flashing is formatting it back
Click to expand...
Click to collapse
Alright thanks
austino pele said:
Alright thanks
Click to expand...
Click to collapse
Check in the zip you are flashing.
You should be able to mod the updater-script
Look for the mount lines... (if it's not a CM/AOSP rom/mod)
You can change them to along these lines, and it should keep the f2fs
Code:
run_program("/sbin/mount", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
run_program("/sbin/mount", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
run_program("/sbin/mount", "/dev/block/platform/msm_sdcc.1/by-name/cache", "/cache");
Obviously you'll need to change to your device, but so long as you have Busybox installed, this will mount as filesystem independant
good luck mate

Categories

Resources