www.chinaphonearena.com

Full Version: Leagoo Lead3 kitkat not working with link2sd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
when you get a chance here is the limit of my knowledge to try to get to a traditional fstab if you have a vold....pretending you have a mtk device

Code:
adb devices
adb shell
su
cd /dev/block/platform
ls  
# if you have internal and external you see 2 folders otherwise one
# pretend its both so
cd mtk-msdc.1

Ideally we want to see a folder called by-name but I only have by-number
Code:
my result
ls -al
drwxr-xr-x root     root              2014-09-10 15:44 by-num
lrwxrwxrwx root     root              2014-09-09 11:54 mmcblk1 -> /dev/block/mmcblk1
lrwxrwxrwx root     root              2014-09-10 15:44 mmcblk1p1 -> /dev/block/mmcblk1p1

ls -al by-num/                      
lrwxrwxrwx root     root              2014-09-10 15:44 p1 -> /dev/block/mmcblk1p1

Inference, the "p1" is partition one, so is traditional fstab entrant, plus my card is only one partition
cheers
@aus9 yes that is the principle of block devices for each partition.
Link2sd uses the same principle to mount the second partition, basically it comes down to this sort of script

Code:
/system/xbin/busybox mount -o rw /dev/block/mmcblk0p2 /data/sdext2

That is part of the script I used on phones where the "create mounting script" of link2sd failed.
Most phones have a script called "install-recovery.sh" in /system/etc, which gets called from within init.rc to be precise here:

Code:
....
service installd /system/bin/installd
    class main
    socket installd stream 600 system system

service flash_recovery /system/etc/install-recovery.sh
    class main
    oneshot

service sbchk /system/bin/sbchk
    user nvram
    group system
    oneshot
...

This service flash_recovery is usually way down the list of initialization processes so it gets run when most services are up.
As you can see it's a oneshot which means it gets called only once.
Editing install-recovery.sh and adding the previous mount line will in fact mount the second partition at boot time. Since /system/etc/install-recovery.sh doesn't get overwritten at boot time, it is a good place to do this and requires little effort.
It effectively mounts the second partition under /data/sdext2 which is where link2sd expects it to find.

Alll of this works on kitkat, even though I used the "create mount script" which differs from the above, however the result is the same.
I can access the second partition through /data/sdext2 normally with root-explorer, I see all the linked files, libs and dex, but kitkat refuses to show the linked apps as normal apps.
Somehow I think this is related to the fuse daemon which is introduced in kitkat.
[Only registered and activated users can see links Click here to register] says this at some point:
Quote:Emulated primary, physical secondary (like Xoom)
This is a typical configuration for a device with multiple external storage devices, where the primary device is backed by internal storage on the device, and where the secondary device is a physical SD card.

The raw physical device must first be mounted under /mnt/media_rw where only the system and FUSE daemon can access it. vold will then manage the fuse_sdcard1 service when media is inserted/removed.

fstab.hardware

and that has everything to do with the "enhanced" security of kitkat involving the media_rw group.
I need to read-up a little more about this, but I'm pretty sure the clue lies there.

There's also mention of this:

Quote:Since external storage offers minimal protection for stored data, system code should not store sensitive data on external storage. Specifically, configuration and log files should only be stored on internal storage where they can be effectively protected.

Which to me is a whole load of horse-crap as from a technical view-point there is no difference between internal or external storage, both are media storage devices, be it flash-chips or mechanical storage (harddisks). What they are referring to is devices formatted under fat32 that do not offer the same level of security as ext2-4. I won't go further into this as that is treated in another [Only registered and activated users can see links Click here to register] and would make this O.T., I only mention it here because link2sd can in fact store the configurations files (typically called linked internal-data) on the second partition and link them.
The concept of link2sd is in fact based on a very old unix trick to expand a filesystem through hard/soft links, but absolutely non-invasive on security as all valid unix permission rules apply.
@Mirandam

Hello,

I take a look on the Spec. from your Phone. It has 4GB ROM - maybe avaiable about 3.7GB.

I don't know your Internal Storage. Most have about 1GB.

What you mean, you can increase the Internal Storage to 2.5 or 3.5GB.

I have posted the steps here:
[Only registered and activated users can see links Click here to register]

Then you can installed more Apps there.

I have tested it on about 10 different Phones and it works.

The important Step is, first a CWM Backup and Backup of your internal SDCard2.

On the other Side you can Test and try the Link2SD additional!

Greetings

Louis777 [Image: dankeschoen.gif]
(2014-09-10, 22:36)Louis777 Wrote: [ -> ]@Mirandam

Hello,

I take a look on the Spec. from your Phone. It has 4GB ROM - maybe avaiable about 3.7GB.

I don't know your Internal Storage. Most have about 1GB.

What you mean, you can increase the Internal Storage to 2.5 or 3.5GB.

I have posted the steps here:

Sorry, but the specs are one thing, reality another. As I said in my OP, the phone has 800MB of app storage space (/data) and only 1.3GB of internal SD-space, which leaves me with virtually no space to repartition.
Due to storage limitations kitkat imposes, it also changes the way the preffered storage location in setup works. If you select internal storage space, your apps go to the internal sd-space, in this case the 1.3 GB internal sd. The other option is phone-storage which is the 800MB app space. That is exactly the reason why I want to use link2sd, which could circumvent this problem.
Kitkat really sucks for small phones.
@Mirandam,

Hi,

take a look at Terminal Emulator.

cat /proc/dumchar_info and
cat /proc/partitions show you the Size of FAT!
From here come the additional Storage.

You wrote, 1,3GB internal Space plus 800MB=2,1GB internal Storage - usrdata!

Greetings
Louis777
@Louis777

That is impossible, you cannot eliminate the internal sd-card entirely to have that space added to data.
Exactly because of what I said, kitkat expects to have internal sd space.
And to be honest, to me it doesn't pay off to go to all the trouble of repartitioning if data is not close to 3 or 4 GB.
Apart from that, I've yet to see a repartitioned kitkat phone and since this phone will not be used by me, I won't take the risk of being amongst the first to do repartitioning under kitkat.
Precisely because of these considerations I opted for a to me very know route: link2sd, which does not require any reflashing or otherwise risky operations.

To make things more clearly: on this phone I only want one solution: for link2sd to work.

This phone is to replace a dual-core phone with nearly the same specs, except for the fact that it has 4.2.1 and ubifs as filesystem. The ebr repartitioning method doesn't work under ubifs, and the internal data space (about 200MB) doesn't allow me to update dropbox or google maps, even with link2sd working.
Quote:for link2sd to work.

Actually I think you may be a little unfair to Louis777 and myself at this point.

Yes I accept your subject says exactly what is in quote.

But your um stronger stance means it is now impossible for me to ask you to check out
[Only registered and activated users can see links Click here to register]
Quote:App uninstaller, apk manager and move-to-SD-card features allow you to install, backup, move between SD card and phone memory or uninstall at ease.

Also your stance now makes it impossilbe for me to mention that when I was using the product, it would make recommendations on whether to move certain system apps or leave them alone.

I shall sacrifice one aussie beer if Ihave offended thee. Big Grin
@aus9
No I'm not offended in any way and I don't take things personally that easily.
I only restated what is my intention to narrow the suggestions to be more to the point. I have considered almost all other optios but as I said at this moment they do not weigh up to link2sd.

The link you provided is known to me, in fact it is an app that comes by default with many chinese phones, and uses the same generic app2sd method to move apps to the sd-card. Link2sd also has this method which also works but.... as I said, kitkat moves the apps to the internal sd, even if you have an external sd.

On 4.2.x installing an external sd card usually provoked the switch-over in terms of mounting to /storage/sdcard leading to having the external sd card as the first sd card storage inline whereas the internal sd card change to be second. On kitkat this is no longer true.
If we go to settings and change the preffered storage location to sd-card, it will go to the internal sd card, never to the external, meaning all media, like photos etc will go to the internal sd-card, which is why I responded to Louis777 that it is impossible to completely eliminate the internal sd-space, kitkat will always need that space.

One thing I haven't tried is [Only registered and activated users can see links Click here to register] which much like link2sd creates a link between the internal sd and the external sd. Even though that won't make link2sd work.
And yes, there's always the possibility to move a system app and create more space there, I already looked into that and there are very few, if any, but it doesn't free enough space, apart from the fact that updating a system app leads to the updated app being put in data/app (just like playstore) which is where just moved it away from.... The great thing about link2sd is that it automatically recreates the link and moves the app to the second partition when the app gets updated, which is exactly what I need, that is, to have this totally transparent and without the user knowing it (no need for user interaction, I mean).

Here's a screenshot of a 4.2.x with link2sd installed:
[attachment=1764]
Take note of the fact that /storage/sdcard0 points to the EXTERNAL sd card, (which is 13gb having a 16gb installed and a second partition of 2gb and a leftover of 1gb)
while /storage/sdcard1 points to the INTERNAL sd card (2.5gb since data on this phone was repartitioned to 4gb, total is 8gb).
This is what I mentioned with the switch-over, because without an external sd card, the internal sd mounts to /storage/sdcard0

And here's the one of the kitkat phone:
[attachment=1765]
As you can see the external sd-card has changed from /storage/sdcard0 to /mnt/media_rw/sdcard_0

Here's another one of what happens when we link an app with link2sd on the kitkat.
[attachment=1766]
The app com.geeksoft.extcardpatch gets a size of 0 and has no icon. It also disappears from the app drawer meaning it can't be executed even if it has indeed moved to the second partition (as is the case here).


Now, ya keep that beer cold as ice.... Big Grin
OK so I will reply to your post 12....kind of

I have been kindly given a so called stock recovery image of Lenovo S850 that has a vold fstab

It has a file called init.fuse.rc and I hope you may be interested in this line
even if not, I shall offer my opinion

Quote:service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled

fact 1....as agreed....vold and KK set up default storage to internal
fact 2 ....lets say not yet mutually agreed,
that quote shows disabled and I suspect you may have line not dis-similar in some init*rc file.

I allege this is what is crippling you from access to external storage. I should mention that this init file has an entrant for storage/sdcard0

#############
Anyhow it looks like next week I am going to have a go at modding my current ROM which is CWM friendly as I can't use flashtools.....to see if I can make my system revert to traditional fstab

and yes I have a vold fstab but Android version only 4.2.2

if I succeed maybe you can feel the warmth of my beery breath.
giggles

cheers
@aus9
Thanks, that is more to the point and into the direction I suspected, related to the fuse daemon.
I just checked and init.fuse.rc is not on the phone. I also have a mpai mp809t with kitkat which doesn't have it either. Both phones have the same kernel version (3.4.67). I haven't tried link2sd on the mpai as it has loads of internal space so I had no need for it, I will however just to see if the same thing happens.
And I will check fact 2.
I don't think the external storage is crippled as I can see and access the files perfectly in root-explorer.
Somehow it seems to like the fuse daemon (which handles the external I/O) doesn't permit the following of soft-links.
Another thing that I will try is to create a link to an app in a folder within /system (not /system/app of course) . Since that link would not be affected by fuse it could prove my hunch is right. It won't solve the problem as that would still depend on the available system space, but at least be a step in some direction.

Salud (as we say here in spain)
Pages: 1 2 3 4 5 6