[GUIDE] How to build CM12 From source for the MB886 Atrix HD - Motorola Atrix HD

I've had some people PM me for guidance building CM12 from source from the Atrix HD. There are currently no device specific guides, so this will help those of you who want to get their hands dirty with development but don't have a place to start.
Please note that I am writing this from memory as I don't feel like wiping my build environment and setting it up again for the purpose of this tutorial. That said, this *should* be accurate, but if you hit any snags comment and we can try and sort them out.
CREDITS:
This is adapted from http://wiki.cyanogenmod.org/w/Build_for_mb886 and http://forum.xda-developers.com/nexus-4/general/guide-cm11-how-to-build-cyanogenmod-11-t2515305 (Big thank you to @Raum1807 for the excellent guide, I'm merely modifying it to work for the MB886).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Overview
I. Preparation
II. Installation of the required packages
III. Installing Java
IV. The sources
V. Building the ROM
VI. Rebuilding with newest sources
I. Preparation
Things you need for building:
A computer
An internet connection
An open mind
Time
Patience
First of all, you need a running up-to-date Ubuntu/Linux system. I used Ubuntu 14.04 LTS 64-bit from within a VirtualBox VM.
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
IMPORTANT: INSTALL EVERYTHING AS A NORMAL USER. DON'T INSTALL AS ROOT!
II. Installation of the required packages (Ubuntu 14.04 LTS 64-bit)
Install packages:
Code:
$ sudo apt-get install bison build-essential curl flex \
g++-multilib gcc-multilib git-core gnupg gperf \
lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev \
libesd0-dev libncurses5-dev libsdl1.2-dev \
libwxgtk2.8-dev libxml2 libxml2-utils lzop \
openjdk-6-jdk openjdk-6-jre pngcrush schedtool \
squashfs-tools xsltproc zip zlib1g-dev
III. Installing Java
You need a version 6 Java Development Kit for building CM12.0. Usually, the SUN JDK 6 is recommended. But there is another way: you can use the OpenJDK 6. When you installed the required packages as described above, you will just need to configure your Java installation.
Check your Java version:
Code:
$ java -version
Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the right Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
If they are pointing to the wrong versions you have to change that to OpenJDK6.
Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
All done.
IV. The sources
Install repo:
Repo is a tool that makes it quite easy to download and maintain the sources of Cyanogenmod.
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ cd ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create the working directory:
Code:
$ mkdir ~/cm12
$ cd ~/cm12
Initialize Repo:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0
and enter your credentials.
Download the sources:
Code:
$ repo sync
Wait until it's finished - takes some time to download the many GB of source code!
If the process hangs use Ctrl+C to break out of it and resume the download with another
Code:
$ repo sync
If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using
Code:
$ repo sync -j1
Initialize the environment
Code:
$ . build/envsetup.sh
Obtain the proprietary files:
First get missing repositories for the Atrix HD by running
Code:
$ breakfast mb886
Then create a file with the name local_manifest.xml in the local_manifests directory. To see this directory, you have to press Ctrl-H in your file manager. Use this code
Code:
$ gedit ~/cm12/.repo/local_manifests/local_manifest.xml
Paste the following lines to the editor
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="TheMuppets/proprietary_vendor_motorola.git" path="vendor/motorola" remote="github" revision="cm-12.0"/>
</manifest>
Save the file.
Run
Code:
$ repo sync
again to get the files needed.
Download the necessary prebuilts from cyanogenmod by running
Code:
$ cd ~/cm12/vendor/cm
$ . get-prebuilts
$ croot
And you're done!
V. Building the ROM
Now build it:
Code:
$ brunch mb886
And the building process starts. Now have patience. Building takes around half an hour on fast systems and a lot more on older,slower machines and VMs.
When everything worked as it should you will find your new ROM-image in ~/cm12/out/target/product/mb886
It is called cm-12-DATE-UNOFFICIAL-mb886-zip. You can flash it via CWM/PhilZ/Cyanogen Recovery as usual.
VI. Rebuilding with newest sources
Whenever you like to update your sources and build a new version you have to run these four simple commands:
Code:
$ cd ~/cm12
$ repo sync
$ . build/envsetup.sh
$ brunch mb886
Compiling takes less time than it took for creating the ROM the first time because it's only building new parts while reusing old parts that haven't changed. Occasionally you might want to wipe your output directory and build completely anew. To do this:
Code:
$ cd ~/cm12
$ repo sync
$ make clean
$ . build/envsetup.sh
$ brunch mb886
Good luck!

Thank you. Great work!

Awesome work mate

How can we build aosp for atrix hd?

madhurvyas said:
How can we build aosp for atrix hd?
Click to expand...
Click to collapse
almost the same, just you have to download aosp source insted of cm's.. give the aosp link while initialising the repo.. google it, you will find it

I have the aosp source, but I dont think the "brakfast" and "lunch" command will work till I edit/add few files, I have added the local_manifest file, and given path to muppets repo.
Still few more things would be required. any links to read would be great help.

madhurvyas said:
I have the aosp source, but I dont think the "brakfast" and "lunch" command will work till I edit/add few files, I have added the local_manifest file, and given path to muppets repo.
Still few more things would be required. any links to read would be great help.
Click to expand...
Click to collapse
https://source.android.com/source/initializing.html
http://xda-university.com/as-a-developer/getting-started-building-android-from-source
These two links can be useful..

How to build the kernel, or get a prebuilt one.
I downloaded atrixhd kernel source from cm12.1 https://github.com/CyanogenMod/android_kernel_motorola_msm8960-common/tree/cm-12.1

madhurvyas said:
How to build the kernel, or get a prebuilt one.
I downloaded atrixhd kernel source from cm12.1 https://github.com/CyanogenMod/android_kernel_motorola_msm8960-common/tree/cm-12.1
Click to expand...
Click to collapse
http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building
try this..

Related

[TUTORIAL] How to Compile Gummy for Crespo

Compiling Gummy
All work here is done from Ubuntu 10.04.. Newer releases may require slightly different packages.
Installing dependencies:
Install Ubuntu 10.04 and install all updates
Install Java SDK (type or copy the commands into the terminal exactly as you see them here )
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner”
Code:
sudo apt-get update
Code:
sudo apt-get install sun-java6-jdk
Install Git
Code:
sudo apt-get install git-core
Install the rest of the needed files
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils pngcrush
Setting up and syncing Gummy’s Repo
Enter the commands in the terminal exactly as they are displayed to setup your PATH
Code:
mkdir ~/bin
Code:
PATH=~/bin:$PATH
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Create your Gummy source directory and then go to that directory
Code:
mkdir ~/Gummy
Code:
cd ~/Gummy
Initialize and sync the Gummy repo (where X is put the number of cores for your CPU such as “repo sync -j4” for a quad core)
Code:
repo init -u[url="https://github.com/teamgummy/platform_manifest.git"][color=#000000] https://github.com/teamgummy/platform_manifest.git[/color][/url] -b master
Code:
repo sync -jX
Take a break and enjoy an ice cold beer
Go to the fridge
Pull out your favorite brand of beer
Open with care
Drink with pleasure
Otherwise its going to take a while ( a long while )
Preparing to Gummy and compiling
Get prebuilts (Term)
Code:
cd ~/Gummy/vendor/Gummy
Code:
./get-prebuilts
Code:
cd ~/Gummy
Compile (dont forget the . and also make sure you again change the X to the number of cores you have)
Code:
. build/envsetup.sh && lunch Gummy_crespo-userdebug && make gummy -jX
thanks man
---------- Post added at 09:47 AM ---------- Previous post was at 09:36 AM ----------
i have Ubuntu v11.10 so what the different packages i have to consider ? and i will be thankful if you mad another tutorial for compiling cyanogenmod 9 or refer to the link that has made this tutorial

[GUIDE] Bulding CM9 from Sources for O2X (P990)

Building CM9 from Sources for O2X
This Guide is a Step by Step Guide to Build CM9 from official CM9 Sources.
It based on:
aMpeX`s [TUTORIAL] The Step-By-Step guide to build Cyanogenmod7 for the LG Optimus 2X
loganmc10`s [GUIDE] Building CM9 for G2X
I only change to P990, respectively CM9 and add the fix for working Baseband
You need:
- a installed Linux, (I use Ubuntu 11.10, 64 Bit)
- a fast PC or Notebook is recommended
- a fast internet-connections is recommended, (you have to download several GBs)
There are 10 Steps, (8 for building, and 2 optionals ):
1. Installing Build-Packages
2. Install and setup Android-SDK
3. Update path
4. Create directories
5. Install repository and download CM9 Sources
6. Fix for non working camera
6a. Fix the known issues
7. Compiling Unofficial CM9 Build
8. Fix unknown Baseband
9. Extended building
10. Optional changes
Some infos before start:
- read the whole Guide carefully, (possibly you have to read it a few times, untill you understand all steps)
- if you do it exactly as explained, there should be no problems, and the result is a working Unofficial CM9-Build
- don`t login to Linux as root
- if you get problems, feel free to PM me, if you can`t post in Dev-Forum
lets start,
1. Installing Build-Packages
install this for 32 bit and 64 bit:
Terminal:
type:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool
NOTE:
this will install Open-JDK instead of Sun-JDK,
(Sun-JDK isn`t longer official available for Ubuntu)
this will result in an error message at the beginning of compiling,
just ignore it, compiling will working fine.
If you want to install Sun-JDK instead of Open-JDK,
the user tonyp has made a tutorial.
use this line instead of above one
Terminal:
type:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
than go to this tutorial
for me the tutorial above doesn`t work (Ubuntu 11.10 64 Bit)
this is working for me:
open terminal:
Code:
sudo add-apt-repository ppa:ferramroberto/java
Code:
sudo apt-get update
Code:
sudo apt-get install sun-java6-jdk sun-java6-plugin
Code:
sudo update-alternatives --config java
(note: you have to press the tab button to be able to press ok, after the last command )
install this for 64 bit also:
Terminal:
type:
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-4.4-multilib g++-4.4-multilib
2. Install and setup Android-SDK
Download newest Android-SDK from here (Linux (i386) )
Extract the Zip-Package to a directory of your choice
Terminal:
navigate to the tools-folder of Android-SDK and type:
Code:
./android
this will launch the AVD-Manager
check repository, select newest repository, and click install packages
3. Update path
go to your Home-Directory, and press CTRL + H to show hidden files,
open .bashrc
and add this:
Code:
export PATH="/home/<yourusername>/<path to the android SDK >/platform-tools/:${PATH}"
export PATH="/home/<yourusername>/bin/:${PATH}"
now you have to log out and in again for the changes take effect.
now check if changes are working,
Terminal:
type:
Code:
adb devices
you should see something like this:
[email protected]:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
Click to expand...
Click to collapse
4. Create directories
Terminal:
type:
Code:
mkdir -p ~/bin
Code:
mkdir -p ~/android/system
5. Install repository and download CM9 Sources
Install repository
Terminal:
type:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Code:
cd ~/android/system/
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
enter name, email adress, and choose if you want colors or not
Download CM9 Sources:
Terminal:
type:
Code:
cd ~/android/system/
Code:
repo sync
depending on your internet connection speed this can take several hours
press CTRL + H
go to :
/android/system/.repo/
create:
local_manifest.xml
paste into local_manifest.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/lge/p990" name="CyanogenMod/android_device_lge_p990" />
<project path="device/lge/star-common" name="CyanogenMod/android_device_lge_star-common" />
<project path="vendor/lge" name="Owain94/proprietary_vendor_lge.git" remote="github" />
</manifest>
Terminal:
type:
Code:
cd ~/android/system/
Code:
repo sync
6. Fix for non working camera
download this zip-package MediaFire SolidFiles.
(I don`t make this patch, and don`t know who had made it, if you made it PM me and I`ll give credit for your work)
Extract the Zip-Package to a directory of your choice.
Terminal:
type:
Code:
cd ~/android/system
Code:
patch -p1 <
NOTE: after "<" there has to be a "blank space" (press spacebar)
now drop the first ...diff file from extracted package into terminal, the path will be automatically added,
run the created command,
the same procedure for the other 4 files
6a. Fix the known issues
for broken building:
open:
device/lge/p990/BoardConfig.mk
delete line:
Code:
BOARD_TOUCH_RECOVERY := true
For mobile data fix:
place this file to android/system/system/core/init/ (overwrite excisting file),
7. Compiling Unofficial CM9 Build
Terminal:
type:
Code:
~/android/system/vendor/cm/get-prebuilts
Code:
cd ~/android/system/
Code:
. build/envsetup.sh
Code:
brunch p990
depending on your PC or Notebooks specs compiling will take from 30 minutes to several hours
you can find your Rom-Zip-Package at:
/android/system/out/target/product/p990/
Click to expand...
Click to collapse
8. Fix unknown Baseband
open your Rom-Zip-Package and extract /system/build.prop
(don`t close Archivmanager)
open build.prop:
delete line:
ro.modversion=9-...-UNOFFICIAL-p990
Click to expand...
Click to collapse
(thanks to owain94 for deleting line info)
find line:
ro.cm.version=9-...-UNOFFICIAL-p990
Click to expand...
Click to collapse
replace this line with:
ro.cm.version=9.0.0-RC1-p990-UNOFFICIAL
Click to expand...
Click to collapse
save build.prop
drop modded build.prop into Archivemanager (/system, overwrite existing file)
Now your Unofficial CM9 Build is ready to install
------------------------------------------------------------------------------------------------------------------------------------------------------------
9. Extended building:
I decided to make a optional 9. Step to have a better building experience
(all tipps by owain94, thanks)
This Step is a replacement for Step 7!
Terminal:
type:
Code:
cd ~/android/system && clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log
this command downloads the cm-prebuilds,
sets up the build environment,
start the building,
exports all warnings and errors to a text file
and cleans the Terminal.
open another Terminal
type:
Code:
cd ~/android/system && clear && tail -f warn.log
this command cleans the terminal,
shows the warnings and errors in this second Terminal,
and keep the focus on it,
first terminal only shows the building process,
so it`s much easier to catch problems while compiling.
If you have connected two screens to your PC or Notebook,
you can also place second Terminal on second screen.
you can find your Rom-Zip-Package also at:
/android/system/out/target/product/p990/
Click to expand...
Click to collapse
10. Optional changes:
Fix for working torch and torch power-widget:
"activate" torch and power-widget:
open:
/android/system/packages/apps/Torch/res/values/config.xml
add or change to:
Code:
<bool name="useCameraInterface">true</bool>
open:
/android/system/packages/apps/Settings/res/values
add or change to:
Code:
<bool name="has_led_flash">true</bool>
add Torch.apk to the package:
open:
/android/system/device/lge/star-common/star.mk
change:
Code:
## LGE stuffs
PRODUCT_PACKAGES += \
LGEServices \
bridgeutil \
libbridges \
libbridge \
libbridge_jni \
secureclockd \
libsecureclock \
screencap \
hwprops \
com.android.future.usb.accessory
to:
Code:
## LGE stuffs
PRODUCT_PACKAGES += \
LGEServices \
bridgeutil \
libbridges \
libbridge \
libbridge_jni \
secureclockd \
libsecureclock \
screencap \
hwprops \
com.android.future.usb.accessory \
Torch
Credits:
aMpeX, loganmc10, pastime1971, owain94, tonyp, temasek
The -j part isn't needed anymore the build script figure it out on their own
and for the vendor files you can ad this to the local manifest
<project name="koush/proprietary_vendor_lge.git" path="vendor/lge" remote="github" />
it is less work we don't want to do to much
also this is maybe a nice addition
Code:
clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log
i use this build line
clear - make my terminal nice and empty
cd vendor/cm && ./get-prebuilts && cd ../../ - get the cm prebuilts
clear - make the terminal clean again
. build/envsetup.sh - set up the build env
brunch p990 - lunch and bacon for the p990
2> warn.log - exports al the warnings and errors to a text file to keep the terminal clean
i have three screens attached to my pc
on one screen i run the above command (clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log)
on another screen i run this command (clear && tail -f warn.log) this will print (and keep track of) the warn.log file with all the errors and warnings
and on the other screen i do useless stuff hehe
anyway i really like to use 2 terminals it is just easier to catch problems
Nice tut mate!
Sent from my HTC One X using xda premium
reserved
great guide bro.
Edit:
If anyone wants to install the SUN JDK instead of Open JDK you can install it from the partner repository:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
Thanks, for your replies, I'll change my Guide at the evening.
Gesendet von meinem HTC One S mit Tapatalk 2
Great! Maybe I will stay building
Sent from LG 2X using Tapatalk 2 Elite
Thanks a lot !!
The Guide is updated, (big thanks to owain94).
I`ll add a new Step or Section (lets see, atm I don`t know) for extended Build-Line and possibly multiscreen using, I`ll test it while compiling for my One-S.
i am getting an error
make: *** No rule to make target `out/target/product/p990/obj/lib/libnvdispmgr_d.so', needed by `out/target/product/p990/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/LINKED/libsurfaceflinger.so'. Stop.
plz help me..
thanks for the tutorial.
podanimesh said:
i am getting an error
make: *** No rule to make target `out/target/product/p990/obj/lib/libnvdispmgr_d.so', needed by `out/target/product/p990/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/LINKED/libsurfaceflinger.so'. Stop.
plz help me..
Click to expand...
Click to collapse
did you sync the vendor files?
libnvdispmgr_d.so is a vendor file that cannot be build because we don't have the sources
you need to sync them from koush his github or extract the vendor files using the script in the device folder
good luck
owain94 said:
did you sync the vendor files?
libnvdispmgr_d.so is a vendor file that cannot be build because we don't have the sources
you need to sync them from koush his github or extract the vendor files using the script in the device folder
good luck
Click to expand...
Click to collapse
ok now compiled successfully..
ROM booted but no wi-fi and camera..
podanimesh said:
ok now compiled successfully..
ROM booted but no wi-fi and camera..
Click to expand...
Click to collapse
Wifi working fine for me, but I'll add a step for camera fix, thanks for reporting
Gesendet von meinem HTC VLE_U mit Tapatalk 2
If anyone wants to have SUN JDK instead of Open JDK it's still possible:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
I also put that in "my" post 3.
thanks for reporting, but as far as I know, sun has many security risks, isn`t it?
XXMrHyde said:
thanks for reporting, but as far as I know, sun has many security risks, isn`t it?
Click to expand...
Click to collapse
Hm I don't think so. As far as I know the reason why Open JDK is used in Ubuntu instead of Sun JDK is that Open JDK is fully open sourced while Sun JDK still uses some pre compiled closed source binaries. Some open source fanatics might call this a security risk as they can't check the source themselves, but apart from that their shouldn't be any risks.
Sent from my LG-P990 using xda app-developers app
this procedure did not make .zip file, but normal folder
tonyp said:
Hm I don't think so. As far as I know the reason why Open JDK is used in Ubuntu instead of Sun JDK is that Open JDK is fully open sourced while Sun JDK still uses some pre compiled closed source binaries. Some open source fanatics might call this a security risk as they can't check the source themselves, but apart from that their shouldn't be any risks.
Sent from my LG-P990 using xda app-developers app
Click to expand...
Click to collapse
Ok, nice to know, I`ll change the Guide, so users can decide, which JDK they want to install
tomsi91 said:
this procedure did not make .zip file, but normal folder
Click to expand...
Click to collapse
Then you make a mistake, if so, my Rom wouldn`t excist
Please upload camera fix tutorial....
Sorry, I was a little bit busy today, I`ll ad the camera fix to the guide now
added camera fix to the Guide
edit:
now it can be choosen if you want to install Sun- or Open-JDK

[GUIDE CM10] How to build your own CyanogenMod 10 ROM from sources for LG P990 O2x

Make your 'own' ROM today!
Revision History:
V1.5 2013.01.07 Update to newest Java 6 version: Java SE Development Kit 6 Update 38
V1.4 2012.11.20 ParanoidAndroid ROM building guide added, minor changes
V1.3 2012.11.10 New FAQ, Updates Java section, WIFI fix
V1.2 2012.11.05 Sync part updated
V1.1 2012.11.04 Typos fixed
V1.0 2012.11.03 Initial release
Thank you note: Thank you Ricardo Cerqueira for your work on the LG P990. Without you none of this would be possible. Thank you ethansp for your feedback and your input regarding the sync matter. Thank you TrymHansen and Ferrum Master for your input in respect of the JAVA topic. And thank you p.valenta for your contribution to the WIFI build fix.
Overview
0. Preparation
I. Installation of the required packages
II. Installing JAVA
III. The sources
IV. Building the ROM
V. Rebuilding with newest sources
VI. FAQ
VII. Building ParanoidAndroid ROM
0. Preparation
Things you need for building:
A computer
An internet connection
An open mind
Time
Patience
First of all you need a running up-to-date Ubuntu/Linux system. I am using Ubuntu 12.10 64-bit.
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
IMPORTANT: INSTALL EVERYTHING AS A NORMAL USER. DON'T INSTALL AS ROOT!
I. Installation of the required packages (Ubuntu 12.10 64-bit)
Install packages:
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils schedtool pngcrush xsltproc zlib1g-dev:i386
Set the links:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
II. Installing JAVA
You need a Java Development Kit for building CM10. Recommended is the SUN JDK 6. As of writing the most recent version is SUN JDK 6 Update 38.
1. Download the jdk-6u38-linux-i586.bin from the Oracle/Sun Java Download Area. If you are on 64-bit Ubuntu as I am, you should grab jdk-6u38-linux-x64.bin.
2. Make the bin file executable:
Code:
$ chmod +x jdk-6u38-linux-x64.bin
3. Extract the bin file:
Code:
$ ./jdk-6u38-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
$ sudo mv jdk1.6.0_38 /usr/lib/jvm/./jdk-6u38-linux-x64.bin
5. Install the new Java source in system:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/java 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javaws 1
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javadoc 1
$ sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javah 1
$ sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javap 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
7. Check Java version:
Code:
$ java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
III. The sources
Install repo:
Repo is a tool that makes it quite easy to download and maintain the sources of Cyanogenmod.
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ cd ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create working directory:
Code:
$ mkdir ~/cm10
$ cd ~/cm10
Initialize Repo:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b jellybean
and enter your credentials.
Download the sources:
Code:
$ repo sync
Wait until it's finished (takes a lot of time!)
If the process hangs use Ctrl+C to break out of it and resume the download with another
Code:
$ repo sync
Tip from ethansp: If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using
Code:
$ repo sync -j1
Initialize the environment
Code:
$ . build/envsetup.sh
Obtain the proprietary files:
Create a file with the name local_manifest.xml in the .repo directory. To see this directory, you have to press Ctrl-H in your file manager.
Create it with
Code:
gedit ~/cm10/.repo/local_manifest.xml
Paste the following lines to the editor
Code:
<manifest>
<project name="CyanogenMod/android_device_lge_p990" path="device/lge/p990" remote="github" revision="jellybean"/>
<project name="CyanogenMod/android_device_lge_star-common" path="device/lge/star-common" remote="github" revision="jellybean"/>
<project name="CyanogenMod/lge-kernel-star" path="kernel/lge/star" remote="github" revision="jellybean"/>
<project path="vendor/lge" name="TheMuppets/proprietary_vendor_lge.git" remote="github" revision="jellybean"/>
</manifest>
Save the file.
Run
Code:
$ repo sync
again to get the files needed.
Download the necessary prebuilts from cyanogenmod by running
Code:
$ ~/cm10/vendor/cm/get-prebuilts
And you are done!
IV. Building the ROM
Now build it:
Code:
$ brunch p990
And building process starts. Now have patience. Building takes around half an hour on fast systems and a lot more on older and slower machines.
When everything worked as it should you will find your new ROM-image in ~/cm10/out/target/product/p990
It is called cm-10-DATE-UNOFFICIAL-p990-zip. You can flash it via CWM as usual.
If you are having trouble with the WIFI not working with your newly flashed ROM, check the FAQ section C below for the solution.
V. Rebuilding with newest sources
Whenever you like to update your sources and build a new version you have to run these four simple commands:
Code:
$ cd ~/cm10
$ repo sync
$ . build/envsetup.sh
$ brunch p990
Building takes less time than it took for creating it the first build because it's only rebuilding new parts and using old parts that haven't changed.
Happy building!
VI. FAQ
A. How to tell how long it takes to build the ROM?
First, it depends on your hardware, second, whether it is your first build or a daily rebuild. To get a first number, you can use the “time” command and add the “brunch” command to it.
E.g.
Code:
time brunch p990
So the system will tell you how long it took to build the ROM. Then you know next time if it will be a short or long coffee break while waiting for your build to finish.
B. Is there a way to speed up the building process?
Actually, there are a lot of ways to speed up the process. Here are some of them:
1. Hardware:
When you build the first time it takes half an hour on fast machines and up to many hours on slower machines. What counts most is raw CPU power. Multi-core computers with a lot of fast RAM are recommended. The more cores the better. Memory-wise a setup with more than 8GB with aggressive but of course also stable timings is also adding to the building speed. A fast HDD or even SSD doesn't hurt either. When resourceful, you can use a system with multiple SSDs and gain more speed than single storage systems. But in most cases the CPU will be the biggest bottleneck. Check with tools, e.g. System Monitor in Ubuntu – and watch the resources tab to find out your bottleneck.
2. System-Software:
If you are using virtual machine software then try to optimize it. Look for “virtualization support” in the BIOS. Give it as much CPU power and memory as you can from your host system. Whenever it is possible it is recommended that you install the system directly, as the virtualization solution usually comes with a performance drop compared to a system installed and booted from directly.
3. The building software:
a. Out Directory
You can use a separate output directory for your builds, e.g. on a different hard drive with a fast file system.
Append
Code:
export OUT_DIR_COMMON_BASE=<path-to-your-out-directory>
to your .bashrc file.
b. Caching
You can setup Ccache, a system that acts as a compiler cache for all the parts of the building that are written in C. This is excellent if you rebuild often. But keep in mind that building the first time takes even longer when you have Ccache activated than building without it. So for first tests it is fine to build without Ccache enabled.
To enable Ccache add
Code:
export USE_CCACHE=1
to your .bashrc file
Optional: If you like to set the path, where the Ccache will be stored on your own, you have to add another line to the .bashrc
export CCACHE_DIR=<path-to-your-cache-directory>
Now run this command once to initialize the Ccache
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 15G
C. I built the ROM successfully. I flashed it too, but the WiFi is not working anymore. What can I do?
The efforts of the CyanogenMod devs can be considered work in progress. And so it happens that features get broken while trying to fix others...
If you suffer from this then take the file 'wireless.ko'. You find the file below as an attachment. Push or copy it to '/system/lib/modules' and overwrite the file with the same name there. Change the rights to 644 or rw- r-- r-- It's the same as read/write by owner, read by group and read by other.
Without reboot, you can switch on the WiFi now. And you should be back in the game. Thanks to p.valenta for confirmation that it is working.
D. I checked the free space of the system partition. There isn't any. What can I do?
Without changing the size of the system partition not so much. But you can squeeze out a few MBs by removing some files from the created ROM image:
E.g. all the videos in /system/media/video can be deleted.
You can erase the /system/media/bootanimation.zip if you want.
Check /system/media/audio/, there you can delete some ringtones you are not using.
And if you know what you are doing, you can even get rid of some .apk files from '/system/app'.
For example LiveWallpapers.apk, VisualizationWallpapers.apk, CMWallpapers.apk, MagicSmokeWallpapers.apk, HoloSpiralWallpaper.apk are expendable.
E. I don't want to use Sun's/Oracle's Java Development Kit. Can I use another one instead?
Yes, you can. But using Sun's version is recommended by Google and CyanogenMod for building ROMs. So consider yourself warned. You can use the OpenJDK 6 that you will find already on your system if you installed the necessary packages as shown above. What you finally need to do is checking which Java version is active.
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
Each time choose the OpenJDK6 variant.
Verify the symlinks: Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
When everything you see says 'OpenJDK6' then you can build your ROM with the usual commands.
VII. Build your own ParanoidAndroid ROM based on CM10 for LG P990
IMPORTANT! THIS IS A FOLLOW-UP GUIDE THAT REQUIRES A WORKING BUILDING ENVIRONMENT.
Preparation
You need a tested and fully working building environment (Ubuntu 12.04/12.10, Java 6, etc.). If you do not have one already, please follow this guide throughly first and build a normal CM10 ROM from sources as a test. If everything works as it should, then you can proceed with the following lines.
ParanoidAndroid Environment
Let's start.
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
Create a directory named 'paranoid' in your home folder
Code:
$ mkdir ~/paranoid
Initialize the Repo in your newly created directory:
Code:
$ cd ~/paranoid
$ repo init -u git://github.com/ParanoidAndroid/android.git -b jellybean
Before downloading the files you need to edit a file. One line leads to sync errors and has to be deleted from the file. Edit 'default.xml' in /paranoid/.repo/manifests/
(Hint if you can't see the .repo directory: it's hidden, so to make it visible press Ctrl+H) or use this line
Code:
$ gedit ~/paranoid/.repo/manifests/default.xml
Search (Ctrl+F) for 'ParanoidPreferences' and remove the whole line. Save and close the 'default.xml' file.
We need to add some LGE (P990) specific repositories as well. You can either copy the 'local_manifest.xml' file (it's the same!) from your cm10-build-environment or create a new file in /paranoid/.repo/
To create a new file use
Code:
$ gedit ~/paranoid/.repo/local_manifest.xml
Insert the following lines
Code:
<manifest>
<project name="TheMuppets/proprietary_vendor_lge.git" path="vendor/lge" remote="github" revision="jellybean"/>
<project name="CyanogenMod/android_device_lge_p990" path="device/lge/p990" remote="github" revision="jellybean"/>
<project name="CyanogenMod/android_device_lge_star-common" path="device/lge/star-common" remote="github" revision="jellybean"/>
<project name="CyanogenMod/lge-kernel-star" path="kernel/lge/star" remote="github" revision="jellybean"/>
<project name="TheMuppets/proprietary_vendor_lge" path="vendor/lge" remote="github" revision="jellybean"/>
</manifest>
Save it.
Sync the repositories (takes time!)
Code:
$ repo sync
Take a looong coffee break.
A few files
After the successful sync process go to 'paranoid/vendor/pa/products/'.
Create a new file with the name 'pa_p990.mk'
Code:
$ gedit ~/paranoid/vendor/pa/products/pa_p990.mk
Insert these lines:
(lines changed, xhdpi to hdpi, thanks rugglez)
Code:
# Check for target product
ifeq (pa_p990,$(TARGET_PRODUCT))
# Define PA bootanimation size
PARANOID_BOOTANIMATION_NAME := HDPI
# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_hdpi
# include ParanoidAndroid common configuration
include vendor/pa/config/pa_common.mk
# Inherit CM device configuration
$(call inherit-product, device/lge/p990/cm.mk)
PRODUCT_NAME := pa_p990
GET_VENDOR_PROPS := $(shell vendor/pa/tools/getvendorprops.py $(PRODUCT_NAME))
endif
Save it.
Open 'AndroidProducts.mk' in 'paranoid/vendor/pa/products/' with
Code:
$ gedit ~/paranoid/vendor/pa/products/AndroidProducts.mk
and add these lines to then end of the file:
Code:
ifeq (pa_p990,$(TARGET_PRODUCT))
PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_p990.mk
endif
Save it.
Create a file called 'p990.proprietaries' in 'paranoid/vendor/pa/vendorprops/'
Code:
$ gedit ~/paranoid/vendor/pa/vendorprops/p990.proprietaries
Code:
[
{
"account": "TheMuppets",
"repository": "proprietary_vendor_lge",
"target_path": "vendor/lge",
"revision": "jellybean"
}
]
Save it.
Open 'vendorsetup.sh' in 'paranoid/vendor/pa/'
Code:
$ gedit ~/paranoid/vendor/pa/vendorsetup.sh
Add this line
Code:
add_lunch_combo pa_p990-userdebug
Save it.
Get CM Prebuilts
Now go to
Code:
$ ~/paranoid/vendor/cm/get-prebuilts
Building ParanoidAndroid
Ready to go! Build your ROM now with
Code:
$ cd ~/paranoid
$ ./rom-build.sh p990
The compiling takes around the same amount of time as when building CM10. Half an hour minimum, up to a few hours on slower systems. You will find your CWM flashable zip in 'paranoid/out/target/product/p990/'. It is called 'pa_p990-version-date-time.zip'
Rebuilding
Everytime you want to rebuild or build a new version, just change to the directory, resync the sources and start building:
Code:
$ cd ~/paranoid
$ repo sync
$ ./rom-build.sh p990
If you haven't enlarged your system partition yet, you have to delete some files or the ROM probably won't fit.
Deletable files
/system/media/: delete bootanimation.zip, saves 9.4 MB
/system/media/video/: delete all files, saves 6.4 MB
/system/media/audio/ringtones/: keep one or two, delete the rest, saves up to ~8 MB
You can even delete some system apps (.apk) from '/system/app/' like LiveWallpapers.apk, VisualizationWallpapers.apk, CMWallpapers.apk, MagicSmokeWallpapers.apk, HoloSpiralWallpaper.apk
I would personally love it if people included instructions for other distros. Not everything uses apt-get. That's kind of just me being nitpicky, but I've compiled CM9 on Archlinux with substituting a few things.
Also, what happened to the month of letting RC shine?
tetrahedonism said:
I would personally love it if people included instructions for other distros. Not everything uses apt-get. That's kind of just me being nitpicky, but I've compiled CM9 on Archlinux with substituting a few things.
Also, what happened to the month of letting RC shine?
Click to expand...
Click to collapse
Google their advice is to use ubuntu if you want to use a distros if your own choices you are probably advanced enough to change the instructions to your needs
And about Ricardo his month it is only a tut to compile it yourself you don't have to share it
Sent from my Galaxy Nexus using XDA Premium HD app
owain94 said:
Google their advice is to use ubuntu if you want to use a distros if your own choices you are probably advanced enough to change the instructions to your needs
And about Ricardo his month it is only a tut to compile it yourself you don't have to share it
Sent from my Galaxy Nexus using XDA Premium HD app
Click to expand...
Click to collapse
I guess I could always post my own adapted instructions! Maybe some day. Ahah.
As funny as it may seem to u, instructions to compile CM10 on different distro than Ubuntu would be highly appreciated. Not everyone uses Ubuntu (I do actually), so u may help someone trying to set it up on their distro...
Just my 2 cents....
tetrahedonism said:
I guess I could always post my own adapted instructions! Maybe some day. Ahah.
Click to expand...
Click to collapse
I think you should, and hey, please don't tempt us, share your things
Thanks for the tread as well raum1807
Great guide. This will probably let me make my own rom and share it on xda
Is it possible to compile on 32 bits system?
Sent from my LG-P990 using Tapatalk 2
slebit said:
Is it possible to compile on 32 bits system?
Sent from my LG-P990 using Tapatalk 2
Click to expand...
Click to collapse
No, 64 bits only
Sent from my LG-P990 using xda premium
HerrKuk said:
No, 64 bits only
Sent from my LG-P990 using xda premium
Click to expand...
Click to collapse
You mean it's impossible to compile on Ubuntu 12.04 32-bit ?
Litderose said:
You mean it's impossible to compile on Ubuntu 12.04 32-bit ?
Click to expand...
Click to collapse
If i've done my homework properly, yes
ICS and older are possible with 32bits though
Sent from my LG-P990 using xda premium
Hi, i'm trying to build following your guide.
I have a little problem with step 5.
When i put the line exactly like your
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac
I get fail, system told me they need prority in entire numeric. I get it work with this:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac 1
Have to do the same with the other 2 commands.
Hope this help someone stucked.
Cheers,
eThAn
ethansp said:
Hi, i'm trying to build following your guide.
I have a little problem with step 5.
When i put the line exactly like your
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac
I get fail, system told me they need prority in entire numeric. I get it work with this:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac 1
Have to do the same with the other 2 commands.
Hope this help someone stucked.
Cheers,
eThAn
Click to expand...
Click to collapse
Thank you for pointing me to that error. Somehow the priority got lost while pasting. I corrected it.
tetrahedonism said:
Also, what happened to the month of letting RC shine?
Click to expand...
Click to collapse
As owain already said, we devs have decided to wait for 3-4 weeks before using his work and releasing it as an "own" ROM.
This does only affect releasing a ROM, not building it.
I will always encourage everone to build their own ROM for their own purpose, there's nothing wrong with that. And you will learn a lot
slebit said:
Is it possible to compile on 32 bits system?
Sent from my LG-P990 using Tapatalk 2
Click to expand...
Click to collapse
HerrKuk said:
No, 64 bits only
Sent from my LG-P990 using xda premium
Click to expand...
Click to collapse
Litderose said:
You mean it's impossible to compile on Ubuntu 12.04 32-bit ?
Click to expand...
Click to collapse
HerrKuk said:
If i've done my homework properly, yes
ICS and older are possible with 32bits though
Sent from my LG-P990 using xda premium
Click to expand...
Click to collapse
HerrKuk is right. If you try to compile it on a 32-bit system you will see a lot of errors. As JBQ stated here, a 64-bit OS is mandatory.
Do any of you guys get working wi-fi on your kangs?
TrymHansen said:
Do any of you guys get working wi-fi on your kangs?
Click to expand...
Click to collapse
Is not working. I have too dead wifi. Stucks "activating WI-FI..."
I going to see logcat later and share here.
Good, thanks, was just wondering if I had to make a new build-system from scratch, I've re-used my old CM9-builder.
tonyp said:
As owain already said, we devs have decided to wait for 3-4 weeks before using his work and releasing it as an "own" ROM.
This does only affect releasing a ROM, not building it.
I will always encourage everone to build their own ROM for their own purpose, there's nothing wrong with that. And you will learn a lot
Click to expand...
Click to collapse
We all understand rest of the devs here are waiting for RC Shine, thats fine. But as these nightly builds are having too many annoying bugs liek slow battery charging, wifi-battery drain issue, screen wake issue, power button issue, which makes it impossible to even test, forget making it daily driver. In fact even some pals are not able to install it properly (4,5 builds). I dont understand why rest of the devs are not making fixes to these various issues in this nightlies. Other devs are expert who can understand this seperate issues and can make patches till a month, before actually making own custom roms.
Uptil now the fixes suggested by some members are either not working or even making it worse sometimes.
Devs, Please think again for your strong valuable expert fixes. How about a single file parmanent patch with all possible fixes? Will appreciate. Sorry if asking too much or out of protocol. I dont know much what you devs have decided long time back.
Was on the latest build from RC and on bb v20c and the ril which came with the build....wifi was working perfectly and I confirm without a big drain of battery....it was richly smooth
O2X with Magical ROM and supersonic kernels from my buddies

[GUIDE] Android One (Sprout) Making Kernel's or ROM's in Simple Way [NOOB FRIENDLY]

Post is Influenced from @Anik_khan Kernel Post to make Procedure More Simple for Us All.
So Don't BE Shocked to see Things
Prerequisites:
Ubuntu 14.04 Trusty Tahr 64 Bit. (Can be on VirtualBox or Full Install Your Wish.)
RAM Minimum:2GB Recommended:4GB
Around 100GB Space for ROM’s. (Kernels can use upto 1GB.)
Unlimited (Fast) LAN Connection.
More RAM, or faster CPU, or SSD will speed up the process.
A Brain (Most Important of All :v)
At the starting of the post I have linked a script by @akhilnarang which if run will automatically install all these programs for lazy people.
If you not interested to do all procedure from below just use the script. Simply it will automatically configure the build environment.
NOTE-------- some of these packages may already be on your machine. Obviously, if you complete a step and you have one of these installed, the machine simply will not do anything. So...it will not hurt anything. Some of the packages are different from Ubuntu 12.04 and 13.04 (use these packages for Ubuntu 14.04 as many of the old ones have obsoleted - these are new replacements).
So if you set up your pc with Ubuntu we are good to go.
All code will be in code boxes like this:
Code:
$
means you have to run that command in the terminal (don't type the $).
All commands with sudo, gksudo, or gksu means it requires root permission.
It will ask for password.
Once you type, then in that terminal session it will not ask you for a few minutes again.
Any time you make changes to .bashrc or .profile file, make sure to run
Code:
$ source ~/.bashrc
$ source ~/.profile
Or exit and open new terminal else the changes will not take place
Setting Up Build Environment
Method 1:
So if you not interested in doing below all steps then simply use this script by my friend @akhilnarang
Open terminal and type:
Code:
$ sudo apt-get install git-core
then do
Code:
$ git clone https://github.com/akhilnarang/scripts.git
$ cd scripts
$ . build-environment-setup.sh
This script will install all required packages
Method 2:
1)Installing Java JDK
Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one:
Download & install java
Code:
$ sudo apt-get update && sudo apt-get install openjdk-7-jdk openjdk-7-jre
CHECK if java properly installed or not
Code:
$ java -version
If you get output like
Code:
Code:
java version "1.7.0_79" or anything higher(in my case)
on the first line then all is good
Now JDK is configured!
Note: Only for Ubuntu 14.04 or higher
2)Installing Required Packages
Open Terminal
Now execute this command:
Note: This will take some time, has to download about 500MB or so of packages
Code:
$ sudo apt-get update && sudo apt-get install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-7-jdk pngcrush schedtool \
libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib liblz4-* android-tools-adb android-tools-fastboot ccache
3)Installing Android SDK
Download the SDK from here!
Accept Terms & download 64 bit.
Extract in your home directory & rename extracted folder "android-sdk".
Now, execute these commands in terminal:
Code:
$ cd ~/android-sdk/tools/
$ ./android sdk
At this point the SDK should come up and you will need to download at least all the tools and all the extras files (at least to 4.0, so select them and install them.When it finishes downloading & installing everything you have to run this command in ANOTHER TERMINAL:
Code:
$ sudo apt-get install gksudo
$ gksu gedit .bashrc
And you need to add at the end of it your SDK paths these three lines (copy and paste them):
Code:
export PATH=~/android-sdk/tools:$PATH
export PATH=~/android-sdk/platform-tools:$PATH
export PATH=~/bin:$PATH
Save and close the file, then close terminal, or
Code:
source ~/.bashrc
Find your .profile file and add this at the bottom of the file
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/plartform-tools:$PATH"
SDK is configured.
4)Configuring USB Access
Now we need to set permissions so that our USB ports can detect our android devices
Type in the following commands, it will download a file with the permissions, give it permission to execute, and restart the service.
Code:
$ sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
ADB & Fastboot are configured
5)Installing Repo Package
Open terminal and type:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6)Configure Git
Open terminal and type:
Code:
$ git config --global user.email ""
$ git config --global user.name ""
Git is configured.
7)Configure ccache
Open terminal and type:
Code:
$ gksu gedit ~/.bashrc
Enter these lines
Code:
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
Save & close
Open terminal & execute:
Code:
$ source .bashrc
$ ccache -M 50G
I usually use 50 gigs. You can use more if you have more space, or build for many devices
Congrats
YOUR BUILD ENVIROMENT IS NOW SETUP .
Making Kernel
Good work !!! Waiting for completion
Sent from my Moto G using Tapatalk
Thread closed per OPs request

[ROM] Unoffical Sailfish OS for Huawei Y6

PHP:
/*
* Your warranty is now void.
*
* We're not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
Devices Confirmed working.
SCL-L21
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Work:
Cellural
3/4G
WiFi
BT
GPS
And other
Not work:
Camera
On first boot not work WiFi and BT
Download: https://yadi.sk/d/UZE7mX1735WJrp
Installation:
1. Flash TWRP if not flashed yet
2. Flash CM-12.1 From tis thread http://forum.xda-developers.com/android/development/rom-unoffical-cm12-1-huawei-y6-t3404674
3. Flash Sailfish OS
Sources here: https://github.com/sailfishos-huawei-y6
Self build instructiion
Build only on Ubnutu
1. Setup evenroment:
Code:
cat <<'EOF' > $HOME/.hadk.env
export MER_ROOT="$HOME/mer"
export ANDROID_ROOT="$MER_ROOT/android/droid"
export VENDOR="huawei"
export DEVICE="y6"
export PORT_ARCH="armv7hl"
EOF
cat <<'EOF' >> $HOME/.mersdkubu.profile
function hadk() { source $HOME/.hadk.env; echo "Env setup for $DEVICE"; }
export PS1="HABUILD_SDK [${DEVICE}] $PS1"
hadk
EOF
cat <<'EOF' >> $HOME/.mersdk.profile
function hadk() { source $HOME/.hadk.env; echo "Env setup for $DEVICE"; }
hadk
EOF
2. Download MerSDK
Code:
export MER_ROOT=$HOME/mer
cd
TARBALL=mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2
curl -k -O https://img.merproject.org/images/mer-sdk/$TARBALL
sudo mkdir -p $MER_ROOT/sdks/sdk
cd $MER_ROOT/sdks/sdk
sudo tar --numeric-owner -p -xjf $HOME/$TARBALL
echo "export MER_ROOT=$MER_ROOT" >> ~/.bashrc
echo 'alias sdk=$MER_ROOT/sdks/sdk/mer-sdk-chroot' >> ~/.bashrc
exec bash
echo 'PS1="MerSDK $PS1"' >> ~/.mersdk.profile
cd
3. Entering into Mer SDK and update it
Code:
exec bash
sdk
# IN SDK
sudo zypper ref
sudo zypper up
sudo zypper ar http://repo.merproject.org/obs/home:/sledge:/mer/latest_i486/ curlfix
sudo zypper ref curlfix
sudo zypper dup --from curlfix
sudo zypper in android-tools createrepo zip
4. In MerSDK download Android build SDK
Code:
hadk
TARBALL=ubuntu-trusty-android-rootfs.tar.bz2
curl -O http://img.merproject.org/images/mer-hybris/ubu/$TARBALL
UBUNTU_CHROOT=$MER_ROOT/sdks/ubuntu
sudo mkdir -p $UBUNTU_CHROOT
sudo tar --numeric-owner -xvjf $TARBALL -C $UBUNTU_CHROOT
ubu-chroot -r $MER_ROOT/sdks/ubuntu
5. Setup repo comand and update repos
Code:
sudo mkdir -p $ANDROID_ROOT
sudo chown -R $USER $ANDROID_ROOT
cd $ANDROID_ROOT
mkdir $ANDROID_ROOT/.repo/local_manifests -p
cd $ANDROID_ROOT
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
sudo mv repo /usr/bin/repo
repo init -u git://github.com/mer-hybris/android.git -b hybris-12.1
6. Setup local_manifest for our device
Code:
cd $ANDROID_ROOT/.repo/local_manifests/
curl -O https://raw.githubusercontent.com/sailfishos-huawei-y6/droid_repo_local_manifests/master/y6.xml
cd $ANDROID_ROOT
7. Download sources (~13 Gb)
Code:
repo sync --fetch-submodules
8. Build android part
Code:
hadk
source build/envsetup.sh
export USE_CCACHE=1
breakfast $DEVICE
make -j4 hybris-hal
9. Download SB2 target
Code:
exit
cd $HOME
SFE_SB2_TARGET=$MER_ROOT/targets/$VENDOR-$DEVICE-$PORT_ARCH
TARBALL_URL=http://releases.sailfishos.org/sdk/latest/targets/targets.json
TARBALL=$(curl $TARBALL_URL | grep "$PORT_ARCH.tar.bz2" | cut -d" -f4)
curl -O $TARBALL
sudo mkdir -p $SFE_SB2_TARGET
sudo tar --numeric-owner -pxjf $(basename $TARBALL) -C $SFE_SB2_TARGET
sudo chown -R $USER $SFE_SB2_TARGET
cd $SFE_SB2_TARGET
grep :$(id -u): /etc/passwd >> etc/passwd
grep :$(id -g): /etc/group >> etc/group
sb2-init -d -L "--sysroot=/" -C "--sysroot=/"
-c /usr/bin/qemu-arm-dynamic -m sdk-build
-n -N -t / $VENDOR-$DEVICE-$PORT_ARCH
/opt/cross/bin/$PORT_ARCH-meego-linux-gnueabi-gcc
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R rpm --rebuilddb
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper ar
-G http://repo.merproject.org/releases/mer-tools/rolling/builds/$PORT_ARCH/packages/
mer-tools-rolling
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper ref --force
10. Create droid-hal rpm packages
Code:
cd $ANDROID_ROOT
rpm/dhd/helpers/build_packages.sh
11. Create KS file for sailfish rootfs
Code:
mkdir -p tmp
HA_REPO="repo [email protected]@"
KS="[email protected]@[email protected]@.ks"
sed -e "s|^$HA_REPO.*$|$HA_REPO --baseurl=file://$ANDROID_ROOT/droid-local-repo/$DEVICE|" $ANDROID_ROOT/hybris/droid-configs/installroot/usr/share/kickstarts/$KS > tmp/$KS
12. Create root_fs
Code:
cd $ANDOROID_ROOT
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh
RELEASE=2.0.5.6
EXTRA_NAME=-my1
sudo mic create fs --arch $PORT_ARCH --debug --tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME --record-pkgs=name,url --outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME --pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 $ANDROID_ROOT/tmp/[email protected]@[email protected]@.ks
After that we will get zip file for TWRP flash
Gold work
Thanks for this good work, do you think it is possible to fix camera?
I use scl-l21 with cm 12.1 and it works even the camera.
Sorry for my bad english.
dasder said:
Thanks for this good work, do you think it is possible to fix camera?
I use scl-l21 with cm 12.1 and it works even the camera.
Sorry for my bad english.
Click to expand...
Click to collapse
In cm camerafix you just replace custom kernel to default.
I think it possible and we work on camera fix. Now we can get image but can`t get focus and white balans.
Thank's will wait of the fix. [emoji106]
Hello I am just curious how the work goes on, thanks in advance
i always wanted an Selfish OS on my device what is the possibility to port Sailfish to other Huawei devices ?
for me this reboots straight int o fastboot mode and i cannot get out unless manual to recovery then reflash known working rom any help would be appreciated
dunryc said:
for me this reboots straight int o fastboot mode and i cannot get out unless manual to recovery then reflash known working rom any help would be appreciated
Click to expand...
Click to collapse
I get a bootloop
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
KrysRom said:
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
Click to expand...
Click to collapse
only SCL-21
Uh ok
Wysłane z mojego SCL-L01 przy użyciu Tapatalka
neochapay said:
only SCL-21
Click to expand...
Click to collapse
But on scl-l02 it got stuck on a boot loop
---------- Post added at 09:31 PM ---------- Previous post was at 09:29 PM ----------
KrysRom said:
I have an error 7 while instalilng the zip, removing the device model line in updater_script changes nothing. My model is SCL-L01
Click to expand...
Click to collapse
Which twrp are u using u need to use 2.8 and remove the the line from update script and flash twrp 2.8
Is there any way to port it/run it on SCL-L01?
Sailfish for Huawei Y5
I need Sailfish OS for huawei Y5
sirfmoyo said:
I need Sailfish OS for huawei Y5
Click to expand...
Click to collapse
build it i post instructions
Any news about SCL-L01 port?

Categories

Resources