A method to offload /system/app to /preinstall

Search This thread

timjosten

Senior Member
Mar 25, 2014
75
80
Hello! I would like to share some knowledge about Atrix 2, especially about using the KitKat port by alteredlikeness on it. If you want to install the ROM on System 1, you face some problems with free space. There is no space to install Google Apps, even the micro modular one. Fortunately, there are unused partitions on the device, like /cache and /preinstall. We can benefit from using it.
Also, I recommend installing custom ROMs on JB Leak 3 firmware. It has better partition layout than the stock ICS (big data partition, relatively small cache partition).
Let's go straight to the facts. To offload the system apps to /preinstall partition you need to edit this file:
/system/etc/bmm/script/boot.sh

remount /system as read-write and add the following code after this line:
Code:
/bb translate -i $MNT $BLK $STR $SYSN > $1/init.fs.rc

this needs to be added:
Code:
  echo exec /bb mount -o remount rw /system                               >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/app                           >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/priv-app                      >>$1/init.fs.rc
  echo exec /bb cp /system/app/* /preinstall/system/app                   >>$1/init.fs.rc
  echo exec /bb cp /system/priv-app/* /preinstall/system/priv-app         >>$1/init.fs.rc
  echo exec /bb rm /system/app/*                                          >>$1/init.fs.rc
  echo exec /bb rm /system/priv-app/*                                     >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/app /system/app           >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/priv-app /system/priv-app >>$1/init.fs.rc

On each reboot, it will look for apps in /system/app and move them to /preinstall/system/app and bind that folder to /system/app. Binding works stable, symlinks are not working at all in this case. Don't know why, apps always crashed if I used symlinks.

This all is useful if you want to install custom ROM on System 1.
 
Last edited:

devilhunter47

Senior Member
Jun 22, 2012
1,269
354
Kottayam
Hello! I would like to share some knowledge about Atrix 2, especially about using the KitKat port by alteredlikeness on it. If you want to install the ROM on System 1, you face some problems with free space. There is no space to install Google Apps, even the micro modular one. Fortunately, there are unused partitions on the device, like /cache and /preinstall. We can benefit from using it.
Also, I recommend installing custom ROMs on JB Leak 3 firmware. It has better partition layout than the stock ICS (big data partition, relatively small cache partition).
Let's go straight to the facts. To offload the system apps to /preinstall partition you need to edit this file:
/system/etc/bmm/script/boot.sh

remount /system as read-write and add the following code after this line:
Code:
/bb translate -i $MNT $BLK $STR $SYSN > $1/init.fs.rc

this needs to be added:
Code:
  echo exec /bb mount -o remount rw /system                     >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/app                 >>$1/init.fs.rc
  echo exec /bb cp /system/app/* /preinstall/system/app         >>$1/init.fs.rc
  echo exec /bb rm /system/app/*                                >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/app /system/app >>$1/init.fs.rc

On each reboot, it will look for apps in /system/app and move them to /preinstall/system/app and bind that folder to /system/app. Binding works stable, symlinks are not working at all in this case. Don't know why, apps always crashed if I used symlinks.

This all is useful if you want to install custom ROM on System 1.

Nice work man!!

Sent from my MB865 using Tapatalk 2
 

dskararia

New member
Aug 29, 2013
3
0
Active display

I am on liquid smooth kitkat .
I want to use active display like moto x.
is it possible?
.

---------- Post added at 11:48 AM ---------- Previous post was at 11:44 AM ----------

system-1 stock rom
sys-3 liquid smooth kitkat.

earlier i've tried lot of rom like Mokee, PAC,SlimBean,etc but till today liquid smooth is the best.
please share ur experience regarding roms.

---------- Post added at 11:52 AM ---------- Previous post was at 11:48 AM ----------

system-1 stock rom
sys-3 liquid smooth kitkat.

earlier i've tried lot of rom like Mokee, PAC,SlimBean,etc but till today liquid smooth is the best.
please share ur experience regarding roms.
 

jdog1989

Senior Member
Aug 23, 2014
102
34
Hello! I would like to share some knowledge about Atrix 2, especially about using the KitKat port by alteredlikeness on it. If you want to install the ROM on System 1, you face some problems with free space. There is no space to install Google Apps, even the micro modular one. Fortunately, there are unused partitions on the device, like /cache and /preinstall. We can benefit from using it.
Also, I recommend installing custom ROMs on JB Leak 3 firmware. It has better partition layout than the stock ICS (big data partition, relatively small cache partition).
Let's go straight to the facts. To offload the system apps to /preinstall partition you need to edit this file:
/system/etc/bmm/script/boot.sh

remount /system as read-write and add the following code after this line:
Code:
/bb translate -i $MNT $BLK $STR $SYSN > $1/init.fs.rc

this needs to be added:
Code:
  echo exec /bb mount -o remount rw /system                               >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/app                           >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/priv-app                      >>$1/init.fs.rc
  echo exec /bb cp /system/app/* /preinstall/system/app                   >>$1/init.fs.rc
  echo exec /bb cp /system/priv-app/* /preinstall/system/priv-app         >>$1/init.fs.rc
  echo exec /bb rm /system/app/*                                          >>$1/init.fs.rc
  echo exec /bb rm /system/priv-app/*                                     >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/app /system/app           >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/priv-app /system/priv-app >>$1/init.fs.rc

On each reboot, it will look for apps in /system/app and move them to /preinstall/system/app and bind that folder to /system/app. Binding works stable, symlinks are not working at all in this case. Don't know why, apps always crashed if I used symlinks.

This all is useful if you want to install custom ROM on System 1.

OK, the jb leak idea is great unless u have the at&t a2 (in which I do). So what are the negative impacts of using this script rewrite? Any boot failure?

---------- Post added at 02:49 PM ---------- Previous post was at 02:34 PM ----------

Also, how to remount /system as read-write? And can I just "copy/paste" what u posted?
 

shubham1120

Senior Member
Nov 27, 2012
452
152
Nagpur
Hello! I would like to share some knowledge about Atrix 2, especially about using the KitKat port by alteredlikeness on it. If you want to install the ROM on System 1, you face some problems with free space. There is no space to install Google Apps, even the micro modular one. Fortunately, there are unused partitions on the device, like /cache and /preinstall. We can benefit from using it.
Also, I recommend installing custom ROMs on JB Leak 3 firmware. It has better partition layout than the stock ICS (big data partition, relatively small cache partition).
Let's go straight to the facts. To offload the system apps to /preinstall partition you need to edit this file:
/system/etc/bmm/script/boot.sh

remount /system as read-write and add the following code after this line:
Code:
/bb translate -i $MNT $BLK $STR $SYSN > $1/init.fs.rc

this needs to be added:
Code:
  echo exec /bb mount -o remount rw /system                               >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/app                           >>$1/init.fs.rc
  echo exec /bb mkdir -p /preinstall/system/priv-app                      >>$1/init.fs.rc
  echo exec /bb cp /system/app/* /preinstall/system/app                   >>$1/init.fs.rc
  echo exec /bb cp /system/priv-app/* /preinstall/system/priv-app         >>$1/init.fs.rc
  echo exec /bb rm /system/app/*                                          >>$1/init.fs.rc
  echo exec /bb rm /system/priv-app/*                                     >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/app /system/app           >>$1/init.fs.rc
  echo exec /bb mount --bind /preinstall/system/priv-app /system/priv-app >>$1/init.fs.rc

On each reboot, it will look for apps in /system/app and move them to /preinstall/system/app and bind that folder to /system/app. Binding works stable, symlinks are not working at all in this case. Don't know why, apps always crashed if I used symlinks.

This all is useful if you want to install custom ROM on System 1.
No man it's not working properly. I was on JB leak, followed the exact procedure mentioned by you. Now there's always some leftover from previous roms and it causes force close loop. I tried formating /system, /data and /cache too. Nothing. guess I'll have to start with FXZ
 

timjosten

Senior Member
Mar 25, 2014
75
80
How did you edit the boot.sh file? Maybe your text editor has messed up the end-of-line character? It should be in Unix format.

Also, if you change roms, /preinstall folder must be cleared before installing new rom, then there will be no leftover.
 
Last edited:
  • Like
Reactions: shubham1120

shubham1120

Senior Member
Nov 27, 2012
452
152
Nagpur
How did you edit the boot.sh file? Maybe your text editor has messed up the end-of-line character? It should be in Unix format.

I used es explorer with rw perm for system. And yes I definitely used UNIX format. Big size gapps work without removing BMM but whenever I install new rom, the apps from previous roms were present and caused constant Force closes. Also, formating system, data and cache from BMM dosen't work. Any idea why because I can't use Mokee and JBX on sys1 because of size limitation.
THANKS in advance:highfive:

---------- Post added at 05:32 PM ---------- Previous post was at 05:30 PM ----------

/preinstall folder must be cleared before installing new rom, then there will be no leftover.
So I have to wipe /preinstall from explorer right? I'll try that! Thanks a ton!

EDIT- It works! Thanks man! I think we gotta market this thread. It's very useful for us sys 1 users!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Hello! I would like to share some knowledge about Atrix 2, especially about using the KitKat port by alteredlikeness on it. If you want to install the ROM on System 1, you face some problems with free space. There is no space to install Google Apps, even the micro modular one. Fortunately, there are unused partitions on the device, like /cache and /preinstall. We can benefit from using it.
    Also, I recommend installing custom ROMs on JB Leak 3 firmware. It has better partition layout than the stock ICS (big data partition, relatively small cache partition).
    Let's go straight to the facts. To offload the system apps to /preinstall partition you need to edit this file:
    /system/etc/bmm/script/boot.sh

    remount /system as read-write and add the following code after this line:
    Code:
    /bb translate -i $MNT $BLK $STR $SYSN > $1/init.fs.rc

    this needs to be added:
    Code:
      echo exec /bb mount -o remount rw /system                               >>$1/init.fs.rc
      echo exec /bb mkdir -p /preinstall/system/app                           >>$1/init.fs.rc
      echo exec /bb mkdir -p /preinstall/system/priv-app                      >>$1/init.fs.rc
      echo exec /bb cp /system/app/* /preinstall/system/app                   >>$1/init.fs.rc
      echo exec /bb cp /system/priv-app/* /preinstall/system/priv-app         >>$1/init.fs.rc
      echo exec /bb rm /system/app/*                                          >>$1/init.fs.rc
      echo exec /bb rm /system/priv-app/*                                     >>$1/init.fs.rc
      echo exec /bb mount --bind /preinstall/system/app /system/app           >>$1/init.fs.rc
      echo exec /bb mount --bind /preinstall/system/priv-app /system/priv-app >>$1/init.fs.rc

    On each reboot, it will look for apps in /system/app and move them to /preinstall/system/app and bind that folder to /system/app. Binding works stable, symlinks are not working at all in this case. Don't know why, apps always crashed if I used symlinks.

    This all is useful if you want to install custom ROM on System 1.
    1
    How did you edit the boot.sh file? Maybe your text editor has messed up the end-of-line character? It should be in Unix format.

    Also, if you change roms, /preinstall folder must be cleared before installing new rom, then there will be no leftover.