[GUIDE] How to build ROMs for LB from source

Search This thread

Olivier

Recognized Developer / Retired Forum Moderator
Nov 6, 2011
2,657
6,886
203
Hi,
since many people asked me how I build my ROMs for locked bootloaders, I have decided to write a short guide.

Getting started
As always, you need to set up a build environment. Since I don’t want to elaborate on this, I suggest you to follow the building instructions on the CyanogenMod wiki. You can also use the AOKP website as a reference.


Initializing the repos
To start, you may want to initialize the repos that you will use later on. Just open a terminal and issue the following command:
Code:
repo init -u git://github.com/aosp-lb-nozomi/manifest.git -b <ROM>
Where <ROM> is the ROM you want to build. You have to choice between aokp, pac, slimbean and mokee.
So, let's say you want to build AOKP - this would be the command you would have to issue:
Code:
repo init -u git://github.com/aosp-lb-nozomi/manifest.git -b aokp


Syncing the code
Now that this is done, you can start syncing (this may take some time):
Code:
repo sync -jX
Replace the X with your core count (eventually +1 or -1). (e.g. If you have a dualcore processor, it can be -j2 or -j3)


Building
Start with:
Code:
. build/envsetup.sh

Now you should be good to go. Lunchtime!
Code:
lunch <ROM>_<device>-userdebug
(e.g. lunch aokp_nozomi-userdebug OR lunch slim_aoba-userdebug)

Finally, you are ready to build.
Code:
make -jX bacon


Patching the ROM to work with LB
If everything went right, you should find an AOKP build in your out folder. But this build is unpatched, so it can be flashed on UB devices only. To patch it, go to your root directory (type "cd"), clone my repo and navigate to it:
Code:
git clone [email protected]:aosp-lb-nozomi/rom_builder.git -b [B]<ROM>[/B] patcher;cd patcher

Again, you have to replace <ROM> by the ROM you want to build. Possible ROMs: aokp, pac, slimbean and mk.
NOTE: If you build for the Sony Xperia Ion (aoba), you have to add that. (e.g. git clone [email protected]:aosp-lb-nozomi/rom_builder.git -b aokp-aoba patcher;cd patcher)

Finally, execute the script (to patch the ROM):
Code:
sh makezip

That’s it! Find your build in the folder “patcher” and flash it. :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hi,
    since many people asked me how I build my ROMs for locked bootloaders, I have decided to write a short guide.

    Getting started
    As always, you need to set up a build environment. Since I don’t want to elaborate on this, I suggest you to follow the building instructions on the CyanogenMod wiki. You can also use the AOKP website as a reference.


    Initializing the repos
    To start, you may want to initialize the repos that you will use later on. Just open a terminal and issue the following command:
    Code:
    repo init -u git://github.com/aosp-lb-nozomi/manifest.git -b <ROM>
    Where <ROM> is the ROM you want to build. You have to choice between aokp, pac, slimbean and mokee.
    So, let's say you want to build AOKP - this would be the command you would have to issue:
    Code:
    repo init -u git://github.com/aosp-lb-nozomi/manifest.git -b aokp


    Syncing the code
    Now that this is done, you can start syncing (this may take some time):
    Code:
    repo sync -jX
    Replace the X with your core count (eventually +1 or -1). (e.g. If you have a dualcore processor, it can be -j2 or -j3)


    Building
    Start with:
    Code:
    . build/envsetup.sh

    Now you should be good to go. Lunchtime!
    Code:
    lunch <ROM>_<device>-userdebug
    (e.g. lunch aokp_nozomi-userdebug OR lunch slim_aoba-userdebug)

    Finally, you are ready to build.
    Code:
    make -jX bacon


    Patching the ROM to work with LB
    If everything went right, you should find an AOKP build in your out folder. But this build is unpatched, so it can be flashed on UB devices only. To patch it, go to your root directory (type "cd"), clone my repo and navigate to it:
    Code:
    git clone [email protected]:aosp-lb-nozomi/rom_builder.git -b [B]<ROM>[/B] patcher;cd patcher

    Again, you have to replace <ROM> by the ROM you want to build. Possible ROMs: aokp, pac, slimbean and mk.
    NOTE: If you build for the Sony Xperia Ion (aoba), you have to add that. (e.g. git clone [email protected]:aosp-lb-nozomi/rom_builder.git -b aokp-aoba patcher;cd patcher)

    Finally, execute the script (to patch the ROM):
    Code:
    sh makezip

    That’s it! Find your build in the folder “patcher” and flash it. :D
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone