[Q] [Explanation] Why/when CM boot process extract libs from apk - Android Software/Hacking General [Developers Only]

Hello,
I'm using a Samsung GT-i9000 phone with limited size yaffs2 partition (mounting point : /datadata). On this speed memory partition are placed apps data files; so whith lots of them we've got a "low memory" warning while the 2Go ext4 /data parition as lots of free space.
I used a script developped in Samsung Vibrant forum to solve this (same problem) : Workaround for small /datadata partition, reported here in XDA : [SCRIPT][CM7/9] /datadata/ low storage notification lagless fix - init.d script.
I modified it to prevent some lag problems (explanation of what I've done in the thread linked) but it doesn't satisfied me as is.
So I'm starting a new developpement script (cleaner way of doing imho) : moving read only static files (ie : lib subdirectory) from /data/data (pointing to /datadata yaffs2 partition) to /data/local/staticdatadata/appdir/lib and making the corresponding softlink from /datadata/appdir/lib.
If script is used when running everything works fine but I've got a problem : when (re-)booting the phone it seems libs are extracted from apk files and copied to /datadata/appdir/lib (while softlink exists so it is erased).
Is someone could explain why (and when) this occurs please ? Is there a way to prevent this ?
PS : I search and read all (I hope) rc scripts and the only thing I found is a script (on /sbin) about encrypted /datadata (and doesn't seem relevant for my problem).

Anyone could help me please ?
An other question : I've seen that /sbin is not the same in recovery than in Android.
I want to modify my /sbin/setupdatadata.sh (the one used in booting process) but when editing it in recovery changes are removed at boot.
In Android it's a RO access (unless I'm root). I could remount it in RW but I think this file comes from "somewhere else" so I prefer modify it ...
Where could I found it please ?
EDIT : find -name "setupdatadata" doesn't help ...

Wendigogo said:
Anyone could help me please ?
Click to expand...
Click to collapse
+1000
Which part of boot procedure extract and copy apk's lib in /datadata (think there's a test or something like that somewhere) ?
Wendigogo said:
In Android it's a RO access (unless I'm root). I could remount it in RW but I think this file comes from "somewhere else" so I prefer modify it ...
Where could I found it please ?
Click to expand...
Click to collapse
I was right; it's part of initrd so I have to compile my own kernel for that ... not a versatile solution.
If not in good section, thanks to point it.

Related

moving dalvik-cache to /cache ???

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

Data/data and permissions accross roms

Hy !
I suffer from instability with almost each rom i tried.
So i'm arrived to think about saving my data (data/data), especially for account login and games progressions
I tried to put them on sd, and sometimes really succeeded in using them accros different roms.
However it was needed to change permission according the cp copy was done under root login. I succeeded and took into account that permissions for lib were differents for system access.
However, in the new android (2.3 in cyanogen 7), the boot process mismatches the libs (linked instead of the lib directory):
/mismatched_uid/settings_10...
even if permissions were corresponding to the packages.list.
Can somebody help me please to understand why it's mismatching?
Thanks a lot
I'm dealing with the same thing right now. I did a nandroid restore, and I've got these mismatched_id symlinks all over the place. SUCKS!
EDIT: Found this: http://niftybits.wordpress.com/2011/08/18/troubleshooting-nandroid-backuprestore/
Well a symlink is just a file pointer, just repoint them with terminal command ln -s target nickname
First just search for what it is pointing to and search where it has moved then just point them to the new place, you could automate with a small script, find missing symlink search for target if found replace. Does require a small knowledge of scripting though.
Sent from my Nexus S using Tapatalk

[TWRP] INT2EXTV2+ for HTC Sensation (use sd-ext partition)

Hi XDA users!
How can a script for using the sdext partition of the SDCARD is done?
I am interested to build one for the Sensation because of its little data partition but I don't know how to do
For example for this ROM: http://forum.xda-developers.com/htc-sensation/development/rom-cyanogenmod11-ivanich-t2911152
Every details or ideas are welcome
Many thanks in advance!
Hi!
After finding this thread: http://forum.xda-developers.com/showthread.php?t=1716124
It seems that the script INT2EXTV2+ can be used in /etc/init.d/ for sd-ext but I think the mmcblXpXX needs to be modified following the Sensation partition layout?
I have found this thread: http://forum.xda-developers.com/showthread.php?t=1168521
Talking about the partition layout of the Sensation.
But I don't understand
Someone can help?
Thanks in advance!
Edit: just found this page: https://github.com/CyanogenMod/android_device_htc_pyramid/blob/ics/recovery.fstab
Seems that the mmcblk1p2 needs to be used as sd-ext
It works! but needs two reboots to get all working (the first, you can have a low storage space available warning but after the second reboot, it should disappear).
The script is in attachment, unzip and put it in /etc/init.d with 755 permissions and 0 : 0 group ownership.
Please leave feedback!
Flashable zips are in attachment.

[Help] Changes to /system won't stick, even after mounting as rw

I've posted about this on StackExchange here (http://android.stackexchange.com/q/157846/126804) but it seems no one can/bothers to answer it. More details are available in the link.
I'm currently trying to convert some user apps into system apps. I've successfully moved the apps into /system/app by making a NAND image and mounting it on Linux, but it throws an error when I try to launch those apps (ClassNotFoundException, something about missing dex). I've already set the permissions the same as the other apps inside /system/app.
Another thing that I've noticed is that I can make any change to /system (copying files, editing, renaming, etc.), but everything gets wiped after a reboot. The same happens with another partition named /custpack (this is what the OEM uses to fill the phone with boatware). I've also tried to place the apps there, but same thing.
How can I debug this?

Empty file in /vendor or /system after creating or modifying file

Hi,
I have a rooted Galaxy S21 with Magisk installed. When creating or modifying a file in the /vendor or /system folders, (after changing the permission from read-only to read-write and afterwards back) the file gets empty (size 0) and there is no way of reversing the contents of a modified file, that got empty after modifying it. Does anyone know why? I just want to know the reason, why the files get empty. I did not find anywhere in the internet the reason behind it. Does it have something to do with dm-verity?
Btw: I know already that you can create a Magisk Module to fix this
Best regards

Categories

Resources