Build for p31xx

From Omni
Jump to: navigation, search

It is advised that you read this before reading this document :

It is assumed that you have android-sdk .

Setting Up A Compile Environment

You should by far have setup your computer to build for android If not go here [1] and do so.

Building the Rom

It is recommended that you use cache for you builds. It will help you in making your builds faster (from hours to minutes)

   echo "export USE_CCACHE=1" >> ~/.bashrc
   ~/android/omni/prebuilts/misc/linux-x86/ccache/ccache -M 25G

This step is optional: You should now log off and log in again just to be sure that the "exports" that we wrote to bashrc is loaded.

What is does :

1)echo "export USE_CCACHE=1" >> ~/.bashrc

 It tells to write at the end of the file .bashrc which is at the HOME directory (it is hidden , press Ctrl + H) . 

Bashrc is the file which is executed everytime you open a terminal . So writing such export commands to bashrc prevents you from manually writing it everytime you open a terminal.

2)~/android/omni/prebuilts/misc/linux-x86/ccache/ccache -M 25G

 It tells the ccache file to limit the ccache size to 25Gb . If you want 50Gb then replace 25G with 50G.

Now set the environment to start building with this command

   . build/
   breakfast p3100

What is does : 1) . build/ (dont forget the "." DOT and " " SPACE before build/ )

 Go here :

2) breakfast p3100

 What this does is grabs the files for your device. 
 It will grab the following projects 

Now connect your device and go to ~/android/omni/device/samsung/p3100/ And execute "" After it has extracted the proprietary files you can move ahead.

Note:This will work only if you are on latest official CyanogenMod or omnirom.

For those who are on other rom it is advisable that they clone the repository of TheMuppets

You will see many devices in the list You can choose one of the two options

1)Download all the folders for developing for multiple devices(if you plan to)

2)Download relevant folders.

1) If you are willing to download all the devices then you may do so by the following command from terminal

   mkdir ~/Proprietary_Vendor_Samsung
   cd ~/Propritary_Vendor_Samsung
   git clone -b cm-11.0

Note: At the time of this writing cm-11.0 is the latest in all the branches . It should be replaced with later versions if any or it will give following errors

   make: *** No rule to make target `vendor/samsung/omap4-common/proprietary/system/vendor/lib/egl/', 
   needed by `/home/mhrsolanki2020/android/omni/out/target/product/p3100/system/vendor/lib/egl/'.  Stop.

As you can notice it is trying to find "" (latest version) but the one that i have contains "" so i will have to update my Proprietory_Vendor_Samsung to the latest one

2)Download relevant folders

How to find out relevant folders? First download your device proprietary folder . i.e. P31xx which contains both P3100 and P3110 And then also omap4-common. Omap4-common: This is the common files that are not included in the device specific folder. It contains files that are common for all Omap4 architecture And then compile the source. If you see any error then download the folders if they are related to proprietary files. If we take the example of the previous error you can see that it talks about omap4-commn in the vendor/samsung folder.

   make: *** No rule to make target `vendor/samsung/omap4-common/proprietary/system/vendor/lib/egl/, 
   needed by `/home/mhrsolanki2020/android/omni/out/target/product/p3100/system/vendor/lib/egl/'.  Stop.

Heres how you download a folder from github You need a tool named subversion that allows you to serve the purpose

   sudo apt-get sudo apt-get install subversion

And then run the following commands

   svn checkout
   svn checkout

now copy the p3100(from p31xx folder) and omap4-common folder to ~/android/omni/vendor/samsung/

Now type

   brunch p3100

And the build should start. since this is the first time . It will take a lot of time to build . But for next build it will take less time.

Screen Shot (which includes time take for development) after a successful build (first build , so no ccache was there to reduce time) Compile.png

Sources: 1) 2) 3)