[SOURCE](TUT){LEGION-MODZ}WARP3D 420 $ROM$ R3TURNZ- cd ~/XDA/$ROM$ - Android

{
"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"
}
I started this thread because my pre-paid phone is not a supported device.
I have to start this over from scratch, so no need to dwell in the past. The reason I started learning this stuff was to help others. I don't even use custom roms in my phone. I have always liked computers, and anything to do with electronics. I don't care for this N00Bz word. I don't care for people that look down on another human being for anything. God above made us all differently for a reason. Society made sellers and buyers, translated to the Android community as builders and users.. My old lady thinks ROOTING is something you do in the garden.. My new project has nothing to do with Cyanogenmod,AOKP, or JellyBeer. I like to do things that no one has done yet. That is why I am not going to reveal my new Source code. Seems like everytime I come up with an idea somebody else gets "motivated" to do it. lol To be honest I will be working on two seldom done roms, i'm repo sync'n the first one right now. Also, during my stay at XDA- i will make a very detailed tutorial on building from Source. Starting with
1. dual and tri booting your PC, for the Windows lovers. (u need Linux 2 build)
2. Learning to use "Google" , this is your new best friend, It never gets tired of your questions, it never runs out of answers, and open 24 hours a day...
3. Learn basic linux commands ....cd, su, apt-get, etc
4. Setting up your build by yourself
5. Setting up a pre-made build box (see step 1)
6. Learn to use Github
7. Use your newly acquired knowledge to "git" your Sources
8. Build a device tree
9. Build a kernel
10. Put together a script to pull Prop files
11. Building
12. Beating your head on the desk when you can't figure out why it wont build, boot , and why you have so many "bugz"
I AM NOT A DEVELOPER
But when i finish this tutorial, i will be.
this tutorial will not cover anything to do with "cooking" a rom, that is cheating...lol
Now I'm going to try my luck at these new $ROM$.
Thank you for visiting and God bless you
"MORE TO FOLLOW"

In the Beginning ,there was DARKNESS and cheap phones
STEP 1​
Windows 7 and Ubuntu,BBQ, or Mint,etc,Build boxes or from live CD. Despite their opposing missions, can get along like best pals on a single computer. Here's how to set up a dual boot or tri boot system that lets you enjoy the best of both worlds in perfect harmony. I know this works because it is how my system at home and on my laptop are setup.
HINT: Linux has around 100 viruses, Windows , it can't be counted. In linux it is harder to get viruses on a PC. Also, Windows viruses don't carry over to your Linux build OS.
Seen in this comparison article
"The expression is intended to suggest that proprietary software is more secure by virtue of its closed nature. If hackers can't see the code, then it's harder for them to create exploits for it--or so the thinking goes.
Unfortunately for Windows users, that's just not true--as evidenced by the never-ending parade of patches coming out of Redmond. In fact, one of Linux's many advantages over Windows is that it is more secure--much more. For small businesses and other organizations without a dedicated staff of security experts, that benefit can be particularly critical."
http://www.pagestart.com/win7heptaboot01.html
1. Make sure you have CD's or USB's with your Distro's on them. I use image burn. If it's Windows, PAY FOR IT!!! if it's Linux, IT'S FREE!!!
2. You are going to need extra space on your hard drive, or PG suggested you can use an extra hard drive.
a. Each repo is going to use up 30 GB
b. Your build tools maybe 5 GB
c. 300 mb for the boot
d. 5-10 GB for the SWAP
e. I use a 1TB for a tri-boot ,500 GB for Windows 7- 250 GB for each of my Linux distros
f. RAM,RAM,RAM,RAM and then some more RAM-- u can thank me later.
g. If you don't have RAM, like on my laptop, I just hooked it to my Internet connection, and let it pull Source while I was sleeping.
3. I like to start fresh--Make a backup, Then I use "KILLDISK" ,it is free and it will write zero's on your hard drive. "Warp, Why do u do that?"
I don't like viruses.
4. Use your Recovery partition or your Windows XP/VISTA/7/8 disk to install the OS.
5. Many hours later, boot into Windows, and hit Start..type diskmgmt.msc
6. If you haven't partitioned a hard drive ,Google it, and learn, this is not a game.
7. Dual boot = 2 primary partitions Tri boot = 3 primary partitions.
Logical is OK for Linux, but dynamic is no good.
8. Pop that fresh copy of your distro in
9. If you are new to Linux "Google it"
10. If you press install alongside windows, it will search out the empty partition and install
11. I don't like GRUB2.
12 Get the non-commercial version of "EasyBCD for Windows, install it, u will be needing it.
13. This is also a free app Google "use easy BCD for dual boot"
14. The only other step needed on the tri boot setup is logging into the first Linux distro u install, open terminal and execute update-grub2 . after everything else is done...
15. If you opted for the "Build Box, skip the setting up build step....
There is also another method to installing Linux on a Laptop, or a stubborn PC with Graphics issues and that is with the "Alternate Ubuntu installer"
I have only got this to work on 12.04 lots with recovery failsafex mode
REMOVE
SYSTEM RESERVED:
THIS CAN MESS UP YOUR PC:
I'M ONLY ADDING THIS FOR ADVANCED USERS:
ALL THE STEPS ARE HERE AT THIS LINK, BUT I USED WHATS IN THE CODE BOX AND IT WORKED FOR ME.
http://www.terabyteunlimited.com/kb/article.php?id=409​
Code:
Open Disk management ,
give SYSTEM a drive letter of e:
Run CMD as Admin
reg unload HKLM\BCD00000000 (if you get an ERROR: bla bla bla) then this may already be removed)
robocopy e:\ c:\ bootmgr
robocopy e:\Boot C:\Boot /s
dir c:\ /ah
If the bootmgr file and the Boot folder show up in the list, the procedure was successful.
bcdedit /store c:\boot\bcd /set {bootmgr} device partition=C:
bcdedit /store c:\boot\bcd /set {memdiag} device partition=C:
Close the Command Prompt window.
Return to Disk Management
Right-click on the Windows partition and select Mark Partition as Active
IF YOU HAVE TO ASK "WHY" I DID THIS ...DON'T DO IT (see number 7.) also easyBCD can do this process as well

Then came GOOGLE!
STEP 2​
This is a SIMPLE STEP...
WWW.GOOGLE.COM
Not www.goggle.com which is a real site, made by Hack3rz. it will mess your PC up.
This step is not limited to one search engine, Google is just my preferred one, because it links in UTUBE in search results and i like it.
Here is a list of other search engines.
Code:
General
No. Name
1 Baidu
2 Bing
3 Blekko
4 DuckDuckGo
5 Exalead
6 Gigablast
7 Google
9 Sogou
10 Soso.com
11 Volunia
12 Yahoo!
13 Yandex
14 Youdao
P2P search engines
No. Name
1 FAROO
2 Seeks
3 YaCy
Metasearch engines
No. Name
1 Blingo
2 Yippy
3 DeeperWeb
4 Dogpile
5 Excite
6 Harvester42
7 HotBot
8 Info.com
9 Ixquick (StartPage)
10 Kayak & SideStep
11 Mamma
12 Metacrawler
13 Mobissimo
14 Otalo English
15 PCH Search and Win
17 WebCrawler
Geographically limited scope
No. Name
1 Accoona
2 Alleba
3 Ansearch
4 Biglobe
5 Daum
5 Egerin
6 Goo
7 Guruji.com
8 Leit.is
9 Maktoob
10 Miner.hu
11 Najdi.si
12 Naver
13 Onkosh
14 Rambler
15 Rediff
16 SAPO
17 Search.ch
18 Sesam
19 Seznam
20 Walla!
21 Yandex.ru
22 Yehey!
23 ZipLocal
I got this list from using "Google"
1. you need to know how many MB in a GB , Google it =1024
2. You need a copy of a missing file ...
3. Anything you aren't sure of.....
4. If you can't find it then go to XDA, Android Forums, unleashedprepaids.com, etc and Search it. Chances are somebody has had the same problem as you.. DONE STEP 2

No, You mean I have to learn something to make a $ROM$
STEP 3​
Unix commands
Note that there are thousands of commands available on a typical unix box. In bash, just hit the "Tab" key twice and say yes, to display the the commands currently available on your machine. A standard unix operating system lists currently thousands of commands. Type x to list all commands starting with x. The following list contains some of the more frequently used programs.
Code:
Access Control
exit - terminate a shell (see "man sh" or "man csh")
logout - sign off; end session (C shell and bash shell only
passwd - change login password
rlogin - log in remotely to another UNIX system
ssh - secure shell
slogin - secure version of rlogin
yppasswd - change login password in yellow pages
Communications
mail - send and receive mail
mesg - permit or deny terminal messages and talk requests
pine - send and receive mail
talk - talk to another logged-in user
write - write to another logged-in user
Programming Tools
as - assembler, specific to each machine architecture
awk - pattern scanning and processing language
bc - online calculator
cc - C compiler
csh - C shell command interpreter
dbx - source-level debugging program
f77 - Fortran compiler
gdb - GNU Project debugger
gprof - display profile of called routines
kill - kill a process
ld - the UNIX loader
lex - generate lexical analysis programs
lint - check C source code
make - maintain large programs
maple - symbolic mathematics program
math - symbolic mathematics program
nice - run a command at low priority (see "man nice" or "man csh")
nohup - run a command immune to hangups
pc - Pascal compiler (xlp on ADS)
perl - Popular script interpreter
prof - display profile data
python - Python programming language
sh - Bourne shell command interpreter
yacc - generate input parsing programs
xcalc - graphical calulator under x
Documentation
apropos - locate commands by keyword lookup
find - locate file (i.e. find . -name *.tex -print)
info - start the info explorer program
man - find manual information about commands
whatis - describe what a command is
whereis - locate source, binary, or man page for a program
Editors
emacs - screen-oriented text editor
pico - screen-oriented text editor (renamed called nano)
sed - stream-oriented text editor
vi - full-screen text editor
vim - full-screen text editor ("vi-improved")
File and Directory Management
cd - change working directory
chmod - change the protection of a file or directory
chown - change owner (or group) of a file or directory
chgrp - change group of a file or directory
cmp - compare two files
comm - select/reject lines common to two sorted files
cp - copy files
crypt - encrypt/decrypt files (CCWF only)
diff - compare the contents of two ASCII files
file - determine file type
grep - search a file for a pattern
gzip - compress or expand files
ln - make a link to a file
ls - list the contents of a directory
lsof - list of open files
mkdir - create a directory
mv - move or rename files and directories
pwd - show the full pathname of your working directory
quota - display disk usage and limits
rm - delete (remove) files
rmdir - delete (remove) directories
stat - status of file (i.e. last access)
sync - flush filesystem buffers
sort - sort or merge files
tar - create or extract archives
tee - copy input to standard output and other files
tr - translate characters
umask - change default file protections
uncompress - restore compressed file
uniq - report (or delete) repeated lines in a file
wc - count lines, words, and characters in a file
Code:
File Display and Printing
cat - show the contents of a file; catenate files
fold - fold long lines to fit output device
head - show first few lines of a file
lpq - examine the printer spooling queue
lpr - print a file
lprm - remove jobs from the printer spooling queue
more - display a file, one screen at a time
less - like more with more features
page - like "more", but prints screens top to bottom
pr - paginate a file for printing
tail - show the last part of a file
zcat - display a compressed file
xv - show print, manipulate images
gv - show ps and pdf files
xpdf = shopw pdf files (use gv)
File Transfer
ftp - transfer files between network hosts
rsync - fast and flexible sync between computers
scp - secure version of rcp
Miscellaneous
alias - define synonym commands
chquota - change disk quota on ACITS UNIX systems
chsh - change default login shell
clear - clear terminal screen
echo - echo arguments
pbm - portable bitmap manipulation programs
popd - pop the directory stack (C shell only)
pushd - push directory on stack (C shell only)
script - make typescript of terminal session
setenv - set an environment variable (C shell only)
stty - set terminal options
News/Networks
netstat - show network status
rsh - run shell or command on another UNIX system
ssh - secure-shell version of rsh
Process Control
bg - put suspended process into background
fg - bring process into foreground
jobs - list processes
^y - suspend process at next input request
^z - suspend current process
Status Information
clock - determine processor time
date - show date and time
df - summarize free disk space
du - summarize disk space used
env - display environment
finger - look up user information
history - list previously issued commands
last - indicate last login of users
lpq - examine spool queue
manpath - show search path for man pages
printenv - print out environment
ps - show process status
pwd - print full pathname of working directory
set - set shell variables (C shell, bash, or ksh)
spend - lists year-to-date ACITS UNIX charges
stty - set terminal options
time - timing programs
top - list top cpu processes
uptime - show system load, how long system has been up
w - show who is on system, what command each job is executing
who - show who is logged onto the system
whois - Internet user name directory service
whoami - who owns the shell
Image Processing
gimp - photoshop type image processing program
xfig - drawing program
xv - image viewer
xvscan - scan picture
xpaint - paint program
kpaint - kde paint program
Sound
mplayer - mpg player
realplay - realaudio player
timidity - midi to wav converter and player
xmms - mp3 player
Text Processing
abiword - open source word processor
addbib - create or extend bibliographic database
col - filter reverse line feeds
diction - identify wordy sentences
diffmk - mark differences between files
dvips - convert TeX DVI files into PostScript
explain - explain phrases found by diction program
grap - pic preprocessor for drawing graphs
hyphen - find hyphenated words
ispell - check spelling interactively
latex - format text in LaTeX (based on TeX)
pdfelatex - latex with pdf output
latex2html - Latex to html
lookbib - find bibliography references
macref - make cross-reference listing of nroff/troff macro files
ndx - create a subject-page index for a document
neqn - format mathematics with nroff
nroff - format text for simple display
pic - make simple pictures for troff input
psdit - filter troff output for Apple LaserWriter
ptx - make permuted index (not on CCWF)
refer - insert references from bibliographic databases
roffbib - run off bibliographic database
sortbib - sort bibliographic database
spell - find spelling errors
ispell - interactive spell checker
style - analyze surface characteristics of a document
tbl - format tables for nroff/troff
tex - format text
tpic - convert pic source files into TeX commands
wget - grab webpage
X windows
grabmode - info on screen: i.e. "1152x864" 51.213kHz/56.59Hz
import - grab window (i.e. import ppm:- >out.ppm)
xdpyinfo - number of colors
xkill - kill xwindow
xlock - lock screen
xterm - xterminal
xwininfo - information on open window
Web
html2ps - html to ps
latex2html - latex to html translator
lynx - text based webbrowser
netscape - webbrowser
sitecopy - sitecopy is for easily maintaining remote web sites.
weblint - html sytax and style checker
MOST OF THESE YOU WON'T USE...

All by myself, I did it!!
STEP 4​
This next step is not easy, it is time-consuming. So if you chose a "Build Box" I understand..
Lucky for you, i have already found everything for you , So split your screen .
On one side a fresh terminal, on the other side my tutorial, and copy/paste from the beginning of part B).
HINT: When adding any file with apt-get. Watch for anything being removed and anything being added. Also copy any SUGGESTED programs to a text- editor ,research them and add them if you like..
Also when adding things with the command--- $ sudo apt-get install , numerous items can be added behind the command, but i recommend doing it one by one.
This is because of obsoleted software or missing software errors.
This is only going to be a basic list: Seperated in two parts, by A)what you need and B)how to get it.
A) TOOLS OF THE TRADE:
1. Compile Dependencies (libs)
2. Python 2.7.3 (3.2 and 3.3 opt.)
3. GNU MAKE (3.81 or 3.82)
4. Java JDK 6.xx ( not 7)
5. Android SDK
6. ADB & Fastboot
7. USB Configs
8. Repo command
9. Add everything to the PATH in ./bashrc
When you see this symbol "$", it means you are in terminal, but not as "ROOT"
Although if you see this symbol # , you are the "ROOT" user .
Your directory name will be in Red as well.
"But Warp, I don't know how to ROOT my Linux Box"
You don't say...
terminal: $ sudo passwd root
this will then open up Unix for you
add some passwords /confirm password /REMEMBER YOUR PASSWORD!!!
My password is ********** lol.
But Warp, I'm a brave "new user" I want "ROOT" access to file manager..
For Ubuntu
Terminal: $ gksudo nautilus
enter password-- DONE
For Mint (cinnamon)
Terminal: $ gksudo nemo
enter password-- DONE
For Mint (Mate)
Terminal: $ gksudo caja
enter password-- DONE!!!
B)
Libs
1..
$ sudo apt-get install git
sudo apt-get install git-core
sudo apt-get install gnupg
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install gperf
sudo apt-get install build-essential
sudo apt-get install zip
sudo apt-get install curl
sudo apt-get install zlib1g-dev
sudo apt-get install libc6-dev
sudo apt-get install lib32ncurses5-dev
sudo apt-get install ia32-libs
sudo apt-get install x11proto-core-dev
sudo apt-get install libx11-dev:i386
sudo apt-get install libreadline6-dev:i386
sudo apt-get install lib32z-dev
sudo apt-get install libgl1-mesa-glx:i386
sudo apt-get install libgl1-mesa-dev
sudo apt-get install g++-multilib
sudo apt-get install mingw32
sudo apt-get install tofrodos
sudo apt-get install python-markdown
sudo apt-get install libxml2-utils
sudo apt-get install xsltproc
sudo apt-get install readline-common
sudo apt-get install libreadline6-dev
sudo apt-get install libreadline6
sudo apt-get install lib32readline-gplv2-dev
sudo apt-get install libncurses5-dev
sudo apt-get install lib32readline5
sudo apt-get install lib32readline6
sudo apt-get install libreadline-dev
sudo apt-get install libreadline6:i386
sudo apt-get install bzip2
sudo apt-get install libbz2-dev
sudo apt-get install libbz2-1.0
sudo apt-get install libghc-bzlib-dev
sudo apt-get install lib32bz2-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libesd0-dev
sudo apt-get install squashfs-tools
sudo apt-get install pngcrush
sudo apt-get install schedtool
sudo apt-get install python
sudo apt-get install gcc-4.7-multilib
sudo apt-get install ccache
sudo apt-get install eclipse
sudo apt-get install lzop
sudo apt-get install libwxgtk2.8-dev
sudo apt-get install liblzo2-dev
sudo apt-get install uuid
sudo apt-get install uuid-dev
sudo apt-get install zlib1g-dev liblz-dev
sudo apt-get install wmctrl
sudo apt-get install kernel-package
sudo apt-get install jfsutils
sudo apt-get install mcelog
sudo apt-get install xfsprogs
Code:
sudo apt-get install git git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs 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 readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev gcc-4.6-multilib squashfs-tools pngcrush schedtool python ccache eclipse lzop libwxgtk2.8-dev wmctrl debhelper liblzo2-dev uuid uuid-dev zlib1g-dev liblz-dev kernel-package jfsutils mcelog xfsprogs
EXTRAS suggested by apt-- I wouldn't advise you installing anything unless you need them...
apport-gtk apport-kde valac gnome-user-guide desktop-base lightdm
gnome-sushi python-launchpadlib python3-launchpadlib ri ruby-dev
ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev ruby-switch
ubuntu-sso-client-gui ubuntuone-client-proxy zeitgeist-datahub
imagemagick-doc autotrace enscript ffmpeg gnuplot grads hp2xx html2ps
libwmf-bin povray radiance texlive-base-bin transfig ufraw-batch
libjline-java-doc librhino-java-doc xfonts-cyrillic
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
git-email git-gui gitk gitweb
bison-doc lib32mudflap0 ncurses-doc libasound2-doc pulseaudio-esound-compat libglib2.0-doc
dh-make debian-keyring g++-multilib g++-4.7-multilib gcc-4.7-doc
libstdc++6-4.7-dbg libstdc++6-4.7-doc libmail-box-perl lib32stdc++6-4.7-dbg libxcb-doc libxext-doc gcc-doc cpp-doc
python-markdown-doc ttf-bitstream-vera ghc-prof ghc-doc haskell-doc llvm-3.0 libghc-bzlib-doc libghc-bzlib-prof
libgmp10-doc libmpfr-dev distcc distccmon-gnome distcc-pump
ant-gcj ant-doc libbsf-java liboro-java libxalan2-java libjaxp1.3-java
liblog4j1.2-java jython antlr libbcel-java libjdepend-java libgnumail-java
libcommons-net-java javacc ant-optional-gcj junit-doc
libcommons-beanutils-java-doc libcommons-collections3-java-doc
libcommons-dbcp-java-doc libcommons-digester-java-doc
libcommons-httpclient-java-doc libavalon-framework-java
libcommons-logging-java-doc libexcalibur-logkit-java libdb5.1-java-gcj
libeasymock-java-doc ecj libecj-java-gcj libfelix-bundlerepository-java-doc
libfelix-gogo-command-java-doc libfelix-gogo-runtime-java-doc
libfelix-gogo-shell-java-doc libfelix-osgi-obr-java-doc
libfelix-shell-java-doc libfelix-utils-java-doc
libgeronimo-jpa-2.0-spec-java-doc libgeronimo-jta-java-doc
libgeronimo-osgi-support-java-doc libice-doc jetty8 libjetty8-java-doc
libjtidy-java-doc libosgi-compendium-java-doc libosgi-core-java-doc
libosgi-foundation-ee-java-doc libsm-doc libswt-gtk-3-java-gcj tomcat7
wx2.8-doc libgnomeprintui2.2-0 libxt-doc openjdk-7-demo openjdk-7-source
visualvm
i386 items
murrine-themes:i386 kde-config-gtk-style:i386 libpam-ldap:i386
libpam-winbind:i386 libnss-ldap:i386 libroar1:i386 libsndio0:i386
roaraudio-server:i386 libasound2-python:i386 nas:i386 glibc-doc:i386
locales:i386 libcanberra-pulse:i386 libdv-bin:i386 oss-compat:i386
pulseaudio-esound-compat:i386 rng-tools:i386 libgd-tools:i386 libglide3:i386 ibx11-doc:i386 xml-core:i386
gnome-keyring:i386 gnutls-bin:i386 gphoto2:i386 gtkam:i386 gpm:i386
krb5-doc:i386 krb5-user:i386 gstreamer-codec-install:i386
gnome-codec-install:i386 gstreamer0.10-tools:i386 jackd2:i386
libjasper-runtime:i386 liblcms-utils:i386 libmyodbc:i386
odbc-postgresql:i386 tdsodbc:i386 unixodbc-bin:i386 libportaudio2:i386
libroar-compat2:i386 ttf-baekmuk:i386 ttf-arphic-gbsn00lp:i386
ttf-arphic-bsmi00lp:i386 ttf-arphic-gkai00mp:i386 ttf-arphic-bkai00mp:i386
libqt4-declarative-folderlistmodel:i386 libqt4-declarative-gestures:i386
libqt4-declarative-particles:i386 libqt4-declarative-shaders:i386
qt4-qmlviewer:i386 libqt4-dev:i386 libicu48:i386 qt4-qtconfig:i386
libraw1394-doc:i386 librsvg2-bin:i386 hpoj:i386 hplip:i386
libsane-extras:i386 sane-utils:i386 libsasl2-modules-otp:i386
libsasl2-modules-ldap:i386 libsasl2-modules-sql:i386
libsasl2-modules-gssapi-mit:i386 libsasl2-modules-gssapi-heimdal:i386
speex:i386 libxcb-doc:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
After you do all this, may be a good idea to add $ sudo apt-get upgrade
2. I don't get this step. Python is already on there, and if it ain't when you input "sudo apt-get install python" it will be...
3. Gnu Make , Your suppose to get this inside of build-essential , I like to know i got the newest one ,so i do it like this.
go to http://ftp.gnu.org/gnu/make/
Download GNU MAKE 3.82
Open up file manager
go to download folder
cut file
go to home directory
paste
extract
close file manager
Open Terminal:
$ cd <name of gnu make folder(exact)>
then it will look something like this
gnu make $
$ ./configure
$ make
# make install
# make clean...DONE
4. Get rid of pre-installed "JAVA"
$ sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Add new Oracle JAVA 6
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
If you want to check the version after it is done
Terminal: $java -version
http://developer.android.com/sdk/index.html#download
5.Terminal: $ wget http://dl.google.com/android/android-sdk_r22-linux.tgz
When that finishes downloading
Terminal: $ tar -xvzf android-sdk_r22-linux.tgz
After extracting the package, run the command below to change into the tools directory.
cd ~/android-sdk-linux/tools
Finally, run the commands below to begin the installation.
./android update sdk
./android
"wget" is the same thing as "curl"
6. This may seem like a pointless step.
Warp, I already have ADB & Fastboot when I installed SDK, but do you have the 4.2.2 update ??
Just to make sure..
Terminal: $ sudo apt-get install android-tools-adb android-tools-fastboot
7. Create a folder in Home dir "51-android.rules" .
Now open a terminal and input: $ gksudo gedit /etc/udev/rules.d/51-android.rules
When another screen pops up copy and paste this inside--
Code:
#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 & Close text-editor.
Now fire up another terminal
To set proper permisisons: (Provide read permission to all users, in addition to whatever other permissions are pre-set)
input:
Terminal: $ sudo chmod a+r /etc/udev/rules.d/51-android.rules
8. Terminal: $ mkdir -p ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Terminal: $ chmod a+x ~/bin/repo
Terminal: $ export PATH=${PATH}:~/bin
9. You can make this change to the path permanent for all future Terminal sessions:
Terminal: gedit ~/.bashrc
add export PATH=${PATH}:~/bin, on its own line, then save the file.
If you ever have problems with repo.. try this
- Make sure you have a bin/ directory in your home directory and that it is included in your path: (Very Important)
$ PATH=~/bin:$PATH
- Next,
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod +x ~/bin/repo

I don't wanna do it
STEP 5​
This step was included , for no particular reason. If you chose a build box, and you made it past step 1 without using it, you did something wrong. Go back to step 1
But I might as well include a few sources for build boxes
BBQLinux http://sourceforge.net/projects/bbqlinux/files/
SuperR's ubuntu or mint buildbox http://unleashedprepaids.com/thread-8191-post-61357.html
h311sdr0id's--h311's kitchen http://forum.xda-developers.com/showthread.php?t=2152398

How did he do that???
STEP 6​
GitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both paid plans for private repositories, and free accounts for open source projects.
If you are a person that wants to "build" and become more than just a "user", then your next stop is at "Github"...
Your old buddy "Google" can get you there pretty fast.
The site provides social networking functionality such as feeds, followers and the network graph to display how developers work on their versions of a repository.
According to the terms of service,if an account's bandwidth usage significantly exceeds the average of other GitHub customers, the account's file hosting service may be immediately disabled or throttled until bandwidth consumption is reduced. In addition, while there is no hard limit, the guideline for the maximum size of a repository is one gigabyte.
GitHub also has their standard GUI application available for download (Windows, Mac, Linux) directly from the service's website.
Ever wonder, "How did this Dev get this unsupported device to boot the latest rom?" Chances are, the way they did it will be inputted in Github.
Pay attention to the device names and models, This is important, because like I said every device is different... Everyday lately, I spend an hour or two looking through Github. Not just at my device, but at other models, other kernels, other Solutions...
Now I'm not saying go there, Find a boardconfig you like, cut/paste it into your device tree, but you may find some answers to problems.
(some info from github Wiki)
beginner's links
http://blog.jonathanargentiero.com/?p=114
http://ryanflorence.com/git-for-beginners/
http://dotnet.dzone.com/articles/intro-git
http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide
http://blog.xkoder.com/2008/08/13/git-tutorial-starting-with-git-using-just-10-commands/
http://www.webdesignermag.co.uk/features/a-beginners-guide-to-git-and-github/
git gui
http://www.collab.net/downloads/giteye

"GIT" it!!!
STEP 7​
"GOT RAM" This is when it will come in handy. EDIT: If you like to multi-task. "message for the anal thread readers"
Open up file manager, HOME directory ,make new folder, name it "android" (easy way to do it)
Open "android" folder, make new folder, name it "system"
Close file manager
or
Fire up a terminal
$ mkdir android
$ cd android
$ mkdir system
To get your Source, all you need are three things.
1. Git
2. Curl
3. Repo command
Whether you used a "build box" or set it up yourself , you have everything, but to pull Source, that's all it uses...
How to Initialize the source repository
Code:
REPOSITORY'S OF FAMOUS ROMS (Select One)
AOSP
repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2
PAC-Man :
Code:
repo init -u git://github.com/PAC-man/android.git -b cm-10.1
repo init -u git://github.com/PAC-man/android.git -b cm-10.2
CM 10.1 :
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
CM10 :
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
BeerGang :
Code:
repo init -u git://github.com/BeerGang/android.git -b cm-10.1
Aokp
For 4.2
repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr1
For 4.1
repo init -u https://github.com/AOKP/platform_manifest.git -b jb
MIUI
repo init -u git://github.com/MiCode/patchrom.git -b ics
Paranoid android
repo init -u git://github.com/ParanoidAndroid/android.git -b jellybean
slim bean
repo init -u git://github.com/SlimRoms/platform_manifest.git -b jb4.2
teambaked
repo init -u https://github.com/TeamBAKED/platform_manifest.git -b jb
(I got this from another guide)
There are other codes out there, but these are main-stream.
So, what you want to do is , open a Terminal
cd = change directory
So you will
$ cd android
$ cd system
$ repo init -u git://github.com/PAC-man/android.git -b cm-10.1
At this point half your terminal or all your terminal will fill with text.
Two ways this will play out
1. it will let you register with name and email
2. it will give you on-screen codes to config it to your name and email
If you want the "Goodies" DO AS IT TELLS YOU
Now after you got that taken care of,
$ repo sync
Learn this code, remember this code, love this code.
it not only pulls the Source to your PC, but it also updates it every time you input it.
So, say Pacman adds a bluetooth update, BAM, that's how you get it.
It depends on your PC specs, to whether how long downloading your Source will take.
PG gets it quick, i get it slow, but we both get it...
For the next month or 4ever, this is where your "repo" will live..
Learn this folder, Open every folder, learn what's in there.
DO NOT ALTER, DO NOT DELETE, DO NOT REMOVE ANYTHING YET!!!

This tree has broken branches
STEP 8​
Creating a basic new device tree
First step to this is to search Github for a device tree for your specific device.
This is where I got lucky.
PG and his associates lol, had already put together a working device tree for our device.
Chances are ,if your device didn't just hit the stores this week, somebody may have started work on a device tree for it.
Although if you do not have anything to start with, You must first open your device folder in the "repo" you "sync'd" to your PC, look at the supported devices
This will be a tool only for reference.
As I open my folder I notice the following
Code:
1. A "bluetooth" folder, with a config file
2. An "include" folder
3. An "overlay" folder
4. A "prebuilts" folder
5. A "recovery" folder
6. A "releasetools" folder
7. AndroidBoard.mk
8. AndroidProducts.mk
9. Boardconfig.mk
10. CM.mk
11. device_warp2.mk
12. extract-files.sh (this is to pull prop blobs)
13. full_warp2.mk
14. Proprietary-files.txt( a list of the prop files you will pull from your stock phone)
15. recovery.fstab
16. setup-makefiles.sh
17. system.prop
18. USBcontroller.cpp
With this group of files, i was able to get a built, but not bootable copy of Jellybeer 10.1.
Now some devices have less and some have alot more files in the device folder.
If you are really serious about becoming a developer, you have to search out others on Github, forums, etc
This step will take teamwork.
Below are two explanations of the files that go into making a device tree...
The directions below describe how to configure make files for new mobile devices and products.
Code:
Create a company directory in //device/partner.
mkdir device/partner/<company_name>
Create a products directory beneath the company directory you created in step 1.
mkdir device/partner/<company_name>/products/
Create a product-specific make file, called device/partner/<company_name>/products/<first_product_name>.mk, that includes the following code:
$(call inherit-product, target/product/generic.mk)
#
# Overrides
PRODUCT_NAME := <first_product_name>
PRODUCT_DEVICE := <board_name>
In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files.
#
# This file should set PRODUCT_MAKEFILES to a list of product makefiles
# to expose to the build system. LOCAL_DIR will already be set to
# the directory containing this file.
#
# This file may not rely on the value of any variable other than
# LOCAL_DIR; do not use any conditionals, and do not look up the
# value of any variable that isn't set in this file or in a file that
# it includes.
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/first_product_name.mk \
Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
mkdir device/partner/<company_name>/<board_name>
Create a product_config.mk file in the directory created in the previous step (device/partner/<company_name>/<board_name>). If this directory does not include a product_config.mk file, the build will fail.
# These definitions override the defaults in config/config.make for <board_name>
#
# TARGET_NO_BOOTLOADER := false
# TARGET_HARDWARE_3D := false
#
TARGET_USE_GENERIC_AUDIO := true
If you wish to modify system properties, create a system.prop file in your <board_name> directory(device/partner/<company_name>/<board_name>).
# system.prop for
# This overrides settings in the products/generic/system.prop file
#
# rild.libpath=/system/lib/libreference-ril.so
# rild.libargs=-d /dev/ttyS0
Add a pointer to <second_product_name>.mk within products/AndroidProducts.mk.
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/first_product_name.mk \
$(LOCAL_DIR)/second_product_name.mk
device/partner/<company_name>/<board_name> must include an Android.mk file with at least the following code:
# make file for new hardware from
#
LOCAL_PATH := $(call my-dir)
#
# this is here to use the pre-built kernel
ifeq ($(TARGET_PREBUILT_KERNEL),)
TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel
endif
#
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
#
# no boot loader, so we don't need any of that stuff..
#
LOCAL_PATH := partner/<company_name>/<board_name>
#
include $(CLEAR_VARS)
#
# include more board specific stuff here? Such as Audio parameters.
#
To create a second product for the same board, create a second product-specific make file called device/partner/company_name/products/<second_product_name>.mk that includes:
$(call inherit-product, partner/google/products/generic.mk)
#
# Overrides
PRODUCT_NAME := <second_product_name>
PRODUCT_DEVICE := <board_name>
By now, you should have two new products, called <first_product_name> and <second_product_name> associated with <company_name>. To verify that a product is properly configured (<first_product_name>, for example), execute the following:
cd device
. ./envsetup.sh
partner_setup <first_product_name>
make PRODUCT-<first_product_name>-user
You should find new build binaries located in device/out/target/product/<board_name>.
New Product File Tree
The file tree below illustrates what your own system should look like after completing the steps above.
<company_name>
<board_name>
Android.mk
product_config.mk
system.prop
products
AndroidProducts.mk
<first_product_name>.mk
<second_product_name>.mk
Part 2
Right... So you want to build your own device tree, read on.
Disclaimer: this is by no means complete, and there will be omissions as have explained all this top of my head and copied pasted certain bits that I have here on my own device tree.
The device tree, for example, /device/lg/gt540would consist of the following make files:
Code:
Android.mk - this will tell the build system to include and to build sources specifically for your device. See below, for an example. This is dependant on the device and hardware, you could have libsensors, liblights, libcamera subdirectories under the example device tree, i.e. /device/lg/gt540/libsensors, /device/lg/gt540/liblights, /device/lg/gt540/libcamera etc.
AndroidBoard.mk - this is for the kernel, the build system uses that to drop the kernel image in place (more about this in a few minutes)
AndroidProducts.mk - specifies the appropriate device's make file, to use for building. i.e. /device/lg/gt540/device_gt540.mk, this is specific also.
device_xxxxx.mk - specifies the properties and extras to copy over into the final output, in this case, it could be for example, device_gt540.mk
BoardConfig.mk - This is the meat of it all, this is where compiler conditional flags are set, partition layouts, boot addresses, ramdisk size, and so on.
Lets peek into each of those to give a glance as to where it all fits in.
Code:
Android.mk:
ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),xxxxx)
include $(call all-named-subdir-makefiles, recovery libsensors liblights libcamera ....)
endif
This is how the build will use that to build recovery, sensors, lights and camera (of course there will be more), its saying 'Yo Builder, go into each of the directories specified, and build the respective sources plskthxbai'
AndroidBoard.mk:
LOCAL_PATH := device/lg/gt540/
#
# Boot files
#
TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
Now this, is telling the build system, to be able to drop this kernel into the out/target/product/lg/gt540 (notice the correlation with the device tree directory?)
AndroidProducts.mk:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/device_gt540.mk
Its telling the build as in 'Yo Builder, read that device make file please and process it upon completion of build.'
*device_xxxxx.mk: (for this example, device_gt540.mk) *
PRODUCT_NAME := lg_gt540
PRODUCT_DEVICE := gt540
PRODUCT_MODEL := LG GT 540
PRODUCT_COPY_FILES += \
... specific ...
PRODUCT_PROPERTY_OVERRIDES := \
ro.com.android.dateformat=dd-MM-yyyy \
... more stuff ...
This is where all the specifics for the device such as drivers, proprietary libraries, supporting scripts specifically for the device, gets copied over to out/target/product/lg/gt540/system/ in this case. Notice how the overrides for the properties, these end up in the build.prop found in the root of the /system of the Android ROM.
BoardConfig.mk:
LOCAL_PATH:= $(call my-dir)
TARGET_NO_BOOTLOADER := true
TARGET_PREBUILT_KERNEL := device/lg/gt540/kernel
TARGET_PREBUILT_RECOVERY_KERNEL := device/lg/gt540/recovery_kernel
# This will vary from device!
TARGET_BOARD_PLATFORM := msm7k
TARGET_ARCH_VARIANT := armv6-vfp
TARGET_CPU_ABI := armeabi
TARGET_CPU_ABI := armeabi-v6l
TARGET_CPU_ABI2 := armeabi
# OpenGL drivers config file path
BOARD_EGL_CFG := device/lg/gt540/egl.cfg
# Dependant, not to be taken literally!
BOARD_GLOBAL_CFLAGS += -DHAVE_FM_RADIO
# Dependant, not to be taken literally!
BOARD_KERNEL_BASE := 0x02600000
# this will be device specific, and by doing cat /proc/mtd will give you the correct sizes
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00480000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00480000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x0cf80000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0d020000
BOARD_FLASH_BLOCK_SIZE := 131072
That is an excerpt, notice how we specify kernel's base address, this is how the boot.img gets generated after compilation is done and yet again, gets dropped into out/target/product/lg/gt540/boot.img. Also, more importantly, we're telling the build system to use the target platform for cross-compiling the sources (*TARGET_BOARD_PLATFORM*/*TARGET_CPU_ABI*) There will be more information in there such as conditional flags to pass to the compiler, for an example. we specified the directive HAVE_FM_RADIO to tell it, when it comes to handling the source for the FM radio system, to conditionally compile parts of the source. Again, this is hardware specific and mileage will vary, also this applies to the address for boot. In a nutshell, this is saying 'Yo Builder, read the damn variables and remember them and apply them when cross-compiling those source files!'
Now that the internals of each of those Android build make-files are shown.
Now, onto the vendor/ part of it, in AOSP, simply, once again, correlation and corresponds with the device/ tree, as in continuing with this example, vendor/lg/gt540/ which gets picked up by the lunch. There's more make files in there but the general consensus is there's a directory called proprietary which contains the proprietary libs (due to close-source etc) that gets copied over. The copying over of the libraries gets specified in the file device-vendor-blobs.mk, in this case, gt540-vendor-blobs.mk.
When the magic happens by doing the following:
. build/envsetup.sh
This is reading in the entire entries found in each of the device/ subdirectories and "remembers them", so the build system knows what type of target is used etc.
When the . lunch gets invoked, a menu appears prompting to pick the device that is required to build. Now the last and final step to do the build...
make -j5 > buildlog.log 2>&1
I run multitail on another terminal and monitor the buildlog.log file to check and make sure its building.
This last step will depend on how many cores you have (n cores + 1 as a rule) and it takes a while to build, GB build takes 40mins on my laptop running Arch Linux 64bit, ICS build takes about 2hrs 30 mins. So mileage will vary on what type of horsepower your machine has.
When the build is done, a little bell goes off and at the bottom of the said log file, I see this:
Combining NOTICE files: out/target/product/xxxxx/obj/NOTICE.html
Target system fs image: out/target/product/xxxxx/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/xxxxx/system.img
out/target/product/xxxx/system.img+ total size is 108776448
As matter of interest JBQ (Jean Baptiste Queru - the 'boss' for managing/distributing the source from Google), his build step is this...
Code:
Extra code to use the ICS Repository
Now enter the following to initialize the repository:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b ics
Extra codes to use the JB Repository
Now enter the following to initialize the repository:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
This is not everything, because a device tree for every device is different, To start from scratch will take alot of time.
You will add, then remove, and then add again.
ASSEMBLE A TEAM...THIS IS A ADVANCED STEP

The president has spoken
STEP 9​
Building a kernel.
You're in deep waters once again.
To explain the kernel, I would say he is like the president of your phone.
He tells everyone what to do, and when to do it, and how to do it.
Kernel
The kernel is the core of an operating system. It functions on a low level (kernelspace) interacting between the hardware of the machine and the programs which use the hardware to run. To make efficient use of the CPU, the kernel uses a scheduler to arbitrate which tasks take priority at any given moment, creating the illusion of many tasks being executed simultaneously.
(From an article about Arch Linux)
"Do you like LAG?"
Well if you answered "no"
Then you better build a good kernel.
I entered "building a kernel for android" and i got a long list of tutorials on this.
So, if my section on kernels isn't enough, Google has more.
"git clone" is the code prefix if you luck out and find a kernel source on github.
first you would
$ cd android
$ cd system
$ cd kernel
$ mkdir <name of company>
$ cd <name of company>
$ git clone bla bla bla bla bla lol
But for the purpose of this step, you did not find a kernel source...
So, if you did step 8, or you found a device repo on Github, then you know alot more about your device now, specifically the hardware that pushes your device..
This table lists the name and locations of SOME kernel sources and binaries
Device / Binary location / Source location / Build configuration
manta / device/samsung/manta/kernel / kernel/exynos / manta_defconfig
mako / device/lge/mako-kernel/kernel / kernel/msm / mako_defconfig
grouper / device/asus/grouper/kernel / kernel/tegra / tegra3_android_defconfig
tilapia / device/asus/grouper/kernel / kernel/tegra / tegra3_android_defconfig
maguro / device/samsung/tuna/kernel / kernel/omap / tuna_defconfig
toro / device/samsung/tuna/kernel / kernel/omap / tuna_defconfig
panda / device/ti/panda/kernel / kernel/omap / panda_defconfig
stingray /device/moto/wingray/kernel / kernel/tegra / stingray_defconfig
wingray / device/moto/wingray/kernel / kernel/tegra / stingray_defconfig
crespo /device/samsung/crespo/kernel / kernel/samsung / herring_defconfig
crespo4g / device/samsung/crespo/kernel / kernel/samsung / herring_defconfig
This is for reference, these devices are supported..
You will want to look at the git log for the kernel binary in the device project that you are interested in.
Device projects are of the form device/<vendor>/<name>. This example is for the Panda...
$ git clone https://android.googlesource.com/device/ti/panda
$ cd panda
$ git log --max-count=1 kernel
The commit message for the kernel binary contains a partial git log of the kernel sources that were used to build the binary in question. The first entry in the log is the most recent, i.e. the one used to build that kernel. You will need it at a later step.
Downloading sources
Depending on which kernel you want,
Device projects are of the form device/<vendor>/<name>.
The goldfish project contains the kernel sources for the emulated platforms.
The msm project has the sources for ADP1, ADP2, Nexus One, Nexus 4, and can be used as a starting point for work on Qualcomm MSM chipsets.
The omap project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.
The samsung project is used for Nexus S, and can be used as a starting point for work on Samsung Hummingbird chipsets.
The tegra project is for Xoom and Nexus 7, and can be used as a starting point for work on NVIDIA Tegra chipsets.
The exynos project has the kernel sources for Nexus 10, and can be used as a starting point for work on Samsung Exynos chipsets.
To git these
$ git clone https://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/exynos.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git
Here are some other links for sources
http://www.htcdev.com/
http://opensource.samsung.com/
http://developer.sonymobile.com/wpor...ads/opensource
http://www.lg.com/global/support/ope...opensource.jsp
You may have to do some leg work and find your source.
As an example, we would build the kernel using the following commands:
Part A. Pre-build Steps
A. Open terminal and change to the root of your kernel directory
B. Type "export ARCH=arm"
C. Type "export CROSS_COMPILE=~/android/system/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-" (your toolchain may be different than this, it is an example)
Part B. The First Build
A. Type "make <your_config_name>_defconfig"
B. Type "make menuconfig" and make the required changes to use any modules you added or similar changes.
C. Type "make -j<maximum number of jobs>"
Part C. Re-Builds
A. Type "make clean"
B. Type "make oldconfig"
C. Type "make -j<maximum number of jobs>"
Part D. Building Modules
You have two options:
A. Type "make modules"
B. Type "make path/to/your/module.ko"
The above steps explained:
Part A.(These steps are required every time you close your terminal and re-open it to build again.)
A. Ok shouldn’t need to explain this.
B. This command sets your target architecture.
C. Defines the path to the toolchain we are going to use to compile our kernel. You can change this to point towards whatever toolchain you have downloaded or feel like using, the way it is currently configured it will use the Linaro toolchain that we downloaded above.
Part B.(These only need to be run the first time you build a kernel.)
A. Load's your configuration file from earlier.
B. Open up a menu to configure your kernel. It will use the config file you loaded in the previous step as a base.
C. Viola start the build. I typically allow 1 job per core, so on my quad core machine I put "make -j4". Just raising that number will not make your build faster, your processor needs to be able to support the number of jobs you are assigning it.
Part C. (Use the command's when you are building any-time outside of the first)
A. This command gets rid of any old/outdated binaries or modules you compiled before, and let's start fresh. I like to run it every I build unless my changes are really small and localized.
B. A very awesome command, it parses through what has changed and only prompts you about new options.
C. See the explanation for the above "Part C.".
Part D.(Use these for just building kernel modules.)
A. This will re-build all modules.
B. Will rebuild just the module you need. Very useful when you need to rebuild a WiFi module.
Outcome A. Build Succeds
W00t!! You have a kernel built by your self from source. There are a couple things you need in-order to use this kernel on your device any ".ko" modules and the zImage binary. If you pay attention to the output of your compiler then you will see the location of those objects. However the following commands will make your life a bit easier(Thanks Recognized Developer Hacre):
A. Open a terminal
B. Change to your root kernel directory
C. Type "mkdir ../<your_kernel>_output"
D. Type "cp arch/arm/boot/zImage ../<your_kernel>_output/zImage"
E. Type "find . -name "*.ko" -exec cp {} ../<your_kernel>_output \;"
The above steps explained:
A-C. Self-Explanatory
D. Move our kernel binary into our output folder
E. This handy bit of magic finds all ".ko" modules and also copies them into your output file.
You will also need to assemble a kernel image containing a initramfs for your device, along with the kernel binary and such. That however is beyond the scope of this tutorial. To get started though try searching the following phrases.
Code:
building android kernel image
xda build kernel image
xda unpack boot.img
Outcome B. Build Fails
Oh dear. It failed. Well guess what...this is going to happen..a LOT. Get used to it, and get used to googling and experimenting with different solutions. The following are some tips that will help you with debugging your issues.
Running a "Clean" build
A. Backup your config file(Type "cp .config ../backupConfig")
B. Re-run the build process using just your defconfig from earlier.
Limiting Output(Thanks Hacre.)
A. Another good tip is to run "make -j1" to get the error, as it will limit the amount of text you need to scroll through.
(from a kernel tutorial)(cred =thewadegeek)
The kernel binary is output as `arch/arm/boot/zImage`, and needs to be copied into the Android source tree in order to build the matching boot image.
Quotes from threads
"when building a whole ROM like AOSP,AOKP,PA or CM then they typically bundle the toolchain/kernel with the source, making this totally unneeded."
"You can typically find a manufacturer's configuration file in "arch/arm/configs". I believe the one for my HTC Flyer was called "flyer_hc_defconfig"
A Q&A from a thread
How can I build the latest kernel using all described stuff (aosp source, kernel config, latest kernel)?
Jean-Baptiste Queru
Mar 25
That's not possible without some work. Device-specific kernel are
typically 3 steps away from the upstream kernel: one step adds
android-specific code, one step adds chipset-specific code, one step
adds device-specific code.
THIS IS NOT COMPLETE.. IT IS A ADVANCED STEP ,LIKE STEP 8 it will take patience and time...

iT'S JUST NOT THE SAME
STEP 10​
This is the step for pulling the prop file or prop blobs from a "stock" phone...
This is the script that SuperR made for the Warp2
Code:
#!/bin/sh
VENDOR=zte
DEVICE=warp2
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
adb pull /system/$FILE $BASE/$FILE
done
./setup-makefiles.sh
This is one from the LGE Mako
Code:
#!/bin/sh
VENDOR=lge
DEVICE=mako
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$ | sed -e 's#^/system/##g'`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
adb pull /system/$FILE $BASE/$FILE
done
./setup-makefiles.sh
NOTICE: the main thing that changed was the
VENDOR=zte
DEVICE=warp2
Your proprietary-file.txt depends on your phone.
I found that during a build, it actually told me diffrent .so files it needed.
Though if you made it this far, your phone is rooted, and you probably have "root explorer"
So you may want to open that up and orient yourself with what system files are in there.
Also, you can open other prop lists from similar phones and see what files they extracted.
Here is a list that PG and associates used
Code:
## RIL
bin/qmuxd
bin/rild
lib/libnv.so
lib/liboncrpc.so
lib/libreference-ril.so
lib/libril.so
lib/libril-qc-1.so
lib/libril-qc-qmi-1.so
lib/libril-qcril-hook-oem.so
lib/libauth.so
lib/libcm.so
lib/libdiag.so
lib/libdsm.so
lib/libdsutils.so
lib/libdss.so
lib/libgsdi_exp.so
lib/libgstk_exp.so
lib/libidl.so
lib/liboncrpc.so
lib/libpbmlib.so
lib/libpdapi.so
lib/libqmi.so
lib/libqmiservices.so
lib/libqueue.so
lib/libwms.so
lib/libwmsts.so
lib/liboem_rapi.so
lib/libpdsm_atl.so
lib/libqc-opt.so
lib/libqdi.so
lib/libqdp.so
lib/libuim.so
## GPS
lib/libcommondefs.so
lib/librpc.so
## Sensors
lib/hw/sensors.default.so
## EXTRA
bin/netmgrd
bin/port-bridge
bin/thermald
etc/media_profiles.xml
etc/thermald.conf
lib/libdsi_netctrl.so
lib/libnetmgr.so
lib/libv8.so
$$$$###$$# HINT #$$###$$$$
EVERY PHONE IS DIFFERENT!!!!

Let's see if it works
STEP 11​
TIME 2 BUILD
Another time when RAM will help you out.
Whatever steps you actually took to get here all depends on how much work has been put into your phone and how much of it you were able to find..
So if you have the following things done, You can continue to build if not, you better go get them.
1. Linux 64 OS
2. Build environment
3. up to date Repo
4. device repo
5. kernel source
6. proprietary files text/ extract.sh
7. prebuilts
8. ccache
9. Build command
10 Teamwork and Patience
"But Warp, you never explained some of this stuff.."
Yep, that's why there is a step about actually building it...
This next section is pulled from PG's read me
Getting my ZTE Sequent repo
$ cd ~/android/system/device/
$ mkdir zte
$ cd zte
$ git clone https://github.com/playfulgod/androi..._zte_warp2.git warp2
Note it says ZTE, not Sony, not Samsung, ETC
Then cd to the kernel directory:
$ cd ~/android/system/kernel
$ mkdir zte
$ git clone https://github.com/playfulgod/kernel_zte_warp2.git warp2
Then prop files from stock..
$ cd
$ cd ~/android/system/device/zte/warp2
$ ./extract-files.sh
When the environment is setup, we need to grab a copy of Term.apk. This is necessary to build CM10.
$ cd ~/android/system/vendor/cm
$ ./get-prebuilts
O k so I waited to tell you about CCACHE at the end. I guess I did that, because you don't need it untill the end anyway..OR is building just the beginning
You decide...
http://ccache.samba.org/manual.html
http://manpages.ubuntu.com/manpages/intrepid/man1/ccache.1.html
Ccache
There's a wonderful tool for gcc called ccache. You can read about it at their home page.
If you're always compiling the same programs over and over again — such as trying out several kernel patches, or testing your own development — then ccache is perfect. While it may take a few seconds longer to compile a program the first time with ccache, subsequent compiles will be much, much faster.
Now that we know what it is
HOW-TO-INSTALL
http://source.android.com/source/initializing.html
Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
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.
export CCACHE_DIR=<path-to-your-cache-directory>
example: export CCACHE_DIR=$HOME/.ccache
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source 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:
prebuilt/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent. (pulled str8 from the link)
Now, we build (system being your work directory):
$ cd ~/android/system
To build for the ZTE Sequent:
$ . build/envsetup.sh && brunch warp2
All credit to PG for his readme file...Which he updated it recently, this is the old one ,I think...

Beating your head on the desk when you can't figure out why it wont build, boot , ...
STEP 12​
In the true nature of a 12 step program, this process never ends.. You will always run into errors, you will always be looking for fixes, patches, and anything to correct a problem you are having.
So, basically the 12th step is TEAMWORK
I hope if this tutorial didn't suck to bad, you will come on this thread and post your questions, post your answers, post your advice. I just started
AND no, just because I made a Tutorial and finished it, it DOES NOT make me a Developer. That was a joke. You have to earn that $hyt...
But one thing i am, is motivated...
I hope you enjoyed my rendition of "HOW-TO-BUILD-FROM-SOURCE"

Shout outz
SPECIAL THANKS TO:​
XDA​ @bcrichster, @NinjaInPyjamas, @Bizack, @danger_beast, @WildfireDEV @BobDabolina​ HACK3R1, PlayfulGod, Junkie 2100, SuperR, dizzle,​ EarlyMon, cooldudezach, rbheromax, Frank the Tank,​agat , downthemachine, hroark13, DM47021, thewadegeek, guspeed
Android,Cyanogenmod, BeerGang,
ChameleonOS, ibotpeaches, 0xD34D,
BO$$HOGG,,and Madhatter34​

warning: (MTD_MSM_NAND && MTD_DOC2000 && MTD_DOC2001 && MTD_DOC2001PLUS) selects MTD_NAND_IDS which has unmet direct dependencies (MTD && MTD_NAND)
If you ever get this one...heres a fix
http://lists.infradead.org/pipermail/linux-mtd/2012-January/039122.html
Code:
Fix the following build warning:
warning: (MTD_DOC2000 && MTD_DOC2001 && MTD_DOC2001PLUS) selects MTD_NAND_IDS
which has unmet direct dependencies (MTD && MTD_NAND)
Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
drivers/mtd/devices/Kconfig | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index 952e956..3560fca 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -191,6 +191,7 @@ comment "Disk-On-Chip Device Drivers"
config MTD_DOC2000
tristate "M-Systems Disk-On-Chip 2000 and Millennium (DEPRECATED)"
+ depends on MTD_NAND
select MTD_DOCPROBE
select MTD_NAND_IDS
---help---
@@ -213,6 +214,7 @@ config MTD_DOC2000
config MTD_DOC2001
tristate "M-Systems Disk-On-Chip Millennium-only alternative driver (DEPRECATED)"
+ depends on MTD_NAND
select MTD_DOCPROBE
select MTD_NAND_IDS
---help---
@@ -234,6 +236,7 @@ config MTD_DOC2001
config MTD_DOC2001PLUS
tristate "M-Systems Disk-On-Chip Millennium Plus"
+ depends on MTD_NAND
select MTD_DOCPROBE
select MTD_NAND_IDS
---help---
--
1.7.1

Wow. Thanks for the huge tutorial man!

Another piece of info.
"make clobber"
In software engineering, clobbering a file or computer memory is overwriting its contents. In makefiles, a common target clobber means complete cleanup of all unnecessary files and directories produced by previous invocations of the make command.
"make clean"
deletes any files generated by previous attempts, leaving you with clean source code
These are codes to use when
1. encountering fatal errors
2. when you "repo sync" new data
3. when you make changes to make files etc...

THIS IS A ROOTING TOOL FROM JUNKIE2100,​IT WORKS FOR THE WARP SEQUENT N861​
www.oldphoneshyte.gov
I updated the picture, I updated the SuperUser.apk and I updated the SU binary...​

Warped420 said:
THIS IS A ROOTING TOOL FROM JUNKIE2100,​IT WORKS FOR THE WARP SEQUENT N861​[/SIZE
I updated the picture, I updated the SuperUser.apk and I updated the SU binary...
Click to expand...
Click to collapse
Updated for what/why??
Sent from my confused Warp/Nexus using Tapatalk 2

This is MY JellyBeer BeerGang 10.1 $ROM$​
I started this project over two months ago.
This is the new v4.30
This is the first build ,nothing is fixed
It doesn't have sound, sd card etc​Without PG and associates I wouldn't have gotten this built, see SPECIAL THANKS section​I have two more $ROM$ coming soon...
www.idon'thavethisphoneanymore.org​
WARP SEQUENT N861​

Related

[Guide] In-Depth Compiling using Ubuntu 12.10

DISCLAIMER: I am in no way responsible for you breaking your phone or your computer. You the reader/user/dev/compiler understand that you enter into this agreement freely with no expectations that everything will work 100% of the time.
This is in no way a means of stealing people away from Shrikes guide. If you do not have ubuntu installed as a complete os/ or do not intend to maked modifications to system files etc. Then please use the guide for compiling roms using a virtual box here (CM9 The complete noobs guide to building CM9 in a virtual machine)
Still with me. COOL. So you now have either a dual boot or a fully thrashed Linux machine. I will be using my Vaio VPCF114 box with Ubuntu 12.10 to make this guide. This is also compatible with 12.04 if you have not yet upgraded. I am not sure if the same goes for Redhat/Fedora or Backtrack 5. My work here is a compilation of years of doing research and compiling my own roms.
This guide is to help people that have little knowledge of linux get a base idea of where to start to make their own roms and kernels. Part 1 will be building your box and compiling a rom. Part 2 will be how to make and grab your Kernel.
First lets get Dropbox from here DROPBOX This is good for backing up your libs and sharing files with other Devs.
What you need:
1) A Windows computer, preferably with a CPU that supports 64-bit. Your pc/laptop does no need to have 64-bit windows on it, your CPU just needs to support the hardware. I think at this day and age, almost all devs have a 64-bit box. You will need this so you can make a dual boot box.
2) Plenty of memory. I recommend at least 4GB on the host computer. You can make it work on less, but more is better.
3) At least 60GB of free hard drive space during the install, but i'm sure you already know that and have gigs upon gigs of free space. If you do not know how much space you have, go to settings>details and it will tell you. Note: The source download is approximately 8.5GB in size. You will need over 30GB free to complete a single build, and up to 100GB (or more) for a full set of builds.
4) Lastly a good book, tab, second pc, whatever because this is not a quick process. And compiling roms literally takes hours.
5) Most importantly UBUNTU 12.10. If on the off hand you do not have it, you can pick it up at Ubuntu Central
OK YOU READY. LET'S GET CRACKING. First you need to set up Java on your box. Then grab a couple of programs you will need for editing files Go to your UBUNTU SOFTWARE CENTER. In the search bar in the top right type in Java. We will be installing Java 6 Runtimes.
{
"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"
}
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, go here JAVA
If the link does not work, you want accept the license agreement and download jdk-6u35-linux-x64.bin
Once it done:
chmod a+x ~/Downloads/jdk-6u35-linux-x64.bin
sudo mv ~/Downloads/jdk-6u35-linux-x64.bin /usr/lib
cd /usr/lib
sudo ./jdk-6u35-linux-x64.bin
Now lets finish the install and make it default: (Remember to enter in the lines one at a time)
sudo mv jdk1.6.0_35/ jvm/
sudo rm jdk-6u35-linux-x64.bin
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_35/jre/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_35/bin/javac 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_35/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_35/bin/javadoc 1
IF YOU HAVE MULTIPLE JAVA JDK'S INSTALLED FOR OTHER PROJECTS YOU WILL WANT TO MAKE 1.6 THE DEFAULT.
On each command you will have to select the version of java you want to use. This command is helpful if you also do other coding.
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Java 6: for Gingerbread and newer
Java 5: for Froyo and older
Note: The lunch command in the build step will ensure that the Sun JDK is used instead of any previously installed JDK.
Now what we need:
We need to open up a terminal window and download packages.
Remember you will need to input your password after each line.
sudo add-apt-repository ppa:git-core/ppa
and
sudo apt-get update
(this will download all of the Quantal updates for universe and multiverse.
Next we want to install some Libs and Binaries. (You can copy and paste this into your terminal)
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 schedtool gcc-multilib g++-multilib pngcrush
(don't worry. some of the libs my fail. This happens as google changes their sources)
Now we need to tell the computer how to "REPO", this is where you will tell it to handle the Andorid sources via the Git command.
cd ~
mkdir -p bin
export PATH=${PATH}:~/bin
Once done you can use "echo $PATH" to see all of your path directories.
sudo apt-get install curl
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
(this will get you the repo script)
Now lets give it executable permissions by using chmod
chmod a+x ~/bin/repo
Now that we can repo
Lets setup the Android SDK. (Get a beer/coffee/soda, this will take a second)
Go to http://developer.android.com/sdk/index.html And install the ADT bundle for Linux.
Install the SDK and Eclipse IDE
Unpack the ZIP file (named adt-bundle-linux.zip) and save it to an appropriate location, such as a "Development" directory in your home directory.
Open the adt-bundle-linux/eclipse/ directory and launch eclipse.
That's it! The IDE is already loaded with the Android Developer Tools plugin and the SDK is ready to go. To start developing, read Building Your First App on the developer site.
Caution: Do not move any of the files or directories from the adt-bundle-linux directory. If you move the eclipse or sdk directory, ADT will not be able to locate the SDK and you'll need to manually update the ADT preferences.
Now to just add the tools to our $Path.
gedit .bashrc
Scroll to very bottom, under last fi input
export PATH=${PATH}:~/adt-bundle-linux/sdk/tools
export PATH=${PATH}:~/adt-bundle-linux/sdk/platform-tools
That was pretty painless.
Now lets start some cool stuff.
TestSigning
Click on your desktop menu bar and go into your home folder. Press Ctrl and h together on your keyboard to show hidden folders. Anything marked with a . in front of it is hidden, we are looking for a folder name .gnome2, go into it and look for nautilus-scripts. Once inside this folder, right click on a empty space and select create document and then empty file and name it sign. Open up that empty document and copy and paste this script from dumbfaq on xda
Code:
#!/bin/bash
# Update the Loc var to where YOU stored the testsign.jar file !
SUCCESS=
Loc=~/android/source/
for arg
do
TMP=$(ls $arg | sed 's/\(.*\)\..*/\1/')
EXT=${arg##*.}
java -classpath "$Loc"testsign.jar testsign "$arg" "$arg"-signed 2> /tmp/signTmp
SUCCESS=$?
if [ $SUCCESS -eq 1 ]
then
zenity --info --title "Sign APK" --text "signing FAILED! \n`cat /tmp/signTmp`"
exit 1
fi
mv $TMP.$EXT-signed $TMP-signed.$EXT
done
zenity --info --title "Sign APK" --text "signing completed!"
Save and exit out and right click on our new script and select properties. select the permissions tab and look for a check box that says allow executing as a program. click on it and now we have a pretty little script that we can just right click on a update.zip file and sign with our test keys for flashing. You will also need the testsign.jar from the bottom of this guide.
Now lets do a couple things so that we can get our Phones Vendor ID.
Type in your terminal
lsusb
While your phone isconnected to see our vendor id and you will something like this. Note that for the Rezound our vendor id is
Bus 002 Device 003: ID 0bb4:0ccd HTC (High Tech Computer Corp.)
In this case the Vendor Id is “18d1″ and the Product ID is “4e12″. Please keep in mind that the Vendor ID for HTC changed from “0bb4″ to “18d1″. The older HTC phones like the G1 have a Vendor ID of “0bb4″.
Now that we have that, we can make our rules for for connecting to adb
sudo gedit /etc/udev/rules.d/51-android.rules
Paste
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM==”usb”, ATTRS{idVendor}==”18d1″, SYMLINK+=”android_adb”, MODE=”0666″
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
Save and exit
Reboot your computer so that all of the changes we have made can Take effect.
OK. All setup and ready to start making a Rom with your name on it.
IF you are already running AOSP on your phone, you can back up you system now Do this by:
cd ~/
mkdir stock
cd stock
adb pull /system/ ~/stock/
This will dump your entire system directory into the stock folder. This is good so you always have a working system. Now zip the folder and tuck it away for safe keeping.
Now the MEAT AND POTATOES. Grabbing the Source. "CYANOGENMOD"
cd ~/
mkdir -p android/source
touch ~/.netrc
cd ~/android/source
sudo apt-get install git
sudo sysctl -w net.ipv4.tcp_window_scaling=0 (remvoes the overstack flow problem that causes some repo jobs to hang)
repo init -u git://github.com/Chad0989/android.git -b ics
(Note: If you want to compile a jellybean rom, just replace the ics with jellybean!)
Once you do this, it's going to ask you for your email. This is how you will log back into the repo in the future. So answer the questions correctly.
Now we will sync the Repo and set it to run.
repo sync -j4
-j# (# means twice the amount of cores in your computer) means jobs. I have an i7 processor and a pretty decent internet connection, so i'm running max jobs at once for faster sync) Be patient. It's still going to take a while to clone the directory.
Once done with the Sync we want to setup our device.
This is where we get the pre-built part of our rom.
First we will
./vendor/cm/get-prebuilts
Probably all that will be left directly after the repo will be the Terminal service for android.
Now we are about ready to compile our Rom:
cd ~/android/source
repo sync (it should only take a moment this time)
. build/envsetup.sh
make clobber
Now you can compile your rom using the brunch command (This will take about 1 to 1 1/2 hours depending on your box)
brunch vigor
Now you can go to the output box and pick up your freshly made Rom.
Reserved for Kernel
Changed Repo from CyanogenMod to Chad0989 for easier Vigor integration.
21NOV12: Change Repo from Chad0989 to Dragonstalker github.
Change Repo from DragonStalker to Chad0989 github
Modified Testsign script to reflect changed ADT Tools location.
First, looks interesting i might look into this when i boot into Ubuntu next time.
jon7701 said:
First, looks interesting i might look into this when i boot into Ubuntu next time.
Click to expand...
Click to collapse
i wanted to show people how i do my own personal roms and kernels. With this setup, you can make roms for multiple devices and also use Eclipse to make apps if thats your bag baby.
dragonstalker said:
i wanted to show people how i do my own personal roms and kernels. With this setup, you can make roms for multiple devices and also use Eclipse to make apps if thats your bag baby.
Click to expand...
Click to collapse
Nice, if i can figure out a little more about how to dev and stuff maybe ill make my own rom one day.
Wow. So going to do this right now. Thanks for your effort on this.
Sent from my ADR6425LVW using xda premium
I can't wait for the final act! I am going to try this so I can get my hands on some jelly beans.
Vedor ID
Quick question. I notice that you mention that "in this case the Vedor ID is 18d1" but in your screenshot it say 0bb4. You have some clarification after that and I'm not sure I understand it 100%. My rezound show the 0bb4 for vedor ID as well. I guess what I'm asking is if you could clarify the statement about the Vendor ID? Thanks, sorry if this is a dumb question.
Very nice guide. Extremely thorough which makes a great tutorial.
vonhinkle said:
Quick question. I notice that you mention that "in this case the Vedor ID is 18d1" but in your screenshot it say 0bb4. You have some clarification after that and I'm not sure I understand it 100%. My rezound show the 0bb4 for vedor ID as well. I guess what I'm asking is if you could clarify the statement about the Vendor ID? Thanks, sorry if this is a dumb question.
Click to expand...
Click to collapse
It shows it as 0bb4. But as for the drivers Ubuntu uses. The Vendor id for High Tech Computers is 18d1. I was using a stock rom to pull the vendor Id from and for some reason, HTC has never changed it on there.
GrayTheWolf said:
Very nice guide. Extremely thorough which makes a great tutorial.
Click to expand...
Click to collapse
I teach networking to and development to the Army. I took the same ideology into this guide. Not just tell you how to do it, but explain why it works. I will, as thing change try to keep this updated, and keep up with Shrike as he learns new things. Thank Shrike for making me realize that we didn't have a guide for people that do run Ubuntu, and need to know how to set up.
Ok the updated Guide is online. Please tell me if anything is not correct. I'm only Human. Working with Snuzzo for and Updated Kernel Optimization section and hopefully Chad with the Repo..
More to Follow .............................
I'm compiling right now. The guide was good, but there were some extra steps I had to take to get this far. My Rezound is old, so my android.rules file needed the 0bb4 id (I got rid of the ATTR{idproduct} part). Also adb wasn't connecting when using filename 51-android.rules, so I used 70-android.rules and mode 0666 instead of 0600, then adb connected. I think the 70 was the fix, but mode 0666 I found from other, older guides on setting up adb, I don't know what change that makes but it's probably unnecessary. Finally, on compile I was getting errors like bison missing and other missing also. That big line with all the installs must have not worked for all the programs, so I just installed the missing ones individually per error message. There may have been other issues that I am forgetting but nothing too hard to figure out, of course I have worked a tiny bit with Ubuntu over the past 5 years.
Still compiling, so it seems to be working. I used Chad0989's repo, and jellybean! Thanks for the guide, if I have any problems I shall post them.
drkow19 said:
I'm compiling right now. The guide was good, but there were some extra steps I had to take to get this far. My Rezound is old, so my android.rules file needed the 0bb4 id (I got rid of the ATTR{idproduct} part). Also adb wasn't connecting when using filename 51-android.rules, so I used 70-android.rules and mode 0666 instead of 0600, then adb connected. I think the 70 was the fix, but mode 0666 I found from other, older guides on setting up adb, I don't know what change that makes but it's probably unnecessary. Finally, on compile I was getting errors like bison missing and other missing also. That big line with all the installs must have not worked for all the programs, so I just installed the missing ones individually per error message. There may have been other issues that I am forgetting but nothing too hard to figure out, of course I have worked a tiny bit with Ubuntu over the past 5 years.
Still compiling, so it seems to be working. I used Chad0989's repo, and jellybean! Thanks for the guide, if I have any problems I shall post them.
Click to expand...
Click to collapse
Thanks for the headsup. Android.source.com said to change it to that. SO I will change it back.
As for the progs that did not install. Android Source pulls progs, i've just been to lazy to go over the tag and remove the ones that have been obsoleted. I will take care of that this weekend.
Schweet! I compiled my own rom! Syncing took about 30 mins, compiling also 30 mins. I have a 4.4 ghz oc'd Core i5 with 8 gig 1866 ram. Now I need to learn some simple things, like how to rename the rom package, edit the installation text, add some tweaks, etc.
What gapps do you use for CM10? I downloaded this one http://wiki.cyanogenmod.org/wiki/Latest_Version/Google_Apps for CM10, but it doesn't list xdpi, and it failed flashing. So I used this one instead http://forum.xda-developers.com/showthread.php?t=1965290 and it worked.
edit: google search seems to force close with the gapps I used.
drkow19 said:
Schweet! I compiled my own rom! Syncing took about 30 mins, compiling also 30 mins. I have a 4.4 ghz oc'd Core i5 with 8 gig 1866 ram. Now I need to learn some simple things, like how to rename the rom package, edit the installation text, add some tweaks, etc.
What gapps do you use for CM10? I downloaded this one http://wiki.cyanogenmod.org/wiki/Latest_Version/Google_Apps for CM10, but it doesn't list xdpi, and it failed flashing. So I used this one instead http://forum.xda-developers.com/showthread.php?t=1965290 and it worked.
edit: google search seems to force close with the gapps I used.
Click to expand...
Click to collapse
Note: There is a reason that me and Chad have asked not to compile CM10 roms. The code is not complete yet.
If you found gapps that work, then that's a major. Post to the thread where you found it and that it works. To rename a rom package, you can just right click>rename and name it what you want it. To rename it so it shows up inside the rom on the phone for details is different.
I would not advise it if you don't know what you are doing, but you have to edit the build.prop. As for tweaks. Depends on what tweaks you want to change. Android Developer site is where i get all my tweaks, and i get some from other devs. Glad you are joining the community.
Happy building and thanks for the contribution.
issues
dragonstalker said:
Note: There is a reason that me and Chad have asked not to compile CM10 roms. The code is not complete yet.
If you found gapps that work, then that's a major. Post to the thread where you found it and that it works. To rename a rom package, you can just right click>rename and name it what you want it. To rename it so it shows up inside the rom on the phone for details is different.
I would not advise it if you don't know what you are doing, but you have to edit the build.prop. As for tweaks. Depends on what tweaks you want to change. Android Developer site is where i get all my tweaks, and i get some from other devs. Glad you are joining the community.
Happy building and thanks for the contribution.
Click to expand...
Click to collapse
hey guys ive been compiling on 12.04 still new to this but ive set up a new enviorment useing this guide with 12.10 im getting this error though
Import includes file: /home/ken/CM10/out/target/product/i577/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/import_includes
make: *** No rule to make target `/home/ken/CM10/out/target/product/i577/obj/lib/libaudioalsa.so', needed by `/home/ken/CM10/out/target/product/i577/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/LINKED/audio.primary.msm8660.so'. Stop.
make: *** Waiting for unfinished jobs....
target StaticLib: libc_nomalloc (/home/ken/CM10/out/target/product/i577/obj/STATIC_LIBRARIES/libc_nomalloc_intermediates/libc_nomalloc.a)
any help would be appreatiated thanks
dragonstalker said:
Note: There is a reason that me and Chad have asked not to compile CM10 roms. The code is not complete yet.
If you found gapps that work, then that's a major. Post to the thread where you found it and that it works. To rename a rom package, you can just right click>rename and name it what you want it. To rename it so it shows up inside the rom on the phone for details is different.
I would not advise it if you don't know what you are doing, but you have to edit the build.prop. As for tweaks. Depends on what tweaks you want to change. Android Developer site is where i get all my tweaks, and i get some from other devs. Glad you are joining the community.
Happy building and thanks for the contribution.
Click to expand...
Click to collapse
Roger that. I will definitely try to do some build.prop tweaks, and then move on from there. Thanks again for the guide! Meanwhile I am emailing Ubuntu about their re-installer option to erase and reinstall Ubuntu, which wipes out all partitions, not just the current Ubuntu partition as I figured would happen. It wiped my main NTFS partition with all my stuff, without even a warning! Currently using Active Partition Recovery, but I fear since I compiled CM on that whole harddrive that most of the contents were probably overwritten. :crying:
drkow19 said:
Roger that. I will definitely try to do some build.prop tweaks, and then move on from there. Thanks again for the guide! Meanwhile I am emailing Ubuntu about their re-installer option to erase and reinstall Ubuntu, which wipes out all partitions, not just the current Ubuntu partition as I figured would happen. It wiped my main NTFS partition with all my stuff, without even a warning! Currently using Active Partition Recovery, but I fear since I compiled CM on that whole harddrive that most of the contents were probably overwritten. :crying:
Click to expand...
Click to collapse
Never heard of that happening before. Let me know what you find out.

HOWTO: Linux and MTP

This is a quick how to get MTP working on Linux, the guide is for distro's based on Debian (mint\debian\ubuntu) OpenSuse, Fedora AND Gentoo. If there's any missing for major distro's let me know, or add them to a separate post and i'll put them up here
***Debian based distros**
Code:
sudo apt-get install mtpfs
sudo mkdir /media/onex
sudo chmod 775 /media/onex
sudo mtpfs -o allow_other /media/onex
gedit /etc/udev/rules.d/51-android.rules
and add the following line:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
and then:
sudo service udev restart
***Arch Linux***
Code:
pacman -S libmtp
After installation, you have several mtp tools available. Upon connecting your MTP device, you use:
mtp-detect
and add the following line:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
and then reload udev rules:
udevadm control --reload
Arch Linux guide is from the ArchLinux wiki
**Redhat\Fedora16**
First of all, I using my computer with other people, who can come over the network, so the 0666 mode bits not a right choice for me. I make it all on a fedora 16, but the distro is really not important.
So the steps:
- add a user to the "disk" group (or whatever You want)
- make a mount point (the media doesn't work for me, across the init removes the content)
- add this mount point to the fstab, with some parameter
- create udevd rules
- restart udevd
- install fuse-mtpfs
- (re)login user
- try it
My common experience is that, the mtpfs is very very very very slow. Really slow, so I can use it only with CLI, any GUI has been coming back with time out
And the "code":
Code:
usermod -a -G disk $LOGINUSER
Code:
sudo mkdir /mnt/sgs2 ; sudo chgrp disk /mnt/sgs2; sudo chmod 0770 /mnt/sgs2
Code:
sudo echo "mtpfs /mnt/sgs2 fuse users,noauto 0 0" >> /etc/fstab
Code:
cat > /etc/udev/rules.d/51-android.rules <<EOF
SUBSYSTEM!="usb_device", GOTO="label_end"
ACTION!="add", GOTO="label_end"
# ATRRS{idVendor}== ertekei:
#Acer 0502
SUBSYSTEM=="usb",ATTRS{idVendor}=="0502",MODE="0660",GROUP="disk"
#ASUS 0b05
SUBSYSTEM=="usb",ATTRS{idVendor}=="0b05",MODE="0660",GROUP="disk"
#Dell 413c
SUBSYSTEM=="usb",ATTRS{idVendor}=="413c",MODE="0660",GROUP="disk"
#Foxconn 0489
SUBSYSTEM=="usb",ATTRS{idVendor}=="0489",MODE="0660",GROUP="disk"
#Fujitsu 04c5
SUBSYSTEM=="usb",ATTRS{idVendor}=="04c5",MODE="0660",GROUP="disk"
#Fujitsu Toshiba 04c5
SUBSYSTEM=="usb",ATTRS{idVendor}=="04c5",MODE="0660",GROUP="disk"
#Garmin-Asus 091e
SUBSYSTEM=="usb",ATTRS{idVendor}=="091e",MODE="0660",GROUP="disk"
#Google 18d1
SUBSYSTEM=="usb",ATTRS{idVendor}=="18d1",ATTRS{idProduct}=="4ee1",MODE="0660",GROUP="disk"
#Hisense 109b
SUBSYSTEM=="usb",ATTRS{idVendor}=="109b",MODE="0660",GROUP="disk"
#HTC 0bb4
SUBSYSTEM=="usb",ATTRS{idVendor}=="0bb4",MODE="0660",GROUP="disk"
#Huawei 12d1
SUBSYSTEM=="usb",ATTRS{idVendor}=="12d1",MODE="0660",GROUP="disk"
#K-Touch 24e3
SUBSYSTEM=="usb",ATTRS{idVendor}=="24e3",MODE="0660",GROUP="disk"
#KT Tech 2116
SUBSYSTEM=="usb",ATTRS{idVendor}=="2116",MODE="0660",GROUP="disk"
#Kyocera 0482
SUBSYSTEM=="usb",ATTRS{idVendor}=="0482",MODE="0660",GROUP="disk"
#Lenovo 17ef
SUBSYSTEM=="usb",ATTRS{idVendor}=="17ef",MODE="0660",GROUP="disk"
#LG 1004
SUBSYSTEM=="usb",ATTRS{idVendor}=="1004",MODE="0660",GROUP="disk"
#Motorola 22b8
SUBSYSTEM=="usb",ATTRS{idVendor}=="22b8",MODE="0660",GROUP="disk"
#NEC 0409
SUBSYSTEM=="usb",ATTRS{idVendor}=="0409",MODE="0660",GROUP="disk"
#Nook 2080
SUBSYSTEM=="usb",ATTRS{idVendor}=="2080",MODE="0660",GROUP="disk"
#Nvidia 0955
SUBSYSTEM=="usb",ATTRS{idVendor}=="0955",MODE="0660",GROUP="disk"
#OTGV 2257
SUBSYSTEM=="usb",ATTRS{idVendor}=="2257",MODE="0660",GROUP="disk"
#Pantech 10a9
SUBSYSTEM=="usb",ATTRS{idVendor}=="10a9",MODE="0660",GROUP="disk"
#Pegatron 1d4d
SUBSYSTEM=="usb",ATTRS{idVendor}=="1d4d",MODE="0660",GROUP="disk"
#Philips 0471
SUBSYSTEM=="usb",ATTRS{idVendor}=="0471",MODE="0660",GROUP="disk"
#PMC-Sierra 04da
SUBSYSTEM=="usb",ATTRS{idVendor}=="04da",MODE="0660",GROUP="disk"
#Qualcomm 05c6
SUBSYSTEM=="usb",ATTRS{idVendor}=="05c6",MODE="0660",GROUP="disk"
#SK Telesys 1f53
SUBSYSTEM=="usb",ATTRS{idVendor}=="1f53",MODE="0660",GROUP="disk"
#Samsung 04e8
SUBSYSTEM=="usb",ATTRS{idVendor}=="04e8",ATTRS{idProduct}=="6860",MODE="0660",GROUP="disk"
#Sharp 04dd
SUBSYSTEM=="usb",ATTRS{idVendor}=="04dd",MODE="0660",GROUP="disk"
#Sony 054c
SUBSYSTEM=="usb",ATTRS{idVendor}=="054c",MODE="0660",GROUP="disk"
#Sony Ericsson 0fce
SUBSYSTEM=="usb",ATTRS{idVendor}=="0fce",MODE="0660",GROUP="disk"
#Teleepoch 2340
SUBSYSTEM=="usb",ATTRS{idVendor}=="2340",MODE="0660",GROUP="disk"
#Toshiba 0930
SUBSYSTEM=="usb",ATTRS{idVendor}=="0930",MODE="0660",GROUP="disk"
#ZTE 19d2
SUBSYSTEM=="usb",ATTRS{idVendor}=="19d2",MODE="0660",GROUP="disk"
LABEL="label_end"
Code:
udevadm control --reload-rules
Code:
yum/apt-get/pacman/etc install mtpfs
Logout-login, for get in to the disk group, connect the device via usb, and try
Code:
mptfs
without any parameter, and it must write out some information:
Code:
[email protected]:~$ mtpfs
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Found 1 device(s):
Samsung: Galaxy models (MTP) (04e8:6860) @ bus 2, dev 4
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
fuse: missing mountpoint parameter
And finally mount /it must be working now with user account/:
[CODE]mount /mnt/sgs2
or dismount:
Code:
umount /mnt/sgs2
**OpenSuse 12.2**
this method will work for music and photos access only,
Code:
sudo zypper addrepo -f http://packman.inode.at/suse/12.2/ packman
sudo zypper ref (type a to always accept the packman repo)
sudo zypper in mtpfs
sudo vim /lib/udev/rules.d/69-libmtp.rules and add the following line (replace vim with gedit if you want a gui editor)
# HTC One X+
ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0dfc", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
sudo cp /lib/udev/rules.d/69-libmtp.rules /etc/udev/rules.d/.
reboot
When you plug in the phone you will see android phone icon on the desktop click on it to browse your files.
*note
disable any media players from trying to read the device...
** Gentoo **
Code:
Prerequisites
If your device is not recognized by libmtp, try upgrading to latest (or even git) version.
User needs to be in group plugdev to mount device.
MTPFS
You need to add option: user_allow_other in /etc/fuse.conf
$ mkdir ~/AndroidDevice
$ mtpfs -o allow_other ~/AndroidDevice
NOTE: this can take really long time, up to several minutes. As an indication of successful mount the mtpfs will go to background.
To unmount:
$ /usr/bin/fusermount -u ~/AndroidDevice
If mtpfs doesn't work for you try updating to latest version first.
Go-MTPFS
Seems to be more stable
$ emerge -a go
$ mkdir ~/go
$ export GOPATH=/home/$USER/go
$ go get github.com/hanwen/go-mtpfs
To mount:
$ ~/go/bin/go-mtpfs ~/AndroidDevice
To unmount:
$ /usr/bin/fusermount -u ~/AndroidDevice
Troubleshooting
Sometimes (e.g. on HTC One X) USB debugging automatically turns on when device is connected to PC. You need to turn debugging off, otherwise libmtp can't recognise device.
Make sure your Android device is not going to sleep and the screen is not getting locked. Set screen timeout to very long values, or enable in Development section flag "Do not turn off the screen".
Thanks to ihavoc and Fonya1 for the opensuse and redhat\fedora tutorials
thank you a lot for your help.
when i try to acces to the /media/onex direcory i have this :
ls: cannot access onex: Transport endpoint is not connected
After making changes reboot your session or pc and it will probably mount correctly which you've probably done by now.
Sent from my HTC One X+ using xda premium
somemadcaaant said:
After making changes reboot your session or pc and it will probably mount correctly which you've probably done by now.
Sent from my HTC One X+ using xda premium
Click to expand...
Click to collapse
excuse me to ask many question but i am really noob. when all this done what would i see in /media/onex ? actualy after mounting the folder is empty
the only thing i need to do is copy files from/to my HOX+
Can anyone please confirm if this is exclusive to the HTC One X+, or would it work for other similar HTC devices such as One X, One S etc. as well?
It still dont work, i have tryed so many things these days to mount my HTC Ox+ as a USB Mass Storage and everything failed.
I tried tou manualy mount a MTP folder on my Ubuntu like Lloir explained here.
I tried to flash a TeamWorkRecovery and a ClockWorkRecovery to access the "Mount USB" option in the menu
my Device is seen by ubuntu but i am unable to read or write anything, for example if I copy a music album, the copy operation starts, takes a very long time an then end whith an error lik "error unable to copy xxxx.mp3 file does not exist"
actualy i am almost convicted that using an MTP device as an usb mass storage under Ubuntu is purely and simply IMPOSSIBLE !
HQRaja said:
Can anyone please confirm if this is exclusive to the HTC One X+, or would it work for other similar HTC devices such as One X, One S etc. as well?
Click to expand...
Click to collapse
works for ALL MTP devices
Thanks a bunch. This should come pretty handy. =)
Lloir said:
works for ALL MTP devices
Click to expand...
Click to collapse
does it works for you ?
how do you copy your files from/to your phone ?
Waiting for Ubuntu instructions (maybe)?
followed instructions to the letter and still cant mount my htc one xL running jellybean on ubuntu
Just a quick reply since this was linked on the front page. Tried with GNex and Ubuntu 12.10 and no dice.
spdrosin said:
Waiting for Ubuntu instructions (maybe)?
Click to expand...
Click to collapse
The instructions for Ubuntu are the first ones (Debian based distros), Lloir mentioned it at the start of the OP:
Lloir said:
This is a quick how to get MTP working on Linux, the guide is for distro's based on Debian (mint\debian\ubuntu) And Archlinux i will add others soon.
Click to expand...
Click to collapse
Linux really needs to add native support for MTP already. They also should add native support for adb as well while they are at it. Its annoying to have to add entrees to udev to even to be able to access the device.
One suggestion for anyone wanting to do this with a device other than an HTC:
You'll need to change the line you add to /etc/udev/rules.d/51-android.rules based on the vendor of your phone.
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Change the code to one of the following USB vendor ids:
Code:
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Fujitsu 04c5
Fujitsu Toshiba 04c5
Garmin-Asus 091e
Google 18d1
Hisense 109b
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenovo 17ef
LG 1004
Motorola 22b8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10a9
Pegatron 1d4d
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony 054c
Sony Ericsson 0fce
Teleepoch 2340
Toshiba 0930
ZTE 19d2
Most up-to-date list is here: http://developer.android.com/tools/device.html
You can also have multiple vendor lines in your /etc/udev/rules.d/51-android.rules file, just put one on each line. As someone who's testing on a bunch of different devices, I simply put a line in for all of the above
If your vendor code isn't listed, enter the command "lsusb" in a terminal, and you'll see something like this:
Code:
Bus 001 Device 119: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II]
Bus 001 Device 112: ID 18d1:4e42 Google Inc.
The first four hex values of the id is the vendor ID, e.g., for the Samsung it's 04e8.
cloverz7 said:
Just a quick reply since this was linked on the front page. Tried with GNex and Ubuntu 12.10 and no dice.
Click to expand...
Click to collapse
same here with GNex and ubuntu 12.04
Use Airdroid
Using Airdroid and wifi from Tethering hotspot, you can simply access your Android without USB Cable and you can use anything OS. Search on Google Play with keyword "Airdroid"
Hey I have to say first off thanks for taking the time to figure this out! My problem is I am very new to linux and ubuntu. So when I open the terminal and type all the commands after "sudo mtpfs -o allow_other /media/onex" I get the response: "Listing raw device(s) No raw devices found." So should I have the device attached when I do this? Secondly the following command opens a text window. Is this where i type "SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"? Because now I can't save the text file because I don't have root. Should I be typing literally everything in Terminal? or am I just too new and missing a step. Your help would be greatly appreciated because I would really like to learn a lot more about linux however I'm a bit cautious asking for root for things and ****ing up lol. I'm over windows and will never use a mac so I want to learn! Sorry to be an idiot and a pain just wanna learn.
Nschneider7 said:
Hey I have to say first off thanks for taking the time to figure this out! My problem is I am very new to linux and ubuntu. So when I open the terminal and type all the commands after "sudo mtpfs -o allow_other /media/onex" I get the response: "Listing raw device(s) No raw devices found." So should I have the device attached when I do this? Secondly the following command opens a text window. Is this where i type "SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"? Because now I can't save the text file because I don't have root. Should I be typing literally everything in Terminal? or am I just too new and missing a step. Your help would be greatly appreciated because I would really like to learn a lot more about linux however I'm a bit cautious asking for root for things and ****ing up lol. I'm over windows and will never use a mac so I want to learn! Sorry to be an idiot and a pain just wanna learn.
Click to expand...
Click to collapse
That "SUBSYSTEM..." line needs to be appended to the file opened in the text editor. It shouldn't be entered on the command line.
And add "sudo" to in front of that gedit line...i.e., "sudo gedit /etc/udev/rules.d/51-android.rules"
Good luck!
I prefer to use adb. If you want a GUI you can use QtADB:
http://qtadb.wordpress.com/

[GUIDE] How To Compile TWRP Recovery for QVGA And Other Unsupported Devices.

How To Compile TWRP Recovery For QVGA And Other Unsupported Devices​
Guys a humble request don't spam this thread. If you face any error reply to this thread or PM me i will help and after you build it please don't post your bugs here this thread is only for compiling and not for resolving bugs in your build. I can only help with the errors you face during compilation because i faced a lot .
I thank XDA members cybojenix, kD as i got an idea of how to make guides from them
I would also thank Dees_troy for the sources.
I have worked hard in creating this guide so when you release your build please give proper credits .
Click to expand...
Click to collapse
Minimum Requirements:-
1. RAM:- 4GB
2. HDD Space:- More than 18GB required for CM7 source code (I am going to use CM7 for this guide as CM9 is not yet supported for many devices).
3. Processor:- Equal to Core 2 Duo or Anything above it.
4. Internet Speed:- Minimum of 2 Mbps as we will be downloading files of large size.
5. Patience:- A lots of it needed to get success
Click to expand...
Click to collapse
Ok Lets Start With Step 1:- Setting Up Your Computer For Development.
Getting Linux​
Please note your PC/Laptop must satisfy the minimum requirements to continue. If it doesn't contact any person who is developing for your device to develop this.
Click to expand...
Click to collapse
For compiling you need Linux the most common and free Linux available for development is Ubuntu. Go ahead choose your version and download it.
If you wish to use Ubuntu 10.04 64-Bit for Development use this link
http://releases.ubuntu.com/lucid/ubuntu-10.04.4-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 10.10 64-Bit for Development use this link
http://releases.ubuntu.com/maverick/ubuntu-10.10-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 11.04 64-Bit for Development use this link
http://releases.ubuntu.com/natty/ubuntu-11.04-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 11.10 64-Bit for Development use this link
http://releases.ubuntu.com/oneiric/ubuntu-11.10-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 12.04 64-Bit for Development use this link
http://releases.ubuntu.com/precise/ubuntu-12.04-desktop-amd64.iso
Click to expand...
Click to collapse
After downloading install it in a Virtual Machine or dual boot it alongside another OS you are using now. If you are using a Virtual Machine make sure you allocate more than 50GB of HDD space.
So far so good now that you have Linux installed :victory: you can proceed to the next step of setting up which is followed in the second post.
Setting Up Your Laptop/PC For Development.​
Note:- You may be asked for a password when using sudo command.
Click to expand...
Click to collapse
Installing Python-2.7.5:-
First and foremost is installing Python. For those who are wondering what Python is well here is the answer Python is a language like C,C++,Java which primarily centers around Linux.
1. Open Terminal by hitting Ctrl+Alt+T.
2. Type or copy paste these codes into terminal (I prefer typing though )
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar -xvzf Python-2.7.5.tgz
cd Python-2.7.5
./configure --prefix=/usr/local/python2.7
make
sudo make install
sudo ln -s /usr/local/python2.7/bin/python /usr/bin/python2.7
3. Python is now installed to make sure type this code in terminal
Code:
python
and it should produce an output like this
Code:
Python 2.7.2+ (default, Jul 20 2012, 22:15:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or " lincense" for more information.
>>>
4. If it shows something like that you are good to go.
5. Press Ctrl+D, close the terminal and proceed to install Java 6 JDK.
Installing Java 6 JDK:-
I have to thank cybojenix and kD for this part as it is theirs and i didn't write this part .
Click to expand...
Click to collapse
If you are using Ubuntu 12.04 follow these commands others skip this set of commands.
1. Download Java 6 JDK from here.
2. After Downloading copy that to the Downloads folder.
3. Open Terminal.
4. Type these commands one by one in the terminal
Code:
cd Downloads
chmod +x jdk-6u34-linux-x64.bin
sudo ./jdk-6u34-linux-x64.bin
sudo mv jdk1.6.0_34 /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_34/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_34/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_34/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
If you are not using Ubuntu 12.04 follow these commands:-
1. Open terminal
2. Type these commands one by one in the Terminal.
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
If you had done those steps correctly then you must now have Java installed.
To check and make sure it is installed type this command in terminal.
Code:
java -version
and the output should be
Code:
java version "1.6.0_34"
Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
If the output was some thing similar you are now ready to install GNU Make.
Close the Terminal and proceed.
Installing GNU Make 3.81
Note:- Any other version of make either lower or higher won't work for compiling TWRP.
Click to expand...
Click to collapse
1. Open Terminal
2. Type these codes in terminal.
Code:
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.81
./configure
sudo make install
3. That's it now you got make installed.
To check and make sure that Make is installed type this command in Terminal.
Code:
make -v
and it shoud give the output
Code:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This Program built for x86_64-unknown-linux-gnu
If it was something smiliar to that you can close the terminal and proceed to the next step.
Ok now we got the big guns rolling it's now time for small guns without whom we can't compile yes I mean't the dependencies.
Open Terminal and apply these commands:-
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 gedit git schedtool
export USE_CCACHE=1
If you are using Ubuntu 10.10 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
If you are using Ubuntu 11.04 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
sudo apt-get install libx11-dev:i386
If you are using Ubuntu 12.04 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
sudo apt-get install libx11-dev:i386
sudo apt-get install libncurses5-dev:i386 libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Good now you will have dependencies installed.
It is now time for SDK and ADB which will be continued in the next post.
Installing SDK and ABD​
Installing SDK:-
1. Download Android SDK from here.
2. Extract it to your home folder.
3. Rename the folder to sdk.
4. Open the Terminal and type these commands
Code:
cd sdk/tools
./android sdk
5. A window should popup and there will will be a list of Packages.
6. Install Android SDK Tools and Android SDK Platform-Tools.
Checking ADB:-
Since you installed Android SDK Tools and Android SDK Platform-Tools ADB must now be checked and configured.
1. Enable USB Debugging in your device and connect your phone to computer.
2. Now execute these commands in Terminal
Code:
cd sdk/platform-tools
./adb devices
It should give the output as
Code:
List of devices attached 0123456789ABCDEF device-name (Note the number-letter combination may vary)
If it does give like that skip Adding Permissions.
Or if it gives the output as
Code:
List of devices attached ????????????????? no permissions
Don't worry we have add permission to your device that's it.
Adding Permissions:-
1. Open Terminal
2. Execute this command.
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
3. It should open text editor
4. Paste this line
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"
5. Replace Vendor ID with your Vendor id given in the list.
For e.g if your vendor is Acer you will replace "xxxx" with "0502"
Here is a list of Vendor ID's
Code:
Acer - 0502
ASUS - 0b05
Dell - 413c
Foxconn - 0489
Fujitsu - 04c5
Fujitsu Toshiba - 04c5
Garmin-Asus - 091e
Google - 18d1
Hisense - 109b
HTC - 0bb4
Huawei - 12d1
K-Touch - 24e3
KT Tech - 2116
Kyocera - 0482
Lenovo -17ef
LG - 1004
Motorola - 22b8
MTK - 0e8d
NEC - 0409
Nook - 2080
Nvidia - 0955
OTGV - 2257
Pantech - 10a9
Pegatron - 1d4d
Philips - 0471
PMC-Sierra - 04da
Qualcomm - 05c6
SK Telesys - 1f53
Samsung - 04e8
Sharp - 04dd
Sony - 054c
Sony Ericsson - 0fce
Teleepoch - 2340
Toshiba - 0930
ZTE - 19d2
6. Save and close the editor.
7. Execute this command in Terminal.
Code:
sudo gedit /etc/udev/rules.d/99-android.rules
8. Again paste this line
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"
Replace "xxxx" with Vendor ID.
9. Save it and close the file.
10. Execute these commands one by one in the Terminal
Code:
sudo chmod a+r /etc/udev/rules.d/99-android.rules
sudo chmod a+r /etc/udev/rules.d/51-android.rules
Now RESTART your Ubuntu and type these codes in the Terminal.
Code:
cd sdk
./adb devices
You must not get the output with ???????????????? no permission still if you get it please reply below I will help.
Now we need to edit .bashrc so that we can access adb from anywhere
Execute these codes in the Terminal.
Code:
cd
sudo gedit .bashrc
It should open text editor copy paste this line at the end.
Code:
export PATH=${PATH}:~/sdk/tools
export PATH=${PATH}:~/sdk/platform-tools
Save it and close it.
Now in terminal type adb devices it should give output List of devices attached.
That's it you got Ubuntu, Python, Java 6 JDK, GNU Make-3.81, SDK and ADB ready.
Now you are ready to start development go on to the next step to download source code.
Intializing Repo And Download Source Code
Step 2:- Initializing Repository And Downloading Source Code​
Initializing Repository​
First step is to download the Repo which is essential to download the source code.
1. Open Terminal
2. Execute these commands one by one in Terminal
Code:
mkdir ~/bin
PATH=~/bin:$PATH
sudo apt-get install curl
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Downloading Source Code​
After you have initialized the repo you are set to download the source code.
1. Open Terminal
2. Execute these commands one by one in Terminal
Code:
mkdir source
cd source
repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread
sudo sysctl -w net.ipv4.tcp_window_scaling=0
repo sync -jx (Replace x with a number this number corresponds to number simultaneous download you want for e.g if you give 5 it will download 5 files at once so go on increase to whatever you like but be reasonable :D)
The Source Code is around 15GB - 17GB so have patience and more importantly HDD space.
Click to expand...
Click to collapse
.
The download will take hours if you are on slow connection like it will be a 2 days is 512kbps connection so if you are planning to develop please have a good internet connection with a reasonable fast speed. Every developer recommends more than 1Mbps and sometimes 4Mbps.
After downloading is finished go to source folder you must have many folders inside them. Also make a backup of the source folder just in case as we will modifying it so if something goes wrong you don't have to re-download it all again.
Go to the next step to start the actual development.
Modding Files And Stuff
Step 3:- Modding Files And Folders To Make Your Device Supportable.​
First up is to compile a build of ClockworkMod.
Building ClockworkMod:-
1. Open Terminal
2. Type these commands one by one in Terminal
Code:
. build/envsetup.sh
lunch (it should show you list of devices select your device with their serial number select your device by typing the serial number)
make clean
make -j4 recoveryimage
If you didn't receive an error you are ready to compile TWRP for your device.
If you do receive and error reply to the post I will help you.
Modifying Files And Folder:-
The original Dees_Troy's build folder isn't gonna work as your device resolution doesn't support it. So I have patched the build folder with some extra libs added to prelink map and patched recovery folder with gui changes for smooth compilation.
If you have experience with using git you can clone the repo or you can download it directly from github.
Click to expand...
Click to collapse
If you are going to clone execute these commands in terminal. (Thanks to cybojenix for this so that there will no manual copying).
Code:
cd source
rm -rf build/
rm -rf bootable/recovery/
git clone git://github.com/chainhacker/TWRP_Build -b 2.3 build
git clone git://github.com/chainhacker/TWRP_Recovery -b 2.3 bootable/recovery
If you are going to download directly use the following link make sure you are downloading 2.3 branch and extract it.
Here is the link for the patched build folder------>TWRP_Build
Here is the link for the patched recovery folder------>TWRP_Recovery
After you have done downloading from the above two files.
Replace the contents of source/build folder with the patched one.
Similarly replace the contents of source/bootable/recovery folder with the patched one.
I have 240x320 resolution already in the patched ones but if your device is not 240x320 and also not supported by TWRP download a theme made by other members which has your device's resolution or create a theme. I didn't create the theme though I resized the images and made changes in ui.xml. If you are interested in theming follow the official TWRP theming guide in their website.
If you did find a theme or created it rename the theme folder to your device resolution folder for e.g. If your device resolution is 320x240 you would rename the folder as 320x240.
Copy the theme folder into source/bootable/recovery/gui/devices.
That's it finished the basic requirements next up is configuring BoardConfig.mk.
Editing BoardConfig.mk:-
1. Navigate to source/device/your_vendor/your_device.
your_vendor:- Vendor of your device e.g for me it is lge.
your_device:- Your device name.
Click to expand...
Click to collapse
2. Find BoardConfig.mk and open it in a text editor.
3. Come to the last and add these line
Code:
#twrp
DEVICE_RESOLUTION:= [I]your_device_resolution[/I] (e.g If your resolution is 240x320 type it)
RECOVERY_GRAPHICS_USE_LINELENGTH := true
2. Save it and close it.
Yay you have finished everything only thing left out is compiling which is carried out in the next post.
Psssst.......
After you have compiled your first successful build here are few other things that you could add to BoardConfig.mk
Note:- You can add this after finishing first successful build of recovery till then avoid these.
Click to expand...
Click to collapse
Code:
RECOVERY_SDCARD_ON_DATA := true -- this enables proper handling of /data/media on devices that have this folder for storage (most Honeycomb and devices that originally shipped with ICS like Galaxy Nexus)
BOARD_HAS_NO_REAL_SDCARD := true -- disables things like sdcard partitioning
TW_INCLUDE_DUMLOCK := true -- includes HTC Dumlock for devices that need it
TARGET_RECOVERY_GUI := true -- uses gui format instead of ui.xml
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565" -- to change the colour
TARGET_USE_CUSTOM_LUN_FILE_PATH :=/sys/devices/platform/usb_mass_storage/lun0/file
TW_CUSTOM_POWER_BUTTON := 107 -- to get a power button on the home screen of recovery
TW_EXTERNAL_STORAGE_PATH := "/sdcard" -- default external storage path
TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard" -- default external mount point
TW_FLASH_FROM_STORAGE := true -- enables you to flash zips form the sdcard (You don't neeed o add this it is activated by default)
TW_HAS_DOWNLOAD_MODE := false -- to enable download or more precisely enabling usb mass storage
TW_HAS_NO_RECOVERY_PARTITION := true -- do this only if you device has no partion to recovery
TW_INCLUDE_CRYPTO := false
TW_INCLUDE_JB_CRYPTO := false
TW_NEVER_UNMOUNT_SYSTEM := true -- always keeps the system mounted
TW_NO_BATT_PERCENT := false -- shows battery percentage
TW_NO_REBOOT_BOOTLOADER := true --- disables rebooting into bootloader
TW_NO_USB_STORAGE := false -- disabled usb storage
TW_SDEXT_NO_EXT4 := false
Compiling Recovery
Step 4:- Compiling Recovery​
Finally you have come to the final part of the guide which is compiling recovery.
1. Open Terminal.
2. Execute these commands in Terminal
Code:
. build/envsetup.sh
lunch (Again select your device)
make -j4 recoveryimage
.
That's it when it is finished grab recovery.img from:
out/target/product/your_product_name/recovery.img
Flash it in your device test it fix the bugs and release it.
Wait if you don't want flash and just see how it looks so that you can flash another recovery if it is not working do these
I am not resposible if your device gets bricked in fastboot mode but mostly it won't happen though
Click to expand...
Click to collapse
1. Copy the recovery.img to sdk/platform-tools
2. Boot your device into fastboot mode.
3. Open Terminal
4. Execute these commands one by one in Terminal
Code:
fastboot devices (wait for your device to show up int terminal)
fastboot boot recovery.img
You can test out all the features except flash zip, backup and restore.
Victory :victory: you have successfully compiled TWRP recovery for your device go ahead have fun and enjoy.
If you really like my work express your gratitude by pressing the Thanks button. See you soon in another thread :victory: :laugh: :fingers-crossed:
Click to expand...
Click to collapse
Reserved
reserved just in case :fingers-crossed:
Contributions
You can Contribute to this guide by suggesting improvements and stuff are welcome PM about the contribution and i will add by giving credits to the person contributed
Does it make any difference if I want to compile it for an ARMV6 device?
Gesendet von meinem Skate mit Tapatalk 4 Beta
Joe4899 said:
Does it make any difference if I want to compile it for an ARMV6 device?
Gesendet von meinem Skate mit Tapatalk 4 Beta
Click to expand...
Click to collapse
Nope it won't make any difference it is just the same even if your device is ARMv6 or ARMv7. Make sure your device is supported by CM
Chain Hacker said:
Nope it won't make any difference it is just the same even if your device is ARMv6 or ARMv7. Make sure your device is supported by CM
Click to expand...
Click to collapse
i'm wondering if it will work for Tegra's device
666satyr666 said:
i'm wondering if it will work for Tegra's device
Click to expand...
Click to collapse
Yes it will work go ahead give it a shot :good:
So that's me again :laugh: Wanted to compile TWRP 2.6.0.0 for cm10.1 so I have set up everything so far but get an error when I try to compile
build/core/base_rules.mk:130: *** external/fuse/lib: MODULE.TARGET.STATIC_LIBRARIES.libfuse already defined by bootable/recovery/fuse.
Click to expand...
Click to collapse
Seems to be really stupid, so far I understand is the libfuse defined twice in recovery and base_rules.mk so think (thought ) it's an easy part - just to remove this libfuse from one of them... But I can't find something with "libfuse", "static libraries" or anything like that in base_rules.mk
Joe4899 said:
So that's me again :laugh: Wanted to compile TWRP 2.6.0.0 for cm10.1 so I have set up everything so far but get an error when I try to compile
Seems to be really stupid, so far I understand is the libfuse defined twice in recovery and base_rules.mk so think (thought ) it's an easy part - just to remove this libfuse from one of them... But I can't find something with "libfuse", "static libraries" or anything like that in base_rules.mk
Click to expand...
Click to collapse
I have never tried compiling 2.6.0.0 because Dees_Troy is evaluating my theme for my device such that it gets official support so if you are ready to use CM7 and TWRP 2.3.3.0 you can follow my guide and i can help you with the errors but any other version please ask Dees_Troy for the solution.
How I compile twrp if my phone is not officially/unofficially supported?is it possible?
Sended from my ascend g330 using tapatalk 4 [VIP]
andrea210701 said:
How I compile twrp if my phone is not officially/unofficially supported?is it possible?
Sended from my ascend g330 using tapatalk 4 [VIP]
Click to expand...
Click to collapse
It is possible after successful build with no bugs you can contact Dees_Troy for evaluation and get official support.
Sent from my LG-P350 using Tapatalk 2
Error detected
Hi, Chain Hacker.
Does it matter how to write address after "git://"?
I mean this:
Code:
[B]repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread[/B]
Should it be like this:
Code:
[B]repo init -u git://github.com/Cyanogen[COLOR="Red"]M[/COLOR]od/android.git -b gingerbread[/B]
By the way, it's a very good manual for those who are just starting to understand how to compile
maximik1980 said:
Hi, Chain Hacker.
Does it matter how to write address after "git://"?
I mean this:
Code:
[B]repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread[/B]
Should it be like this:
Code:
[B]repo init -u git://github.com/Cyanogen[COLOR="Red"]M[/COLOR]od/android.git -b gingerbread[/B]
By the way, it's a very good manual for those who are just starting to understand how to compile
Click to expand...
Click to collapse
No i doesnt matter at all the only thing that is case sensitive are the words after cyanogenmod as they must be written as it is so it is your wish whether you are gonna write Cyanogenmod or CyanogenMod and by the way thanks for the complement
Sent from my LG-P350 using Tapatalk 2
TWRP Recovery size...
Hi again...
I've managed to compile a TWRP-Recovery 2.6.0.1 based on CM9 for my Huawei Ascend Y101 (8186).
But I had to change recovery partition size in BoardConfig.mk (originally it was BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000, I changed it to 0x00600000), because without these changes it wasn't possible to build a recovery.img ("recovery.img is too large... etc.")
When I flashed it on my device, the TWRP recovery started and worked perfectly, but I wasn't able to boot my device. But it's not a problem for me, I understand why it wasn't able to boot very good.
The question is the following: is it possible to decrease somehow the source files' sizes of TWRP recovery (maybe images, don't know...) in order to compile the recovery.img that would be less than 4.85 MB (actually it's size is 5*095*424, it's more than my recovery partition....... )
By the way, the size of a CWM-recovery (cm9) that I've compiled is 4*489*216, so it fits like a glove :good: and works fine...
Thanks in advance. I understand that you compiled a TWPR recovery based on CM7, but I don't see much differences...
maximik1980 said:
Hi again...
I've managed to compile a TWRP-Recovery 2.6.0.1 based on CM9 for my Huawei Ascend Y101 (8186).
But I had to change recovery partition size in BoardConfig.mk (originally it was BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000, I changed it to 0x00600000), because without these changes it wasn't possible to build a recovery.img ("recovery.img is too large... etc.")
When I flashed it on my device, the TWRP recovery started and worked perfectly, but I wasn't able to boot my device. But it's not a problem for me, I understand why it wasn't able to boot very good.
The question is the following: is it possible to decrease somehow the source files' sizes of TWRP recovery (maybe images, don't know...) in order to compile the recovery.img that would be less than 4.85 MB (actually it's size is 5*095*424, it's more than my recovery partition....... )
By the way, the size of a CWM-recovery (cm9) that I've compiled is 4*489*216, so it fits like a glove :good: and works fine...
Thanks in advance. I understand that you compiled a TWPR recovery based on CM7, but I don't see much differences...
Click to expand...
Click to collapse
The difference is no on the source dude so relax. You have to modify your kernel and change the compression method to lzma. Contact Dees_Troy for this because i dont know how to change it. You can chat with him through IRC.

[TUT] Introduction into Kernel development

INTRODUCTION INTO KERNEL DEVELOPMENT
PREPARATION
This guide is NOT a full development tutorial! For development of kernels you should be familiar with C. I cannot teach you full C - would be too much for me - but I can show you how to prepare a build environment especially for RAZR Kexec Kernel building! At the end you will find some first steps about how to develop a kernel.
As soon as you have a full dev setup you will be motivated to proceed with learning C - hopefully
For me it worked!
The reason is that I would like to see more people giving it a shot! Kexec is wondeful and it would be great if there are some more people working on kernels.
Please leave me some credits if this tutorial helped you wherever you provide your work! THX!
OVERVIEW
1. Install Linux
2. Setup build environment
3. Initialize Kernel Source
3.1 Branches
3.2 How to compile a kernel
4. Create your first development branch (Add a new Governor)
5. Git Commands
I will tell you the way I started once and guide you through the preparation.
It's important to know how to setup a build environment! The best way to learn about kernel development is to learn by practice!
How to setup a build environment
1. INSTALL LINUX
I suggest Linux Mint 15 Cinnamon (or Linux Mint 15 Mate is good for older for low-spec Systems) - it's free and very easy to install near Windows 7 (dual boot). After the installation you will have a very Windows-like desktop environment which is easy to handle also for beginners. Then you need to learn the Linux Shell!
*of course you can install any other Linux, like Ubuntu. Linux Mint is based on Ubuntu 13.04 and I use it as well.
If your CPU supports 64 bit you should install the 64 bit version! This is impossible also later when it comes to install libraires for development, etc. There are mostly two versions, whether for x32 or x64.
After the installation of Linux you need to imstall related software and depencies.
2. SETUP BUILD ENVIRONMENT
Now, Linux is installed, we begin to setup the build environment.
First install Git which is the main part for using services like Github, etc..
We will install also adb and fastboot!
NOTE
The main installation command for packages in Linux is:
apt-get install (mostly used with 'sudo' ("superuser doers" - admin), then it will be:
sudo apt-get install package-name
You can combine one command to imnstall multiple packages, like:
sudo apt-get install package-name package-name ...
It doesn't matter how much names you enter!
NOTE: Sometimes you will have to confirm the installation of a specific package, means it will ask you for proceed (e.g.: ...this will take xx mb of space (J/n) ?).
Press "j" and enter in this case.
Click to expand...
Click to collapse
Let's start!
Open a shell (terminal) and type:
Code:
sudo apt-get install git android-tools-adb android-tools-fastboot
(you will have to enter your password. Keep in mind that you won't see any input when typing passwords in Linux!)
Now you have installed adb, fastboot and Git!
After this you need to create a working space which means you have to download the full Android source to be able to build your kernel later.
Still in Terminal make sure you're in your user root directory (just type "cd" to get back into your root dir). Now you have to create a new directory for Android sources. Therefor we use the "mkdir" command (make directory). We need to create a folder structure, so we create another folder inside of your new folder:
Code:
mkdir android
cd android
mkdir system
NOTE
This will create: /home/android/system
There is a simpler way to create a folder structure by using on single command. Just add a "-p" to the mkdir command to create multiple directories:
Code:
mkdir -p ~/android/system
NOTE
The "-p" lets you also create directories while being somewhere else!
The "~" symbol is a placeholder for your home folder! It tells the terminal that you want to create the folders in your "home" dir. For better understanding I'll show you the command w/o the placeholder again:
mkdir -p /home/android/system
Click to expand...
Click to collapse
Now you have install the depencies (libraires, etc, needed for compiling Android). So you are still in your terminal and type:
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 libxml2 libxml2-utils xsltproc
NOTE
These depencies are for 32 bit & 64 bit systems!!
Click to expand...
Click to collapse
Now we need some additional libs because we are using a 64 bit system. Still in terminal install them by using the apt-get command. I will only show you the package names now, so you can practice and see if you have understood it. Install these:
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib
NOTE
You can simply use copy&paste
Click to expand...
Click to collapse
Next step is the creation of the repo base directory. It is needed by the repo software which lets you control and use the git repositories on your local machine (your computer). Use the "mkdir" command to create the following directory:
Code:
mkdir -p ~/bin
Now you have to install the "repo command". It's a binary file, so you have to make it "executable" (runable) by using the "chmod" command. Chmod is similar to the "set_perm("...")" command used by updater-scripts (EDIFY script language). It just sets the permissions of a file, i.e. to allow the execution of this file or to make sure the file can be accessed by any people or other programs.
Enter the following to download the "repo" binary and make it executable (runnable):
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
NOTE
It would be too much to explaing stuff like "Curl", etc..
Click to expand...
Click to collapse
Now we have to make sure that we can call "repo" from anywhere. This means if you're in terminal in for example: $ /home/Downloads and you type "repo" it will tell you usually that "repo" is an unknown command. To avoid this we need to make it generic by adding "repo" to your static PATH (Path of execution). The command:
Code:
export PATH=${PATH}:~/bin
NOTE
if you set an "export" for anything (lkie repo) in your terminal, it will be gone as soon as you exit the terminal or also after a reboot. To keep it in your PATH forever you have to add the "export" to your bashrc file (this file stores your preferred Path commands, it's like a list where you can add whatever you need) to make this change to the path permanent for all future Terminal sessions:
Code:
gedit ~/.bashrc
This will launch a graphical text editor (if it doesn't work, try it with "sudo"). Just copy&paste the following line into it, save it and close:
Code:
export PATH=${PATH}:~/bin
Click to expand...
Click to collapse
Fine! So far we are prepared! Now we have to download the android source!
Still in terminal, type:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
NOTE
"repo init" initializes a repository oy your PC
the Git address is the link to the CM source code repo. YOu just told the computer that you just initialized a CM Git repo in the specifi folder /android/system
Click to expand...
Click to collapse
.
To start the download of all the source code to your computer:
Code:
repo sync
NOTE
This process can take a very long time - depends on your internet connection speed. The source is about 10 GB!!
"repo sync" will be your further command to keep the rpo up-to-date! Just enter it while being in the root dir of the android source (/android/system) at least once a day!
Click to expand...
Click to collapse
Now, when the download has been finished we have to download the prebuilt apps (like terminal emulator, etc):
Code:
cd ~/android/system/vendor/cm
then enter:
Code:
./get-prebuilts
Now there are the vendor files needed! There are two ways to do that: The "easy" way and - sometimes it doesn't work, then you have to use - the "harder" way.
The easy way:
Code:
source build/envsetup.sh
breakfast spyder
NOTE
this will usually download the vendor files (motorola speific device drivers). If you get an error message you have to use the second way (harder way).
Click to expand...
Click to collapse
Click to expand...
Click to collapse
The harder way:
cd to you vendor dir and clone the proprietary files manually:
Code:
cd ~/android/system/vendor
git clone https://github.com/Motorola-OMAP4-CM/proprietary_vendor_motorola.git -b cm-10.2
NOTE
"git clone" will be used always when you want to download a git repository to your computer, so you can work with it locally. e.g on Github.com there is always a clone URL given at the right side of the repo. Just type "git clone <link>" into the terminal to clone this repo.
Click to expand...
Click to collapse
Now open the file explorer (whether by using the mouse or in terminal: nautilus (maybe you you have to install this first) and head to /android/system/vendor.
You will find a folder called "proprietary_vendor_motorola".
Just rename it to "motorola".
NOTE
In the future, everytime you update your repo (repo sync) you will have to update the vendor repo too. Perform this by using "git remote update" command in terminal. Therefore you have to be in /android/system/vendor/motorola, and type:
Code:
git remote update
git pull
Click to expand...
Click to collapse
Congratulations! You have successfully setup your Android build environment!
Now we need the kernel source!
3. INITIALIZE KERNEL SOURCE
So you learned some basics about Git! Proof that you understand it and clone the kernel source repo to your PC! I'll give you the links but you have to clone it yourself! Use the clone URL you find at the following Github repo. Make sure you are NOT cloning into your Android source dir /android/system!)
The source for our 3.0.8 Kernel:
www.github.com/CyanogenMod/android_kernel_motorola_omap4-common
NOTE
Too hard? Let me help you (You can even copy&paste my stuff - but for real learning experience you should try to make it on your own)
Head into this dir:
Code:
cd ~/android
Clone the kernel source:
Code:
git clone https://github.com/CyanogenMod/android_kernel_motorola_omap4-common.git
The new folder will be: ~/android/android_kernel_motorola_omap4-common where your kernel source sits.
When done, you have successfully loaded the kernel source! Fine!
3.1 ---> BRANCHES
Now I am going explain you something about "branches" and how to use them!
A "branch" is a part of almost all git repos. It is very important and also very useful to work with branches!
A typical repository looks like that:
[CODE GIT REPO
|
master branch
/ \
/ \
branch: Test branch: Stable
\ /
\ /
\ /
MERGE changes[/CODE]
The repo contains mostly multiple branches. There is always the "master branch" (can have another name of course, branches can be named like you want) and some lower branches.
The "Master branch" is the main branch!
All other branches are custom and mainly used to test new code or sth else.
Let's say we have a kernel repo! This repo contains the JBX-Kernel. The master branch contains the current STABLE Version of the kernel. Now we want to implement a new feature. But when we use the master branch for development (which is sometimes an experiment) we could potentially break the kernel or its source and make it becoming unusable. Therefore we can use a different branch.
NOTE: A branch is always a copy of this branch where you are while creating a new branch! This means when I am currently in the JBX-Kernel master branch, and I create a new branch from there, then I will get a new branch which includes a full copy of my JBX-Kerne master branch. -- But I can work with it without being scared about breaking my repo!
Then many devs are using a "Merge branch". There we could in example copy all changes (which have been tested successfully before) together into a new branch. This process is called "merging".
Let's say we have finished our new feature inside of a test branch. Now the feature is ready to be built in into the Stable Kernel. Then we merge the test branch into the master branch. Thsi results in an updated master branch which now includes our new feature!
Another possibility to use branches can be found if you want to split our repo into different systems, such like the CM kernel source contains branches for CM10.1 and CM10.2. So there is a branch calld "cm-10.1" and another branch called "cm-10.2".
When you look at the part where we initalized the CM repo, you might notice that the repo URL includes this:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
The line marked with red in the URL points to a specific branch, the cm-10.2 branch.
Now we are still in the kernel source dir!
Because you want to build a 4.3 Kernel we need to be in the right branch for this! There are already branches exisiting in the kernel source (like explained above), it's splitted into different versions (4.2.2 and 4.3).
Still in terminal be sure you're inside your kernel source root dir (~/android/android_kernel_motorola_omap4-common), type:
Code:
git checkout cm-10.2
NOTE
"git checkout" is the command to switch to another branch. But it's also used to create or delete branches. More about that later...
Click to expand...
Click to collapse
The output in the terminal will tell you sth like: "Switched to branch cm-10.2"
(if it's the first time you enter a branch it will download the files first and tell you: "Switched to a new branch cm-10.2". Don't be confused by this. If you try to enter a non-existing branch it will give you an error).
Now you are in the kernel repo, in the 4.3 branch!
Before we start to play with the source code I will show you how to build a kernel! As long as the kernel source is untouched you can be sure that it will work! Also this will make sure you have done everything right so far - as soon as the kernel boots you've built!
3.2 HOW TO COMPILE A KERNEL
To get a first impression about how to build the kernel, please have a deeper look at my personal JBX build script:
https://github.com/RAZR-K-Devs/android_kernel_motorola_omap4-common/blob/JBX_4.3/build.sh
The script is very simple and contains only a few commands which can be used in the terminal as well. For your the script is only interesting until the poiont where it says: "make -j4 TARGET_KERNEL_SOURCE=/home/dtrail/android/android_kernel_motorola_omap4-common/ TARGET_KERNEL_CONFIG=mapphone_OCE_defconfig $OUT/boot.img"
Since the latest Android version and the modified kexec stuff it's not enough anymore to build the kernel only. The PVR source has been moved into the Android source and it must be built together with the kernel in order to get a working (booting) kernel! That's why I don't show you the common way.
In fact you can now build your kernel by taking my build script commands, and enter them - one by one - in your terminal. BUT you have to modify the paths because script was made for use on my computer (so, you probably are not called "dtrail!" ). You have to start in your kernel source dir (this is the location where my build script is being executed). To make it easier for you, I have pasted the script here and changed it so it will work for you. I have removed all comments and echo (output) commands so there are only the related build commands left. I just added comments just for you:
Code:
# THESE LINES (those beginning with #) ARE COMMENTS!!!
# Be in your kernel source: /android/android_kernel_motorola_omap4-common
# this command cleans all leftover files from prior compile (needed)
make mrproper
# We build the kernel and its modules
# enter the Android source dir
cd /android/system
# This command makes sure to use the additional build cache. It will make all fufutre build processes MUCH faster! (YOu have to install ccache first by using apt-get)
export USE_CCACHE=1
# Clean also the Android source dir
make mrproper
make ARCH=arm distclean
# Tell the compiler that we want to build now
source build/envsetup.sh
# Tell the compiler which device we want to build for
lunch cm_spyder-userdebug
# built kernel & modules (This command includes the full path to the kernel course and the used kernel config)
make -j4 TARGET_KERNEL_SOURCE=/home/YOUR_USERNAME_HERE/android/android_kernel_motorola_omap4-common/ TARGET_KERNEL_CONFIG=mapphone_mmi_defconfig $OUT/boot.img
After you entered this your computer will start building. The first compiling process will take longer! But future bui9lds will be built much faster thanks to the use of CCACHE!
CONGRATULATIONS!! You built your first kernel!!
Now we have to create a flashable zip file and flash the kernel to see if it works. >The advanced Linux users from you should have another look into my build script I linked above, there you can see how it automaticall pushes (copy) the fiules into a prepared folder which includes everything needed for a flashable zip and compresses it to a ready zip file!
Other less experienced users can just download my latest JBX-Kernel, unpack it, delete "logo.bin" and do this:
go to (by using mouse or terminal):
Code:
/android/system/out/target/product/spyder
There you will find a file called "kernel" - this is your fresh compiled kernel! Copy it to the unpacked JBX-Kernel folder, into:
Code:
.../JBX-Kernel_whatever.../system/etc/kexec
(and overwrite the previous kernel in there)
Now go to:
Code:
/android/system/out/target/product/spyder/system/lib/modules
There are all the modules you've just built. Copy them to:
Code:
.../JBX-Kernel_whatever.../system/lib/modules
Now compress the folders to a new zip file, copy it to your phone and flash it in recovery!
4. CREATE YOUR FIRST DEVELOPMENT BRANCH (add a new Governor)
to create a new branch locally, be in terminal inside the root of your kernel source, and type:
Code:
git checkout -b BRANCH_NAME
Replace BRANCH_NAME with whatever you want!
Now you created and switched to your new branch! Here you can start plaing with the files!
To develop Linux kernel (Android IS Linux!) you will have to learn C! The kernel is developed in pure C which is the best programming language for drivers (machine controlling).
if you're German I can suggest your the "open Book - C von A bis Z" (Galileo Computing, gratis).
Otherwiase just google for free C books or tutorials.
Take your time, this is not easy in the fist place - but as soon as you are more experienced you will find it more easy!
The best way to learn it is to read and browse others Kernel repos! You are always free to watch my JBX-Kernel Repo! Read the commit messages to see what this commit is for and look at the code-side changes! If you read carefully, and learn C at the same time, you will understand the commits, step by step.
Let me give you some more hints:
Set you some smaller goals and start to reach them one by one! Don't set yourself too high goals, otherwise you will make yourself too much pressure!
Small steps are the way to your success!
Some of you might only want to make some minor changes, such like adding new governors, etc. Therefor you can i.e. use google to find related commits. So open Google and type:
Code:
github kernel omap add governor
We hope that google will show us some repos where the dev(s) wrote commit messages like "Added XXX governor", etc, etc..
In this example Google will put out this:
https://www.google.com/search?q=github+kernel+omap+add+governor
If you click the link you will find the very first result, which leads us to:
https://github.com/broodplank/glass-omap-xrr02
There click on Commits and you will see a commit "Add SmartassV2 governor". Now open this commit, you will find this:
https://github.com/broodplank/glass-omap-xrr02/commit/f959e0e8c16412319e991b26aaa50d8fe3555a4e
There you can see now the FULL commit with all its details! It shows you exactly how to add a governor! The green parts are ALWAYS insertions on Github, while red parts are deletions! SO you can see exactly:
1. WHICH files have been changed
2. WHAT has been changed in these files
3. WHERE in the files were the changes made
4. HOW were these changes performed
Now, if you study this commit for a while, you might know what has to be done in order to add a new governor!
NOTE: The very long files which are COMPLETELY green are NEW FILES!
Let's say you want to take this SMartassV2 governor into your kernel:
You can do it with different ways.
1. Cherry-Pick
For this weay you have to add the "glass-omap-xrr02" repo as remote to your repo. So you get the clone URL and use the git remote command (in your kernel root dir with terminal):
Code:
git remote remove upstream
git remote add upstream https://github.com/broodplank/glass-omap-xrr02.git
Now we must fetch the repos content:
Code:
git fetch upstream
Wait until the fetching process is finished.
Now we need the SHA1 sum of the commits. You go to your browser and look at the commit. The SHA1 is a very large number you can find at the upper right.
In this case this is the SHA1 for the commit "add SmartassV2 governor":
Code:
f959e0e8c16412319e991b26aaa50d8fe3555a4e
So, we need to cherry-pick this commit by typing in the terminal:
Code:
git cherry-pick f959e0e8c16412319e991b26aaa50d8fe3555a4e
Now there are three possibilites! If you see a message about "...conflicts" then it didn't work correctly because your local kernel source files might be a little bit different than those from the remote repo. In this case you open these files with a text editor (gedit) and find the lines with the errors, they are looking like this:
Code:
<<<<< HEAD
..some code...
>>>>>> Add SmartassV2 governor
Compare the files to those in the remote commit in your browser qand correct the issues or just this:
Code:
git cherry-pick --abort
This reverts your cherry-pick and your files are clean and like they were before the cherry-pick!
YOu can add the governor manually by simply looking the remote commit in the browser and copy the green stuff into your local files. Make sure you insert the codes in the right places!!! When you copy it from the green parts you will have to remove EVERY SINGLE "+" at the beginninf of each line!
There is another view in github for files, called "RAW". This will shows the pure file - but also without green/red marks! But in case you add the SMartassV2 governor, you can just search for the keyword "smartass" in the raw view of the file and then copy all lines which are including "msartass" into your local files
The governor itself is a complete new file, so you canswitch to the raw view, right click --> select all --> copy. Then create as new file in the right location (/kernel_source_dir/drivers/cpufreq/cpufreq.c) with the same name like in the commit (cpufreq_smartassv2.c) and paste the whole code into it, save and close.
Don't forget the rest of the code in the other files!!
At last you have to insert the new governor into your kernel configuration! The kernel config is mostly a "defconfig" file!
ALl the related defconfigs we need are located in:
Code:
.../arch(arm/configs
The default defconfig for our RAZR is the:
Code:
mapphone_mmi_defconfig
The defconfig file inlcudedes everything which is built into the kernel later. If you search for keyword "GOV" you will see the other governos, like Hotplug, etc.. YOu can see how they are used in the defconfig file, so add your new governor the same way. This should be:
Code:
CONFIG_CPU_FREQ_GOV_SMARTASS2=y
# CPU_FREQ_DEFAULT_GOV_SMARTASS2 is not set
*The second line is for setting it as default governor.
Thats was it! Now make sure everything was done the right way, save and close all files. In terminal type:
Code:
git status
This shows you info about the current status. In this case it will show you the changed files and the new file(s) in red color.
Now you have to stage your commit:
Code:
git add .
Adds all new/changed/untracked files to the commit, then:
Code:
git commit -m "Added Smartassv2 governor"
Done! Your new commit is staged to the index and can be uploaded! (Uploading is not part of this at the moment! If you want to learn more about git, use Google)
Now repeat the compile process like you did already! See if your new governor is included and working.
For further learning it's a good way to proceed with learning C and read, compare and understand commits from other devs/repos.
Ok, guys! I hope you enjoy the guide and it's helpful for you! I will extend/fix/correct this time by time... for now I'm done!
5. GIT COMMANDS
Here are some basics about using git by Terminal:
git branch -D BRANCH_NAME - Delete a branch
git branch -b BRANCH_NAME - create a new branch (but don't switch to it)
git checkout -b BRANCH_NAME - create & switch to a new branch
git checkout BRANCH_NAME - switch to a exisitng branch
git push origin BRANCH_NAME - upload your changes to your repo on Github (You have to be in that branch you are also uploading to!)
git remote update - checks for the latest changes in the original repo (that one where you took the source)
git pull - after you used "git remote update" use "git pull" to download the changes to your computer
git diff BRANCH_NAME - shows differences between the current branch and any branch
git add . - Adds all your changed files to the index (this is important to upload your changes)
git commit -m "this is my commit message" - USe this after "git add ." to append a message to your changes, so other devs can
see why you did it, etc..
git log - Shows the commit history (the history of changes in this repo) inlcuding the related SHA1 for each commit
git revert SHA1 - this reverts (undo) one spedific commit. The SHA1 sum can be found near the commit messages (whether you
can look the with your browser or by us ing "git log")
git remote remove upstream - Removes the current upstream repository
git remote add upstream <git URL> - Adds a new upstream, useful if you want to take over changes from another repos/devs
git fetch upstream - get the new remote repo's content
git cherry-pick SHA1 - this picks one single commit from your current upstream repo - or from another branch
git cherry-pick --abort - This aborts your curerent cherry-pick, useful if you run into conflicts
Click to expand...
Click to collapse
If you find any mistakes or somethings missing in your mind, PM me or post it here.
Please leave me some credits if this tutorial helped you wherever you provide your work! THX!
CREDITS
*Cyanogenmod - took some single infos from their website
How to build Cyanogenmod for Droid Razr (website):
http://wiki.cyanogenmod.org/w/Build_for_spyder
*Hashcode - for being always helpful and supportive and of course for his great work with dhacker
*Linux, Google, XDA-DEVELOPERS
-- reserved --
Another reserver
MINE
Great write-up @dtrail1,
And I completely agree. I'm always hoping for more devs to jump into kernel development to learn and have fun with their devices.
Deffinitely interested in this. Il be hitting this guide up soon as I pick a better internet provider for Repoing.
Saving your book
Sent from my XT910 using xda app-developers app
Thanks for the write up .
Sent from my XT912 using XDA Premium 4 mobile app
Thanks. Perfect for youngsters like me
Sent from my XT910 using Tapatalk 2
Corrected a typo where a .git extension was missing (and users might not be able to clone the repo without it)
umts_spyder
Thank you dtrail1 for the great guide.
as XT910 owner, i guess that everywhere I see spyder in the code, I should replace it with umts_spyder ?
tester5224 said:
Thank you dtrail1 for the great guide.
as XT910 owner, i guess that everywhere I see spyder in the code, I should replace it with umts_spyder ?
Click to expand...
Click to collapse
No, just use the SPYDER source - otherwise your kernel won't support LTE for the CDMA users. The LTE modules are only built with the SPYDER source, that's why we use it.
But you can repeat these steps with UMTS_SPYDER, it will only download the UMTS depencies then, so you are able to build CM10.2 for the XT910. For the kernel only use SPYDER source.
dtrail1 said:
No, just use the SPYDER source - otherwise your kernel won't support LTE for the CDMA users. The LTE modules are only built with the SPYDER source, that's why we use it.
But you can repeat these steps with UMTS_SPYDER, it will only download the UMTS depencies then, so you are able to build CM10.2 for the XT910. For the kernel only use SPYDER source.
Click to expand...
Click to collapse
So if I understood correctly, the GSM\UMTS and LTE\CDMA are using the same kernel in CM ?
thanks for the reply
tester5224 said:
So if I understood correctly, the GSM\UMTS and LTE\CDMA are using the same kernel in CM ?
thanks for the reply
Click to expand...
Click to collapse
If I understood it correctly in the normal cm there are two different kernels. One for gsm without LTE modules and one cdma with LTE modules. So in case want to build for both you need the cdma version as it has the LTE modules and so cdma users have LTE and as usually gsm users will have there normal network.
Sent from my XT910 using XDA Premium 4 mobile app
Para94 said:
If I understood it correctly in the normal cm there are two different kernels. One for gsm without LTE modules and one cdma with LTE modules. So in case want to build for both you need the cdma version as it has the LTE modules and so cdma users have LTE and as usually gsm users will have there normal network.
Sent from my XT910 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
No, the kernel has no differences! It's about the modules. The kernel is always the same but the mlodules are not. If you build the kernel with UMTS_SPYDER depencies you will get umts baseband modules only. But if you build it with the SPYDER source you will get a working modules for umts and cdma.
:good: got it, thanks
tester5224 said:
:good: got it, thanks
Click to expand...
Click to collapse
It's special for our device. Usually it's enough to build the kernel only w/o using the full 15GB rom sources. But since 4.2.2 some parts of the kernel source were moved into the android rom source (e.g. the PVR (SGX) Sources), so we have to use the full rom source to build a working kernel - otherwise your kernel will cause a black screen on boot.
@dtrail1 Question regarding the script you use to build the kernel.
Your script shows: make mrproper
When I run this command I receive an error message: make: *** No rule to make target 'mrproper'. Stop.
Do you have any advice on where I set the target?
Edit: After continuing with the remainder of the script the last error I receive is: make: *** Waiting for unfinished jobs....
This command is needed to clean out the source directories. The error message is normal, just don't care about.
The second error you wrote about sounds like you tried to build without defconfig.
Make sure you have all related "export" commands AFTER the mrproper/distclean commands.
If you did so, then the error is caused by something else. Please post me the full last few lines of your terminal output, then I can tell you more.
Gesendet von meinem XT910 mit Tapatalk 4
awesome guide brother. thank you. i ll give it a try today

Noob's guide to building AOSP from scratch.

So, I have been an Android developer since 2009 (HTC dream), and have been actively "consuming" XDA, custom ROMs and other tweaks. Surprisingly, never tried to build my own ROM from scratch.
Recently, something made me want to build the ROM, so that I can make some changes to the way SystemUI behaves (specifically putting some app shortcuts to my Pixel phone(s), like camera etc. which are now removed in Android 10). So, after a week's struggle I got to where I wanted to reach. (90% time spent in getting the first successful flash. 1% feature development. 9% feature polishing).
Here is my guide to all beginners. (It is pretty simple, if you know the steps).
System setup
I have always been a Windows user (and I love my Surface(s)), but you cannot build Android on Windows machines (as clearly called out in source.android.com). I still tried to install Ubuntu shell from Microsoft store, and build (Spoiler alert: Does not work).
Next is Mac. Android can be built in Mac, I got it build in Mac. But, it is not easy. Especially with setting up the environment, having the right version of MacOS (doesn't work on Catalina yet). And also, challenges with filesystem format (Android building only works on case sensitive file system, so you have to create such a partition). Android building needs at least 160GB of disk space (so unless you are super rich and have 512GB+ Macbook with top specs, it is going to be hard).
My choice machine hence became, my two desktops (i7 4 core, 16GB, 1TB SSD, Ubuntu 18.04 and Xeon 12 core, 32GB, 512GB disk, with Ubuntu 18.04).
There is a reason why I specifically talk about these two machines. To build Android fast (cold clean build in less than 4 hours), you need
Fast processors, and more cores
Lots of RAM
A SSD disk (with 200GB space)
If you are missing any of the above 3, you will build times will go up. I have found for hot build, both machines did a decent job (2-3 mins if you are working on single module), but SSD was more important than cores, and RAM.
Setting up your Ubuntu machine. {ETA 30 mins}
Android has official (and clearly laid out) steps here.
But for Ubuntu these are pretty much the steps.
Code:
$sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip
And the guide doesn't mention this, but you need Python2.7, so get this.
Code:
# refreshing the repositories
sudo apt update
# its wise to keep the system up to date!
# you can skip the following line if you not
# want to update all your software
sudo apt upgrade
# installing python 2.7 and pip for it
sudo apt install python2.7 python-pip
# installing python-pip for 3.6
sudo apt install python3-pip
Also install adb.
Code:
sudo apt install android-tools-adb android-tools-fastboot
If you have come till here, you're ready to build for different devices.
Getting the code ready to build {ETA 5 hours - 1 day}
Most of this is also mentioned in the AOSP official website, but some stuff are tricky, I will try to highlight those steps here.
We are going to build the ROM for Pixel 3 (Android 10 - QP1A.191105.003 )
Download and explode the code {ETA 2-3 hours, depending on internet speed}
Here we are talking about downloading at least 20GB of code (text heavy content) over the internet. Going to be excruciatingly slow.
Also, we will be downloading code for specific device model, so if you want to do it for a newer model, you will have to go through the grind again.
Although, technically it might be possible to have the same folder contain code for multiple devices, it is too risky IMO, something goes wrong, you lose everything.
Recommended folder structure would be
aosp --> device 1
aosp --> device 2
......
aosp --> device n
Click to expand...
Click to collapse
With each folder containing over 150GB of contents (after downloading, building etc), so in practical sense, n could be only 3-4 at max.
Setting up repo.
Repo is a tool that Google uses to checkout and manage the AOSP code in your local machine. Once you download the codebase, you can use the command to resync, update, code base.
Code:
mkdir ~/bin
PATH=~/bin:$PATH
You should persist this folder in your PATH variable all the times.
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
This sets up repo in your machine.
One final step before you actually start the long download, setup your git details.
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Now download the code. Like I previously suggested I would do this.
Code:
mkdir ~/aosp
cd ~/aosp
mkdir pixel3
cd pixel3
Now, let's start getting the code home.
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r10 --depth=1
Here we have done a bunch of things.
We have chosen a particular Android build tag to download (branch). You can follow the link to choose which branch you want to checkout, based on your test phone and Android version you want to build.
We have asked to only download the latest version of the branch and not all of the branch (--depth), this considerably reduces our download time.
Now that we have decided what to download, let's download the code with this command.
Code:
repo sync -qc -j4
This command is going to take a while to download over 20GB of code. In the meanwhile, let's see what we did here.
-q Asks the download to be silent (which means it will show just overall progress)
-c Makes sure we are only downloading current branch
-j[x] This the tricky one. Let's talk about this.
With -j we are asking repo to spawn multiple downloads (parallelly), to speed up the process. We will see this flag going forward in other places also. We should keep the value of x to number of cores we have in our machine. To find how many cores you have run
Code:
nproc --all
. Note that I have had situations where I put a very high value for n (higher than my cores as well), and eventually ran my JVM out of RAM to run the command (in parallel). So, the trade off here is to restrict it to the core number.
***Key step: Download radio drivers.***
Most tutorials miss this or mention it very subtly. But, without this step the ROM you flash won't boot to the home screen (you will be in the boot loop).
Go to the driver binaries page, and download the right zip files for the Android build version (android-10.0.0_r10) and device (Pixel 3) you chose earlier in the repo command.
You will be downloading two zip files (one vendor image zip and one radio drivers zip), both zips will have on shell script file each (.sh), just put those two files in your repo folder (~aosp/pixel3) and run the scripts. It will download the required proprietary files (after asking you to accept the terms). Do not miss this step.. I lost 3 days trying to find the reason for my ROM not booting up, this was it.
Let's build our code
Now things are more definitive.
Code:
source build/envsetup.sh
This command basically sets up your environment, adding necessary commands to path etc.
Code:
lunch aosp_blueline-userdebug
You can read more about this command here.
Basically this sets up the right parameters to build for your specific model. The param can derived based on aosp_[device code]-[userdebug | eng | user].
Once you have run the above two commands, you can *finally* build your codebase.
Code:
m droid -j4
m basically makes and builds the whole codebase.
Code:
droid
refers to the defaults target configuration (optional). -jN is to specify parallelism (equal to number of cores you have).
This command could take anywhere between 4-12 hours for the first run. But, if you followed all steps above, you should have a green message in the end saying this
Code:
[COLOR="SeaGreen"]#### build completed successfully (2:03:04 (hh:mm:ss)) ####[/COLOR]
Flashing your phone
Now, you're 50% safe when your build has finished successfully. Now, next 50% depends if you're able to flash it and get the phone booting.
This part most of you should know, so I am keeping it brief.
Enter fastboot
Code:
adb reboot bootloader
Unlock your bootloader
Code:
fastboot flashing unlock
Flash your Build
From the root folder of your repository (~/aosp/pixel3)
Code:
fastboot flashall -w
In a few minutes your device should be booting to the freshing baked ROM that you made.
What next?
You can just repeat
Code:
m droid -j4
to repeat builds
You can also go to a specific module folder and execute
Code:
mm
to only build that module
You can use adb sync to update specific modules without flashing again (this never worked for me, always bricked my device)
Use *fastboot flashall* without [-w] flag to flash over existing ROM without losing user data.
You can clean up the whole builds and rebuild everything from scratch. Run
Code:
make clobber
to clean your build, and use
Code:
m
to build again
You could face adb issues (device not detected) in Ubuntu. I am not going into details of how to fix that
This has been pretty much my journey so far with AOSP. I am comfortable making changes to modules and building them again.
Aw man, thanks for posting this. Never thought building rom itself would take this much effort & resources. Rom devs are serioulsy awesome ppl. :good:
Thx a lot ,I just want to learn it,it is vevy clear and help me a lot
Thanks very much for creating this. I didn't try flashing the result yet, but the build finished without any problems.
thank you very much for your post, I also want to modify little bit in code aosp and test this changes. Could you plaese provide advice about how I can open code (Android studio?), do some changes and test it by emulator?
thanks for the great guide
but following it gapps will not be included in the build, correct?
do you guys know how to include open gapps?
tia!
hi everything worked in this guide in terms of the build. While flashing the device all steps succeed but during boot the pixel is stuck at the google loading screen. Any suggestions. I have been stuck on the screen for > 30 minutes.
rorlig said:
hi everything worked in this guide in terms of the build. While flashing the device all steps succeed but during boot the pixel is stuck at the google loading screen. Any suggestions. I have been stuck on the screen for > 30 minutes.
Click to expand...
Click to collapse
Maybe you did not download appropriate .sh scripts for your device or didn't run them successfully before building the code. These scripts additionally download files and without them you could have these problems which you mentioned.
I built and loaded AOSP Andorid 9 for PIxel 2 using the eng build vs the userdebug and its works however, when I start installing and granting Google services and such it works but i get a lot of crashes. do you have Google working and not crashing all the time?
```
$ adb root
$ adb remount
$ adb shell
$ cd /system/priv-app
$ mkdir GoogleServicesFramework
$ mkdir Phonesky
$ mkdir PrebuiltGmsCorePi
$ cp /sdcard/GoogleServicesFramework.apk GoogleServicesFramework/GoogleServicesFramework.apk
$ cp /sdcard/Phonesky.apk Phonesky/Phonesky.apk
$ cp /sdcard/PrebuiltGmsCorePi.apk PrebuiltGmsCorePi/PrebuiltGmsCorePi.apk
$ chmod 755 GoogleServicesFramework
$ chmod 755 Phonesky
$ chmod 755 PrebuiltGmsCorePi
$ chmod 644 GoogleServicesFramework/GoogleServicesFramework.apk
$ chmod 644 Phonesky/Phonesky.apk
$ chmod 644 PrebuiltGmsCorePi/PrebuiltGmsCorePi.apk
:: Need to add permissions for the three apps above
::If a device fails to boot, you need to logcat and grep for " - not in privapp-permissions whitelist" and add any missing items in the xml
$ adb push C:\Users\username\Desktop\PIxel2_9.0.0_eng_build\privapp-permissions-platform.xml /etc/permissions/privapp-permissions-platform.xml
```
Hello, I'm interested on the Mac os part. I've been building pixel experience on Ubuntu form am external HDD but because it's a 2011 iMac I have USB 2.0 and r/w speeds are really low slowering the whole process. On the internal drive I have a 500gb SSD that I'd like to use for compiling but partitioning is not an option, could you help me setting up enviroment?
PD: I tried setting it up with brew but I am missing dependencies I can't (don't know how) install them with brew, all guides are for Ubuntu or for Mac is but old.
Thank you in advance!
This guide inspired me to setup a Dockerized build and flash environment for the Pixel 5.
Leaving it here as Pixel 3 owners might find it useful: https://github.com/nvllsvm/pixel5-aosp-builder
Draje0 said:
This guide inspired me to setup a Dockerized build and flash environment for the Pixel 5.
Leaving it here as Pixel 3 owners might find it useful: https://github.com/nvllsvm/pixel5-aosp-builder
Click to expand...
Click to collapse
Thanks, this is very helpful! Have you tested the built image on a pixel 5?
ammarr said:
Thanks, this is very helpful! Have you tested the built image on a pixel 5?
Click to expand...
Click to collapse
Yup - it boots and seems to work except for phone call audio (T-Mobile US).
I am having issue, I did this and got:
#### build completed successfully (17:26:44 (hh:mm:ss)) ####
Click to expand...
Click to collapse
flashing claims to have succeeded but when the phone reboots it just goes back to fastboot mode and says "no valid slot too boot to"
The last few lines of output when doing "fastboot flashall -w" are:
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata' OKAY [ 0.007s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting OKAY [ 0.000s]
Finished. Total time: 82.933s
Click to expand...
Click to collapse
Is the filesystem raw not supported normal? Other than that I am really not sure why this isn't working.
very very handy post, appreciate it, even though i would probably be not building on my own. 20GB smh.. phew!
Anyone know or figure out how to get gapps on this once built (or built-in) without having to have TWRP?
Great guide. I am working on creating a custom rom myself. I've been wondering if it's possible to prevent system apps from being included in the build. There are a few apps that I use f-droid apps in their place (example K9 mail for stock email app) and don't want to see them re-appear when the ROM is updated. If this is not possible, can they be removed from the build before flashing?
Edit ..
Figured it out.
Hi.. I'm Building AOSP 10 for POCO F1(beryllium). i dont know which command should i choose in lunch cause my device isnt listed.. They have only for Pixel Devices.. Pls guide through it
***Key step: Download radio drivers.***
Most tutorials miss this or mention it very subtly. But, without this step the ROM you flash won't boot to the home screen (you will be in the boot loop).
Go to the driver binaries page, and download the right zip files for the Android build version (android-10.0.0_r10) and device (Pixel 3) you chose earlier in the repo command.
You will be downloading two zip files (one vendor image zip and one radio drivers zip), both zips will have on shell script file each (.sh), just put those two files in your repo folder (~aosp/pixel3) and run the scripts. It will download the required proprietary files (after asking you to accept the terms). Do not miss this step.. I lost 3 days trying to find the reason for my ROM not booting up, this was it.***
How can I get this 2 zip files for my Samsung device (SM-A715F). Thank you

Categories

Resources