[GUIDE]Making a ROM from source{Mediatek} - Miscellaneous Android Development

Guide to Mediatek Building(Guide 3:=/system)
Requisites
A Linux machine
The required packages(Look to the 2nd post)
A source code(CyanogenMod,AOKP..)[Look at post 3 for more details]
The Mediatek modified packaged, attached to post]
Lets get started!
I'll reinstate the fact that mediatek is Anti GPL so doesnt release the source codes but some companies recently have started releasing the source and many of you guys asked me how to build a rom for a mediatek device. Here it goes
There are three requirments for building a rom for a phone from source
a)device tree
b)kernel source
c)vendor tree(usually made by the device/setup-makefiles.sh
Step 1(Merging Mediatek files):First. you'd have to merge the package i gave in the post to your source tree.
Step 2(Setting up the environment)Assuming you have a kernel tree) Try to find a device tree for your phone this device tree can either be built from start or can be "forked" of a similar device. What i mean is, suppose you have a mt6589 chipset you can take the device tree from another mt6589 chipset. Here is a link to my device tree for Canvas 4 kitkat mt6589 device tree..kernel source for mt6589. If you are building for very similar devices of canvas 4 you could use my prebuilt kernel too.
Step 3(Obtaining proprietory files):: For wifi,gps and radio to work we have to obtain some files which are "device-specific". We do this by executing the file in the device tree called the "extract-files.sh" or the "proprietory-files.sh". what these files do is they grep the contents from the proprietory-files.txt and pull it from your phone using adb.
Step 4(Building):What we want to do first is setup the build environment. The script is located inside the build folder.This script describes how to set up your local work environment to build the Android source files. You will need to use Linux or Mac OS. Building under Windows is not currently supported.. to execute this script,
Code:
source build/envetup.sh
. We have to now "lunch" the device. What this does is that it initializes the build environment for that particular device.
we use this to tell linux to build it for your device this is done by
Code:
lunch cm_devicename-userdebug or lunch cm_devicename-eng
A very good artical i came across for explaining the build-variants is here. Now is the easy part(Compiling). We now type
Code:
make -j# bacon
what bacon does is create a .zip file which is flashable on your phone. #=no of processors+2. But if your processor is hyperthreaded, add 4 to the no of physical cores.
Step 5(Errors):There is no one solution for all errors but general errors like "Term.apk not found" can be fixed by going to the vendor/cm(aokp..)/get-prebuilts. Other errors are welcome in the thread and I'll try my best to solve them
Hope it helped you!, any feedback on the tutorial is welcome.
Hit that thanks button if you think its worth it
Regards and Good Luck
My first tutorial:building a boot.img for mediatek
Links to my next Guides
Building the boot.img{MediaTek}
Building the Kernel{MediaTek}
Toolchain links are coming up.

Required packages before building
Python 2.6 -- 2.7, which you can download from python.org.
GNU Make 3.81 -- 3.82, which you can download from gnu.org,
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.
Git 1.7 or newer. You can find it at git-scm.com.
#Required packages
Code:
sudo apt-get install git 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 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8 && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Go to etc/udev/rules.d/51-android.rules
Code:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
# adb protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
# fastboot protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
# adb protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
# fastboot protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"
In bash.rc
Code:
export USE_CCACHE=1
Beter way installing java
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java6-installer
Reuqired package check
Code:
sudo apt-get install git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8
THIS
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
You're done

Source code links
you can get repo script by typing
Code:
curl $ http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Code:
repo init -u <URL to android manifest> -b <branch name>
this is the generalized way to do this.
For cyanogenmod:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
For aokp
Code:
repo init -u https://github.com/AOKP/platform_manifest.git -b kitkat
This is about 14GB and will take time to download. once its downloaded make sure you have the required packages from the second post. To start building follow the first post

Nice guide, will surely try it when i get some time... Subscribed

EnerJon said:
Nice guide, will surely try it when i get some time... Subscribed
Click to expand...
Click to collapse
Have fun!
Regards

Kernel Development guide coming today

Suggestions for new guides are welcome and I'll try my best to do them.
Sent from my Moto G using XDA Free mobile app

I assume this would work on a MT6572, yes?

blakegriplingph said:
I assume this would work on a MT6572, yes?
Click to expand...
Click to collapse
If you have the kernel source, yes it'll work
Sent from my Moto G using XDA Free mobile app

MasterAwesome said:
If you have the kernel source, yes it'll work
Sent from my Moto G using XDA Free mobile app
Click to expand...
Click to collapse
Well, I hope this would work with the Lenovo A369i sources.

blakegriplingph said:
Well, I hope this would work with the Lenovo A369i sources.
Click to expand...
Click to collapse
Looks good to me try it out and give me the results. if it doesnt work i'll try to guide you through alternative steps..
Regards and good luck

MasterAwesome said:
Looks good to me try it out and give me the results. if it doesnt work i'll try to guide you through alternative steps..
Regards and good luck
Click to expand...
Click to collapse
I'm no coder, but I just want to try it out of curiosity. Might do an initial build and leave the rest to the lads for them to mess with.

blakegriplingph said:
Well, I hope this would work with the Lenovo A369i sources.
Click to expand...
Click to collapse
Device looks normal, technically it should work. If you face any errors please ask me and i'll guide you through the process.
Regards and good luck

MasterAwesome said:
Device looks normal, technically it should work. If you face any errors please ask me and i'll guide you through the process.
Regards and good luck
Click to expand...
Click to collapse
Lol you replied to that post already
But yeah, although I was told once that the kernel sources Lenovo provided were apparently a mess.

blakegriplingph said:
Lol you replied to that post already
But yeah, although I was told once that the kernel sources Lenovo provided were apparently a mess.
Click to expand...
Click to collapse
I closed my browser in the middle when I was was typing.. Somehow it got posted .
Yeah Lenovo sources are a mess... I modified it and put a working A820 KERNEL Source on github. https://github.com/IceFlavouredKitkat/A820_kernel
Sent from my Moto G using XDA Free mobile app

MasterAwesome said:
I closed my browser in the middle when I was was typing.. Somehow it got posted .
Yeah Lenovo sources are a mess... I modified it and put a working A820 KERNEL Source on github. https://github.com/IceFlavouredKitkat/A820_kernel
Sent from my Moto G using XDA Free mobile app
Click to expand...
Click to collapse
Nice one dude, I'm just ticked off at how much of a scrooge MTK is, hence why I lol whenever you guys do your part at trolling the company.

blakegriplingph said:
Nice one dude, I'm just ticked off at how much of a scrooge MTK is, hence why I lol whenever you guys do your part at trolling the company.
Click to expand...
Click to collapse
True Dat
Sent from my Moto G using XDA Free mobile app

MasterAwesome said:
True Dat
Sent from my Moto G using XDA Free mobile app
Click to expand...
Click to collapse
Yup. BTW, you mentioned about the source files weighing in at 14GB. Wouldn't that take eons to compile? I've compiled Wine and ReactOS before and boy did I waste an hour or so of my time waiting for the binaries to churn out.

blakegriplingph said:
Yup. BTW, you mentioned about the source files weighing in at 14GB. Wouldn't that take eons to compile? I've compiled Wine and ReactOS before and boy did I waste an hour or so of my time waiting for the binaries to churn out.
Click to expand...
Click to collapse
Depends on your PC and your hard drive and ram. I have an i3-2100(upgrading to a amd 6 core soon) and a Seagate 1TB Harddrive and 8gb ram. Pretty basic stuff it takes about 2:30 hours to compile. It's basically because my pc has just 2 core and even if it were more cores my Harddrive would bottleneck it so... :/
Mounting into tmpfs and using ccache significantly reduces compile time
Sent from my Moto G using XDA Free mobile app

Nice guide Mate.. you r encouraging mtk development
Sent from my Iris 504q using Tapatalk

Related

How to compile Jelly Bean from Source [UBUNTU]

Hey there! I know the current situation in the i9003. We have a functional but not full ICS and now we need kernel 3.X to make everything work perfectly. Dhiru is working hard, he made a very very good work but he cannot do more until hillbeast finishes a bootable 3.0 kernel. A few hours ago, JB Source Code was released and now it can be compiled from source. I have read a good tutorial made by dastin1015 which explains how to do that. I say THIS IS NOT MY WORK (obviously) so credits go for him.
If somebody knows how to do that, please, try it. Probably we will be saving a lot of time for further development. Only to make it boot in a i9003 is a big step and a big contribution for the community. Here are the steps:
GUIDE - HOW TO COMPILE JB ON UBUNTU FROM SOURCE​
To compile Jellybean on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling. Also note that this appears to be a development preview source code.
This will NOT make a fully functional ROM, but will give you a place to start. Also I CANNOT fix every error you run into.
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 80GB (or more) for a full set of builds.
1) You need the following:
-JDK 6 if you wish to build Jellybean. You can download it from java.sun.com. Or:
Code:
$ sudo apt-get install sun-java6-jdk
-Python 2.4 -- 2.7, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com. Or:
Code:
$ sudo apt-get install git-core
2) Install required packages. 64-bit (recommended)
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
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
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 xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
3) Configure your USB.
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
4) Save the file and close it and then issue this command:
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6) Initialize the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b jb-dev
7) When prompted, enter your real name and email address.
8) Gather the files:
Code:
$ repo sync
9) Compiling:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
10) Issue:
Code:
$ lunch
11) Pick your poison.
12) Now issue (The '#' is the number of cores your processor has plus 1, ex. I have a dual core processor so I type 'make -j3':
Code:
$ make -j#
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the HTC Evo 3D CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc
3) Clone the github device tree from remote to local: (The shooter would be whatever you want that folder to be named so make sure it is whatever standard name would be for your device, example: Nexus One [passion], Nexus S [crespo], Motorola Droid [sholes], HTC Incredible [inc], etc.)
Code:
$ git clone git://github.com/CyanogenMod/android_device_htc_shooter.git shooter
4) Now navigate into the folder:
Code:
$ cd shooter
5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.
6) Extract Device Proprietary Files:
Code:
$ ./extract-files.sh
7) Navigate back to your home directory for building:
Code:
$ cd ~/WORKING_DIRECTORY
8) Prepare To Compile:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
9) Get your list of devices:
Code:
$ lunch
10) Pick your poison.
11) Now compile:
Code:
$ make -j#
Or for a flashable zip:
Code:
$ make -j# otapackage
~NOTE~
If you are running into issues such as:
Code:
Which would you like? [full-eng] 5
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
Device shooter not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for shooter not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
** Don't have a product spec for: 'full_shooter'
** Do you have the right repo manifest?
What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_shooter.mk therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows.
Source​
Hope it helps for our development, and again, if u know how to do that, please try
Click to expand...
Click to collapse
luiseteyo said:
Hey there! I know the current situation in the i9003. We have a functional but not full ICS and now we need kernel 3.X to make everything work perfectly. Dhiru is working hard, he made a very very good work but he cannot do more until hillbeast finishes a bootable 3.0 kernel. A few hours ago, JB Source Code was released and now it can be compiled from source. I have read a good tutorial made by dastin1015 which explains how to do that. I say THIS IS NOT MY WORK (obviously) so credits go for him.
If somebody knows how to do that, please, try it. Probably we will be saving a lot of time for further development. Only to make it boot in a i9003 is a big step and a big contribution for the community. Here are the steps:
GUIDE - HOW TO COMPILE JB ON UBUNTU FROM SOURCE​
To compile Jellybean on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling. Also note that this appears to be a development preview source code.
This will NOT make a fully functional ROM, but will give you a place to start. Also I CANNOT fix every error you run into.
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 80GB (or more) for a full set of builds.
1) You need the following:
-JDK 6 if you wish to build Jellybean. You can download it from java.sun.com. Or:
Code:
$ sudo apt-get install sun-java6-jdk
-Python 2.4 -- 2.7, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com. Or:
Code:
$ sudo apt-get install git-core
2) Install required packages. 64-bit (recommended)
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
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
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 xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
3) Configure your USB.
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
4) Save the file and close it and then issue this command:
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6) Initialize the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b jb-dev
7) When prompted, enter your real name and email address.
8) Gather the files:
Code:
$ repo sync
9) Compiling:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
10) Issue:
Code:
$ lunch
11) Pick your poison.
12) Now issue (The '#' is the number of cores your processor has plus 1, ex. I have a dual core processor so I type 'make -j3':
Code:
$ make -j#
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the HTC Evo 3D CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc
3) Clone the github device tree from remote to local: (The shooter would be whatever you want that folder to be named so make sure it is whatever standard name would be for your device, example: Nexus One [passion], Nexus S [crespo], Motorola Droid [sholes], HTC Incredible [inc], etc.)
Code:
$ git clone git://github.com/CyanogenMod/android_device_htc_shooter.git shooter
4) Now navigate into the folder:
Code:
$ cd shooter
5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.
6) Extract Device Proprietary Files:
Code:
$ ./extract-files.sh
7) Navigate back to your home directory for building:
Code:
$ cd ~/WORKING_DIRECTORY
8) Prepare To Compile:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
9) Get your list of devices:
Code:
$ lunch
10) Pick your poison.
11) Now compile:
Code:
$ make -j#
Or for a flashable zip:
Code:
$ make -j# otapackage
~NOTE~
If you are running into issues such as:
Code:
Which would you like? [full-eng] 5
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
Device shooter not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for shooter not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
** Don't have a product spec for: 'full_shooter'
** Do you have the right repo manifest?
What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_shooter.mk therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows.
Source​
Click to expand...
Click to collapse
Nice efforts! Liked!! You should continue maybe you can be the 1st dev of JB ^^
EDIT: Nevermind.
Anybody is going to try this? Almost all the big devices have a start build of JB. I can't do this so, isnt here any developer who wants to try this?
luiseteyo said:
Anybody is going to try this? Almost all the big devices have a start build of JB. I can't do this so, isnt here any developer who wants to try this?
Click to expand...
Click to collapse
Altough I'm not this device user, but i'm setting up my PC to start building for my LG-P500
And I must say that this is really a very helpful and the easiest guide available apart from the errors I'm going to face while building
luiseteyo said:
Anybody is going to try this? Almost all the big devices have a start build of JB. I can't do this so, isnt here any developer who wants to try this?
Click to expand...
Click to collapse
dhiru1602 said:
CM10 boots. Needs more testing.
Everything as that of CM9 seem to work fine with the only problem being the space on the system partition. It's too low to accommodate the full ROM and Jellybean Google apps. With the release of 3.0 kernel, we will resize the partitions, but as of now I have moved the applications to the data partition on a temporary basis.
Will make a release in a separate thread by the next few days.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=29018786&postcount=2809
shriomman said:
http://forum.xda-developers.com/showpost.php?p=29018786&postcount=2809
Click to expand...
Click to collapse
Yes i know
Sent from my iPad using Tapatalk HD
Workaround for repo syntax errors
For those getting a syntax error on
Code:
repo init
It's because of Python3 being listed as Python in /usr/bin.
A temporary workaround is to symlink python2 in place of python 3.
Code:
$ mkdir ~/bin
$ ln -s /usr/bin/python2 ~/bin/python
$ export PATH=~/bin:$PATH
Check to see if it worked
Code:
$ which python
And if it returns the binary in ~/bin/python it worked
The solution would either be to symlink python by default or rewrite repo in Python3.

[Tutorial][S4] How to make your very own Jellybean 4.1.1 on the HTC One S!

Hello everyone! I am anxiously awaiting jellybean for our phone and I know that many of you are also, so I decided to make this thread and help speed things up ! I am currently watching my repo sync so I am hard at work developing this for us but other users can work to, so we get it done faster . So if you are not on ubuntu 10 or 11, LEAVE because this is likely not going to work for you . A few things first: 1. the "$" is an indication of the command, there is one $ before every command and it is already in your terminal so do not type it. 2. You may want to copy and paste commands... 3. This will either not boot or have many bugs, as expected.
There are currently 2 JB roms available, here (by me) and here (by djsubtronic)
GENERAL JELLYBEAN THREAD IS HERE
1) First thing is first, install the required packages:
Open terminal and KEEP IT OPEN FOR ALL OF THIS!!!!!!!!!!!!
Code:
$ sudo apt-get install openjdk-6-jdk
$ sudo apt-get install python
$ sudo apt-get install git-core
Next, download the android sdk for linux and extract it to your home directory. Name it "android-sdk" (without the quotes) for simplicity. In you home folder, show the hidden files (hit Ctrl + H). Open the .bashrc file in the text editor. Add the following lines at the bottom (end) of it:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Save it and then go back to the home folder. Edit the .profile file and add this to the end:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You now have the sdk installed. In your terminal, enter:
Code:
$ cd android-sdk
$ android
When the sdk manager pops up, download platform-tools, and update the tools folder if needed.
If it does not pop up, try one the following 3 commands and see if it does:
Code:
$ cd tools
$ android
Or
Code:
$ cd platfrom-tools
$ android
Code:
$ cd
$ android
And if none of those bring up the manager, close your terminal window. Then open terminal and type:
Code:
$ android
MORE FILES?!?!?! Yes.
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
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
$ 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 xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Finally! Past the downloads (for now... wait for the repo sync)
2) Configure the usb:
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
In the blank text field, paste the following:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
Save the new text file and close it. Enter this command in your terminal window:
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
3) Installing the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4) Initialize (init) the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1
or, if you want to do CM10, replace the last line (repo init -u blahblahblah) with:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b jellybean
4.5) If you already have the repo initialized and all of the above done, and are just starting over, do this:
Code:
$ cd WORKING_DIRECTORY
$ repo init -b android-4.1.1_r1
$ repo sync
Don't do it if you are starting new.
5) Sync the needed files (repo)
Code:
$ repo sync -j1
When it asks, enter your REAL name and email
6) Compile:
Code:
$ source build/envsetup.sh
or
Code:
$ . build/envsetup.sh
7) Who's hungry?
Code:
$ lunch
Seriously, you have to!
8) Adding HTC One S (ville) to the list
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc
$ cd htc
9) I have no name for this (github sync )
Code:
$ git clone git://github.com/intervigilium/android_device_htc_ville.git -b jellybean-ril ville
or
Code:
$ git clone git://github.com/intervigilium/android_device_htc_ville.git -b jellybean ville
10) Navigate to "ville"
Code:
$ cd ville
11) Connect your HTC One S to the computer and verify that adb is working (usb debugging) and once that is verified do this:
Code:
$ ./extract-files.sh
You can disconnect after this is done.
11.5) Every .cpp file in device/htc/ville/libsensors needs these lines to be added after the #includes section:
Code:
#define LOGE
#define LOGE_IF
The following lines must be added to /device/htc/ville/liblights/lights.c after the #includes section:
Code:
#define LOGE
#define LOGE_IF
#define LOGV
(Thanks to djsubtronic for this step!)
12) Time to build!
Code:
$ cd ~/WORKING_DIRECTORY
then:
Code:
$ source build/envsetup.sh
or
Code:
$ . build/envsetup.sh
13) Verify the ville is there:
Code:
$ lunch
14) Choose from the list
15) Compile!
The # stand for the number of cores plus one (Example: my VAIO has 2 cores so I do -j3, if it were quad core I would do -j5)
Code:
$ make -j#
Flashable zip command (instead of above command):
Code:
$ make -j# otapackage
Thanks to dastin1015 for this (Look at it for a general build): http://forum.xda-developers.com/showthread.php?t=1762641
Thanks to everyone with a ville github account!
Post your results in this thread. Also, ask questions here too!
If I have done something wrong, just tell me politely what it is and I will fix it. It is late here and this is a long thread so there is likely at least one mistake. Thanks!
ERRORS AND FIXES:
Code:
build/core/product_config.mk:205: *** No matches for product "device_ville". Stop.
** Don't have a product spec for: 'device_ville'
** Do you have the right repo manifest?
Add this:
Code:
PRODUCT_NAME := device_ville
PRODUCT_DEVICE := ville
PRODUCT_BRAND := Android
PRODUCT_MODEL := Full Android on ville
to the bottom (end) of device_ville.mk
Ville does not show up in lunch menu? Make the file "vendorsetup.sh". Edit it and add this:
Code:
add_lunch_combo device_ville-userdebug
Nice
Enviado desde mi HTC One S usando Tapatalk 2
Reserved for fixes and updates
Nice one.
You can add that every .cpp file in device/htc/ville/libsensors needs these lines to be added after the #includes section:
Code:
#define LOGE
#define LOGE_IF
djsubtronic said:
Nice one.
Click to expand...
Click to collapse
I'll post pictures tomorrow or the next day
djsubtronic said:
Nice one.
You can add that every .cpp file in device/htc/ville/libsensors needs these lines to be added after the #includes section:
Code:
#define LOGE
#define LOGE_IF
Click to expand...
Click to collapse
How would I say that (under what step do you recommend)
BiteBlaze said:
How would I say that (under what step do you recommend)
Click to expand...
Click to collapse
Needs to be done before make, so I would say just before the build steps.
djsubtronic said:
Needs to be done before make, so I would say just before the build steps.
Click to expand...
Click to collapse
I'll add that now
I won't be able to post pictures until monday so if anyone has screenshots of the terminal window at certain points in the instructions, email me. Goodnight and good luck!
Has anybody tried doing this?
Reviewers said:
Has anybody tried doing this?
Click to expand...
Click to collapse
There is a check the general sections topic on Jelly Bean. There are plenty of people trying. The only one with a booting build thus far is Team Liquid's Nocoast.
Why doesn't it work on ubuntu 10.04?
Add to OP after the libsensors bit:
The following lines must be added to /device/htc/ville/liblights/lights.c after the #includes section
Code:
#define LOGE
#define LOGE_IF
#define LOGV
---------- Post added at 12:31 PM ---------- Previous post was at 12:03 PM ----------
Stuck on this:
in function wpa_driver_nl80211_ops:driver_nl80211.c(.data.rel. ro.wpa_driver_nl80211_ops+0x1c8): error: undefined reference to 'wpa_driver_nl80211_driver_cmd'
Added this line to device/htc/ville/BoardConfig.mk: BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_wl12xx
and then got another error...
make: *** No rule to make target `out/target/product/ville/obj/STATIC_LIBRARIES/lib_driver_cmd_wl12xx_intermediates/lib_driver_cmd_wl12xx.a', needed by `out/target/product/ville/obj/EXECUTABLES/wpa_supplicant_intermediates/LINKED/wpa_supplicant'. Stop.
How to get that file?
Alie360 said:
Why doesn't it work on ubuntu 10.04?
Click to expand...
Click to collapse
It does. It doesn't work on 12
~ BiteBlaze via HTC One S... If I have helped you out, hit the Thanks button
BiteBlaze said:
It does. It doesn't work on 12
~ BiteBlaze via HTC One S... If I have helped you out, hit the Thanks button
Click to expand...
Click to collapse
You wrote "So if you are not on ubuntu 10 or 11, LEAVE because this is likely not going to work for you "...
I was assuming it was working only on 12
Alie360 said:
You wrote "So if you are not on ubuntu 10 or 11, LEAVE because this is likely not going to work for you "...
I was assuming it was working only on 12
Click to expand...
Click to collapse
Haha ok I get it you had it backwards. I mean that only people on 10 or 11 can do this ("If you are NOT on ubuntu 10 or 11, this is likely not going to work for you)
djsubtronic said:
Add to OP after the libsensors bit:
The following lines must be added to /device/htc/ville/liblights/lights.c after the #includes section
Code:
#define LOGE
#define LOGE_IF
#define LOGV
---------- Post added at 12:31 PM ---------- Previous post was at 12:03 PM ----------
Stuck on this:
in function wpa_driver_nl80211_ops:driver_nl80211.c(.data.rel. ro.wpa_driver_nl80211_ops+0x1c8): error: undefined reference to 'wpa_driver_nl80211_driver_cmd'
Added this line to device/htc/ville/BoardConfig.mk: BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_wl12xx
and then got another error...
make: *** No rule to make target `out/target/product/ville/obj/STATIC_LIBRARIES/lib_driver_cmd_wl12xx_intermediates/lib_driver_cmd_wl12xx.a', needed by `out/target/product/ville/obj/EXECUTABLES/wpa_supplicant_intermediates/LINKED/wpa_supplicant'. Stop.
How to get that file?
Click to expand...
Click to collapse
Added to the OP. Did you find the file?
BiteBlaze said:
Added to the OP. Did you find the file?
Click to expand...
Click to collapse
I undid the change from BoardConfig.mk
http://translate.google.co.uk/trans...a=X&ei=crACUOCNFOeY1AXcxNWzBw&ved=0CHAQ7gEwCQ
That link has a link to a git that has drivers for the nl80211, wpa_supplicant, and hostapd. Trying to get it to work using those files.
djsubtronic said:
I undid the change from BoardConfig.mk
http://translate.google.co.uk/trans...a=X&ei=crACUOCNFOeY1AXcxNWzBw&ved=0CHAQ7gEwCQ
That link has a link to a git that has drivers for the nl80211, wpa_supplicant, and hostapd. Trying to get it to work using those files.
Click to expand...
Click to collapse
Good. I will try tomorrow. I am glad to say they are upgrading my internet to about 15MBs! I should get a good build on monday
villainhalf said:
There is a check the general sections topic on Jelly Bean. There are plenty of people trying. The only one with a booting build thus far is Team Liquid's Nocoast.
Click to expand...
Click to collapse
I think I will post a link to the general thread in the OP. Nocoast refuses to release it or give us any more info... hopefully some info comes today... maybe screenshots? Or hopefully what the issues are and maybe a logcat

[GUIDE][ROM][S4] How to build your own Baked BlackBean ROM! [AOSP 4.2.1][NOOB-PROOF]

How to compile your own Baked ROM (jb-4.2 branch)​
I have decided to create a guide on how to build your own Baked Blackbean ROM for the HTC One S. I will make this as simple as possible, so even people with no previous knowledge of Linux can follow this tutorial successfully. The ROMs that you compile are for your personal use only...please do not share or post them to show courtesy to TeamBaked. If you have any questions or have any trouble during any part of this tutorial, feel free to post them and I will try to get you sorted out.
I've tried to make this guide as comprehensive as possible, explaining what each step does. It should be fairly thorough and easy enough for anyone with a bit of patience to build.
Click to expand...
Click to collapse
Requirements:
patience (this is the most important)
Ubuntu 12.04 64bit, dual-booted or virtual machine
some space on your Ubuntu partition, I'd say about 50GB to be very safe
an internet connection
Step 1: Setting up your environment
1) You need to install the required packages for compiling AOSP. Open up a terminal, and type this in:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-4.5-multilib g++-4.5-multilib libxml2-utils libxml2 xsltproc
Lastly:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
OPTIONAL STEPS (Good if you want to do more Android development in the future)
Let's configure our USB access.
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
A text editor should pop up with a blank file. Copy and paste this to the file:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
Save and close the file. Now do this to change its permissions:
Code:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
2) Now we will need to download the Android SDK and set it up properly.
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the archive to your home directory and name it android-sdk
In your home folder, press CTRL + H to show hidden files.
Open up your .bashrc and paste this at the end:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Open .profile and put this at the end as well:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
The SDK has now been setup properly. You can type
Code:
android
in terminal to bring up the SDK menu and install tools/packages if you want.
Step 2: Getting the source downloaded
1) Installing repo and syncing the repository.
Open a new terminal window and type this in:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now let's initialize the Baked repo. I am creating a folder name "baked" which is where I will download the source to.
Code:
mkdir baked
cd baked
repo init -u https://github.com/TeamBAKED/platform_manifest.git -b jb-4.2
Let's download the source.
Code:
repo sync -j#
The '#' refers to how many simultaneous jobs you want. I usually do -j16 since I have fast fiber-optic internet, so my command would be "repo sync -j16".
Now the source is downloading. You can leave your computer alone until it is done.
Step 3: Adding in configurations for ville.
This step is NOT needed anymore, because the One S has been merged into official BAKED. Skip ahead to step 4! :victory:
Because TeamBaked doesn't officially support the One S, we will have to add in the parts for ville manually and ensure buildability. I have pre-made everything, so there is really nothing you need to do on your part. You just need to download the parts and place them in their correct directories.
1) We need to first add a local_manifest.xml so we can integrate the projects needed for ville during repo sync. Luckily, I have already prepared one. In baked/.repo/ create a file named "local_manifest.xml", and paste this in:
Code:
Save and close. Then do another
Code:
repo sync -j#
so we can now fetch the additional ville-related parts. The manifest tracks the CM10.1 repos for the kernel and msm8960 common stuff, but the device tree that it tracks is from my Github because I have modified it for the Baked ROM. I'll try and keep it as updated as the CM10.1 device tree as development continues.
2) Now we need another config file, which tells the build system what to execute and which device-specific parameters to be set. Go into baked/vendor/baked/products/ and create a file named "ville.mk". Paste this in:
Code:
# Inherit AOSP device configuration for ville.
$(call inherit-product, device/htc/ville/device_ville.mk)
# Inherit common product files.
$(call inherit-product, vendor/baked/configs/common.mk)
# Inherit GSM common stuff
$(call inherit-product, vendor/baked/configs/gsm.mk)
# Setup device specific product configuration.
PRODUCT_NAME := baked_ville
PRODUCT_BRAND := HTC
PRODUCT_DEVICE := ville
PRODUCT_MODEL := HTC One S
PRODUCT_MANUFACTURER := HTC
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=htc_ville BUILD_FINGERPRINT=tmous/ville/ville:4.0.4/IMM76D/96068.7:user/release-keys PRIVATE_BUILD_DESC="=2.35.531.7 CL96068 release-keys" BUILD_NUMBER=96068
# bootanimation
PRODUCT_COPY_FILES += \
vendor/baked/prebuilt/bootanimation/bootanimation_540_960.zip:system/media/bootanimation.zip
Now open up AndroidProducts.mk. We need to tell it to call the configuration file that you just created. Add in
Code:
$(LOCAL_DIR)/ville.mk \
right after vibrantmtd. So the whole file should look something like this (at the time of writing, YMMV):
Code:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/captivatemtd.mk \
$(LOCAL_DIR)/crespo.mk \
$(LOCAL_DIR)/crespo4g.mk \
$(LOCAL_DIR)/d2att.mk \
$(LOCAL_DIR)/d2mtr.mk \
$(LOCAL_DIR)/d2spr.mk \
$(LOCAL_DIR)/d2tmo.mk \
$(LOCAL_DIR)/d2usc.mk \
$(LOCAL_DIR)/d2vzw.mk \
$(LOCAL_DIR)/endeavoru.mk \
$(LOCAL_DIR)/fascinatemtd.mk \
$(LOCAL_DIR)/galaxysmtd.mk \
$(LOCAL_DIR)/i9300.mk \
$(LOCAL_DIR)/grouper.mk \
$(LOCAL_DIR)/maguro.mk \
$(LOCAL_DIR)/mako.mk \
$(LOCAL_DIR)/manta.mk \
$(LOCAL_DIR)/mesmerizemtd.mk \
$(LOCAL_DIR)/p3113.mk \
$(LOCAL_DIR)/p5wifi.mk \
$(LOCAL_DIR)/toro.mk \
$(LOCAL_DIR)/tf201.mk \
$(LOCAL_DIR)/tf300t.mk \
$(LOCAL_DIR)/tf700t.mk \
$(LOCAL_DIR)/toroplus.mk \
$(LOCAL_DIR)/showcasemtd.mk \
$(LOCAL_DIR)/stingray.mk \
$(LOCAL_DIR)/vibrantmtd.mk \
[COLOR="Red"][B]$(LOCAL_DIR)/ville.mk \[/B][/COLOR]
$(LOCAL_DIR)/wingray.mk
Step 4: Actually building. FInally!
1) Open a terminal, and navigate to the baked/ directory.
2) Type this:
Code:
cp external/kernel-headers/original/sound/asound.h prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/sysroot/usr/include/sound/
You will run into errors if you don't copy over that kernel header. AOSP Jelly Bean glibc sysroot seems to include an asound.h that relies on uint32t which isn't (normally) defined.
3) Type:
Code:
. build/envsetup.sh
lunch
4) You will be brought up with a menu that looks something like this:
Code:
You're building on Linux
Lunch menu... pick a combo:
1. mini_armv7a_neon-userdebug
2. mini_armv7a-userdebug
[B][COLOR="Red"]3. baked_ville-userdebug[/COLOR][/B]
4. full_panda-userdebug
5. baked_toro-userdebug
6. baked_maguro-userdebug
7. baked_mako-userdebug
8. baked_manta-userdebug
9. baked_toroplus-userdebug
10. baked_crespo-userdebug
11. baked_crespo4g-userdebug
12. baked_grouper-userdebug
13. baked_captivatemtd-userdebug
14. baked_d2att-userdebug
15. baked_d2mtr-userdebug
16. baked_d2spr-userdebug
17. baked_d2tmo-userdebug
18. baked_d2usc-userdebug
19. baked_d2vzw-userdebug
20. baked_endeavoru-userdebug
21. baked_fascinatemtd-userdebug
22. baked_galaxysmtd-userdebug
23. baked_i9300-userdebug
24. baked_mesmerizemtd-userdebug
25. baked_p3113-userdebug
26. baked_p5wifi-userdebug
27. baked_showcasemtd-userdebug
28. baked_stingray-userdebug
29. baked_tf201-userdebug
30. baked_tf300t-userdebug
31. baked_tf700t-userdebug
32. baked_vibrantmtd-userdebug
33. baked_wingray-userdebug
Which would you like? [full-eng]
See that baked_ville-userdebug is at number 3. So type in '3' or whatever the corresponding number is.
4) Now wait a minute or two (depending on how fast your computer is) as it calls the makefiles and sets up your build system.
5) When the 'lunch' has finished, you should see something like this:
Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.1
TARGET_PRODUCT=baked_ville
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_[email protected]_3.20GHz-with-gentoo-2.1
HOST_BUILD_TYPE=release
BUILD_ID=JOP40D
OUT_DIR=/home/klin1344/baked/out
============================================
Now type in
Code:
mka bacon -j#
and the build process will begin! Again, here the -j# is an option on how many simultaneous jobs you want. It's common to use a number between 1 and 2 times the number of hardware threads on the computer being used for the build.
5) When the build is done, you should get a package in baked/out/target/product/ville/.
6) Flash and enjoy!!
Updating / Re-building
Always do a full clean when you want to update your build.
1) Clean out the previous build(s).
Code:
rm -rf out
2) Sync up the repo to get the latest changes.
Code:
repo sync -j#
3) Follow the tutorial again starting from Step 4.
Troubleshooting
Troubleshooting​
Coming soon.
one more just in case.
I was just thinking about this since they wouldn't let you share blackbean 7. Thanks
Sent from my HTC One S using Tapatalk 2
thanks man, to bad you stop developing this;
baked blackbean made by you it's still the best ROM out here in it branch;
their are definitely good at it and also your build from baked6 is way in front of others
to bad we'll never have an (un)official build from baked7 made by profs
I've been thinking about trying to build from source.
But I don't meet the first requirement.
Thanks for the guide! Good work as usual.
Sent from my HTC One S using Tapatalk 2
Thanks a lot klin. Since blackbean 6 was best rom I had on my htc one s and you cannot give out the new version anymore I was thinking about building that rom on my own for the first time. But I didn't know how. I will definetly use that tutorial. I cannot understand why teambaked is so awkward.
I'm back, and I'm going to finish this guide right now. Glad to see that people are looking forward to this and that it'll help quite a few who want to build for themselves.
Sent from my SGH-T999 using Tapatalk 2
Guide is finished and up! If you guys run into ANY errors, feel free to post in the thread and I'll do my best to help you out. Happy building!
klin1344 said:
Guide is finished and up! If you guys run into ANY errors, feel free to post in the thread and I'll do my best to help you out. Happy building!
Click to expand...
Click to collapse
[email protected]:~$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
ln: failed to create symbolic link `/usr/lib/i386-linux-gnu/libGL.so': File exists
essentialmindz said:
[email protected]:~$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
ln: failed to create symbolic link `/usr/lib/i386-linux-gnu/libGL.so': File exists
Click to expand...
Click to collapse
This means that creating a symlink failed because the file already exists. You can just skip this step as there is no need to symlink if the file is there.
Sent from my SGH-T999 using Tapatalk 2
Very detailed and accurate... Thanks for the time you took writing this... Great job.. This makes me wanna build from source again..
Sent from my HTC One S using xda premium
$droyd$ said:
Very detailed and accurate... Thanks for the time you took writing this... Great job.. This makes me wanna build from source again..
Sent from my HTC One S using xda premium
Click to expand...
Click to collapse
droyd, are you perhaps thinking about building this ROM?
Jeez, klin1344! You're THE MAN! I was devastated when the BBB download link was pulled cause I didn't download it in time! This guide of yours is a GREAT initiative and I for one will be following it in the next few days! :good::good::laugh:
Is this going to work for villec2 (S3)??
Sent from my HTC One S using xda app-developers app
mteezey said:
I was just thinking about this since they wouldn't let you share blackbean 7. Thanks
Sent from my HTC One S using Tapatalk 2
Click to expand...
Click to collapse
This is ridiculous, they never said he couldn't share Blackbean 7, they only asked that he not share before they shared! It has not been officially released on any device by teambaked why is this such a sin? I don't understand. I think it's just pure respect and self discipline. I want Blackbean 7 on HTC One S just as much as the rest of us but they simply have chosen not to release it til they are ready. I think it's crazy to think we can have it here before any official builds. We don't have to be mad. They gave permission.
Anyway Thanks for the guide, it is a great offering to help us.
luxandroid said:
Is this going to work for villec2 (S3)??
Sent from my HTC One S using xda app-developers app
Click to expand...
Click to collapse
I don't think so, because there is no cm10 for the c2
Gesendet von meinem Nexus 7 mit Tapatalk 2
CrayzyBoy said:
I don't think so, because there is no cm10 for the c2
Gesendet von meinem Nexus 7 mit Tapatalk 2
Click to expand...
Click to collapse
yeah but who knows maybe with some corrections...just wondering...
many thanks klin, you're the best
I'll give it a chance this week, as I'll have some spare time in a few days
LibertyMonger said:
This is ridiculous, they never said he couldn't share Blackbean 7, they only asked that he not share before they shared! It has not been officially released on any device by teambaked why is this such a sin? I don't understand. I think it's just pure respect and self discipline. I want Blackbean 7 on HTC One S just as much as the rest of us but they simply have chosen not to release it til they are ready. I think it's crazy to think we can have it here before any official builds. We don't have to be mad. They gave permission.
Anyway Thanks for the guide, it is a great offering to help us.
Click to expand...
Click to collapse
I get where you coming from but team Baked had the same issue before and they went about it in a lame way which they did again so that's why some are not happy with it and you got the fact this site about sharing work.
Think I have to give this a try but guess I better give more space to Linux lol.

[Pantech Burst] [Guide] Build your own AOKP_JB Rom

You must be running a 64bit version of Ubuntu.
If you attempt to build with 32bit I will not help as it is not supported.
This will NOT make a fully functional ROM, but will give you a place to start. Also I CANNOT fix every error you run into.
READ the entire OP and make sure to properly follow instructions. Don't forget to search the thread as your question may have already been answered.
Please use http://pastebin.com/ for all errors you run into. Posting a link is much easier than a long list of errors in the thread. Thank you.
You will need 25GB (or more) free to complete a single build, and up to 80GB (or more) for a full set of builds.
1) You need the following:
-JDK 6 if you wish to build Jellybean.
Code:
$ sudo apt-get install openjdk-6-jdk
-Python 2.4 -- 2.7, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com. Or:
Code:
$ sudo apt-get install git-core
-Java ™ SE Runtime Environment (build 1.6.0_37-b06)
-Android SDK:
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I renamed my SDK to android-sdk to make it easier to navigate to.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Find your .profile file and add this at the bottom of the file:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You have now successfully installed the Android SDK.
To check for updates issue this into your terminal:
Code:
$ android
2) Install required packages.
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 lib32readline-gplv2-dev schedtool lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
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 xsltproc zlib1g-dev:i386 \
pngcrush optipng
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
3) Configure your USB.
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
4) Save the file and close it and then issue this command:
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create the following directories for where the AOKP repo will be stored and synced
Code:
mkdir ~/android
mkdir ~/android/aokp_jb
Move to our new AOKP directory
Code:
cd ~/android/aokp_jb
Initialize the AOKP repo and download the manifest
Code:
repo init -u git://github.com/AOKP/platform_manifest.git -b jb
Sync AOKP source
Code:
repo sync
Sit and wait for a long time. Nearing 10GB of source code now.
Open the aokp_jb_prestofiles.zip file and copy the contents to the following
Code:
aokp_jb/vendor/aokp/products/AndroidProducts.mk
aokp_jb/vendor/aokp/products/presto.mk
aokp_jb/.repo/manifest.xml
go back to ~/android/aokp_jb/
Sync source to pull files from TeamPresto and any changes to either aokp or TeamPresto's Github
Code:
repo sync
Start the build
This is probably the EASIEST part of all, simply copy/paste this command and walk away!
Code:
. build/envsetup.sh && brunch presto
Syncing the repo is dependent upon your Internet connection. It can take anywhere from 30 minutes to several hours to fully sync. Same thing goes for build times. Don't expect this to be short. If you have patience and have no build errors, you'll end up with a flashable zip in ~/aokp_jb/out/target/product/presto! Happy crack-flashing!
[Reserved]
Thank you goes to AOKP Team, Rootswiki, TeamPresto, and everyone else who's contributed.
kagedws6 said:
[Reserved]
Thank you goes to AOKP Team, Rootswiki, TeamPresto, and everyone else who's contributed.
Click to expand...
Click to collapse
**edit** at the moment this will build a bootable rom that is crazy fast but does not have access to wifi or the radio. still in progress
kagedws6 said:
**edit** at the moment this will build a bootable rom that is crazy fast but does not have access to wifi or the radio. still in progress
Click to expand...
Click to collapse
Well when I get home I will help with this. WE SHALL HAVE THE AOKP. And I realize that I have to back up all my windows stuff.......... To do a full install. Instead of dual boot. My hdd isn't big enough Lol.
hi
Is there a compiled .zip file that i can download because i don't have ubuntu, but i really want jb on m pantech burst.
Thanks
mustafa.ali61 said:
Is there a compiled .zip file that i can download because i don't have ubuntu, but i really want jb on m pantech burst.
Thanks
Click to expand...
Click to collapse
We are still getting the bugs worked out. This page is primarily for people who want to learn to build aokp from scratch and its got setup information to pull from the 3 github folders we are currently modifying to get everything working. right now wifi and data works but we are working on being to answer calls at the moment. any builds now would not be usable on a daily basis

[GUIDE]Building a Kernel from source{Mediatek}

Guide to Mediatek Building(Guide 1:=Kernel)
Here, we'll be talking about how to build kernels and how they are different than the ones we've built for Qualcomm.
Requisites
A linux machine
Required Packages(Attached in 2nd post)
C programming and a knowledge about Makefiles
NDK
Lets begin,
Step 1(Setting up the build environment):=As always we have to set up the build environment so that the linux knows we are building something.
This is how we do it
Code:
export TARGET_BUILD_VARIANT=user TARGET_PRODUCT=devicename MTK_ROOT_CUSTOM=../mediatek/custom/ TARGET_KERNEL_VERSION=devicename &&export PATH=pathToDir/arm-eabi-4.6/bin:$PATH&&export CROSS_COMPILE=arm-eabi-&&export ARCH=arm
Let me explain what this does
The BUILD_VARIANT specifies what the kernel is going to be built for. A very good article i came across for explaining the build-variants is here.
The TARGET_PRODUCT/TARGET_KERNEL_PRODUCT tells the linux machine what "device specific" files to use
The MTK_ROOT_CUSTOM specifies the directory of the mediatek/custom folder. remember this mide be in the same directory as the kernel source as well.
The PATHThis sets your toolchain executables to your path. Download toolchain(preferably arm-eabi-4.6) Or, if you want to, you could build your own toolchain from source code
The CROSS_COMPILE, A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. The toolchain facilitates this function
ARCH=arm, ARM is a family of instruction set architectures for computer processors based on a reduced instruction set computing (RISC) architecture developed by British company ARM Holdings. ARM is also used in Android. Here by typing
Code:
export ARCH=arm
we are telling linux that we are going to be building for the CPU architecture "ARM".
Thats enough theory, lets get our hands dirty
Step 2(Configuring your kernel):=This is the heart to what your phone does so be careful when you do this if you're doubtful about something dont hesitate to ask me in the thread.. the base config is usually present in the kernel_source/mediatek/config/devicename/autoconfig/kconfig/platform. this is your base config which you will use and build with different requirments(Example:SELinux). You can always build a config from the start, I advice you dont do that until you have compiled a few kernels before. for using existing config as a base
Code:
cd kernel_source
cp mediatek/config/devicename/autoconfig/kconfig/platform .config
Now,
Code:
make menuconfig
This will give a graphical interface for you to choose what features you want to add to your phone(Example:I/O Schedule,CPU Governors..) More about this here. You're now ready for compiling
Step 3(Compiling):=This is the moment of truth; This is what youve been waiting for! Now, type
Code:
make zImage
You will get something which says
Code:
arch/arm/boot/zImage Ready
Step 4(Adding MediaTek headers):=[GUIDE]Building Mediatek boot.img{Appending headers}. This is my next guide, follow this to your way to compile a whole ROM for your phone.
Now, use your source code to build a ramdisk for you by typing make bootimage. in the out folder you'll get a folder called root. This folder is the initramfs or the ramdisk. to this follow my next guide to understand how to append mediatek headers
Code:
make modules
This is almost the most important step or your ROMS wont boot. after this is complete go to your sourcedir then in search type ".ko" you'll get a bunch of .ko files copy these to your device tree/ROM to make the rom to work.
If you're moving to a device tree make sure to add this to your device_makefile
Code:
PRODUCT_COPY_FILES += \
$(MOD_SRC)/ccci.ko:$(MOD_TGT)/ccci.ko \
$(MOD_SRC)/ccci_plat.ko:$(MOD_TGT)/ccci_plat.ko \
$(MOD_SRC)/devapc.ko:$(MOD_TGT)/devapc.ko \
$(MOD_SRC)/devinfo.ko:$(MOD_TGT)/devinfo.ko \
$(MOD_SRC)/mtk_fm_drv.ko:$(MOD_TGT)/mtk_fm_drv.ko \
$(MOD_SRC)/mtk_hif_sdio.ko:$(MOD_TGT)/mtk_hif_sdio.ko \
$(MOD_SRC)/mtk_stp_bt.ko:$(MOD_TGT)/mtk_stp_bt.ko \
$(MOD_SRC)/mtk_stp_gps.ko:$(MOD_TGT)/mtk_stp_gps.ko \
$(MOD_SRC)/mtk_stp_uart.ko:$(MOD_TGT)/mtk_stp_uart.ko \
$(MOD_SRC)/mtk_stp_wmt.ko:$(MOD_TGT)/mtk_stp_wmt.ko \
$(MOD_SRC)/mtk_wmt_wifi.ko:$(MOD_TGT)/mtk_wmt_wifi.ko \
$(MOD_SRC)/mtklfb.ko:$(MOD_TGT)/mtklfb.ko \
$(MOD_SRC)/pvrsrvkm.ko:$(MOD_TGT)/pvrsrvkm.ko \
$(MOD_SRC)/scsi_tgt.ko:$(MOD_TGT)/scsi_tgt.ko \
$(MOD_SRC)/scsi_wait_scan.ko:$(MOD_TGT)/scsi_wait_scan.ko \
$(MOD_SRC)/sec.ko:$(MOD_TGT)/sec.ko \
$(MOD_SRC)/vcodec_kernel_driver.ko:$(MOD_TGT)/vcodec_kernel_driver.ko \
$(MOD_SRC)/wlan_mt6628.ko:$(MOD_TGT)/wlan_mt6628.ko
This copies your custom built modules to the Module out folder. In BoardConfig.mk add
Code:
TARGET_PREBUILT_KERNEL := $(DEVICE_FOLDER)/prebuilt/kernel
..
Remember :If you're building kernel for already existing 4.2 roms disable SELINUX support by going into security options inside menuconfig
You're done!!
All Questions and feedbacks are welcome in the thread
Be sure to drop a thanks if you thought this was usefull
Happy Building.
--------------------------------------------------
Links to my next Guides
Building the boot.img{MediaTek}
Building the ROM{MediaTek}
Build Packages
Required packages before building
Python 2.6 -- 2.7, which you can download from python.org.
GNU Make 3.81 -- 3.82, which you can download from gnu.org,
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.
Git 1.7 or newer. You can find it at git-scm.com.
#Required packages
Code:
sudo apt-get install git 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 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8 && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Go to etc/udev/rules.d/51-android.rules
Code:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
# adb protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
# fastboot protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
# adb protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
# fastboot protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"
In bash.rc
Code:
export USE_CCACHE=1
Beter way installing java
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java6-installer
Reuqired package check
Code:
sudo apt-get install git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8
THIS
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
You're done
@MasterAwesome this went a little bit over my head....
i understood till making zimage,,,,,after that how to make it a boot img...
Avenger4droid said:
@MasterAwesome this went a little bit over my head....
i understood till making zimage,,,,,after that how to make it a boot img...
Click to expand...
Click to collapse
After compiling the zImage, move it to your device tree in your source code. under a folder called prebuilts. Look at my git repo for more reference a210_device_tree. As i said add a flag in the BoardConfig.mk
Code:
TARGET_PREBUILT_KERNEL:=sourcetokernel
. then, we use the the PRODUCT_COPY_FILES to copy the kernel specific files. since modules are kernel specific you'd have to use the modules you built or you'll get a boot loop.
Suggestions for new guides are welcome and I'll try my best to do them.
Sent from my Moto G using XDA Free mobile app
Sent from my Moto G using XDA Free mobile app
@MasterAwesome
Hello..Glad that someone has given a tutorial thread for Kernel developement. I have a few queries for which i am banging my head on for a while...Though i have used slightly diff commands from what u have said the following are my queries.
I tried building kernel for two Micromax devices A117 ( Used Blu life One M source ) & A250 ( Used Blu life One X source ). These are clone devices of Micromax
I personally own a Blu life One M & have booted the kernel succesfully from the source. But i am unable to boot it up in A117.
And i compiled Blu life One X source and tried in A250 and again i wasn't able to bootup. But another guy managed to boot it up in A250 from the same Blu life one X source. ( Proof : http://forum.xda-developers.com/showpost.php?p=50489380&postcount=300 ). On messaging him he said he hasn't made any change in source and just compiled and t booted for him. I wasn't able to get further support for him.
So what could be my mistake. If u can figure out the mistake for me i can boot it up in both Micromax devices. On analysing my logcat i see gpumodule failing !
Santhosh M said:
@MasterAwesome
Hello..Glad that someone has given a tutorial thread for Kernel developement. I have a few queries for which i am banging my head on for a while...Though i have used slightly diff commands from what u have said the following are my queries.
I tried building kernel for two Micromax devices A117 ( Used Blu life One M source ) & A250 ( Used Blu life One X source ). These are clone devices of Micromax
I personally own a Blu life One M & have booted the kernel succesfully from the source. But i am unable to boot it up in A117.
And i compiled Blu life One X source and tried in A250 and again i wasn't able to bootup. But another guy managed to boot it up in A250 from the same Blu life one X source. ( Proof : http://forum.xda-developers.com/showpost.php?p=50489380&postcount=300 ). On messaging him he said he hasn't made any change in source and just compiled and t booted for him. I wasn't able to get further support for him.
So what could be my mistake. If u can figure out the mistake for me i can boot it up in both Micromax devices. On analysing my logcat i see gpumodule failing !
Click to expand...
Click to collapse
Common errors:
Appending the headers
Not adding newly built modules
If you've done both give me the link to the source I'll make a boot.img check it out on your phone.
Sent from my Moto G using XDA Free mobile app
MasterAwesome said:
Common errors:
Appending the headers
Not adding newly built modules
If you've done both give me the link to the source I'll make a boot.img check it out on your phone.
Sent from my Moto G using XDA Free mobile app
Click to expand...
Click to collapse
zImage Header patch i do always by placing the compiled zImage in mediatek/build/tools and using mkbuild to patch it.
I didn't get the second point of adding newly built modules? ( I use the modules generated while compiling )
Santhosh M said:
zImage Header patch i do always by placing the compiled zImage in mediatek/build/tools and using mkbuild to patch it.
I didn't get the second point of adding newly built modules? ( I use the modules generated while compiling )
Click to expand...
Click to collapse
Do a arm-eabi-strip - - strip-unneeded *.ko then push the ko files to /system/lib/modules. Since modules are very kernel specific if you use wrong modules you'll get all sorts of errors.
Sent from my Moto G using XDA Free mobile app
How to do this bro ? If u explain me the commands in detail it would be helpful..
I have pm you the commands I use...Could you have a look at it?
( Without the above command it booted for me in Blu life One M. My concern s why it ain't booting in A117 & A250. A250 has been booted by a guy who used the same source )
Sent from my BLU LIFE ONE M using Tapatalk
Santhosh M said:
How to do this bro ? If u explain me the commands in detail it would be helpful..
I have pm you the commands I use...Could you have a look at it?
( Without the above command it booted for me in Blu life One M. My concern s why it ain't booting in A117 & A250. A250 has been booted by a guy who used the same source )
Sent from my BLU LIFE ONE M using Tapatalk
Click to expand...
Click to collapse
There's your error, don't run make mediatek-Config. Copy the kconfig present in ../mediatek/Config/blue**/autoconfig/kconfig to your source dir as a .config file here edit the file. Using make menuconfig. Also make sure your files are correct if you cloned it from a git repo, do a git reset - - hard. Run a make clean and a make mrproper.
Explanation: using make mediatek-Config will bring in the mt6589 defaults; phones require a little more than that
and make sure to check my next guide on Appending headers or the boot.img don't work. Append headers both on ramdisk and kernel.
Warnjng:git reset - - hard will delete all changes you've made to the kernel source!
Regards and good luck.
Sent from my Moto G using XDA Free mobile app
No I didn't clone from git...I just downloaded source and compiled...I will compile by the method you said today night...
( In blu life one m it booted by make-mediatek config )
This is the link for kernel source http://forum.xda-developers.com/showthread.php?t=2650513&page=3
Post count no 24. Can u give a try ?
Sent from my BLU LIFE ONE M using Tapatalk
Santhosh M said:
No I didn't clone from git...I just downloaded source and compiled...I will compile by the method you said today night...
( In blu life one m it booted by make-mediatek config )
This is the link for kernel source http://forum.xda-developers.com/showthread.php?t=2650513&page=3
Post count no 24. Can u give a try ?
Sent from my BLU LIFE ONE M using Tapatalk
Click to expand...
Click to collapse
I'm actually out for a vacation is it okay if I check by Friday? Sorry :/
Are you sure that blue life m and A117 and A250 all have the same specs. Each and every hardware?
Upload a dmesg I'll look at it and tell you what's wrong. Go to your recovery then type dmesg > /sdcard/dmesg.txt then upload it.
MasterAwesome.
Sent from my Moto G using XDA Free mobile app
Ya sure bro....Your time...I don't own both devices I just want to boot and build kernels for that devices
Yes bro...they are clones with ditto hardware and everything similar...Blu life one x s a clone of A250 and I had shown u the proof of the guy who had booted blu life one x source in A250...Similarly blu life one m s clone of A117.
I depend upon testers for these devices...Dmesg and kmesg I have for builds I made 2 months ago..That time my compilation methods were wrong and the tester at that time was able to give whatever I asked..
My recent build I have only log cat...My new tester says he isn't able to take dmesg and kmesg
Logcat s k ?
Sent from my BLU LIFE ONE M using Tapatalk
tip
MasterAwesome said:
Code:
cd kernel_source
cp mediatek/config/devicename/autoconfig/kconfig/platform .config
Click to expand...
Click to collapse
make mediatek-configs
is better instead of your command
why ? because mtk build scripts merge multiple config files (mediatek/config/devicename/autoconfig/kconfig/platform and mediatek/config/mt6589/autoconfig/kconfig/platform and some in mediatek/config/common/)
If you want to add features, just modify mediatek/config/devicename/autoconfig/kconfig/platform and/or mediatek/config/mt6589/autoconfig/kconfig/platform
simply copying is not advised
EDIT : This is maybe why you got some weird issues :/
Dr-Shadow said:
make mediatek-configs
is better instead of your command
why ? because mtk build scripts merge multiple config files (mediatek/config/devicename/autoconfig/kconfig/platform and mediatek/config/mt6589/autoconfig/kconfig/platform and some in mediatek/config/common/)
If you want to add features, just modify mediatek/config/devicename/autoconfig/kconfig/platform and/or mediatek/config/mt6589/autoconfig/kconfig/platform
simply copying is not advised
EDIT : This is maybe why you got some weird issues :/
Click to expand...
Click to collapse
Typing a make command after you've set the target product does the same thing... Stop the build after it says .config written and I compared it. I got same .config.
I was asking him to disable selinux so I asked him the kconfig from the the devicename. But I automatically assume you're right always and shall follow your method henceforth. Thank you
MasterAwesome
Sent from my Moto G
MasterAwesome said:
Typing a make command after you've set the target product does the same thing... Stop the build after it says .config written and I compared it. I got same .config.
I was asking him to disable selinux so I asked him the kconfig from the the devicename. But I automatically assume you're right always and shall follow your method henceforth. Thank you
MasterAwesome
Sent from my Moto G
Click to expand...
Click to collapse
On which kernel source it gives same .config ?
Dr-Shadow said:
On which kernel source it gives same .config ?
Click to expand...
Click to collapse
Wiko stairway
Sent from my Moto G
MasterAwesome said:
Wiko stairway
Sent from my Moto G
Click to expand...
Click to collapse
This doesn't give same .config
rm .config && make mediatek-configs
diff mediatek-configs ../mediatek/config/wiko/autoconfig/kconfig/project
shows this diff :
http://pastebin.com/Ef7NyksD
Be carefull, ../mediatek/config/wiko/autoconfig/kconfig/project and ../mediatek/config/out/wiko/autoconfig/kconfig are different (the out is generated files from mtk scripts so kconfig is the result of merging project/platform files)
Dr-Shadow said:
This doesn't give same .config
rm .config && make mediatek-configs
diff mediatek-configs ../mediatek/config/wiko/autoconfig/kconfig/project
shows this diff :
http://pastebin.com/Ef7NyksD
Be carefull, ../mediatek/config/wiko/autoconfig/kconfig/project and ../mediatek/config/out/wiko/autoconfig/kconfig are different (the out is generated files from mtk scripts so kconfig is the result of merging project/platform files)
Click to expand...
Click to collapse
Thank you.. Got it
Sent from my Moto G

Categories

Resources