[MOD] Enable shutdown scripts for gingersense roms 11-25-2011 - Droid Incredible Android Development

WARNING READ BEFORE FLASHING. USE AT YOUR OWN RISK.
I TAKE NO RESPONSIBILITY FOR DAMAGE TO YOUR PHONE.
FOR GINGERBREAD SENSE ONLY!
THIS WILL INSTALL TINYS LATEST GINGERSENSE KERNEL.
Thanks to tiny for his awesome kernel.
This mod will enable you to run scripts at shutdown. It modifies the /shutdown.inc.rc file to run a file named init.shutdown.sh, located in the /etc folder. Just add your scripts to the init.shutdown.sh file, and they will be run at every shutdown. Note they will only be run when using the shutdown option, not when using the restart options. After flashing this mod you may switch kernels as you see fit. The gingertiny kernel is not required for use of this mod only for installation. This has only been tested on the 4.08.605.2 ota. However it should work on any gingersense rom. You tell me if it dosent, if your brave enought to test. As always make a backup before flashing.
WIPE DALVIK-CACHE AND THE CACHE PARTITION BEFORE FLASHING. FLASH THRU CW RECOVERY LIKE ANY ROM.
http://dinc.does-it.net/Mods/gingersense_enable_init.shutdown.zip
To test navigate to /etc/init.shutdown.sh and add this to the file without quotes and save "mkdir /mnt/sdcard/test" and then power off the phone and then back on. Go to your sdcard if there is a folder named test then the mod worked.
Dont know how much want there is for a mod like this, but i made it for my self so i figgured i'd share it.

Very neat. Trying to find a practical application for this. :/

I'm glad to see you create your own thread Cm! The only thing I can think of, that I would want ONLY to run at shutdown, might be a wipe battery stats script or a clear the cache partition script.
What are you using it for?

jermaine151 said:
I'm glad to see you create your own thread Cm! The only thing I can think of, that I would want ONLY to run at shutdown, might be a wipe battery stats script or a clear the cache partition script.
What are you using it for?
Click to expand...
Click to collapse
I use it for exactly that, to clear cache, dalvik-cache, and battery stats. You could also use it to fix permissions, delete logs, or unmount a manualy mounted folder or partition such as an sdext.

what does this do exacly?

Alton (Halo 2) said:
what does this do exacly?
Click to expand...
Click to collapse
It enables you to run script commands automaticly at shutdown.

Can you post some sample scripts that we would be able to drop in the folder for us that don't know how to write scripts? Thanks
Sent from my ADR6300 using XDA App

Here are some samples of scripts you can use at shutdown. Add any of the lines you want to use to /system/etc/init.shutdown.sh
/etc/init.shutdown.sh:
Code:
#!/system/bin/sh
# Clear dalvik-cache
rm /data/dalvik-cache/*.dex
# Clear the cache partition
rm -r /cache/*
# Wipe app cache
busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
# Clear battery stats
rm /data/system/batterystats.bin
# Export logcat to sdcard
logcat > /sdcard/logcat.txt
# Defrag database files
for i in \`find /data -iname "*.db"` do \sqlite3 $i 'VACUUM;'; done

im confused. what shutdown scripts would you run?

synisterwolf said:
im confused. what shutdown scripts would you run?
Click to expand...
Click to collapse
I run the wipe dalvk, wipe cash, wipe app cache, and wipe battery stats.

cmlusco said:
I run the wipe dalvk, wipe cash, wipe app cache, and wipe battery stats.
Click to expand...
Click to collapse
Good to know. Thank you.
Sent from my sexy assistant. (AMOLED HTC Incredible)

Related

SwitchRom.sh Question Help

Ok
i posted a question in the switchrom thread, but no one help
so my question is:
If i have Cyanogens ROM currently tagged using the script whatever
I want to install a new build(Elitev0.5 DrizzyHero)
But my question is
In order to install hero with no hicups, your supposed to wipe,wipe ext2/3,reboot recovery,then wipe again, then check filesystems, then flash.
But my question is with Switchrom.sh script
Do i need to just wipe with alt+w
then flash
or do i need to do something els, like...
Wipe(alt+w)
then erase the app folder/dalvik chache
then reboot recovery, then wipe again
then check filesystems (wouldn't that corrupt the script???)
then flash
then to return back to cyan
use the same method??
jf4888 said:
Ok
i posted a question in the switchrom thread, but no one help
so my question is:
If i have Cyanogens ROM currently tagged using the script whatever
I want to install a new build(Elitev0.5 DrizzyHero)
But my question is
In order to install hero with no hicups, your supposed to wipe,wipe ext2/3,reboot recovery,then wipe again, then check filesystems, then flash.
But my question is with Switchrom.sh script
Do i need to just wipe with alt+w
then flash
or do i need to do something els, like...
Wipe(alt+w)
then erase the app folder/dalvik chache
then reboot recovery, then wipe again
then check filesystems (wouldn't that corrupt the script???)
then flash
then to return back to cyan
use the same method??
Click to expand...
Click to collapse
I had to read your question about 4 times to understand what you're asking and I'm still not too clear.
I don't even know how many questions your asking. Perhaps it just the layout of your post.
Anyway. I'll give it a try because I often use the script to bounce between CM ROMs and Hero ROMs. If your currently using a stable NON-Hero build then store your build by performing a nadroid backup and then use the console:
# mount system/sd
# sh system/sd/switchrom.sh -s ROMNAME
And if your going to install a new rom like Hero it's recommended to first wipe everything on your ext partition like it was freshly formated. Wipe in Recovery then flash your Hero build (make sure you meet all the requirements first). Depending on your Hero build you may need to push the app_s folder onto your ext partition. Other builds do it for you (such as the one I'm using. Ref to my signature.) Once you have that all set up and you want to store it reboot back into Recovery and go back into console again:
# mount system/sd
# sh system/sd/switchrom.sh -s HEROROMNAME
This will backup the necessary files for your Hero rom. It is now okay to simply enter:
# sh system/sd/switchrom.sh -r ROMNAME to restore your original Non-Hero rom. You do not need to remove any folders (such as app_s) because the script does this for you.
To return to your Hero ROM it is the same way:
# mount system/sd
# sh system/sd/switchrom.sh -r HEROROMNAME
Once you have to two ROMs set it and properly stored then you should easily be able to switch between the two.
Advice:
Before you use the script ALWAYS make sure that you have significant battery remaining. Failure to do so (based on my experience) may cause your apps to be restored but not your Nandroid Recovery which may result in issues.
Always remember to do a Nandroid backup BEFORE running the script as it is necessary for the script to work properly. Otherwise you may find your recent saved rom may possibly become a crossbreed of apps with a different ROM.
Remember to delete your old Nandroid files. Since they are copied over to the SwitchROM directory, they are not necessary (except for the most recent one).
I personally do not always do a filesystem check but it is recommended.
Binary100100 said:
I had to read your question about 4 times to understand what you're asking and I'm still not too clear.
I don't even know how many questions your asking. Perhaps it just the layout of your post.
Anyway. I'll give it a try because I often use the script to bounce between CM ROMs and Hero ROMs. If your currently using a stable NON-Hero build then store your build by performing a nadroid backup and then use the console:
# mount system/sd
# sh system/sd/switchrom.sh -s ROMNAME
And if your going to install a new rom like Hero it's recommended to first wipe everything on your ext partition like it was freshly formated. Wipe in Recovery then flash your Hero build (make sure you meet all the requirements first). Depending on your Hero build you may need to push the app_s folder onto your ext partition. Other builds do it for you (such as the one I'm using. Ref to my signature.) Once you have that all set up and you want to store it reboot back into Recovery and go back into console again:
# mount system/sd
# sh system/sd/switchrom.sh -s HEROROMNAME
This will backup the necessary files for your Hero rom. It is now okay to simply enter:
# sh system/sd/switchrom.sh -r ROMNAME to restore your original Non-Hero rom. You do not need to remove any folders (such as app_s) because the script does this for you.
To return to your Hero ROM it is the same way:
# mount system/sd
# sh system/sd/switchrom.sh -r HEROROMNAME
Once you have to two ROMs set it and properly stored then you should easily be able to switch between the two.
Advice:
Before you use the script ALWAYS make sure that you have significant battery remaining. Failure to do so (based on my experience) may cause your apps to be restored but not your Nandroid Recovery which may result in issues.
Always remember to do a Nandroid backup BEFORE running the script as it is necessary for the script to work properly. Otherwise you may find your recent saved rom may possibly become a crossbreed of apps with a different ROM.
Remember to delete your old Nandroid files. Since they are copied over to the SwitchROM directory, they are not necessary (except for the most recent one).
I personally do not always do a filesystem check but it is recommended.
Click to expand...
Click to collapse
i was kind of curious about this as well. thank you for the detailed guide. will try this out soon
also just out of curiosity, how is the 69mb swap size treating you on hero? also what about when you go back to cyanogen's rom?
david1171 said:
i was kind of curious about this as well. thank you for the detailed guide. will try this out soon
also just out of curiosity, how is the 69mb swap size treating you on hero? also what about when you go back to cyanogen's rom?
Click to expand...
Click to collapse
I love the 69mb swap. Much better then 32mb.
I don't see any difference using the 69mb on Cyanogen Roms then when I was using the 32mb. The most I ever had my phone on since the adjustments was 34 hours and for some reason I was getting a few FC/Waits and I decided that it was about time for a reboot. I was going to try it with Hero but then Cyanogen 4.1 came out and I only made it to about 12 hours or so.

[SCRIPTS][GUIDE] Resizing Tattoo partitions - damn simple

Hello Friends,
If you want to re-size you tattoo to have more space for system and data partitions
Here is simple how to do.
No chance of bricking your phone, and it doesn't involve SPL
It works for installed ROM as well as new installations
It was done using the the scripts and information from following thread
http://forum.xda-developers.com/showthread.php?t=717874
Installation instructions:
download FR-recovery-v1.5.3-CustomMTD_S.zip and FR-boot-v1.5.3-CustomMTD_S.zip
reboot to recovery
and use following commands to specify partition size
Explanation of commands used below : after the mtd command first number is system size and the next is cache and remaining will be data partition
choose your cache partition size based on the fact, whether it uses for dalvik-cache or not.
If it used for dalvik-cache do not go less than 80mb (roughly) other wise 20 mb is fine.
Code:
adb shell
mount /sdcard
echo "mtd 200 20" > /sdcard/mtdpartmap.txt
backup your rom
wipe cache + data
If you are 'growing' system, make sure cache and data are clean
if your 'shrinking' system make sure system is clean
To wipe system you need clockworkmod-recovery​
flash FR-recovery-v1.5.3-CustomMTD_S.zip
repeat wipe cache + data
reboot to recovery
At this point if you can either restore your existing installation
OR Flash fresh ROM and other extras
Finally flash FR-boot-v1.5.3-CustomMTD_S.zip
reboot
You could see re-partitioned tattoo with more space for system and data
Here are my Tattoo partition sizes before
Code:
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 95188 0 95188 0% /dev
/dev/block/mtdblock3 [B][COLOR="Red"]153600[/COLOR][/B] 137452 16148 89% /system
/dev/block/mtdblock4 [B][COLOR="Red"]153600[/COLOR][/B] 1172 152428 1% /cache
/dev/block/mtdblock5 [B][COLOR="Red"]169088[/COLOR][/B] 56596 112492 33% /data
and after following above instructions
Code:
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 95188 0 95188 0% /dev
/dev/block/mtdblock3 [B][COLOR="Red"]204800[/COLOR][/B] 118140 86660 58% /system
/dev/block/mtdblock4 [B][COLOR="Red"]20480[/COLOR][/B] 1164 19316 6% /cache
/dev/block/mtdblock5 [B][COLOR="Red"]251648[/COLOR][/B] 123200 128448 49% /data
It is recommended to use clockworkmod-recovery, although i could use AmornRA recovery (for a fresh install of ROM)
HELP TIPS or POINTS
You don't need to flash both of the files each time you install a new ROM.
You only need to flash the recovery patch once, unless you want to re-size or you installed a new recovery.
The boot patch *must* be flashed after you have installed a new ROM or kernel (boot.img) or for every restoring of backup.
If you are 'growing' system, make sure cache and data are clean
if your 'shrinking' system make sure system is clean
In order to wipe system, data, cache partitions
flash clockworkmod-recovery, and from recovery the recovery menu
go to "mounts and storage" option and wipe required partitions
If you want to restore original MTD, flash original recovery to wipe custom MTD
Here is the information for Developers to include this in their ROMs
ROM Zip Patcher for Devs
To make life even simpler for end users it is possible to integrate the 'patch' within a ROM
AutoMTD_partitionPatcher_v1.5.3.zip
currently Linux only,
within the zip is a tarball, untar that.
get that directory into your PATH, ( or just cd into it )
and then execute
Code:
PatchUpdateScript.sh <zip file to patch>
it will then
create a temp directory ( in your current directory )
copy your zip to it
extract required files
patch update(r)-script
zip and sign.
It simply saves the user from flashing the boot patch after flashing your ROM
Click to expand...
Click to collapse
Hope that is useful
All credit goes to Firerat (Custom MTD Partitions)
i have tested this now!
And it works great...
Although my linux machine did not have the java packs installed to patch the boot.img, i simply made nandroid backup and put img into zip afterwards.
Thanks for guide
Dexter_nlb said:
i have tested this now!
And it works great...
Although my linux machine did not have the java packs installed to patch the boot.img, i simply made nandroid backup and put img into zip afterwards.
Thanks for guide
Click to expand...
Click to collapse
Good that you could use it
I didn't have time to look in to ROM patching script, But how do you mention the partition sizes with this script?
Please let me know.
Cheers
rallapag said:
I didn't have time to look in to ROM patching script, But how do you mention the partition sizes with this script?
Click to expand...
Click to collapse
i initially used the txt file on /sdcard to configure the recovery, then when rom was installed patched it. then a nandroid backup and copied rom to my update.zip and reinstalled rom normally, with patch included..
this solution is of course for one size of mtd's, but it was even easier..
Sorry for my misunderstanding I just went through the autoMTD script and realized what you said earlier.
Auto MTD script patches boot.img, so for patched ROM's as well you need flash FR-recovery with mtdpartmap.txt in user sd card defining partition sizes.
Cheers

[Q] Can I automate/ default into the Dalvik-Cache wipe for each poweron/reboot?

This is to at least avoid the need to boot into CWM recovery every time
Reason:
I immediately flashed my brand new Nook HD+ with the emmc CM 10.1 three weeks ago
The vanilla CM booted in 90 seconds but that was 350 app installs ago and many uninstalls and app updates as well
If I power on the HD+ seem to always get stuck in the boot loop of the CM Logo; I wait up to 10 minutes
It seems booting into CWM recovery via N button on Power on and choosing wipe dalvik-cache allows a rebuild of dalvik-cache for the 350 apps followed by normal boot into CM 10.2
Besides the long delay is there any harm in wiping Dalvik-Cache every time I reboot or poweron?
I believe only this method and CM safe mode are the only way I know to avoid bootloops
Do I need to modify Dalvik-Cache settings/properties to fix bootloops? If not can I automate/ default into the Dalvik-Cache wipe for each poweron / reboot
BTW reason I rebooted a few times is I am still trying to struggling getting USB OTG / USB host mode working
Should I turn off USB debugging if I can not use USB OTG and I also do not use ADB?
TIA
Dave
What is CM safe mode?
The dalvik cache is split into two places. The system app dalvik cache is stored in /cache/dalvik-cache. The installed apps dalvik cache is stored in /data/dalvik-cache. It does no harm to clear those caches periodically. It just takes a while when you reboot for the operating system to rebuild them from the apks.
So you should be able to manually delete the /data/dalvik-cache folder with your file manager just before you reboot. I am assuming that is the one giving you problems. If not it, try the one in /cache.
If you know how to write scripts you can automate it.
Edit: if it turns out to be the dalvik-cache in /cache causing the problem, I have a build.prop setting to move the /cache dalvik to /data.
Sent from my Nook HD+ running CM10.1 on emmc.
Help with automating the Dalvik-Cache wipe
Thanks for the reply Leapinlar!
When I am booting into in CWM recovery and choose the Dalvik-Cache wipe is it wiping out both /data/dalvik-cache and /cache/dalvik-cache?
How long do I realistically need to wait before I can determine I am in a bootloop situation? I do wait 10 minutes but maybe less time?
Does CM 10.1 boot time dramatically increase over time or does adding apps also increase the boot time ?
I found a script on: http://smanager.wikidot.com/scripts:power-scripts[/U "Superclean and reboot "
As a newbie I would like to know which file or directory to put a subset of this script so that it automaticly runs when I poweroff or reboot via the power button even better would be how to add a popup question box asking me if I want to wipe out dalvik-cache as part of the shutdown.
TIA
Dave
leapinlar said:
What is CM safe mode?
The dalvik cache is split into two places. The system app dalvik cache is stored in /cache/dalvik-cache. The installed apps dalvik cache is stored in /data/dalvik-cache. It does no harm to clear those caches periodically. It just takes a while when you reboot for the operating system to rebuild them from the apks.
So you should be able to manually delete the /data/dalvik-cache folder with your file manager just before you reboot. I am assuming that is the one giving you problems. If not it, try the one in /cache.
If you know how to write scripts you can automate it.
Edit: if it turns out to be the dalvik-cache in /cache causing the problem, I have a build.prop setting to move the /cache dalvik to /data.
Sent from my Nook HD+ running CM10.1 on emmc.
Click to expand...
Click to collapse
The CWM dalvik wipe wipes both of them.
Yes, adding apps increases boot time. The operating system has to verify that the dalvik cache files match the apks. The more apks installed, the longer the boot. If they do not match, it rebuilds them. If they are missing (like after a wipe) it starts rebuilding immediately without checking. 350 apps sounds very high. Do you really need that many?
Some have said that the ability to read emmc decreases with use (kind of akin to defrag on a PC). That is what that trim controversy is all about. There is a process where that can be cleaned up with the trim app, but it has been known to brick certain Samsung memory chips (and some HD+s have them).
I don't know anything about that script or where to put it to execute on power off. You put it either in /system/etc/init.d or /data/local/userinit.d to execute on startup.
And you have still not told me what CM safe mode is.
Sent from my Nook HD+ running CM10.1 on emmc.
safe mode on CM 10.1
safe mode on CM 10.1
Press power button and then press and hold reboot option..
Phone / Tablet will ask you to boot in safe mode or normal mode..
I did this twice in the past
So the apps folder upon reboot is much smaller as most APKs are not loaded in this safe mode
I am kind of a newbie with CM but it is very nice
TIA
Dave
leapinlar said:
The CWM dalvik wipe wipes both of them.
Yes, adding apps increases boot time. The operating system has to verify that the dalvik cache files match the apks. The more apks installed, the longer the boot. If they do not match, it rebuilds them. If they are missing (like after a wipe) it starts rebuilding immediately without checking. 350 apps sounds very high. Do you really need that many?
Some have said that the ability to read emmc decreases with use (kind of akin to defrag on a PC). That is what that trim controversy is all about. There is a process where that can be cleaned up with the trim app, but it has been known to brick certain Samsung memory chips (and some HD+s have them).
I don't know anything about that script or where to put it to execute on power off. You put it either in /system/etc/init.d or /data/local/userinit.d to execute on startup.
And you have still not told me what CM safe mode is.
Sent from my Nook HD+ running CM10.1 on emmc.
Click to expand...
Click to collapse
[email protected] said:
safe mode on CM 10.1
Press power button and then press and hold reboot option..
Phone / Tablet will ask you to boot in safe mode or normal mode..
I did this twice in the past
So the apps folder upon reboot is much smaller as most APKs are not loaded in this safe mode
I am kind of a newbie with CM but it is very nice
TIA
Dave
Click to expand...
Click to collapse
Huh! That is a new one for me. LOL. Thanks.
If it boots faster in that mode, that tells me you have too many apps.
Sent from my Nook HD+ running CM10.1 on emmc.
Your boot loop sounds similar to the one I had for a while. It just sits at the Cyanogen Mod circle for EVER. The fix for me was to go in and disable 'quick render' in the launcher settings. (Remove the checkmark)
Will try disable 'quick render' in the launcher settings.
Aaron thanks for the info * I will see if helps my bootloop issue
I went to Trebuchet settings to uncheck 'quick render' in the Homescreen panel
TIA
Dave
Solution: quick & dirty automating the Dalvik-Cache wipe
Thanks to Leapinlar for great explanations and patience and
Kudos to Bartito for his Shutdown APK!
Just tested the instructions below on HD+ CM 10.1
Leapinlar can you please verify the commands before other users try this as I am still a Newbie to CM
after following these instructions I powered on the HD+ and the dalvik-cache rebuilt 268 APKs without needing to boot into CWM recovery
This will continue for every poweron and reboot until the script /system/etc/shut.d/rmdalvikdata is removed
The boot process is obviously delayed significantly but hopefully no more bootloops!
1) launch terminal emulator app and type these commands from the terminal:
su
mount -o rw,remount /system
mkdir /system/etc/shut.d
chmod 755 /system/etc/shut.d
echo "rm /data/dalvik-cache/*" > /system/etc/shut.d/rmdalvikdata
chmod 777 /system/etc/shut.d/rmdalvikdata
ln -s /system/etc/shut.d /system/etc/shutdown
exit
exit
2) please, download the "SystemScriptsExecutor-cwminstaller.zip"
from: http://forum.xda-developers.com/showthread.php?t=1387692
Note: I saved it the zip file to the MicroSdXc card
3)install SystemScriptsExecutor-cwminstaller.zip from CWM recovery on Nook HD Plus.
Note: I actually used vi on term with a USB keyboard to create /system/etc/shut.d/rmdalvikdata
and I am not sure the symlink is necessary
It looks correct. And I would leave the symlink in. The Executer may need it.
Sent from my Nook HD+ running CM10.1 on emmc.
I saw the same problem on cm-10.1.3-RC2-ovation: "wallpaper quick render" enabled causes bootup to stall on the animated logo. Clearing cache was the only way to complete with it enabled. Disabling restores the ability to boot and reboot normally.
It's a devious bug as you might only run into it days after enabling the feature. In my case, it was a few days after a fresh CM installation, having setup and installed everything the way I wanted. adb logcat didn't show anything obvious within the boot loop. I spent a while building the installation back from scratch with incremental nandroid backups attempting to find the point where things broke. Glad I found this thread instead!
It'd be nice to have it fixed as quick render makes scrolling between home pages noticeably smoother.
Aaron Camp said:
Your boot loop sounds similar to the one I had for a while. It just sits at the Cyanogen Mod circle for EVER. The fix for me was to go in and disable 'quick render' in the launcher settings. (Remove the checkmark)
Click to expand...
Click to collapse
Thank you sir! I have struggled with this and your suggestion seems to have cured the problem. I have spread the word in 2 other threads.
Wish the developer would see this. Then, perhaps, a fix might be in the future.

Remove Odexes Of UNINSTALLED SYSTEM APPS xperia zr 5.0.2_10.6.A.0.454 stock

In Linux environment anybody can unsquash /system/ODEX.sqsh which contains odex for all stock apps edit the odex in accordance to apps uninstalled squash it back with right options & put it back in /system in recovery mode. I personally freed 100 mb from system partition.
What is new thing i found that possibility of new environment of read only file system by using squashfs to compress the directory & mounting it on boot
kindly post a detailed method
I think another option is to wipe dalvik and cache in recovery and let it regenerate all odex again.
itandy said:
I think another option is to wipe dalvik and cache in recovery and let it regenerate all odex again.
Click to expand...
Click to collapse
no u cant do this by wiping dalvik,cause this file isnt in dalvic memory,its on system,so just open it in linux or some linux emulator in windows and remove odex files that u dont need and then push it to phone by adb or creat a flashable zip and flash by dual recovery.
by the way it cant add to your internal memory,just free some space to system .
itandy said:
I think another option is to wipe dalvik and cache in recovery and let it regenerate all odex again.
Click to expand...
Click to collapse
As i mentioned earlier Sony applied new method of providing prepopulated odex in system.sin which includes odexes for all stock app you can see in /system/odexes where odex.sqsh is mounted. Even if you remove system app you can see odex in /system/odex. & most important if remove odex.sqsh in recovery & clear dalvik & cache when you reboot you will stuck in bootloop. Clearing dalvik & cache alone wont clear odexs of uninstalled stock app.
sachinss1979 said:
As i mentioned earlier Sony applied new method of providing prepopulated odex in system.sin which includes odexes for all stock app you can see in /system/odexes where odex.sqsh is mounted. Even if you remove system app you can see odex in /system/odex. & most important if remove odex.sqsh in recovery & clear dalvik & cache when you reboot you will stuck in bootloop. Clearing dalvik & cache alone wont clear odexs of uninstalled stock app.
Click to expand...
Click to collapse
You're right. I didn't notice you're talking about system apps.
Jrobah said:
kindly post a detailed method
Click to expand...
Click to collapse
first of all get system.sin for 5.0.2.
you can do it by renaming .ftf to .zip & extracting it.
Then use sin2raw or androxide flashtool to extract system.ext4.
Now Linux Part.
1) Install MKSQUASHFS 4.0 onward on your Linux machine. you can google it.
2) Mount System.ext4 image
3) Extract odex.sqsh then unmount system.ext4
4) in terminal using squashfs check the properties of your odex.sqsh & save it.
Unsquash odex. sqsh to odex
I used "unsuashfs -s odex.sqsh" command to check the properties.
In my case properties of odex.sqsh are as following,
Found a valid SQUASHFS 4:0 superblock on odex.sqsh.
Creation or last append time Sat Mar 14 09:00:00 2015
Filesystem size 316566.50 Kbytes (309.15 Mbytes)
Compression lzo
Block size 131072
Filesystem is exportable via NFS
Inodes are uncompressed
Data is compressed
Fragments are not stored
Xattrs are uncompressed
Duplicates are not removed
Number of fragments 0
Number of inodes 910
Number of ids 1
5) now open file manager with su. open odex directory delete removed stock apps folder only. Save it.
6) Squash it using "mksquashfs odex odex.sqsh (options of original odex.sqfs)"
In my case i used commandline
"mksquashfs odex odex.sqsh -comp lzo -b 131072 -noI -no-fragments -no-duplicates -noX"
7) Now copy it on your phone.
8) Boot your phone in recovery mode. Take your nandroid backup.\
9) Replace your /system/odex.sqsh with new one. correct the permissions to 0644.
10) Wipe dalvik & cache only. Reboot your phone & done.
will work with MM/ selinux ?
Hello,
have you repeated this with marshmallow ? In MM, you have to deal with selinux.
The files in sqsh (on my xperia M4) have selinux security context. I guess, you have to use linux with selinux enabled.
Kind regards

[Problem] [Q] Moving dalvik-cache to /cache from /data in CM13

/cache folder - 541 MB free space
/dalvik-cache - 400 MB something (approx. 120 apps, CM13 snapshot, Helium v27 kernel, opengapps pico installed)
What I did:
1) Moved /data/dalvik-cache folder to /cache
2) CHMOD /cache/dalvik-cache folders and files like original as in /data/dalvik-cache. I did it twice using ES Explorer and then terminal in recovery with superuser access so that it doesn't get back to original.
3) Boot in Recovery -> Terminal
Code:
su
busybox chown 1000.1000 /cache/dalvik-cache
ln -s /cache/dalvik-cache /data/dalvik-cache
sync
Now, after reboot, phone either gets stuck in bootloop or "preparing to start".
Other things I tried:
"To get it working just wipe dalvik cache in cwm, it will re-create directory in /data."
- This didn't work for me. System was unable to create folders in /cache on boot.
Possible Reasons and Solutions:
1) There is an init file which "forcefully" moves dalvik-cache back to /data.
2) The cache directory NEEDS 655 permissions otherwise you'll be stuck in a boot loop or everything will force close.
3) The permissions are reset on reboot.
4) The only way to really do it is to chmod during boot, you'll need init.d capability for that.
These are the things I could collect. Anybody please let me know how to fix this?
Tried init method
kkumar326 said:
/cache folder - 541 MB free space
/dalvik-cache - 400 MB something (approx. 120 apps, CM13 snapshot, Helium v27 kernel, opengapps pico installed)
What I did:
1) Moved /data/dalvik-cache folder to /cache
2) CHMOD /cache/dalvik-cache folders and files like original as in /data/dalvik-cache. I did it twice using ES Explorer and then terminal in recovery with superuser access so that it doesn't get back to original.
3) Boot in Recovery -> Terminal
Code:
su
busybox chown 1000.1000 /cache/dalvik-cache
ln -s /cache/dalvik-cache /data/dalvik-cache
sync
Now, after reboot, phone either gets stuck in bootloop or "preparing to start".
Other things I tried:
"To get it working just wipe dalvik cache in cwm, it will re-create directory in /data."
- This didn't work for me. System was unable to create folders in /cache on boot.
Possible Reasons and Solutions:
1) There is an init file which "forcefully" moves dalvik-cache back to /data.
2) The cache directory NEEDS 655 permissions otherwise you'll be stuck in a boot loop or everything will force close.
3) The permissions are reset on reboot.
4) The only way to really do it is to chmod during boot, you'll need init.d capability for that.
These are the things I could collect. Anybody please let me know how to fix this?
Click to expand...
Click to collapse
I tried init edit, busybox commands and manual edit to change cache folder's chmod but it goes back to default. This is the root cause because without restart it's working normal. After restart only it's stuck because chmod is changing back to default. Any solutions to keep it edited?
@Tomoms Hey, just to let you know I tried few more things:
1) Extracted boot.img from CM13 ROM and changed "chmod 775 /cache", "chown system system /cache" and added, changed few more things for dalvik-cache in /cache as in /data/dalvik-cache. Recompiled boot.img and flashed it with ROM.
2) Result: /cache folder finally changed to 755 with system system control. Got dalvik-cache folder in /cache, same as in /data folder. I linked dalvik-cache from /data /dalvik-cache and it still didn't work.
This is really strange. I've been trying these tweaks for last 4-5 days and it still isn't working. I think /cache folder is clearing itself on starting of device. Though, I did't find any such thing in boot.img.
kkumar326 said:
@Tomoms Hey, just to let you know I tried few more things:
1) Extracted boot.img from CM13 ROM and changed "chmod 775 /cache", "chown system system /cache" and added, changed few more things for dalvik-cache in /cache as in /data/dalvik-cache. Recompiled boot.img and flashed it with ROM.
2) Result: /cache folder finally changed to 755 with system system control. Got dalvik-cache folder in /cache, same as in /data folder. I linked dalvik-cache from /data /dalvik-cache and it still didn't work.
This is really strange. I've been trying these tweaks for last 4-5 days and it still isn't working. I think /cache folder is clearing itself on starting of device. Though, I did't find any such thing in boot.img.
Click to expand...
Click to collapse
Hey, there's definitely something in the init files that move the dalvik cache to /data at boot. I've found it and I can change it for you using a flashable zip. Wait for my next PM.
Hey.
Yes our 8960 devices have quite a big cache, most newer devices no longer have such a cache.
We already talked about remapping the dalvik-cache to the /cache partition with a symlink,
as it's handled by init.rc to create an actual folder & could be changed to link cache.
However, though it can seem like a good idea, it would anyhow end up with a filled cache partition,
when users have a lot of apps it will fill quite fast, I already have 200-300MB with my daily apps,
heavy gamers and apps installer will end up with a stuck situation & it would introduce new issues.
Handling a dual target to fill cache, then data, and to handle this all
would add additional complexity, load and potential issues.
Also that cache is used through the recoveries for updates & stuff so free space needed in it.
Things evolved quite a lot since 4.3 with ART .
You could do it manually, but every update would need to be patched & all..

Categories

Resources