[HowTo] [for cooks] preload partition / how and why you should use it!

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
Hi folks,

an other very short tutorial for the people (cooks), who do not know how to use the preload (hidden) partition and symlink system apps to it.

Some basics on preload-partition and why you should use it:

We have the so called 'hidden/preload partition' (mmcblk0p12) on our device. Besides the system partition with around 840 mb space, this hidden partition has additional 500 mb...this 500 mb were thought from sammy in the beginning mainly for their own crap like gamehub apps or learning hub and so on. But as system partition is on the edge right now with jelly bean they also use it for placing system apps inside --> the reason is that 840 mb in system is far to less for all files!

Usually most cooks just transfered system apps to data partition (located on your usb storage) to get out of this mess. This method with using hidden partition just gives great opportunity to keep your system partition smaller and you can transfer apps to it which you can not move to data! Your device will probably also perform faster with less space used inside system-partition. Our kernel dev Phil also made it possible now to backup/restore preload-partition within nandroid on his newer CWM-recoveries --> so now you can do a full backup/restore including this preload-partition....before it was not possible!

How to symlink system-apps to preload-partition:

just take the app 'Notepad++' (google for it) on your PC/Laptop, open it, create a new file and put the following inside ('nameofapp.apk' is just an example for any app you wanna symlink):

Link: /preload/symlink/system/app/nameofapp.apk
save and close as 'nameofapp.apk' --> this is the one to put inside /system/app to symlink to the original one you put inside /preload/symlink/system/app.

Now do this steps with every system app you wanna symlink...

This is the manual way to this, though I know scripts can be used to do these steps automatically...;) But this way you at least get a basic understanding how it works!

I won't tell you how to push apps to preload-partition inside CWM-flashable ROM in general, cause this is basic knowledge when you wanna cook a ROM - but you could download any ROM already using this method and look inside 'META-INF\com\google\android\updater-script' and you will know how to do this. ;)
 
Last edited:

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
In dsixda's Kitchen the symlinks are automatically generated with a few lines of code in updater-script.
I'll will try to extract them when continuing to work with my Rom/Tutorial, so non-kitchen-builders can user it in their updater-scripts.

Have to say: it's very nice that you share your knowledge and experience with us, eybee. Thanks for that.
 
  • Like
Reactions: bluheart

maskerwsk

Senior Member
Dec 13, 2011
1,479
1,588
0
Sheffield
Hey eybee. Nice guide.
One question. I'm using dsixda kitchen to build a rom but the zipaligning falls over when it reaches the nameofapk.apk text file. Anyway round this?

Sent from my GT-N7000 using xda premium
 

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
Hey eybee. Nice guide.
One question. I'm using dsixda kitchen to build a rom but the zipaligning falls over when it reaches the nameofapk.apk text file. Anyway round this?

Sent from my GT-N7000 using xda premium
What do you mean by "nameofapk.apk"?
Maps.apk? (Then I know what you mean).

eybee won't give explanations for that because he doesn't use the kitchen.
 

maskerwsk

Senior Member
Dec 13, 2011
1,479
1,588
0
Sheffield
What do you mean by "nameofapk.apk"?
Maps.apk? (Then I know what you mean).

eybee won't give explanations for that because he doesn't use the kitchen.
yeah for example i moved MusicPlayer.apk to preload and created notepad++ file for MusicPlayer.apk which i put in system/app.

but when zipaligning apks in kitchen, when it reached the system/app/MusicPlayer.apk it fails
 

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
yeah for example i moved MusicPlayer.apk to preload and created notepad++ file for MusicPlayer.apk which i put in system/app.

but when zipaligning apks in kitchen, when it reached the system/app/MusicPlayer.apk it fails
of course i fails...you can not zipalign a symlink ;)
just zipalign before, when all apps are still in /system/app and move to /preload afterwards
 

ThaiDai

Senior Member
May 28, 2011
2,537
2,574
203
Aachen/หนองบัวลำภู
of course i fails...you can not zipalign a symlink ;)
just zipalign before, when all apps are still in /system/app and move to /preload afterwards
The problem is explained in the kitchen itself. You get a warning to move all apps first before de-odexing.
But I didn't get any mistake like this when zipaligning - I think the related script checks if there are symlinks. I move the apps before the de-odexing step in the Advanced options but not when zipaligning. So maybe he has some other problems.
 

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
The problem is explained in the kitchen itself. You get a warning to move all apps first before de-odexing.
But I didn't get any mistake like this when zipaligning - I think the related script checks if there are symlinks. I move the apps before the de-odexing step in the Advanced options but not when zipaligning. So maybe he has some other problems.
As explained: he is trying to zopalign the symlink in /system/app which of course fails (it is just a link named .apk!)...the original app he already moved to preload
 

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
This is excellent! We can now take control of an extra 500mb that Samsung thought we would never have access to:cool:

Sent from my GT-N7000 using xda app-developers app
this partition is well known since Galaxy S2 (paulobrien was talking about it back in Aug 2011)....but was not really needed til now
 

Robbie Hood

Senior Member
Nov 7, 2010
3,410
6,018
0
36
breda
www.darkyrom.com
As explained: he is trying to zopalign the symlink in /system/app which of course fails (it is just a link named .apk!)...the original app he already moved to preload
Using a simple more powerfull line in update script

Code:
symlink("/preload/symlink/system/app", "/system/app");
this symlinks the whole folder to system/app so all that is in preload is also visible and active in a linked system/app folder.

This removes the whole functionality of the /system/app folder though but you have a very fast and clean system saves a lot of typing/ copypasting though :)
 
Last edited:

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
Using a simple more powerfull line in update script

Code:
symlink("/preload/symlink/system/app", "/system/app");
this symlinks the whole folder to system/app so all that is in preload is also visible and active in a linked system/app folder.

This removes the whole functionality of the /system/app folder though but you have a very fast and clean system :)
yes, I saw in your script already :D
 

Robbie Hood

Senior Member
Nov 7, 2010
3,410
6,018
0
36
breda
www.darkyrom.com
for all: but there will be one after installation, but just containing symlinks...:cowboy:
well not exactly :p
The folder is linked so when you open it via /system/app or any browser you are virtually in /preload/symlink/system/app with the real apks:eek:
its somewhat the same principle as the sdcard on galaxy s3 which is linked to /data/media and does not have its own partition
 
  • Like
Reactions: eybee1970

eybee1970

Senior Member
Jan 22, 2010
4,940
13,224
0
well not exactly :p
The folder is linked so when you open it via /system/app or any browser you are virtually in /preload/symlink/system/app with the real apks:eek:
its somewhat the same principle as the sdcard on galaxy s3 which is linked to /data/media and does not have its own partition
Ok...this is the correct way to say it ;)
Just did not want anybody coming in here then and say "hey, when i open with Root Explorer i still can see /system/app and all apps inside..." ;)