[GUIDE] Convert Any Phone/Tablet into KaliPwn Phone/Tablet - Android Software/Hacking General [Developers Only]

****i am not responsible for your phone or anything you do with aircrack-ng
this guide will help you do, what a $1,295.00 PWN PHONE can!!
*this guide is based on nexus 5 you can substitute it with any phone/tablet(with otg support) with this guide
------------------------------------------------------------------------------------------------
Things You Need
------------------------------------------------------------------------------------------------
1) Nexus 5 (rooted)
2) OTG Cable
3) list of USB supported
.TP-LINK TL-WN722N(confirmed by me & DragonHunt3r)
.Linksys WUSB600N V2 (confirmed by DragonHunt3r)
.TP-LINK TL-WN725N V1 & V2
.ALFA Network AWUS036H
(if you have other wifi usb then just ask ill try to add it into the guide)
4) Ubuntu (to compile kernel)
------------------------------------------------------------------------------------------------
PART A
(Compiling Kernel)
------------------------------------------------------------------------------------------------
Setting up your ubuntu machine
Code:
$ sudo apt-get update
Code:
$ sudo apt-get install oracle-java6-installer
Code:
$ sudo apt-get install git gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z1-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libreadline6-dev lib32readline-gplv2-dev libncurses5-dev bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev squashfs-tools pngcrush schedtool dpkg-dev
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/
create a file /etc/udev/rules.d/51-android.rules (as the root user)
copy paste the below code and save
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>"
<username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
Setting correct paths
Code:
gedit android-path.sh
cope paste the code and save it
Code:
export CC=$(pwd)/arm-eabi-4.6/bin/arm-eabi-
export CROSS_COMPILE=$(pwd)/arm-eabi-4.6/bin/arm-eabi-
export ARCH=arm
export SUBARCH=arm
export PATH=$PATH:$(pwd)/andorid_boot_tools_bin
Make it executable and source to current terminal window.
(you need to source it to your current terminal window before you compile)
Code:
$ chmod +x android-path.sh
$ source android-path.sh
Download Source (any kernel source can be used)
1. HTC
2. Samsung
3. LG
4. Sony
5. Nexus devices
using nexus 5 andoid kernel source
Code:
$ git clone https://android.googlesource.com/kernel/msm.git
Code:
$ cd msm/
$ git branch -a
$ git checkout origin/android-msm-hammerhead-3.4-kitkat-mr2
Code:
$ make hammerhead_defconfig
$ make menuconfig
Adding required drivers
For TP-LINK_TL-WN722N
Code:
quick look in [URL="https://wikidevi.com/wiki/TP-LINK_TL-WN722N"]wikidev[/URL] will tell you that TP-LINK TL-WN722N uses [URL="http://wireless.kernel.org/en/users/Drivers/ath9k_htc"]ath9k_htc[/URL] drivers
Enabling [URL="http://wireless.kernel.org/en/users/Drivers/ath9k"]ath9k[/URL] drivers in kernel
To enable ath9k, you must first enable mac80211 through make menuconfig when compiling your kernel. If you do not know what this means then please learn to compile kernels or rely on your Linux distribution's kernel. Below are the options you need to enable ath9k through make menuconfig.
[CODE]Networking support --->
Wireless --->
< * > cfg80211 - wireless configuration API
< * > Generic IEEE 802.11 Networking Stack (mac80211)
You can then enable ath9k in the kernel configuration under
Code:
Device Drivers --->
[*] Network device support --->
Wireless LAN --->
Atheros Wireless Cards ---->
< * > Atheros 802.11n wireless cards support
< * > Atheros HTC based wireless card support
save and exit menuconfig
check in your .config file if you have them enable(its a hidden file)
Code:
CONFIG_ATH_COMMON=y
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_HTC=y
[/CODE]
For TP-LINK TL-WN725N V1 & V2
Code:
quick look in [URL="https://wikidevi.com/wiki/TP-LINK_TL-WN725N_v1"]V1[/URL] & [URL="https://wikidevi.com/wiki/TP-LINK_TL-WN725N_v2"]V2[/URL] wikidev will tell you that TP-LINK_TL-WN725N uses [URL="http://wireless.kernel.org/en/users/Drivers/rtl819x"]rtl8192cu[/URL] & [URL="https://github.com/lwfinger/rtl8188eu"]8188eu[/URL] drivers
To enable rtl8192cu & 8188eu, you must first enable rtl8192cu & 8188eu through make menuconfig when compiling your kernel. If you do not know what this means then please learn to compile kernels or rely on your Linux distribution's kernel. Below are the options you need to enable rtl8192cu & 8188eu through make menuconfig.
[CODE]Device Drivers --->
[*] Network device support --->
Wireless LAN --->
[*] Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
For Linksys WUSB600N V2
Code:
quick look in [URL="https://wikidevi.com/wiki/Linksys_WUSB600N_v2"]wikidev[/URL] will tell you that WUSB600N V2 uses [URL="http://wireless.kernel.org/en/users/Drivers/rt2800usb"]rt2800usb[/URL] drivers
To enable rt2800usb, you must first enable rt2800usb through make menuconfig when compiling your kernel. If you do not know what this means then please learn to compile kernels or rely on your Linux distribution's kernel. Below are the options you need to enable rt2800usb through make menuconfig.
[CODE]Device Drivers --->
[*] Network device support --->
Wireless LAN --->
Ralink driver support ---->
< * > Ralink rt27xx/rt28xx/rt30xx (USB) support -->
< * > rt2800usb - Include support for rt35xx devices (EXPERIMENTAL) (NEW)
< * > rt2800usb - Include support for unknown (USB) devices
For ALFA Network AWUS036H
Code:
quick look in [URL="https://wikidevi.com/wiki/ALFA_Network_AWUS036H"]wikidev[/URL] will tell you that AWUS036H uses [URL="http://wireless.kernel.org/en/users/Drivers/rtl8187"]rtl8187[/URL] drivers
Enabling [URL="http://wireless.kernel.org/en/users/Drivers/ath9k"]rtl8187[/URL] drivers in kernel
To enable rtl8187, you must first enable rtl8187 through make menuconfig when compiling your kernel. If you do not know what this means then please learn to compile kernels or rely on your Linux distribution's kernel. Below are the options you need to enable rtl8187 through make menuconfig.
[CODE]Networking support --->
Wireless --->
< * > Common routines for IEEE802.11 drivers
< * > Generic IEEE 802.11 Networking Stack (mac80211)
You can then enable rtl8187 in the kernel configuration under
Code:
[CODE]
Device Drivers --->
[*] Network device support --->
Wireless LAN --->
[*] Realtek 8187 and 8187B USB support
save and exit menuconfig[/CODE]
save and exit menuconfig if you dint do it
save and exit menuconfig[/CODE]
now your ready to compile
Code:
make -j4
this will take some time to compile
you should get something like this in the end
Code:
Kernel: arch/arm/boot/zImage-dtb is ready
now you need to get a boot.img from any {your device} rom and place it in boot_img (create this folder where you earlier downloaded the toolchain and the kernel)
Code:
$ cd .. # if you was in msm directory
$ git clone https://github.com/pbatard/bootimg-tools.git
$ cd bootimg-tools/
$ make
$ cd cpio/
$ gcc mkbootfs.c -o mkbootfs -I../include
$ cd ../..
$ mkdir andorid_boot_tools_bin
$ cd andorid_boot_tools_bin/
$ cp ../bootimg-tools/mkbootimg/mkbootimg .
$ cp ../bootimg-tools/mkbootimg/unmkbootimg .
$ cp ../bootimg-tools/cpio/mkbootfs .
$ cd ..
time to create your own boot
Code:
$ unmkbootimg -i boot_img/boot.img
$ cp msm/arch/arm/boot/zImage-dtb kernel
$ mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x02900000 --second_offset 0x00f00000 --tags_offset 0x02700000 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.img
install the boot.img to your phone (this wont flash the kernel, it will temporarily boot with this kernel, after you restart you will go back to what ever kernel you had before
(this is for nexus 5 it might work for others also)
Code:
$ adb reboot bootloader
$ sudo fastboot boot boot.img
------------------------------------------------------------------------------------------------
PART B
(setting up your phone)
------------------------------------------------------------------------------------------------
For TP-LINK_TL-WN722N
Code:
download the firmware files [URL="http://wireless.kernel.org/download/htc_fw/1.3/"]here[/URL]
1. htc_7010.fw
2. htc_9271.fw
For TP-LINK TL-WN725N V1 & V2
Code:
Download the firmware files [URL="https://drive.google.com/folderview?id=0Bxm4XqSOJU3YWlVaZ1NFRDF4RTA&usp=sharing"]here[/URL]
For Linksys WUSB600N V2
Code:
Download the firmware files [URL="https://drive.google.com/folderview?id=0Bxm4XqSOJU3YMGZTcjJ2ei10V1k&usp=sharing"]here[/URL]
1. rt2870.bin
For ALFA Network AWUS036H
Code:
hopefully nothing to do here,... if it doesnt work let me know
copy them to your phone
use a file manager with root to copy both of them to /system/etc/firmware/
install Linux deploy on your phone
fire up linux deploy and go to properties-->Distribution and select kali linux
installation path set to /sdcard/linux.img
hit the install button
after installation click start button
start your favorite ssh program and happy aircrack-ng
(SH credentials are “android” for the username (configured via Linux Deploy) and “changeme” as the password.)
​

can u add it for d-link dwa-123

i just want to say you are my hero :good:

ummmm.... super interesting....
you think that work reaver???

this is amazing, does device compatibility play a role with LG G2? I know it doesn't have support for that one wifi monitoring thing on stock anyways.

Hello, it is possible to convert à galaxy s6 into KaliPwn phone? I have the 5.0.2 firmware and origin kernel, can i install? The franco kernel. Thank you very much for your answers

This is really insteresting but also a bit old. Can anyone confirm this still works or redirect me to an updated version of this guide?

Related

[SOLVED][Q]Adb + Ubuntu 12.04

Hi all,
I'm new user of the One S.
I want can run adb in ubuntu 12.04, but isn't work, i'm not root, rom stock after power on at the first time
Code:
sudo gedit /etc/udev/rules.d/[COLOR="Red"]70[/COLOR]-android.rules or sudo gedit /etc/udev/rules.d/[COLOR="Red"]51[/COLOR]-android.rules
with this in
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
i'm restart UDEV or Reboot computer
and the result is same at any time
Code:
adb devices
List of devices attached
???????????? no permissions
Any one can help me?
SOLUCE
Code:
sudo gedit /etc/udev/rules.d/99-android.rules
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0cec", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0cec"
TEST=="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
Code:
sudo chmod a+rx /etc/udev/rules.d/99-android.rules
Code:
reboot
Code:
~$ adb devices
List of devices attached
SH24SW405437 device
s
If this not work add
Code:
sudo gedit /.android/adb_usb.ini
Code:
0bb4
Code:
reboot
this worked for me
This worked for me (Kubuntu 12.04):
Type the following commands:
Code:
cd /etc/udev/rules.d/
Code:
sudo vim 51-android.rules
Press
Code:
i
to edit, then paste the following text:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4",ATTR{idProduct}=="0cba", MODE="0666"
Click to expand...
Click to collapse
press Esc key, then
Code:
wq
m!k3 said:
Hi all,
I'm new user of the One S.
I want can run adb in ubuntu 12.04, but isn't work, i'm not root, rom stock after power on at the first time
Code:
sudo gedit /etc/udev/rules.d/[COLOR="Red"]70[/COLOR]-android.rules or sudo gedit /etc/udev/rules.d/[COLOR="Red"]51[/COLOR]-android.rules
with this in
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
i'm restart UDEV or Reboot computer
and the result is same at any time
Code:
adb devices
List of devices attached
???????????? no permissions
Any one can help me?
Click to expand...
Click to collapse
Have you tried Knives-and-Forks Tools for linux user try with sudo <command>
adb works on Ubuntu 12.04LTS
x1123 said:
Have you tried Knives-and-Forks Tools for linux user try with sudo <command>
Click to expand...
Click to collapse
On Ubuntu 12.04LTS
step 1:
use lsusb command to find out your devices's ID:
lsusb
Bus 003 Device 007: ID 18d1:d002 Google Inc.
step2:
add a line in the /etc/udev/rulers.d/xx-android.rules using the ID found in step 1.
http://source.android.com/source/initializing.html
Configuring USB Access
Under GNU/linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access.
The recommended approach is to create a file /etc/udev/rules.d/51-android.rules (as the root user) and to copy the following lines in it. <username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"

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.

[GUIDE] Build Android From Source

Today, we will be learning how to build android from source! Lets start.​The Android build is routinely tested in-house on recent versions of Ubuntu LTS (10.04), but most distributions should have the required build tools available.​Please note that building on mac osx wont be discussed here.​
Requirements
A Linux or Mac computer. It is also possible to build Android in a virtual machine on unsupported systems such as Windows. If you are running Linux in a virtual machine, you need at least 16GB of RAM/swap and 30GB or more of disk space in order to build the Android tree.
A 64-bit environment is required for Gingerbread (2.3.x) and newer versions, including the master branch. You can compile older versions on 32-bit systems.
30GB of free disk space to complete a single build and up to 100GB or more for a full set of builds. The source download is approximately 8.5GB in size.
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.
Setting up the linux build Environment
Installing the JDK
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.
Please note : Java 6: for Gingerbread and newer.
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Installing required packages (Ubuntu 10.04 - 11.10)
You will need a 64-bit version of Ubuntu. Ubuntu 10.04 is recommended. Building using a newer version of Ubuntu 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 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 xsltproc
On Ubuntu 10.10
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10
Code:
$ sudo apt-get install libx11-dev:i386
Configuring USB Access
Under GNU/linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access.
The recommended approach is to create a file /etc/udev/rules.d/51-android.rules (as the root user) and to copy the following lines in it. <username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
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>"
# 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>"
NOTE : Those new rules take effect the next time a device is plugged in. It might therefore be necessary to unplug the device and plug it back into the computer.​
Setting up ccache
Put the following in your .bashrc or equivalent.:
Code:
export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
Code:
export CCACHE_DIR=<path-to-your-cache-directory>
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
When building Ice Cream Sandwich (4.0.x) or older, ccache is in a different location:
Code:
prebuilt/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
--- > Please note : By default, the output of each build is stored in the out/ subdirectory of the matching source tree.​
Downloading the Source
The Android source tree is located in a Git repository hosted by Google. This document describes how to download the source tree for a specific Android code-line.
Installing Repo
Repo is a tool that makes it easier to work with Git in the context of Android.
TO install repo:
1. Make sure you have a bin/ directory in your home directory and that it is included in your path:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
2. Download the Repo tool and ensure that it is executable:
Code:
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Initializing a Repo client
After installing Repo, set up your client to access the Android source repository:
1. Create an empty directory to hold your working files.
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
2. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
Code:
$ repo init -u https://android.googlesource.com/platform/manifest
3. When prompted, configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.​
Downloading the Android Source Tree
To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run
Code:
$ repo sync
The Android source files will be located in your working directory under their project names.​
Building the System
Choosing a Branch
Some of the requirements for your build environment are determined by which version of the source code you plan to compile.
See Codenames, Tags, and Build Numbers for a full listing of branches you may choose from. You may also choose to download and build the latest source code (called "master"), in which case you will simply omit the branch specification when you initialize the repository.​
Initialize
Initialize the environment with the envsetup.sh script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.
Code:
$ source build/envsetup.sh
Choose a Target
Choose which target to build with lunch. The exact configuration can be passed as an argument, e.g.
Code:
$ lunch full-eng
The example above refers to a complete build for the emulator, with all debugging enabled.
All build targets take the form BUILD-BUILDTYPE, where the BUILD is a codename referring to the particular feature combination. Here's a partial list:
{
"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"
}
and the BUILDTYPE is one of the following:
​
Build the Code
Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build
Code:
$ make -jN
You can either run your build on an emulator or flash it on a device. Please note that you have already selected your build target with lunch, and it is unlikely at best to run on a different target than it was built for.
Flash a Device
To flash a device, you will need to use fastboot, which should be included in your path after a successful build. Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with
Code:
$ adb reboot bootloader
Once the device is in fastboot mode, run
Code:
$ fastboot flashall -w
The -w option wipes the /data partition on the device; this is useful for your first time flashing a particular device, but is otherwise unnecessary.​
Emulate an Android Device
The emulator is added to your path automatically by the build process. To run the emulator, type
Code:
$ emulator
Using ccache
ccache is a compiler cache for C and C++ that can help make builds faster. In the root of the source tree, do the following:
Code:
$ export USE_CCACHE=1
$ export CCACHE_DIR=/<path_of_your_choice>/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
Note : The suggested cache size is 50-100G.
Note 2 : You can watch ccache being used by doing the following:
Code:
$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s[/B]
​
Reserved
Reserved for updates
Last one
I would like to keep this one
Bahalshsjshsijwghwowbbapbfnaoabbdms
(Deleted)

[GUIDE]Making a ROM from source{Mediatek}

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

[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