How can I build kernel with fixed screen calib?
a little work (your work) can change your life
1. download Builduntu - Preconfigured Android Compile Environment v2.1:
http://forum.xda-developers.com/showthread.php?t=2585828
do not forget to hit the thanks button
2. Set up a VM machine in VMplayer or VirtualBox
3. Open terminal and type (or paste):
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml
cd ..
repo sync -j8
4. wait
5. find proper file, change it
6. Open terminal and type (or paste):
cd wave
cd vendor/cm/
./get-prebuilts
cd ../../
. build/envsetup.sh
brunch wave
7. wait
8. enjoy
Pro tip:
if your processor supports virtualization, check if it's enabled in bios, it improve performance of VM
Agasharr said:
a little work (your work) can change your life
1. download Builduntu - Preconfigured Android Compile Environment v2.1:
http://forum.xda-developers.com/showthread.php?t=2585828
do not forget to hit the thanks button
2. Set up a VM machine in VMplayer or VirtualBox
3. Open terminal and type (or paste):
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml
cd ..
repo sync -j8
4. wait
5. find proper file, change it
6. Open terminal and type (or paste):
cd vendor/cm/
./get-prebuilts
cd ../../
. build/envsetup.sh
brunch wave
7. wait
8. enjoy
Pro tip:
if your processor supports virtualization, check if it's enabled in bios, it improve performance of VM
Click to expand...
Click to collapse
Hmmm.... can you make a kernel for neeraj ??? you know unix.... and change as per krishchat kernel....
Agasharr said:
a little work (your work) can change your life
1. download Builduntu - Preconfigured Android Compile Environment v2.1:
http://forum.xda-developers.com/showthread.php?t=2585828
do not forget to hit the thanks button
2. Set up a VM machine in VMplayer or VirtualBox
3. Open terminal and type (or paste):
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml
cd ..
repo sync -j8
4. wait
5. find proper file, change it
6. Open terminal and type (or paste):
cd wave
cd vendor/cm/
./get-prebuilts
cd ../../
. build/envsetup.sh
brunch wave
7. wait
8. enjoy
Pro tip:
if your processor supports virtualization, check if it's enabled in bios, it improve performance of VM
Click to expand...
Click to collapse
thank you very much sir,i shall remain grateful to you, already i have started downloading,it will take about 9 hrs
It's my humble request to all the developers to consider my request of screen calibration fix while making new kernel.
i tried each and every thing to do it myself,but failed.I was busy in same for 9-10 days,and resulted into nothing,i dont know how to compile kernel
neeraj797 said:
It's my humble request to all the developers to consider my request of screen calibration fix while making new kernel.
i tried each and every thing to do it myself,but failed.I was busy in same for 9-10 days,and resulted into nothing,i dont know how to compile kernel
Click to expand...
Click to collapse
To compile kernel only, see here : http://forum.xda-developers.com/showthread.php?t=2276481 step 1-6
zImage will be in ~yourdirectory/out/prouct/target/wave
i dont know how to compile kernel
Click to expand...
Click to collapse
I have the same problem.
http://forum.xda-developers.com/showthread.php?t=2276481
http://forum.xda-developers.com/showthread.php?t=1697618
Please, feel free to learn MORE.
Instead yelling, begging... be an b.p in a
There are many different ways to solve problems...
Please accept, that not many users have the same problem like you...
So you are not priority number 1.
Thanx for reading.
Best Regards
Agasharr said:
a little work (your work) can change your life
1. download Builduntu - Preconfigured Android Compile Environment v2.1:
http://forum.xda-developers.com/showthread.php?t=2585828
do not forget to hit the thanks button
2. Set up a VM machine in VMplayer or VirtualBox
3. Open terminal and type (or paste):
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml
cd ..
repo sync -j8
4. wait
5. find proper file, change it
6. Open terminal and type (or paste):
cd wave
cd vendor/cm/
./get-prebuilts
cd ../../
. build/envsetup.sh
brunch wave
7. wait
8. enjoy
Pro tip:
if your processor supports virtualization, check if it's enabled in bios, it improve performance of VM
Click to expand...
Click to collapse
builduntu not installing,i kept on trying for many days using different combinations and tools.tell me whether can't we do same thing using any other linux os?
neeraj797 said:
builduntu not installing,i kept on trying for many days using different combinations and tools.tell me whether can't we do same thing using any other linux os?
Click to expand...
Click to collapse
For the virtual box? Why not running an Ubuntu live CD?
(....or even better: installing Ubuntu aside Windows....)
(....or even even better: replacing Windows with Ubuntu ....)
neeraj797 said:
builduntu not installing,i kept on trying for many days using different combinations and tools.tell me whether can't we do same thing using any other linux os?
Click to expand...
Click to collapse
Ubuntu 12.04 64 bit is the better. (64 bit is needed)
Then follow this http://forum.xda-developers.com/showthread.php?t=2276481 step 1 and 2 (and maybe step 3) to set up build environment. Then follow what Agasharr says (from cd~)
To build kernel only, after ". build/envsetup.sh" :
lunch cm_wave-userdebug
make bootimage
BenzoX said:
Ubuntu 12.04 64 bit is the better. (64 bit is needed)
Then follow this http://forum.xda-developers.com/showthread.php?t=2276481 step 1 and 2 (and maybe step 3) to set up build environment. Then follow what Agasharr says (from cd~)
To build kernel only, after ". build/envsetup.sh" :
lunch cm_wave-userdebug
make bootimage
Click to expand...
Click to collapse
This will not work if you are running ubuntu via VMware or virtual box. Tried it on 13.10 eventhough the guide recommends 12.04 but i think the problem persists with every version. I suggest builduntu if you are using a virtual machine.
aashil16 said:
This will not work if you are running ubuntu via VMware or virtual box. Tried it on 13.10 eventhough the guide recommends 12.04 but i think the problem persists with every version. I suggest builduntu if you are using a virtual machine.
Click to expand...
Click to collapse
boss,already tried builuntu,but it did not work.a guy replied to me and said that this is because my processor is pentium and the oldest supported is core 2 duo
neeraj797 said:
boss,already tried builuntu,but it did not work.a guy replied to me and said that this is because my processor is pentium and the oldest supported is core 2 duo
Click to expand...
Click to collapse
Make a dual boot Ubuntu Windows. You'll need 40 Go for ubuntu (windows 7 included disk utility can shrink partition size so you don't even need to format your hard drive).
Agasharr said:
a little work (your work) can change your life
1. download Builduntu - Preconfigured Android Compile Environment v2.1:
http://forum.xda-developers.com/showthread.php?t=2585828
do not forget to hit the thanks button
2. Set up a VM machine in VMplayer or VirtualBox
3. Open terminal and type (or paste):
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml
cd ..
repo sync -j8
4. wait
5. find proper file, change it
6. Open terminal and type (or paste):
cd wave
cd vendor/cm/
./get-prebuilts
cd ../../
. build/envsetup.sh
brunch wave
7. wait
8. enjoy
Pro tip:
if your processor supports virtualization, check if it's enabled in bios, it improve performance of VM
Click to expand...
Click to collapse
i am getting following error while copying/pasting your first command.I am using luninux-a debian/ubuntu based os
neeraj797 said:
i am getting following error while copying/pasting your first command.I am using luninux-a debian/ubuntu based os
Click to expand...
Click to collapse
Set up build enviromnent first following steps 1-3 here : http://forum.xda-developers.com/showthread.php?t=2276481
neeraj797 said:
i am getting following error while copying/pasting your first command.I am using luninux-a debian/ubuntu based os
Click to expand...
Click to collapse
http://source.android.com/source/downloading.html
To install Repo:
Make sure you have a bin/ directory in your home directory and that it is included in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Download the Repo tool and ensure that it is executable:
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Click to expand...
Click to collapse
neeraj797 said:
i am getting following error while copying/pasting your first command.I am using luninux-a debian/ubuntu based os
Click to expand...
Click to collapse
Information for you about error no command 'repo' found
I should not say more that Rebellos has already said http://forum.xda-developers.com/showpost.php?p=47926638&postcount=1739, but your screenshot is hard to believe: you are just copying/pasting without understanding you copy from an xda forum and it appears a contracted url with "..."
You are pasting
"wget https://raw.github.com/Badadroid/and...l_manifest.xml"
instead of
"wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml"
and of course in your screenshot appears a 404 error.
neeraj797 said:
i tried each and every thing to do it myself,but failed.I was busy in same for 9-10 days,and resulted into nothing,i dont know how to compile kernel
Click to expand...
Click to collapse
ash009 said:
I had the same ghost touch problem like u my status bar also kept coming down but the problem has stopped after I installed zendrokat by tigrouzen
Thanks tigrouzen,volk,rebellos and all other developers for making fully functional android for our waves
Sent from my GT-I9000 using xda app-developers app
Click to expand...
Click to collapse
but i face same even in tigrozen's rom too,but little than the roms by volk and rebellos
---------- Post added at 11:15 AM ---------- Previous post was at 11:09 AM ----------
hunktb said:
Information for you about error no command 'repo' found
I should not say more that Rebellos has already said http://forum.xda-developers.com/showpost.php?p=47926638&postcount=1739, but your screenshot is hard to believe: you are just copying/pasting without understanding you copy from an xda forum and it appears a contracted url with "..."
You are pasting
"wget https://raw.github.com/Badadroid/and...l_manifest.xml"
instead of
"wget https://raw.github.com/Badadroid/android_wave_local_manifest/cm-11.0/local_manifest.xml"
and of course in your screenshot appears a 404 error.
Click to expand...
Click to collapse
thanks a lot for finding mistake
---------- Post added at 11:17 AM ---------- Previous post was at 11:15 AM ----------
adfree said:
@ neeraj797
You can create new Thread if you want... or use my or others about compiling...
But this here is from volk204 about:
Code:
[ROM][WIP] CM11 Badadroid v4.1.1
Thanx.
Best Regards
Click to expand...
Click to collapse
sorry,what is that code about?how can i use it
Agasharr said:
http://source.android.com/source/downloading.html
Click to expand...
Click to collapse
your point 4 said "choose appropriate file",how can i do so here? is this error coz of repo command??????????
Related
This quide is a work in progress. (only testing with Ubuntu 10.04 x64)
After searching for a complete how to for building android from source I have determined there is none that are 100% complete.
Here is a compilation of guides from various sites that I used to build for the streak
Step One – install some packages.
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
Click to expand...
Click to collapse
Step Two – select the right version of Java.
sudo update-java-alternatives -s java-1.5.0-sun
Click to expand...
Click to collapse
Ubuntu doesn't have packages for the X11 libraries, but that can be worked around with the following command:
sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
Click to expand...
Click to collapse
Step Three - Installing repo.
make bin dir in home directory and add to path
cd ~
mkdir bin
export PATH=~/bin:$PATH
Click to expand...
Click to collapse
This can be made Permanent bay adding to the .bashrc file in ~/
Download the repo script and make it executable:
curl http://android.git.kernel.org/repo >~/bin/repo
chmod a+x ~/bin/repo
Click to expand...
Click to collapse
Step Four – Repo Init.
Create a working directory
mkdir mydroid
cd mydroid
Click to expand...
Click to collapse
Initialize the repo
repo init –u git://android.git.kernel.org/platform/manifest.git
Click to expand...
Click to collapse
Or if you would like to check out a specific branch use the following
repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
(replace cupcake with your branch of choice)
Click to expand...
Click to collapse
If successful you will receive a message like:
“repo initialized in /mydroid”
To pull the files to your working directory now use:
repo sync
Click to expand...
Click to collapse
Step Four – Verify tags.
gpg --import
Then paste in the following:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----
Click to expand...
Click to collapse
Once you have done this press CTRL + D
Now there are a few changes we need to make before we build.
1.)We need to install gcc-4.3 (gcc-4.4 has more strict rules then previous versions that causes some issues during build)
sudo apt-get install gcc-4.3 g++-4.3
Click to expand...
Click to collapse
2.)Add JAVE_HOME to ~/.bashrc
nano ~/.bashrc
Click to expand...
Click to collapse
Add this to the end of the file:
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.16
Click to expand...
Click to collapse
A small issue with gcc
sudo apt-get install g++-multilib
Click to expand...
Click to collapse
Fix issue with webkit build later on
cd ~
cd android/system/external/webkit
git cherry-pick 18342a41ab72e2c21931afaaab6f1b9bdbedb9fa
Click to expand...
Click to collapse
Now that this is complete the build is pretty straight forward.
bluez
2) build android by
. build/envsetup.sh
choosecombo (all default option)
make -j4
3) replace external/bluez, and 'export BOARD_HAVE_BLUETOOTH=true'
4) mmm external/bluez
-------------------------------------------------------------------------------
jpeg
2) build android by
. build/envsetup.sh
choosecombo (all default option)
make -j4
3) replace external/jpeg
4) mmm external/jpeg
-------------------------------------------------------------------------------
webkit
2) build android by
. build/envsetup.sh
choosecombo (all default option)
make -j4
3) replace external/webkit
4) mmm external/webkit
-------------------------------------------------------------------------------
wpa_supplicant
2) build android by
. build/envsetup.sh
choosecombo (all default option)
make -j4
3) replace external/wpa_supplicant
4) mmm external/wpa_supplicant
-------------------------------------------------------------------------------
kernel
2) repleace kernel
3) build android by
. build/envsetup.sh
choosecombo
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1]
Build type choices are:
1. release
2. debug
Which would you like? [1]
Product choices are:
1. emulator
2. generic
3. sim
4. msm7627_ffa
5. msm7627_surf
6. qsd8250_ffa
7. qsd8250_surf
You can also type the name of a product if you know it.
Which product would you like? [generic] 7
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng]
4) make -j4
Guide not complete. Will finish shortly
Sources -
http://source.android.com/source/download.html
http://www.johandekoning.nl/index.php/2009/06/07/building-android-15-build-environment/
http://hi.baidu.com/caicry/blog/item/cad9977f11f2920528388a9f.html
http://opensource.dell.com/releases/streak/1.12/HOW-TO-BUILD.txt
This is awesome work you're doing here! Seems pretty daunting to try to build android if you don't know where to begin- this is a great step by step guide.
very nicely done. always good to have all the info in once place, im forever forgetting commands as it is. needs a sticky
Anyone actually got this to work? I can build the framework but building the kernel is another story.
First of all, what kernel should be used? common? msm? something else? And what branch?
Second, what kernel configuration? The one from the phone doesn't work 100%
Thirdly, "choosecombo" does not find any products to choose from. Is that a problem?
Fourthly, after it's all build, what's next? How is the update zip made?
drstock said:
Anyone actually got this to work? I can build the framework but building the kernel is another story.
First of all, what kernel should be used? common? msm? something else? And what branch?
Second, what kernel configuration? The one from the phone doesn't work 100%
Thirdly, "choosecombo" does not find any products to choose from. Is that a problem?
Fourthly, after it's all build, what's next? How is the update zip made?
Click to expand...
Click to collapse
Read the first post again....your answers are all there
fards said:
Read the first post again....your answers are all there
Click to expand...
Click to collapse
What? No they're not, read the questions again.
Anywho, I got the kernel to build with the config from the phone, just one change needed: CONFIG_QSD_OEM_RPC_VERSION_CHECK=N
Using the MSM7XXX kernel, android-msm-2.6.29-donut branch. Haven't had the guts to test it yet.
Here's mores links
http://opensource.dell.com/releases/streak/1.12/
Probably the same stuff but haven't read above.
you really should use the codeaurora android tree nopt the android one as CA has the extra edits for snapdragon
drstock said:
What? No they're not, read the questions again.
Anywho, I got the kernel to build with the config from the phone, just one change needed: CONFIG_QSD_OEM_RPC_VERSION_CHECK=N
Using the MSM7XXX kernel, android-msm-2.6.29-donut branch. Haven't had the guts to test it yet.
Click to expand...
Click to collapse
oh yes they are...
here, let me wipe your arse for you. hold your hand
you need the dell kernel source.
kernel
2) repleace kernel
3) build android by
build/envsetup.sh
choosecombo
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1]
Build type choices are:
1. release
2. debug
Which would you like? [1]
Product choices are:
1. emulator
2. generic
3. sim
4. msm7627_ffa
5. msm7627_surf
6. qsd8250_ffa
7. qsd8250_surf
You can also type the name of a product if you know it.
Which product would you like? [generic] 7
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng]
4) make -j4
Click to expand...
Click to collapse
which parts dont you understand of that?
once you have the source set up properly (try source build/envsetup.sh as an alternative to ./buildsetup.sh)
choosecombo should work fine.
flash the seperate created imgs.
Nice work deserves a sticky keep it up
Would love to try it myself when the howto is complete.
fards said:
oh yes they are...
here, let me wipe your arse for you. hold your hand
Click to expand...
Click to collapse
fards said:
you need the dell kernel source.
Click to expand...
Click to collapse
Of course I use the dell kernel source.
fards said:
which parts dont you understand of that?
once you have the source set up properly (try source build/envsetup.sh as an alternative to ./buildsetup.sh)
choosecombo should work fine.
Click to expand...
Click to collapse
First of all, it says "replace kernel" but the framework does not include the kernel source, only a prebuilt generic kernelcd . And I can't replace the prebuilt kernel at that step since I haven't built the kernel yet at that step. See my predicament?
Building the framework does not rebuild the kernel as far as I can see.
choosecombo works, but it doesn't give the output described in the howto. This is what I see when running it:
~/mydroid$ choosecombo
Build for the simulator or the device?
1. Device
2. Simulator
Which would you like? [1]
Build type choices are:
1. release
2. debug
Which would you like? [1]
Which product would you like? [generic]
Click to expand...
Click to collapse
As i understand it the product targets should be available under device/ but that directory doesn't even exist.
fards said:
flash the seperate created imgs.
Click to expand...
Click to collapse
Could you upload the images you created to mediafire?
Thanks for the help.
By the sound of it, you don't have the dell kernel *source*
It's not prebuilt at all. It's an archive which has a folder inside called kernel, inside there is a lot of files and folders that when compiled make the kernel zImage
You need to delete the folder called kernel that's inside the main folder where you repo synced the codeauroura/android source, depending on which. Git you used
Then move the kernel folder from the dell source archive to the codeauroura/android whatever youcalledit folder where you just deleted the other folder.
Then carry on with the instructions.
I'm not using The donut source, I'm trying to port to froyo, and as such don't have a valid boot.Img
fards said:
By the sound of it, you don't have the dell kernel *source*
It's not prebuilt at all. It's an archive which has a folder inside called kernel, inside there is a lot of files and folders that when compiled make the kernel zImage
You need to delete the folder called kernel that's inside the main folder where you repo synced the codeauroura/android source, depending on which. Git you used
Then move the kernel folder from the dell source archive to the codeauroura/android whatever youcalledit folder where you just deleted the other folder.
Then carry on with the instructions.
I'm not using The donut source, I'm trying to port to froyo, and as such don't have a valid boot.Img
Click to expand...
Click to collapse
I'm using the dell kernel source (streak_1.12_kernel.tar.gz). The prebuilt kernel I'm talking about is the one included in the framework, located under /prebuilt/android-arm/kernel/. As I understand the documentation, that's the one used when images are built. Is that incorrect? Cause from what I can see, the kernel isn't even built when running make on the framework, even if the source is there.
I haven't looked at froyo, but in the donut source (that you get from "repo init -u git://android.git.kernel.org/platform/manifest.git -b donut") no kernel source is included. It's in a separate repo, or actually several different repos depending on target (msm7xxx, tegra etc).
It's inconsistencies like these that makes me doubt the build instructions from dell. But maybe I'm just thick.
I am terribly n00b at all this but a veteran software developer; just never developed on embedded systems, yet. The question I have is, does Dell have Android "drivers" for their hardware that can be extracted and put into the kernel available with the Android source code? I believe this is how old Windows Mobile OS worked.
Hey crush6, are you planning on finishing the amazing howto you started?
Sorry guys been away for a few days I will finish this up soon.
drstock said:
I haven't looked at froyo, but in the donut source (that you get from "repo init -u git://android.git.kernel.org/platform/manifest.git -b donut") no kernel source is included. It's in a separate repo, or actually several different repos depending on target (msm7xxx, tegra etc).
Click to expand...
Click to collapse
As you were told several times, you need to use CodeAurora source, not the generic Android source.
smokku said:
As you were told several times, you need to use CodeAurora source, not the generic Android source.
Click to expand...
Click to collapse
If I could only get it:
~/mydroid$ repo init -u git://codeaurora.org/platform/manifest.git -b donut
--- long python traceback ---
xml.parsers.expat.ExpatError: mismatched tag: line 11, column 4
Click to expand...
Click to collapse
drstock said:
If I could only get it:
Click to expand...
Click to collapse
Nevermind, didn't realize that I needed to specify manifest too. I assume Q8650BSDCANLYA3200.xml is correct for the streak.
So you want to build CyanogenMod and don't know where to start?
I wanted to make a step-by-step guide for installing and configuring everything necessary for building CM9 in a virtual machine (VM) on a Windows machine. There's a scattered information in the forums on most of this, but I wanted to bring it together and share what worked best for me for any newbies who want to try to get their feet wet with AOSP development, or who would just like to be able to have their own up to date builds from source.
Huge thanks go out to dmeadows013 and antp121. It was their guides I started with when doing this myself, and without them, I don't think I would have even known where to begin. Their guides are at http://forum.xda-developers.com/showthread.php?t=1810297 and http://forum.xda-developers.com/showpost.php?p=31530111&postcount=12
This guide is designed to allow people with no Linux or development experience to get up and running as quickly as possible. Though no prior knowledge should be required, I highly recommend that you pay attention to what you are doing, and research or ask about anything you have questions about so that you'll understand the process. I've divided this into multiple parts to make it easier to do in stages.
What you need:
1) A Windows computer, preferably with a CPU that supports hardware virtualization. Most relatively modern processors do, so if you've bought your computer in the last 4 or 5 years, it's probably fine. Without this, you won't be able to run 64-bit or multiple processor VM's. Your Windows OS doesn't have to be 64-bit, your CPU just needs to support hardware virtualization. I won't say that this will not work on a 32-bit VM, but I've never tried it, so I can't support it if it doesn't. If you want to try, just replace all of the references to 64-bit in this guide with 32-bit.
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, at least 50GB of which will be used permanently.
4) Plenty of time on your hands. You don't want to be rushed while you're doing this the first time.
Preliminaries:
1) Go to https://www.virtualbox.org/wiki/Downloads and download the latest version of VirtualBox for Windows hosts. The current version as of this writing is 4.2.
2) From the same website, download the latest version of the Virtual Box Extension Pack.
3) Go to http://www.ubuntu.com/download/desktop and download the 64-bit version of Ubuntu Desktop 12.04.1 LTS. This version will be supported for at least two years and will provide a stable OS base for at least that length of time.
Install and configure VirtualBox:
1) Run the VirtualBox installer executable you downloaded in the preliminaries section. Choose the default options at every prompt.
2) During the installation, the software will ask you for permission to install drivers. Choose install when it asks.
3) When the installation is complete, uncheck the box to start the application, then click Finish.
4) Run the VirtualBox Extension Pack installer that you downloaded in the preliminaries, and click Install and Agree.
5) From the VirtualBox Manager, click New
6) Name your machine whatever you wish (Android Build Box, for example), select Linux as the type, and Ubuntu (64-bit) as the version. Click Next
7) Give the machine as much memory as you can spare and click Next. I've found myself to need at least 1536MB (1.5GB) as a minimum to build with. More memory will result in a faster build time. If you intend to give the machine more than one processor, you need to give it more memory as well.
8) On the Hard drive prompt, click Create
9) Choose VDI and click Next
10) Choose Dynamically allocated and click Next
11) Give the drive at least 50GB of space and click Create. As always, more is better. 50GB will give you enough room to work on a single copy of CM9 with a little breathing room. You need more if you want to work on multiple copies.
12) Choose your VM and click Settings
13) Click the Advanced tab in General settings. Set Shared Clipboard to Bidirectional. This will allow you to copy and paste between the virtual machine and your Windows host.
14) If you wish to give your VM access to more than one processor, click on System, then choose the Processor tab. Select the number of processors you wish your VM to use.
15) Click OK. Your VM is now configured.
Install Ubuntu 12.04.1:
1) In the VirtualBox Manager, choose your VM and click Settings.
2) Click Storage.
3) Click Empty, underneath the IDE Controller entry.
4) On the far right, under Attributes, click the small CD icon and click "Choose a virtual CD/DVD disk file..."
5) Choose the file ubuntu-12.04.1-desktop-amd64.iso that you downloaded earlier
6) Click OK
7) Make sure your VM is selected, and click Start.
8) As it boots, confirm the messages that appear, click "Do not show this message again" if desired.
9) After a few minutes, the VM will boot to a selection screen. Choose Install Ubuntu.
10) Click Download updates while installing and Install this third party software. Click Continue.
11) Leave Erase disk and install Ubuntu checked, then click Continue. This will only erase the virtual drive.
12) Click Install Now.
13) Choose your time zone and click Continue.
14) Choose your keyboard layout and click Continue.
15) Set up your username, password, and a machine name. REMEMBER THIS PASSWORD. You will need it, even if you enable Log in automatically. Click Continue.
16) Now sit back and relax. The installation will take a while.
17) When installation is complete, click Restart Now
18) When prompted, press Enter
19) The VM will reboot into your new Ubuntu installation.
A note about your new VM installation of Ubuntu: This is just like any other computer and should be treated as such. It needs to be properly shut down to prevent disk corruption. To shut down the system, click the gear icon in the upper right and choose Shut down. You should also keep the system properly updated, because when it is running, it is just as accessible to the Internet as any other computer on your network, so keep the security updates installed as you are notified.
Update Ubuntu 12.04.1 and install Guest Additions:
1) Log into your system with the user you created during installation. Ignore any warnings you may get about new drivers being available. We will take care of that in a bit.
2) Click the top icon of the sidebar (Dash Home), type update, and click Update Manager.
3) Click Install Updates
4) When prompted, enter your user password.
5) When updating is complete, click Restart Now
6) After restart, log back in.
7) In the VM Window menu, click Devices, then click Install Guest Additions...
8) Click Run and enter your password when prompted.
9) After process completes, reboot by clicking the gear in the upper right corner, clicking Shut Down, and clicking Restart.
Configure your build environment
1) Log into your Ubutntu system, open Firefox from the sidebar and go to http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html
2) Click agree and download jdk-6u35-linux-x64.bin
3) Click on Dash Home, type terminal, and open the Terminal app.
4) Right click on Terminal in the sidebar and select Lock to Launcher.
5) Retrieve the build tools:
Code:
sudo apt-get install git-core git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool gcc-multilib g++-multilib pngcrush g++ gcc dpkg-dev
6) Unpack Java by typing the following commands in terminal:
Code:
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
7) Install Java by executing the following commands:
Code:
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
8) Make Java 1.6 the default by typing the following commands individually, and selecing the jdk1.6.0_35 line in each (typically number 2):
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Create the build directories and retrieve the code:
1) Log into your Ubuntu system and open a terminal window
2) Create your build directories:
Code:
mkdir ~/android ~/android/bin ~/android/cm-10.1
3) Open your profile config:
Code:
gedit ~/.bashrc
4) Insert the following into the end of your profile:
Code:
ANDROID_JAVA_HOME=/usr/lib/jvm/jdk1.6.0_35
export ANDROID_JAVA_HOME
PATH=~/android/bin:$PATH
export PATH
5) To reload your profile, exit your terminal window and open a new one.
6) Download the repo binary:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/android/bin/repo
chmod a+x ~/android/bin/repo
7) Initialize and sync the repo (download the code). This will typically take a couple of hours the first time you run it:
Code:
cd ~/android/cm-10.1
repo init -u git://github.com/Chad0989/android.git -b cm-10.1
repo sync
8) Retrieve the prebuilts:
Code:
./vendor/cm/get-prebuilts
Build CM10.1
1) Now, all that's left is to build. If you want to get the latest code, run another repo sync (included here). It only retreives changes, so it should only take a few minutes from now on. Ignore warnings and let it build. As long as it doesn't crash, you're fine. It can take anywhere from an hour to half a day, depending on the resources you gave the VM:
Code:
cd ~/android/cm-10.1
repo sync
. build/envsetup.sh
make clobber
brunch vigor
2) Go get your freshly baked CM10.1 from ~/android/cm-10.1/out/target/product/vigor.
I hope this is useful for someone. This guide is the result of several days of learning on my part, and several hours of writing. If there is anything that doesn't work, let me know. I will probably be cleaning it up a bit in the near future, and I may add an FAQ and/or glossary if it appears that one is needed. I'll also attempt to keep it updated with the newest versions of the tools. Thanks for reading, and have fun building.
Special thanks to:
dmeadows013 and antp121 - For providing the guides that got me started. I couldn't have done any of this without you.
chad0989 - For AOSP on the Rezound.
IAmTheOneTheyCallNeo - For answering my stupid questions and inspiring me to get more involved
Snuzzo - For answering more stupid questions and giving more inspiration
synisterwolf - For being generally awesome and putting up with me in chat
puhleez - Who's environment issues inspired me to make this guide
Alternate instructions for setting up Debian:
After some discussions in the thread, I decided to switch to Debian for my build environment, because I hate Unity, and I've always liked Debian better anyway for a work system. I still recommend Ubuntu for most people, as it is the most noob friendly Linux build out there. If you're going to use Debian, or most of the other builds, you need a better understanding of the security model and an expectation that it's going to take a little more front end setup (that isn't covered here). However, if you want to use Debian, the instructions to configure the build environment are mostly the same. The only difference is the retrieval of the build tools. Debian names their 32-bit packages differently, so it changes to this:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev lib32ncurses5-dev x11proto-core-dev lib32libreadline6-dev libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc lib32z1-dev schedtool gcc-multilib g++-multilib pngcrush
Alternate instructions for building PAC-man:
The guide will be the same until the point where you initialize the repo (Create the build directories and retrieve the code, step 7). Instead of those steps, do the following:
Code:
mkdir ~/android/pac
cd ~/android/pac
repo init -u git://github.com/PAC-man/android.git -b cm-10.1
repo sync
There is no need to retrieve the prebuilts or set up the environment for PAC. The build script will do everything. To build, just do this:
Code:
cd ~/android/pac
repo sync
make clobber
./build-pac.sh vigor
Since this is a multi-device repo, the initial build will take a little longer, because the script will retrieve the missing pieces for vigor, and replace some things that are little different for us than the standard, but the build itself should be around the same time as a stock CM10.1 build.
This is pretty sweet. Thanks for this. When im bored at work next week I def give this a go.
Ive been wanting to try this but I don't think my little dual core laptop is up to it lol. Thanks for the write up
Sent from my ADR6425LVW using Tapatalk 2
Thank you. Now I can refer people to this page. I have never done it in a virtual box.
This is awesome Shrike. It will help encourage people to get into building roms that wouldn't have otherwise run across it. Things like this help to continue the android hobby and lifestyle that so many of us enjoy.
If anyone here is interested in setting up a VPS on our server so they can build roms on a virtual build box even if they don't have a powerful computer, just let me know.
Thank you so much. Too many people bothering me on gtalk about this.
This is an awesome guide. Definitely need start getting invovled with developing for Android. It would be cool we could get a guide on how to do this with the linaro tool chain also.
Great work and thanks for contributing
awesome going to read this later. thanks for the guide.
Wow man. I can' t thank you enough for spending the time to put this together. I struggled with getting it to work and after many attempts just gave up. I'll definitely be trying again, maybe this afternoon.
Thanks again!!
Thank you for this. I am working through the procedure now. Other than the location of the jvm in the initial install everything is looking good (details will follow when I confirm it wasn't an ID10T error on my part).
---------- Post added at 04:16 PM ---------- Previous post was at 04:11 PM ----------
merashallan said:
Thank you for this. I am working through the procedure now. Other than the location of the jvm in the initial install everything is looking good (details will follow when I confirm it wasn't an ID10T error on my part).
Click to expand...
Click to collapse
I figured out the problem. If you install the Oracle java before you install all the additional packages there will not be a directory named /usr/lib/jvm as the openjdk has not yet been installed. This also means you have to repeat step 7 after step 8 since there are no alternatives to Oracle java before step 7.
I think if you perform step 8 before step 5 the procedure will work.
Anyways it's looking like a good guide so far as it's saving me lots of time figuring out what I need.
doing my repo sync right meow.
merashallan said:
Thank you for this. I am working through the procedure now. Other than the location of the jvm in the initial install everything is looking good (details will follow when I confirm it wasn't an ID10T error on my part).
---------- Post added at 04:16 PM ---------- Previous post was at 04:11 PM ----------
I figured out the problem. If you install the Oracle java before you install all the additional packages there will not be a directory named /usr/lib/jvm as the openjdk has not yet been installed. This also means you have to repeat step 7 after step 8 since there are no alternatives to Oracle java before step 7.
I think if you perform step 8 before step 5 the procedure will work.
Anyways it's looking like a good guide so far as it's saving me lots of time figuring out what I need.
Click to expand...
Click to collapse
Thanks for the feedback. I've incorporated it in the the document.
This is awesome. I've always wondered how to go about compiling and such, but didn't want to bug any of the developers. This is definitely a start into developing! Thank you
Deleted
When you repo sync, where is the data supposed to go? in the root of HOME or in ANDROID/CM9? Mine went into the root of HOME.
h4ckers said:
When you repo sync, where is the data supposed to go? in the root of HOME or in ANDROID/CM9? Mine went into the root of HOME.
Click to expand...
Click to collapse
It should go to ~/android/cm9. There was a typo in step 7 of the build directory setup. Sorry about that. Fixed now.
nice job man
shrike1978 said:
It should go to ~/android/cm9. There was a typo in step 7 of the build directory setup. Sorry about that. Fixed now.
Click to expand...
Click to collapse
I noticed that. I copied everything to where it needs to go. Did this command again to make sure I had all the changes:
Code:
cd ~/android/cm9
repo sync
Still went to the root of HOME. Strange. After building a test, I will see what else I can do to fix my issue. Thanks for the guide and by chance do you know where to pull AOKP and MIUI? I saw Dmeadows' git but didn't know what to pull.
h4ckers said:
I noticed that. I copied everything to where it needs to go. Did this command again to make sure I had all the changes:
Code:
cd ~/android/cm9
repo sync
Still went to the root of HOME. Strange. After building a test, I will see what else I can do to fix my issue. Thanks for the guide and by chance do you know where to pull AOKP and MIUI? I saw Dmeadows' git but didn't know what to pull.
Click to expand...
Click to collapse
I haven't tried to build either yet, so I haven't the foggiest where to start. TBH, I'm not a particularly big fan of either, so I've never really looked into it. However, the build environment should be sane to build them if you can figure out where to get them and what code you need to merge.
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.
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
I am experiencing some issues and have come for a bit of guidance.
Here are the steps I've done so far (I'm pretty sure I butchered it);
1. Downloaded CM source (repo sync and all that jazz)
2. source build/envsetup.sh
Here's where I begin making mistakes:
3. cd device/
4. mkdir lge
5. cd lge && git clone https://github.com/TeamRegular/android_device_lge_h631.git
So now I've got a folder with my device tree inside the LGE folder called android_device_lge_h631. I see no problem with that
6. sudo sh vendorsetup.sh && sudo sh
Both times here it throws an error about a missing directory called g4stylus (?)
7. Reboot computer because why not?
8. source build/envsetup.sh
9. lunch
select 41 (cm_h631_userdebug)
At which point it gives an error about there being no device and not being able to get device data from the cm repository (?).
I'm new so place work with me.
Where did I go wrong?
bradym512 said:
Where did I go wrong?
Click to expand...
Click to collapse
A meta-answer: Never post "I got an error about *something*". Always post your *exact* commands and the *exact* output that you got from running them (copy from the terminal window).
Also, if you use sudo anywhere in the build process, you're doing it wrong.