[PDroid] ICS/JB port of PDroid framework - LG Optimus 2x

For JB 4.2.1, see "OpenPDroid" thread by FFU5y
This is to port PDroid 1.32 source code to ICS and JB (4.1.2) in AOSP, CM, AOKP.
PDroid is the privacy protection framework (see svyat's PDroid thread). All the credit goes to svyat. I am just porting his source code to ICS.
I am using CM9/CM10 on LGE P990, and that is my platform of "development". All the credit goes to CM team.
Source code patch : http://code.google.com/p/pdroid/
Download : PDroid app on the market, https://play.google.com/store/apps/details?id=com.privacy.pdroid
Download : PDroid app (there is a direct download link at svyat's PDroid thread)
# Jellybean (JB can't find the app from market any more. use the direct link above)
Download : PDroid source code patch v1.32 for JB AOSP 4.1.1, http://www.mediafire.com/?cxe43zko42io4d6 (needs to split framework.jar into two files)
Download : PDroid source code patch v1.32 for CM10 (4.1.1), http://www.mediafire.com/?5ox50wyse49p32s
Download : PDroid source code patch v1.32 for CM10 (4.1.2), http://www.mediafire.com/?48bzsiufn74q7yo
# Icecream sandwich
Download : PDroid source code patch v1.32 for ICS AOSP 4.0.4, http://www.mediafire.com/?sjh8dmwcfbkeix8
Download : PDroid source code patch v1.32 for CM9.0, http://www.mediafire.com/?ikw8qxsvkmiglh2
# Gingerbread
Download : PDroid source code patch v1.32 for CM7.2 , http://www.mediafire.com/?ddfz9b3eihm4i9h
How to compile (simple) : it may potentially break git/repo
cd ~/android
repo sync -j16
patch -p1 < ~/build.diff
patch -p1 < ~/libcore.diff
patch -p1 < ~/frameworks.diff
. build/envsetup.sh
brunch <DEVICE_TARGET>
Click to expand...
Click to collapse
if your rom doesn't support brunch, then do lunch <DEVICE_TARGET> and then make otapackage
for building modules only you can do make framework core services
How to compile (under git)
# removing previous compile
cd ~/android; rm -rf out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/privacy/ out/host/common/obj/JAVA_LIBRARIES/layoutlib_intermediates/classes/android/privacy/
#[OR] cd ~/android; make clobber
# removing previous patch
cd ~/android/build; git checkout . ; git clean -df
cd ~/android/libcore; git checkout . ; git clean -df
cd ~/android/frameworks/base; git checkout . ; git clean -df
cd ~/android; repo abandon pdroid; repo sync -j16
# applying pdroid patch
cd ~/android/build; git checkout -b pdroid; patch -p2 < ~/build.diff;
cd ~/android/libcore; git checkout -b pdroid; patch -p2 < ~/libcore.diff
cd ~/android/frameworks/base; git checkout -b pdroid; patch -p3 < ~/frameworks.diff
cd ~/android; . build/envsetup.sh; brunch <DEVICE_TARGET>
Click to expand...
Click to collapse
see http://forum.xda-developers.com/showpost.php?p=31525268&postcount=662 for 65536 method limit in framework.jar
Current status:
it should compile normally. ( @hide added )
logcat shows some errors and exceptions. (possibly due to database api change)
this is a work in progress, and therefore it needs more thorough testing ... your contribution is greatly appreciated.
2012.04.06. updated to 1.32
2012.04.08. @hide added to PhoneStateListener public methods to fix AOSP 4.0.4 compile error
2012.05.07. CM9 patch updated to fix the error due to recent change in ActivityManager
Binary smali patch:
now we have a working smali patcher, see post #4.
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Development notes
dev note (suggestion/criticism welcomed)
ICS changed framework, substantially in frameworks/base/core/java/android/app/ContextImpl.java, in terms of how service is registered and how to access static outer context.
i added getStaticOuterContext() to address this issue. (any comment on it ?)
JB changed framework again, splitted frameworks/base/services/java/com/android/server/am/BroadcastQueue.java off frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
again, added mContext to store context in BroadcastQueue.java

CyanogenMod 9
the purpose of this kang is to test PDroid on ICS, not to provide another ICS rom for LG P990.
PDroid/CM9/P990 (2012.06.26.) : http://www.mediafire.com/?3o736y3qy2v81y8
known issues of PDroid
google map can still find your location by its own network location service.
(v1.32 fixes issues of alarm, yandex map, etc.)
known issues of CM9
web browser crashes upon rotation (flash libs.zip for a dirty hack fix)
no hardware acceleration support
no camcorder support
mobile data issue (mobile data is lost after a while)
change log
2012.03.20. fixed wifi DHCP renewal issue
2012.03.30. updated pdroid source to 1.32
2012.04.02. CM9.0 updated to android 4.0.4
CM9 other devices
the source patch in post #1 should compile for any device and CM9.
confirmed devices : i9100, nook color, crespo4g, p930, P1000/N/L, vibrantmtd(AOKP), fascinate (AOKP), Galaxy Nexus (AOKP)
blind build of CM9 for other devices (untested. i do not own these devices.)
Samsung Maguro : http://www.mediafire.com/?g7klyf5ccu21ptm
LGE P930 CM9 : http://www.mediafire.com/?ow1y71l9axopa57
LGE P999 CM9 : http://www.mediafire.com/?5hxkigwgo354jd4
also read mateorod's post for an easy instruction how to use botbrew ! (big thanks to mateorod and inportb, who developed Botbrew)

Other ROMs
other ROMs
auto_patcher
this patch has evolved to a more general one with a capability to patch many (pdroid & v6supercharger at the moment) at once. (see http://forum.xda-developers.com/showthread.php?t=1719408)
pdroid_patcher
latest version: alpha v0.5.0 patches 2012.06.16. (md5sum= d7f13959858795562ed8df82d04236a0)
it works on linux for CM9 and AOKP. (other ROMs coming later)
it also supports CM7 (and hopefully other GB ROMs as well)
credit goes to mateorod for patch and script, me for scripting, and svyat for this awesome work on PDroid 1.32
Prerequisite
1. set up linux vm if you don't have a linux machine
2. install the linux packages "jdk" (and "jdk-devel" depending on linux distro) if missing "java" or "jar" (openjdk works as well as sun java jdk)
3. install the linux command "patch" if missing (see below)
HOW TO PATCH: (linux only)
1. download pdroid smali patcher for linux (see above)
2. unzip
3. run it by "./pp/pdroid_patcher YOUR_ROM_ZIP {PATCH}" (optional argument PATCH if you need to specify which patch to use, where PATCH is cm9, aokp, etc.)
4. flash pdroid.zip with CWM to install pdroid patched framework (flash restore.zip if you want to revert back to original)
HOW TO VM see robjective's post http://forum.xda-developers.com/showpost.php?p=27241458&postcount=37
HOW TO INSTALL TOOLS if you encounter "Missing patch diff tools" error, see http://forum.xda-developers.com/showpost.php?p=26388234&postcount=422
Change Log (incomplete)
# 2012.05.00. (v0.1)
# ...........
# 2012.05.12. (v0.2) allows user to specify a different version of patches
# 2012.05.13. (v0.3.0) force "patch -N", remove temp upon failure, generate log output
# 2012.05.13. (v0.3.1) revised the generation of updater-script (SGS2)
# 2012.05.15. added AOSP patches
# 2012.05.15. added crespo-aosp patches, added device-specific patching if patch exists
# 2012.05.15. remove restore.zip upon failure
# 2012.05.15. (v0.4.1) added CM7 (GB) patches
# 2012.05.18. (v0.4.2) added checking for tool commands
# 2012.05.21. (v0.4.3) apply device specific patches only when specified, removed crespo-*.patch
# 2012.05.31. (v0.4.4) CM9 patches updated, crespo-asop-*.patch added
# 2012.06.04. (v0.4.5) added checking tools and rom, added aroma installer support
# 2012.06.15. CM9 patches updated
# 2012.06.16. AOKP patches updated
# 2012.06.17. (v0.5.0) patcher script restructured
edit: please feel free to post a link to your ICS ROM if you get it to work w/ PDroid

Hi.
Would the above zip work on CM9 on SGS2 (i9100)?
Thanks.

wkwkwk said:
Hi.
Would the above zip work on CM9 on SGS2 (i9100)?
Thanks.
Click to expand...
Click to collapse
source patch in post #1 should be able to compile into any CM9.

I have to compile the code directly on my phone haven't I?

ev!denz said:
I have to compile the code directly on my phone haven't I?
Click to expand...
Click to collapse
That is the only way for now.

Hi.
I've successfully compiled PDroid into CM9.
One question though. If I afterwards do a 'repo sync -j16', do I have to diff the files again?
I assume I have to if those files get updated but if they don't and I still diff them, the diff will fail and that's that, correct?
Thanks.

wkwkwk said:
Hi.
I've successfully compiled PDroid into CM9.
One question though. If I afterwards do a 'repo sync -j16', do I have to diff the files again?
I assume I have to if those files get updated but if they don't and I still diff them, the diff will fail and that's that, correct?
Thanks.
Click to expand...
Click to collapse
i am no expert of "git", but i guess "repo sync" will always revert all the changes you make.
i do it a hard way (i have a separate folder which is a shadow copy of repo sync'ed one.)
i'd appreciate it if someone can explain a clever way to "git" and "patch".
edit: would you mind telling people which device you compiled it for ?
edit: never mind. i saw your other post saying I9100.

I did a repo sync and then tried to apply the patch.
Diff said the files seem already patched so I left all of them alone.
I'm trying to recompile right now, although it's going to take a while. I'll let you know about the outcome.
Thanks for your work.

wkwkwk said:
I did a repo sync and then tried to apply the patch.
Diff said the files seem already patched so I left all of them alone.
I'm trying to recompile right now, although it's going to take a while. I'll let you know about the outcome.
Thanks for your work.
Click to expand...
Click to collapse
oh, i recall that if there was no change in those files in the repo, git will leave those files alone.
when there is a change in any files that patch changed, repo will complain and fail.
what i do then is delete those patched files, and repo sync again. re-apply patch after. (dirty hack, i know...)
edit: i would appreciate it if someone can post how to deal with git and manual patch elegantly...
edit: i guess one possibility is to treat the manual patch as a commit (git branch ics; git checkout ics; patch ?)

To start a new topic branch in repo, try "repo start pdroid --all". This create pdroid branch in all git repositories in the android repo. To switch back, "repo start ics --all" or whatever branch you were initially on. Make sure to commit your changes into topic branch before switching

I did what I could as far as patching the cm9 source with the linked files. I'm building on my Fascinate (Samsung galaxy S) and the app seems to be not letting me use it from the market, do I need a different apk or is it just not applied correctly?

Keithn said:
I did what I could as far as patching the cm9 source with the linked files. I'm building on my Fascinate (Samsung galaxy S) and the app seems to be not letting me use it from the market, do I need a different apk or is it just not applied correctly?
Click to expand...
Click to collapse
PDroid app is the same one. (As far as I know, svyat doesn't have a different version for ICS.)
Do you mean that you can't download PDroid app from market ? If that is the case, check out svyat's thread post #1. He has a direct link to the app. Could you elaborate your symptom more in detail ? I didn't understand it.

Hey pastime, I found this thread just right now - you managed to port it to ICS, well done, congratz
Won't use ICS untill full hwa is working in CM7 (aka LG releasing their ICS) but it's good to know I can continue to use PDroid then, found myself to really like it's functionality.

pastime1971 said:
PDroid app is the same one. (As far as I know, svyat doesn't have a different version for ICS.)
Do you mean that you can't download PDroid app from market ? If that is the case, check out svyat's thread post #1. He has a direct link to the app. Could you elaborate your symptom more in detail ? I didn't understand it.
Click to expand...
Click to collapse
No I could download and install, just when I went to use it it said that it didn't support ICS and closed on me. So the app was not working for me. Sorry for the confusion I re-read that and could barely understand it myself lol

Keithn said:
No I could download and install, just when I went to use it it said that it didn't support ICS and closed on me. So the app was not working for me. Sorry for the confusion I re-read that and could barely understand it myself lol
Click to expand...
Click to collapse
the app will say that if cm9 framework is not patched with pdroid framework.
do you see frameworks/base/privacy/ ?

Hey, this is great! I am in the middle of a build for my CM9 Nook, but as soon as it finishes i will try this! But it is gonna take some research on my end, I think. I have been building for several weeks but getting a successful build is about the extent of my abilities at the moment. I haven't cherry-picked, or added commits or anything like this. I guess I am about to learn!
Where do I put the downloaded patch in my build directory? Or is this a git branch you have already posted the source code to?
Sorry for so noob! I just need my hand held some, I guess.

mateorod said:
Hey, this is great! I am in the middle of a build for my CM9 Nook, but as soon as it finishes i will try this! But it is gonna take some research on my end, I think. I have been building for several weeks but getting a successful build is about the extent of my abilities at the moment. I haven't cherry-picked, or added commits or anything like this. I guess I am about to learn!
Where do I put the downloaded patch in my build directory? Or is this a git branch you have already posted the source code to?
Sorry for so noob! I just need my hand held some, I guess.
Click to expand...
Click to collapse
you can put diff files wherever you want.
just reference them when you do "patch -p1 < DIFF"
it is not going to be in git branch. (first of all, i am not the author of code, svyat is. i am a porter)
the author will post his (Froyo, GB) source code to a google site (soon).

Related

[HOW-TO] Dev basic´s: Source, Compiling, Github & co ~ Day 4

Welcome to fuss132 dev basic´s​
So you want to become a developer for android? You dont know where to start? Well, I will try to give you some point you can start with.
"There are many tutorials on compiling source code?", you may ask "So no need of this?". No, youre not right. Of course there are many how tos that explain you how to compile something... but to do the magic there is more needed than just "Execude this commands and ready". You need to know the things behind, you need to get the flair of android.
What I want:
First of all, I know that there are many people that see how devs are failing; or some that need help and those people cant help them. They have the time to learn something, but they dont know how. You can expect a point to start with, some welcome drink of android development. Expect the falir of android! Join the android open source project! I posted this in the I9100G section, because I use my kernel (called horsepower) as an example, but it can be used for every device! And please if I helped you thank me in whatever post I helped you I´m doing this in my spare free time to help you!
What I dont want:
I cant give you everything! You will need some time, it took me one and a half years to get to know a big part of how android works and stuff. You will not be a "full" developer after this! Furthermore, I dont teach you for 10 variants of my kernel coming up at the forum or of cm roms what ever! Android is an opensource project. This means creating something new - but together. If you did something you think its worth to publish make a git push request and your work will be included to my kernel f.e. Every dev that notice your work will let you post in his thread and your work will be thanked!
Also required for this howto:
A computer running ubuntu 12
Some basic ubuntu terminal knowledge
Time and more time
Also a good internet connection could be usefull
How it will work:
So you think you can manage this? Good luck, I will help you whereever I can. But please understand, that my work on kernels and roms will come first I will try to post every day a new tutorial. We will start with setting up your computer and will end up in some weeks with compiling your own aosp rom. Ready? So lets go to the second post here and start with Day 1: Introduction
PS: Well we only have one forum so, besides this fact that this is about learning developing, I posted it here...
Day one: Introduction and downloading source code
This is all for jellybean!
So no longer talking about developement, let´s do some of itselfe.
We first need the source code. For completeness we will download both - kernel source and main rom source. If you dont know what kernel is for please stop reading here... you will fail 99,9999%. (Maybe you just forgot which files this is for: Kernel is the boot.img in your update.zip´s and the rest located in /system is the compiled main rom.)
1. Creating your working directory and stuff
You should know the commands, just use the same folder names and structure for a better chance that I can help you if something goes wrong.
cd
mkdir cyanogenmod
cd cyanogenmod
Click to expand...
Click to collapse
2. Downloading the source and required software
At this part we use a very useful build script made by teamhacksung, thanks to them!
Staying at your /cyanogenmod folder do the following (What this git command mean ~ well dont think about it we will learn it afterwards):
git clone git://github.com/teamhacksung/buildscripts.git -b cm-10.1 buildscripts
ln -s buildscripts/samsung/build.sh
./build.sh prepare
Click to expand...
Click to collapse
This script will now do some very useful things for you Select the specifics of your system and wait for finishing till the point "Download sources?" Tipe a "y" and select "cm-10.1". (When it asks for your folder you want the source in only tipe "sources" and hit enter). This will download the main uncompiled canogenmod sources for you (including some kernel and device specific stuff). It will take looong Depeding on your net connection. Some hours usually
3. Downlading kernel sources and recovery stuff
Everything went well? So this means we need to go further. In /cyanogenmod/sources should now be some folders and files... And now we should download a kernel source for our device (choose one for your device, I will use I9100G ones).
Navigate to your source and execute
cd
cd cyanogenmod
cd sources
mkdir kernel/samsung/
cd kernel/samsung/
git clone https://github.com/fuss132/android_kernel_samsung_t1.git -b greenblob-4.2.2 t1
Click to expand...
Click to collapse
Hah, you now have latest greenblobkernel source on your computer.
But to finally build the kernel and rom we will also need some device specific files for our I9100G. For other devices you will find these files when you search on gitbub. Or google device xy ics device tree.
cd
cd cyanogenmod
cd sources
git clone git://github.com/CyanogenMod/android_device_samsung_i9100g.git -b cm-10.1 device/samsung/i9100g
Click to expand...
Click to collapse
As it finished you have all the sources you need
Thats enough for day one, I think. See you soon
Day 2: Github basics part 1
So we successfully downloaded all sources. Brilliant, now let´s go on. In future time you may work on kernels of even the main rom, and of course you should upload the changes you made to contribute to the community. You will need github for this. For some basic info go here I will only focus on how to use it.
The script from above post should already installed git, if not do the following:
sudo apt-get install git
Click to expand...
Click to collapse
And you should also register an account for free at github.com -> here
As you did this we will also need to set up your github account on your computer, so use the following commands and replace it with the email adress and username you chose before:
First we should be in our kernel example local repository so use cd /cyanogenmod/sources/kernel/samsung/t1 to switch to it
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
Click to expand...
Click to collapse
If you now upload some changes you have to enter your password every time. To make the things easier we will use an ssh key and will add it to our github account. Its not important to know what all these commands are doing just do them
ssh-keygen -t rsa -C "[email protected]"
//Now you need to enter a passphrase.
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub <- this is the path to your stored key
Click to expand...
Click to collapse
Now go to https://github.com/settings/ssh, login and click "add ssh key". Choose a name (doesnt matter which one) and paste your key from your clipboard into the field below. Thats it github is now set up
1. Some basics commmands
There are some basic commands you should know. Firstly, some explanations for you. The source you downloaded is stored on www.github.com.
With git clone [email protected]/pathtsource you can download new files and sources from existing repositorys.
When you change some files in your local repository (all files from one source path f.e. cd /cyanogenmod/sources/kernel/samsung/t1 and then execute and then) use git status to display the changes you made.
You made some changes? Then pack these changes into a commit by typing git add -A and also add a commit message that will appear later like git commit -m "Camera freeze fix" and finally upload it: git push. We will make some practical examples tomorrow, so dont worry about this now. Just keep that in mind.
Thanks for reading and see you tomorrow!
As usuall, if you like this thread and stuff please submit it as news tip!
Day 3: Github basics part 2 and preparing for compiling
Welcome to Day 3: Github basics part 2 and preparing for compiling! Lets beginn our "session" with a short test. Remember which command you have to use for cloing a repository (downloading the files to your computer)? Well we need this one here.
1. Again Github basics
Imagine the following situation; You want to help another person to fix a bug. You should create your own repository first to dont mix files up. In short we copy all files from a repository to our own new one. We have a point to start then and will use his code, but his code wont change when we change ours.
Go to www.github.com/ and login
I create a short repository for you all, nothing special but you can practise with it.
Open the following page (its the repositiory shown in your webbrowser: https://github.com/fuss132/lerninggit_practical_repository. Click on fork at the right:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If github is asking you to which user it should fork the files click the only availabe button ^^
You have now your own repository with the same files. We will download the files now. Open your terminal and navigate to the folder (it should be an empty one). So you have to do the following:
cd whereeveryyouwantit
git clone [email protected]:[B]yourusernamehere[/B]/lerninggit_practical_repository.git
Click to expand...
Click to collapse
Now we "fix the bug" and do some changes to your local files.
cd tutorialmembers
sudo gedit memberlist
// add your name to the list, save and exit //
cd ..
Click to expand...
Click to collapse
So we made the changes, now we will upload them, you should know the commands already. If you have any questions please post in this thread
git status
git add -A
git commit -m "add my name to the list"
git push
Click to expand...
Click to collapse
Brilliant, if you know visit https://github.com/yournamehere/lerninggit_practical_repository you will see that your changes have been uploaded. So you fixed my problem, you should now share the solution with me.
Open your repository in a webbrowser https://github.com/yournamehere/lerninggit_practical_repository and click on Pull Requests on the right side. Now select on the right side as head repo mine fuss132 one and as base repo in the left the default, your one. Describe what you did in the filed below and finally click on "Send pull request.
Thats it you now shared it with me and I will include your changes to my repo
2. Back to the roots: Prepare for compiling
Now cd to the folders you downloaded all the sources in. You should see folders like bionic, fendor, main... I will call this main source directory now
If you would compile the sources now you would stuck after some seconds Android needs a special java version for building. And this one cant be downloaded anymore. Well, bad situation... We will give up here we will never compile android :'(
Ok, **** you java we will rule you
There is an error only because the build system does not recognize the java version when it is an openSDK
$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
To work around it, you can just comment out the following lines in build/core/main.mk:
cd build/core/
gedit main.mk
instead of
ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
java_version :=
endif
there should be
# ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
# java_version :=
# endif
Click to expand...
Click to collapse
Java is now no longer checking its version and everything is working. Stupid solution, but working
The second part is that the linker would complain that it cannot find -lGL .
The workaround for it would be:
just execute this line:
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
Click to expand...
Click to collapse
The last thing what we need is again the buildscript file, just do the following (you dont have to remember this):
// be in the main directory of your sources //
gedit build.sh
copy all lines from https://github.com/teamhacksung/buildscripts/blob/ics/samsung/build.sh and paste them into your file
save and close
in terminal: chmod 777 build.sh
Click to expand...
Click to collapse
Thats it for today, thanks for reading! Please press thanks if you like it and maybe click on "newsworthy thread". Questions, as usuall in this thread please
Day 4: Compiling your first things and looking into the source code
It´s been a long time since we met the last time, I hope you didnt forgot everything. If you did - you know - just go to through the first posts and learn again. Sorry that it took so long for you to wait, but I´m writing this in my spare free time and I´m involved into many many projects at this time that are more important that this one. But I didnt forget you! So lets go in again and start coding!
1. Going through the source code
I know, I turned things around in the title of this thread, but compiling will take a very long time so lets go through the source code first.
Open a file explorer and navigate to your root forlders. You will see there many folders. As you all know, Cyanogenmod is a Custom Rom and adds much features to your devices, thats why they are using custom product configs. One for each phone and one for all phones.
Let´s go into the folder vendor/cm. You will see a file called "vendorsetup.sh" in which all available devices are written in.
Ok, you will wonder why theres only something like this in your folder if you downloaded the sourcecode for Cyanogenmod 10:
for combo in $(cat vendor/cm/jenkins-build-targets)
do
add_lunch_combo $combo
done
Click to expand...
Click to collapse
Because since cm10 they´re doing things a bit different. In the next few days we will download the aokp source code and start porting aokp to a new device, because aokp is using the old building system like in cm9 and previous version - and I want that you know all of them. So back to our cm10 thing: All product specific files are now directly in the source code of the device, the device tree. Its the one we downloaded and stored in /device/samsung/i9100g.
But to build a fully working Cyanogenmod Rom we need more that only te device tree, we need some proprietary files from your device. In short, they are files that are very device specific like camera.t1.so (a camera module only for our device) that is pre generated and could not be build by our system. (Thats also the reason why developers cant edit it. We are not able to edit it, too). To pull all those files from your device, please connect it and be sure that you are already running a cyanogenmod 10 rom, otherwise some files might be different and not be copyed - your rom will not be successfully build.
Open our terminal and execute:
Code:
sudo bash
cd cyanogenmod/sources/device/samsung/i9100g
chmod 777 proprietary-files.sh
./proprietary-files.sh
Using adb all the files are now being pulled from your device and stored in the right directory of your system. If you successfully did this (and I didnt forget something) we should be now able to compile our own cyanogenmod rom.
2. Compiling your rom
So let´s go! (We will update the sourcecode before again, maybe some cool things changed). We will not use the build script for this, we´re doing things "oldschool". If you want to make things as easy as possible do ./build.sh i9100g and everything will be done for you.
sudo bash
cd cyanogenmod/sources
repo sync
/* start building*/
. build/envsetup.sh
lunch
/* pick the device you are building for */
make bacon or make fullota or make -jx (where x is the number of your cpu cores)
Click to expand...
Click to collapse
And now we have to wait some hours depending on your computer. I´ll catch you guys in the next tutorial!
Please press thanks and submit this thread as newsworthy one! Thank you and have a good time
First page of the thread!
This post also...
3 left if my math education not failed
Oh no, it was just one... hmm thats why I want to became a computer scientist not a mathematician ^^
newsworthy thread
@fuss
Submitted as newsworthy thread . Guys pls do the same if its useful to u guys . First to comment n ur thread
+1 will wait time after time..
Good one Fuss Should be recommended to make this sticky once you complete the tutorial.
This happens when fuss is in playful mood...lol.. hoping to see more of it..... I have already built a rom...its a modified stock rom...but I am failing to compile and decompile systemui Apk...using apktool..I tried installing framework-res apk...but eventually found out that apktool won't work for ics...so any help from your side is appreciated...
Sent from my GT-I9100G using xda premium
Wow very useful ty fuss
Sent from my GT-I9100G using xda app-developers app
seriously long thread..
pergh....
Will wait for this guide! Very usefull!!!
Kingspp said:
This happens when fuss is in playful mood...lol.. hoping to see more of it..... I have already built a rom...its a modified stock rom...but I am failing to compile and decompile systemui Apk...using apktool..I tried installing framework-res apk...but eventually found out that apktool won't work for ics...so any help from your side is appreciated...
Sent from my GT-I9100G using xda premium
Click to expand...
Click to collapse
Use apk-manager or the latest smali and baksmali binaries.
Added Day 2: Github basics part 1 to todays agenda
superatmos said:
Use apk-manager or the latest smali and baksmali binaries.
Click to expand...
Click to collapse
Thanks for the reply.... I will try and use smali and baksmali...since apk manager did not work...
Sent from my GT-I9100G using xda premium
Awesome guide you are doing here! Cannot wait to see how it continues today. Big thumbs up for this mate!

[DEV] ICS CM9 && MIUI CM9 for HTC Desire C [updated 19.Apr.2013]

CM9 4.0.4 ICS HTC Desire C (Ice Cream Sandwich)
Here is development thread for Desire C
I'm not responsible if you do something wrong to your phone using this rom, so you doing that on your own risk!
Currently working and not working:
What works:
Auto-brightness
Bluetooth
Browser
Keyboard
Overclocking
Phone radio (calling, sms, data)
Sensors (light, proximity, rotation, acceleration)
Superuser
Touchscreen (with multitouch)
Vibration & Haptic feedback
Gallery
Hardware acceleration (EGL)
Live wallpapers
Screenshots
Screen off/on animations
Wallpaper scrolling
bootanimation
Audio (not full working, need some fixes)
CM9 ramdisk
Camera
What not working:
WIFI
Everything other is untested!
What working but not good:
everything other is untested
IMPORTANT !!!
Somehow boot.img can not be flashed without "fastboot", I tried using dd, using recovery, using some other tools... it can not be flashed this way!
To get everything ok and corectly for CM9 you need to flash these boot.img from these zip using fastboot !!! Its only a way!!! So after installing rom (or before installing the rom), reboot phone to the bootloader, flash boot.img this way:
fastboot flash boot boot.img
Its reguired because audio and other things not working if you not flash boot.img !!!
Google Apps for Ice Cream Sandwich:
You can find it here -> http://goo.im/gapps/
My android git for Desire C: https://github.com/munjeni
If you like my work and if my hard work on this device helped you to get something better, please give full credits "at least" to my hard work, thanks! If you use source code from my git please do not miss my name in your post, thank you! Happy porting!!!
IMPORTANT if you compiling CM9 from source!!!
Double check build.prop because some lines is replaced by new line, so you need to back these new line into original line, if you not do it you will get boot loop! Its easy for figuring out, simple open build.prop file and fix these lines, its something like:
ro.ril.blablabla
1,15 US
ITA
blabla
but need to be in one line like this:
ro.ril.blablabla 1,15 US ITA blabla
Kernel: kernel is Htcdev stock rom source code.
https://github.com/munjeni/kernel_htc_golfu
Download rom - 19.Apr.2013.:
Sorry I deleted file acidentaly... if some one have mirrired link please pm me!
Thanks:
Qualcomm for userspace drivers!!!
CyanogenMod Team
cute_prince
cm2pico
speed_bot
Pico devs for audio lib
MIUI rom based on my CM9 rom
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
IMPORTANT !!!
- Somehow boot.img can not be flashed without "fastboot", I tried using dd, using recovery, using some other tools... it can not be flashed this way!
- To get everything ok and corectly for MIUI you need to flash these boot.img from these zip using fastboot !!! Its only a way!!! So after installing rom (or before installing the rom), reboot phone to the bootloader, flash boot.img this way:
fastboot flash boot boot.img
Its reguired because audio and other things not working if you not flash boot.img !!!
- Do not install superuser or any other permission tool because MIUI have his own security feature Superuser, Supersu...etc will break compatibility and other apk will not work corectly!
- To get MIUI security feature working you need to give and remember permissions to the MIUI LBE guard (it will enable byself), but to invoke these settings menu you need to initiate these menu by settings submenu (cpu control)... run cpu control from setting menu, you will be prompted for root permissions, enable root permissions, open again cpu control submenu and apply for example an cpu frequency, you will be prompted for root permissions, aply them, reboot phone, after next boot you will be prompted for LBE guard security, APPLY AND REMEMBER permissions for LBE, reboot phone and you are done! After this settings your root permissions manager, startup manager...etc and everything other which using LBE feature will be full working now!
Download rom:
Unofficial_MIUI_GOLFU_1366462688.zip
Source code:
https://github.com/munjeni/miui_sony_xperia
Initial patch for Desire C is done, git for MIUI is updated, almost everything working in MIUI rom but have some small bugs... you can fix all other bugs! Happy porting!!!
Oh yeah, flashing this right now. i'll try to help.
No responses? ...I will sell this phone now
munjeni said:
No responses? ...I will sell this phone now
Click to expand...
Click to collapse
Give it time, its still a very new device.
If I had the technical knowledge I would definitely offer my help, but unfortunately, programming with linux/android is beyond my ability.
The wildfire s was also very slow to receive development for some time after its release, but now its buzzing with both cm9/10.
Whatever you decide is best for you Munjeni, we do appreciate all your efforts mate:thumbup:
Thanks for the share.. works great.
yeah man, i didn't have the ability to work with android and linux too... sorry !
but i'm a very good tester haha, only things i really need to work right now it's the wifi.
Appreciate the work. Hope this can be further progressed.
I'm not great with linux and porting, but I hope theres others who can help out.
I would like to help, but I don't know how to port sense 2.1 and 3.5 for our device.
Sent from my HTC Desire C using xda premium
Munjeni,
would it be useful to use some of the sources from the HTC explorer/pico, its using the same cpu. I'm not sure about the other hardware, board or radio etc.
Here's the thread link: http://forum.xda-developers.com/showthread.php?t=1821582
The guys github might be useful.
keep it up! thank you
intel007 said:
Munjeni,
would it be useful to use some of the sources from the HTC explorer/pico, its using the same cpu. I'm not sure about the other hardware, board or radio etc.
Here's the thread link: http://forum.xda-developers.com/showthread.php?t=1821582
The guys github might be useful.
Click to expand...
Click to collapse
Thanks, will try to build audio libs from explorer. Wifi chip is diferent in desire but I have idea how to fix it... new build will be soon! Did you tested gps?
Edit:
I'm unable to get audio and wifi, still have no idea which audio libs is inside stock rom (is it qdspv2 or what??), I just wont to compile it from source! About wifi, I have compiled/tried many compact wireless modules in combination with compiling/configuring it with android source and still no way/idea how to fix it (with every compiled modul I am unable to find/create wlan0 still only sucess if I use at6kl_sdio.ko from stock rom but unable to fix wifi...). Do you have idea/link to source for sdio version of the Atheros 6kl modul, I am unable to find it, only I have found ath6kl without _sdio prefix... ??? Any info will help me! Why these s**ts is harcoded in Desire C... very stupidly and boring thing that we need hard work to get this s**t working. but CM9 and Jelly Bean is very fast and smooth in Desire C ! I am unable to sell this phone (do it mean it is realy an s**t phone...?? I think too! Missing compas, mising camera autofokus, mising button backlights (very strange that htc selling this phone without lights for butons), its 600mhz only...etc) so I will leave this development for sure when I buy an another phone in next few weeks (what you mean about Sony Xperia Go 1ghz dual core, display 3.5inch, cam autofocus, blic!...etc???)! If you need cm9 source three let me know!
@Munjeni
This helped me to link a modfied kernel to get the wifi working on differents roms. Not sure if this is what you need.
In the About phone information of the rom, it looks like:
2.6.35.7-ge382d80
[email protected]
The important part above is -ge382d80, and we have to reference this when compiling the kernel. Make sure the part preceding -ge382d80 does match the output of the following command:
$ make kernelversion
The trick is to write that -ge382d80 in a .scmversion file in the kernel source tree (obviously, you need to replace -ge382d80 with whatever your device has):
so in the root of the kernel source type
$ echo -ge382d80 > .scmversion
This may work if you are having problems with wifi. If you need me to compile a kernel with your version reference let me know; just post this from the cm9 rom - 2.6.35.7-ge382d80
[email protected]
If you do move on with phones, please post the CM9 source, hopefully others can help too.
info from http://glandium.org/blog/?p=2214
Thanks, but dude, first, we speaking here about CM9 android, not about stock android. I speaking here about enabling wifi under CM9 only! But about stock rom and wifi you no need to hack kernel in order to change version, you have a better way to do that, you just need to edit golfu_defconfig, change version string, and you can compile kernel that will have the version like stock kernel...its not problem...I know that allready! But wifi under cm9 not working now! Problem is why these wifi libs/firmwares/modules is hardcoded and why missing from public kernel source! It mean its not part of the golfu kernel, its part of compat wireless source and wifi module is compiled from there!!! I tried many compact wifi modules to compile from source but still no one working... unable to enable wifi from android settings menu... I think there is something hardcoded in ramdisk init (binary) because cm9 init binary could not giving cm9 rom to boot! So "init" is allso hardcoded! I got wifi (not stock modules) working but only manualy init! Still wifi enabled from android settings menu could not be enabled and I have no idea why! I found ideal kernel wifi "sdio bassed" source for our desire c but these kernel is 3.6 and ath6kl module reguire a lot of works if we want to port it to our kernel, still unable to compile! But I found compat wireless but on my look into source I am unable to find compatible ath6kl source for example I am unable to find sdio bassed source "ath6kl_sdio" that have definitions "path to firmwares" inside core.h:
Code:
/* AR6003 3.0 definitions */
#define AR6003_HW_2_1_1_VERSION 0x30000582
#define AR6003_HW_2_1_1_FW_DIR "ath6k/AR6003/hw2.1.1"
#define AR6003_HW_2_1_1_OTP_FILE "otp.bin"
#define AR6003_HW_2_1_1_FIRMWARE_FILE "athwlan.bin"
#define AR6003_HW_2_1_1_TCMD_FIRMWARE_FILE "athtcmd_ram.bin"
#define AR6003_HW_2_1_1_UTF_FIRMWARE_FILE "utf.bin"
#define AR6003_HW_2_1_1_TESTSCRIPT_FILE "nullTestFlow.bin"
#define AR6003_HW_2_1_1_PATCH_FILE "data.patch.bin"
#define AR6003_HW_2_1_1_BOARD_DATA_FILE AR6003_HW_2_1_1_FW_DIR "/bdata.bin"
#define AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE \
AR6003_HW_2_1_1_FW_DIR "/bdata.SD31.bin"
If you help me to find compat wireless source that have definitions for path to firmwares than I will maybe fix wifi! I no want "stock" files, I just want to compile custom from source!
Other problem:
Android source code (cm9, jelly bean) allso mising something about ath6kl thing! For example, found all references about ath6kl with "all paths to"... see here -> http://paste.ubuntu.com/1187235/ ...expecialy this line:
Code:
/./system/lib/libhardware_legacy.so:ath6kl_sdio
so what these LINE mean? These line mean that ath6kl is referenced too in android source code (libhardware_legacy folder !) and allso hardcoded for our desire c because libhardware_legacy inside CM* android source code missing these ath6kl things! So we have BOOTH problem/missing source code for ath6kl_sdio in android and in kernel for our desire c wifi and we first need to find them, import them into android source, import them into kernel source, and finaly compile...
About audio:
I have absolutely no idea which source code is used for compilation for desire c ... its like another hardcode We probably can use audio libs from stock rom and fix some errors/mising lines in cm9 framework to get these libs working, now I have "SIGSEGV" with these libs! I have no idea, generic audio libs compiled from from cm9 source code not working, I am unable to fix it, its very annoying and hard !
Edit:
Possible solution for android only -> https://github.com/vegaics/libhardware_legacy/blob/master/wifi/wifi.c this need to be modified for Golfu
Guys, I sold my Desire, I will not continue developing for this phone so I will upload cm9 source tomorow on my git so you can finish them, sorry and happy porting!
Thanks for your work. I don't know enough about linux to help with the porting. Hope some others are out there to continue
Link to my Desire C android source code used for this build is here -> https://github.com/munjeni so if you like my work and if my hard work on this device helped you to get something better, please give full credits "at least" to my hard work, thanks! If you use source code from my git please do not miss my name in your post, thank you! Happy porting!!! :good:
Thanks munjeni, good luck with your future developments mate:thumbup:
I'm gonna start learning some of this development stuff for future projects, I have an upgrade in a month or two so I'll wait till then before I start messing with my phone, don't wanna be left phoneless.
I'm sure development will pick up soon guys, this is still a pretty new device, and I'm sure experienced devs will arrive soon (fingers crossed)
This would be an even greater/faster device with cyanogenmod and little bump to the cpu frequency.
It has great battery life, even in comparison to my sons s3 and my brother's too, which is a great feature for any recent smartphone.
HTC Desire C uses MSM76XXA Audio libraries .. since munjeni left the project, if anyone else is interested i will share the source
here's a mirror to the download above with the stock ROM files already added http://www.filefactory.com/file/4sc9kje5y6cx/n/cm9_golfu-ota-eng.root.zip

[DEV] How to build CM10.1 (Android 4.2.1) for the LG-P990 O2x

Build your 'own' CM10.1 ROM (Android 4.2.1) today!
Revision V1.3 2013.01.09 Updates: No more patching needed. local_manifest.xml updated to new branch revision. Text updates.
Revision V1.2 2012.12.13 Updates: Repo sync branch finally changed from mr1-staging to cm-10.1. Thanks HerrKuk.
Revision V1.1 2012.12.11 Updates: New Patch: WiFi shows networks, BT works, audio.h reworked, notification lights are back, USB mass-storage support included. Compatible to V30A Kernel.
Revision V1.0 2012.12.01 Initial release
Thank you note: Thanks to Ricardo Cerqueira for his work on this device.Thanks to marsgod for BT and WiFi patches/tips.
General note: Please keep in mind that CM10.1 is still experimental. This guide is for those who cannot wait...
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Preparation
What you need:
You need a fully working build environment. If you don't have one running already, you can follow my guide in the other thread to get a fully working environment under Ubuntu 12.10 64bit. Follow the easy steps in the guide. Make a test build with CM10 to see if it is working. Then you will be ready for the next step.
Your build environment is now set? Good, let's start!
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
Get the sources
Start with creating a new working directory for CM10.1:
Code:
$ mkdir ~/cm10.1
$ cd ~/cm10.1
Initialize Repo for Android CM10.1 (Android 4.2.1):
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and enter your credentials if needed.
Download the sources:
Code:
$ repo sync
Wait until it's finished (takes a lot of time!).
If the process hangs use Ctrl+C to break out of it and resume the download with another
Code:
$ repo sync
Initialize the environment
Code:
$ . build/envsetup.sh
Obtain the proprietary files:
Create a file with the name local_manifest.xml in the .repo directory to add additional sources. To see the hidden .repo directory, you have to press Ctrl-H in your file manager.
Create the xml-file with
Code:
$ gedit ~/cm10.1/.repo/local_manifest.xml
20130109: Update! New branch revisions!
Paste the following lines to the editor
Code:
<manifest>
<project name="TheMuppets/proprietary_vendor_lge.git" path="vendor/lge" remote="github" revision="cm-10.1"/>
<project name="CyanogenMod/android_device_lge_p990" path="device/lge/p990" remote="github" revision="cm-10.1"/>
<project name="CyanogenMod/android_device_lge_star-common" path="device/lge/star-common" remote="github" revision="cm-10.1"/>
<project name="CyanogenMod/lge-kernel-star" path="kernel/lge/star" remote="github" revision="cm-10.1"/>
</manifest>
Save the file.
Run another
Code:
$ repo sync
Download the necessary prebuilts from cyanogenmod by running
Code:
$ ~/cm10.1/vendor/cm/get-prebuilts
Ok. That's done!
Patching
20130109: Thanks to Ricardo Cerqueira's Update to the CyanogenMod repos there is no more patching needed!
Only for those who have patched the sources before and want to build with the new sources. If you are new to this skip the 'Patching' part and go to 'Build the ROM' directly.
If you have patched/changed the sources and want to get up-to-date, here is what you can do:
change the local.manifest.xml file that it looks like the one you see above
delete all the directories inside your ~/cm10.1/ directory but keep the hidden .repo directory
repo sync now and the missing files will be downloaded and the whole structure will be recreated without redownloading the repos you already have
get the prebuilts with ~/cm10.1/vendor/cm/get-prebuilts
and this is it, just brunch p990 again
Build the ROM
Code:
$ repo sync
$ brunch p990
and flash it via CWM. Make a clean start (if necessary) with format /system, wipe data/factory reset, etc..
Have fun!
FAQ
Revision V1.5 20130110 New GAPPS, now without the nasty force closing AOSP keyboard 'bug'
Revision V1.4 20130109 Sections updated: bootloader section, Baseband section, partition size, mass storage mode. Sections removed: building smaller ROMs, mobile data connection, Flight mode, WIFI & BT
Revision V1.3 20121214 Updates: New GAPPS from 20121212
Revision V1.2 20121211 Updates: Bluetooth working, WiFi Networks showing and more. Plus typo fixes.
Revision V1.1 20121206 Updates: Partition size, swapping internal/external memory, USB mass-storage mode.
Revision V1.0 20121201 Initial release
Thanks to key.ita, XXMrHyde, tonyp, Custom40 and marsgod for their contributions to this FAQ.
Where are the Google Applications - GAPPS?
Get the fixed GAPPS here. Fix: The 'bugged' gesture typing is disabled. That's due to Tegra2 which isn't supporting NEON instructions. With the fix you can use the keyboard as usual without force closes.
Or you can get the 'original' GAPPS from 20121212 for 4.2.1 here. Download and flash them via CWM.
The keyboard is force closing all the time. Is there a solution?
Yes. Just flash the fixed GAPPS over your installation via CWM. The gesture typing will be disabled but you can use the AOSP keyboard then as you used it in the previous versions. It's up to you but now you can disable the useless gesture trail, dynamic floating preview etc. under 'Settings>>>Language & input>>>Android keyboard AOSP>>>Enable gesture typing'. Then remove the tick from 'Enable gesture typing' and you are ready to use the AOSP keyboard without any problems.
What bootloader should be used?
You have to use the old bootloader.
Any Baseband recommendations?
I am using the 30B Baseband. You can find it in tonyp's Baseband thread under 'ICS Basebands'. But it is working with other BBs like V20L as well.
[/I]
What about the partition size? Will this ROM (including the GAPPS) fit in the old partition layout?
Yes, it does. Some files get copied to /data so the ROM plus GAPPS fit the old partition size completely.
The 'Developer options' from 'settings' are gone. Where are they?
Touch the 'Build number' seven times in 'about phone'. Then they will appear.
How do I use the external SD-Card as the internal memory (swap SD-Cards)?
Edit the 'vold.fstab' file on your phone under 'system/etc/' and change the lines to:
Code:
dev_mount sdcard /storage/sdcard0 auto /devices/platform/sdhci-tegra.2/mmc_host/mmc1
dev_mount emmc /storage/sdcard1 9 /devices/platform/sdhci-tegra.3/mmc_host/mmc0
If you want to use it permanently on your building system and in every ROM you make then edit '~/CM10.1/device/lge/p990/vold.fstab' and use the both lines above accordingly.
I want to transfer files from/to the phone via USB. How do I turn on the mass-storage mode?
Use the terminal on the phone or use adb shell:
Code:
su
setprop persist.sys.usb.config mass_storage
And reboot. When you use your Computer's USB connection the next time, Android will ask you whether you like to switch on the mass-storage mode.
I want to use the mass-storage mode in my builds. What can I do?
I included it in the ROM building process by editing "~/CM10.1/device/lge/star-common/star.mk'. At the very end of the file you find the line 'persist.sys.usb.config=mtp'. Change it to 'persist.sys.usb.config=mass_storage'. Next time you build a new ROM the mass-storage mode is included. Tip: if you are updating your ROM then sometimes you have to make the switch manually (one time only!) as described above to initiate the change.
Are there any other problems?
I think it is awesome!!! Very fast, nice camera, same energy usage as CM10. I am using it as my daily driver. (well, since Nov 28 now... :fingers-crossed
Please build CM10.1 yourself and test it thoroughly. Maybe we can remove some of the remaining problems together.
Reserved for future use
nice guide :silly:
mivv a lazy one....
Are the sources downloading fast? I didn't try Paranoid... You said few coffees... I think I drank a bucket of coffee and it still wasn't there = went to sleep
I'll try, Although I am busy with my pi... that sdcard corruption bug with OC driwes me crazy, I guess I'll ssh my kitchen PC too do something in parallel...
Does this build has the call bug or it's like Benee's hackfest free of it?
and Raum1807 does HW acceleration work?
Will do this guide next week. Just finished REMICS TOUCHWIZ UX now released for everyone. Then Motorola UI... So next week I'll have time
Sent from my Xoom using XDA Premium HD app
Might give this a go myself, but as you said, it's still in pretty early stages of development.
Thanks for the useful guide though
Shouldn't the file's name be local_manifest.xml?
I.e.
Code:
$ gedit ~/cm10.1/.repo/local.manifest
needs to be changed into
Code:
$ gedit ~/cm10.1/.repo/local_manifest.xml
in order for it to work. Right?
svante38 said:
Shouldn't the file's name be local_manifest.xml?
I.e.
Code:
$ gedit ~/cm10.1/.repo/local.manifest
needs to be changed into
Code:
$ gedit ~/cm10.1/.repo/local_manifest.xml
in order for it to work. Right?
Click to expand...
Click to collapse
Of course. Corrected it. Thanks!
puma99dk| said:
Does this build has the call bug or it's like Benee's hackfest free of it?
and Raum1807 does HW acceleration work?
Click to expand...
Click to collapse
HWA is working. It is basically running like CM10.
The call bug hasn't occurred to me (yet). But I think it is the wrong name anyway: in my opinion it is an microphone/audio bug.
In this ROM the RIL and audio are a bit different. So maybe this bug isn't there. But this is a good reason why I would like to see more people building and testing CM10.1.
Raum1807 said:
Of course. Corrected it. Thanks!
Click to expand...
Click to collapse
Also, looking at your patch, it seems to point to directories on your local machine:
Code:
/home/ac64/cm10.1/...
Shouldn't this be changed to:
Code:
~/cm10.1/...
In order for it to work on all computers?
Can someone upload a build of this?
Sent from my LG-P990 using xda app-developers app
svante38 said:
Also, looking at your patch, it seems to point to directories on your local machine:
Code:
/home/ac64/cm10.1/...
Shouldn't this be changed to:
Code:
~/cm10.1/...
In order for it to work on all computers?
Click to expand...
Click to collapse
By applying the patch with the "-p 4" argument, the first 4 "parts" of the path will be ignored,
by typing:
Code:
cd ~/cm10.1
patch -p4 < CM10.1_building.patch
the path will be "set" correct.
It`s a better to do it this way, so the patch is working also if your path to your repo is different,
e.g. your repo path is CM10.1/android/system/
you have to type:
Code:
cd ~/cm10.1/android/system/
patch -p4 < CM10.1_building.patch
But you can change the path in the CM10.1_building.patch to ~/CM10.1...
but in this case, you have to change the -p4 argument to -p0, or just apply the patch without -p argument
XXMrHyde said:
By applying the patch with the "-p 4" argument, the first 4 "parts" of the path will be ignored,
by typing:
Code:
cd ~/cm10.1
patch -p4 < CM10.1_building.patch
the path will be "set" correct.
It`s a better to do it this way, so the patch is working also if your path to your repo is different,
e.g. your repo path is CM10.1/android/system/
you have to type:
Code:
cd ~/cm10.1/android/system/
patch -p4 < CM10.1_building.patch
But you can change the path in the CM10.1_building.patch to ~/CM10.1...
but in this case, you have to change the -p4 argument to -p0, or just apply the patch without -p argument
Click to expand...
Click to collapse
Oh I see. Thanks for clearing that up.
Thanks OP for the building instructions too, teaching people to fish instead of just providing them one!
Raum1807 said:
HWA is working. It is basically running like CM10.
The call bug hasn't occurred to me (yet). But I think it is the wrong name anyway: in my opinion it is an microphone/audio bug.
In this ROM the RIL and audio are a bit different. So maybe this bug isn't there. But this is a good reason why I would like to see more people building and testing CM10.1.
Click to expand...
Click to collapse
I highly doubt a magic fix
Sent from my Optimus 2X using xda app-developers app
Custom40 said:
Might give this a go myself, but as you said, it's still in pretty early stages of development.
Thanks for the useful guide though
Click to expand...
Click to collapse
if you get it done, please share
last i have test a CM10.1 from EaglesBlood and there work no camera and BB28g has no Signal... would in this CM10.1 all fixed??
See the Screenshots in post #1, signal is working,
just building CM10.1, will report if camera is working
MetaIIica said:
last i have test a CM10.1 from EaglesBlood and there work no camera and BB28g has no Signal... would in this CM10.1 all fixed??
Click to expand...
Click to collapse
EaglesBlood is not CM, its based on AOSP.

[GUIDE] Understanding and using Gerrit [Easy+Explained]

So, what happened to me in the past few days was that, I had to submit few patches to gerrit, and I had no idea what to do, where to start, and everything that runs in the mind of a person who first uses gerrit. One simply doesn't gets the whole knowledge he needs to use gerrit at one place, so I decided to make it, so it could be easier for the new users. ​
Click to expand...
Click to collapse
So firstly, I'll explain few terms that are important for you to learn before going towards a bit tricky side. ​
Git - To be precise, git is a code-sharing website/software that allows you to share your project resources you can 'Make Software, better, together'(That's what the tag line says )!
Now, before I go to gerrit, read this: Major Open Source Projects, like, CyanogenMod, AOKP, OmniROM etc. don't directly accept pull requests and in case you want to make a change in their source for a fix/feature or anything, you need to send them patches over gerrit which are then reviewed by the trusted members of the community and if they find it valuable enough, gets merged into the git repository!
Gerrit(Copying the definition from Wiki) - Gerrit is a free, web-based team software code review tool. Software developers in a team can review each other's modifications on their source code using a Web browser and approve or reject those changes. It integrates closely with Git, a distributed version control system.
So, now, git and gerrit are so closely related, that a patch verified over gerrit can directly be merged on git without much hassel, also please note that your gerrit and git username must be same.
Pull Requests - Pull requests are sent over Git after you fork a repository, make some changes into it and then want the owner to merge those changes into his repository, and that's how community development and Open Source works.
Patches - In simple terms, any changes you make to repos of Open Source Projects like CM or AOKP and send them over gerrit for code review are called Patches.
How GERRIT works?! ​
Now, Gerrit is deployed in place of this central repository and adds an additional concept, a store of pending changes. Everyone still fetches from the authoritative repository but instead of pushing back to it, they push to this pending changes location. A change can only be submitted into the authoritative repository and become an accepted part of the project once the change has been reviewed and approved.
I found a nice diagram explaining this over the internet that will clear your doubts(if any ) -
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now few important stuff needs to be setup before proceeding-​
Setting up Git:
Debian/Ubuntu:
Code:
sudo apt-get install git
Fedora:
Code:
yum install git
ArchLinux:
Code:
pacman -S git
openSUSE:
Code:
zypper install git
Configuring git:
Code:
git config --global user.email "[email protected]"
Code:
git config --global user.name "your-username"
Setting up SSH Keys(Skip this if you have already set them up) -
Code:
cd .ssh
ssh-keygen -t rsa -C "[email protected]"
Now this will create 2 files in ~/.ssh directory as follows:
~/.ssh/id_rsa //identification (private) key
~/.ssh/id_rsa.pub //public key
Click to expand...
Click to collapse
Adding SSH Keys to your Account -
Code:
cat /home/username_on_pc/.ssh/id_rsa.pub
This will show up few lines over terminal, copy those and add them into your git profile(I won't explain that, there are many guides for the same)
Now install few packages -
Code:
sudo apt-get install python-pip
sudo pip install git-review
Now comes setting up the Gerrit part -​
In case of CyanogenMod,
Code:
git config --global review.review.cyanogenmod.org.username "gerrit username"
git config --global review.review.cyanogenmod.org.email "email you registered with"
In case of AOKP,
Code:
git config --global review.gerrit.aokp.co.username <gerrit username>
git config --global review.gerrit.aokp.co.email <email you registered with>
Making Changes and Submitting Patches -​
I'd firstly recommend you to repo sync to grab the full latest source.
Next(Don't make changes before this step) -
Code:
repo start <branch> <path to make changes
Example(You need to be in the source directory) -
Code:
repo start kitkat packages/apps/Settings
Now after this, go into the folders, make your changes and save them but only the changes in the specified directories(Packages/apps/Settings in this case)!
then
Code:
cd packages/apps/Settings
After making changes, for satisfaction, run,
Code:
git status
It tells you what files you modified(In Red color ) and shows on which branch you're currently on.
Now, the committing part,
Run:
Code:
git add -A
Run git status again, and it'll show the files in green color, telling you that the changes have been added.
Now:
Code:
git commit -s
This will commit the changes and open up a Text Editor called NANO. Here you need to edit the commit message that appears at the side of the gerrit window to describe what the patch does.
After writing the commit message, press Ctrl+O and then Enter key to save the commit message and then Ctrl+X to exit the editor. This is the committing part done. :good:
Now submitting the patch -
Code:
repo upload .
After this, it will ask you Yes/No twice(For the first time) and once(Everytime next) and you obviously have to hit Y!
Guess what?! Done!
Congratulations, you just learned gerrit and know how you use it. I hope you'll send some nice patches and respect the Open Source. :victory:
But, wait, what if there is a merge conflict :crying::crying:
Don't worry, there is a nic doc over the internet to help you with this - http://www.mediawiki.org/wiki/Gerrit/resolve_conflict
If you still have doubts, see few examples here or ask on the thread. I'll be happy to hrlp! :victory:
Credits -
> Firstly, My Parents :angel:
> @galaxyfreak @championswimmer @crossfire77 to introducing me to gerrit.
> AOKP/CM team for hosting useful docs.
Ok, so you have changes to make to the gerrit commit you just sent? Read on ​
Ok, it goes easy,
repo start like earlier, make changes, go to the directory where the changes were made(Settings in this case). Now, make sure you go to the patch URL now and copy up the Change ID, which can be done by clicking over it.
Now, git status to spot the changes.
The,
Code:
git add -A
and
Code:
git commit --amend
^This will tell git that you need to amend an existing commit. Cool, isn't it?
Now, make changes(if any) to the commit message. and then
Code:
repo upload .
YES, That's it! The new change will now be at the same URL under Patch Set 2! And will got 3, 4 so on as you make changes.
Reserved!
Really a Great work !
Great work !
git config --global review.gerrit.omnirom.org.username "gerrit username"
git config --global review.gerrit.omnirom.org.email "email you registered with"
Here are the configs required for omnirom.
Unable to patch
#Superuser said:
Ok, so you have changes to make to the gerrit commit you just sent? Read on ​
Ok, it goes easy,
repo start like earlier, make changes, go to the directory where the changes were made(Settings in this case). Now, make sure you go to the patch URL now and copy up the Change ID, which can be done by clicking over it.
Now, git status to spot the changes.
The,
Code:
git add -A
and
Code:
git commit --amend
^This will tell git that you need to amend an existing commit. Cool, isn't it?
Now, make changes(if any) to the commit message. and then
Code:
repo upload .
YES, That's it! The new change will now be at the same URL under Patch Set 2! And will got 3, 4 so on as you make changes.
Click to expand...
Click to collapse
When I do the above commands to provide a patch to CyanogenMod gerrit it gives a new Change-ID and got committed as a new 'Merge Commit'. Can you tell me where I am going wrong? :crying:
solomonsunder said:
When I do the above commands to provide a patch to CyanogenMod gerrit it gives a new Change-ID and got committed as a new 'Merge Commit'. Can you tell me where I am going wrong? :crying:
Click to expand...
Click to collapse
You sure that you ran git commit --amend ?
patchset
#Superuser said:
You sure that you ran git commit --amend ?
Click to expand...
Click to collapse
Yes. I tried to follow your post and this one wiki.cyanogenmod.org/w/Doc:_using_gerrit. I did a change earlier here. review.cyanogenmod.org/#/c/59083/ for a new translation. Since there were whitespace errors and a file strings.xml~ got added, I changed my local file, deleted the strings.xml~, did a git add strings.xml. Then I did a git commit --amend which gave me a new Change-ID which said Merge commit 'refs/changes/83/59083/1' of review.cyanogenmod.org/CyanogenMod/android_frameworks_base into SystemUITamil. Then I did a repo upload. This got uploaded as review.cyanogenmod.org/#/c/59286/ :crying:
I tried to manually change the Change-ID to I52f02ea81fa7e20334e7ac7f26d37ced6fe54489 and then do a repo upload. But it didn't allow me and gave a message ! [remote rejected] SystemUITamil -> refs/for/cm-11.0 (squash commits first)
Where am I going wrong?
Rebase worked
#Superuser said:
You sure that you ran git commit --amend ?
Click to expand...
Click to collapse
I did a rebase on frameworks/base and then followed your steps. Now it is working fine. :good: I used to do a repo start branchname projectpath even for patches. Could that have been a reason it was creating new changes?
solomonsunder said:
I did a rebase on frameworks/base and then followed your steps. Now it is working fine. :good: I used to do a repo start branchname projectpath even for patches. Could that have been a reason it was creating new changes?
Click to expand...
Click to collapse
I never actually close the Terminal after submitting a patch and verifying it, so not sure, maybe it lost track of the changes you made and the change that got uploaded. Rebase is actually useful in this. :good: Glad that you figured it out.
Hi @v_superuser,
Thanks for the guide. I reached upto "repo upload ." step but after that it returns upload failed.
Can you please help me out with this? I registered on aicp gerrit and also added publickey on gerrit.
Link to screenshot.
Says "Make sure you have correct rights" could be some rom specific stuff they have done for repo or seeing the rest, it could be something with your ssh keys.
You sure you're using same email id and username on git and gerrit?
v_superuser said:
Says "Make sure you have correct rights" could be some rom specific stuff they have done for repo or seeing the rest, it could be something with your ssh keys.
You sure you're using same email id and username on git and gerrit?
Click to expand...
Click to collapse
No, username is different. Email id is same.
I cannot change either of them now.
I was able to connect via ssh using [email protected] (Nikhil is username in gerrit)
nikhilmenghani is my username in github.
Any thoughts?
Nikhil said:
No, username is different. Email id is same.
I cannot change either of them now.
I was able to connect via ssh using [email protected] (Nikhil is username in gerrit)
nikhilmenghani is my username in github.
Any thoughts?
Click to expand...
Click to collapse
Use same git and gerrit username.
@v_superuser
I tried again and facing the same error
Code:
Upload project frameworks/native/ to remote branch kitkat:
branch kitkat ( 1 commit, Sat Oct 4 22:55:31 2014 +0530):
8dd591e7 DisplayDevice: Backwards compatibility with old EGL
to gerrit.aicp-rom.com (y/N)? y
The authenticity of host '[gerrit.aicp-rom.com]:29418 ([195.154.174.249]:29418)' can't be established.
RSA key fingerprint is 8c:9c:82:a7:4e:4f:8c:c6:c3:21:3d:c0:38:5d:25:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[gerrit.aicp-rom.com]:29418,[195.154.174.249]:29418' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Any thoughts?
I added public key to gerrit.aicp-rom.com from id_rsa.pub file too.
Nikhil said:
@v_superuser
I tried again and facing the same error
Code:
Upload project frameworks/native/ to remote branch kitkat:
branch kitkat ( 1 commit, Sat Oct 4 22:55:31 2014 +0530):
8dd591e7 DisplayDevice: Backwards compatibility with old EGL
to gerrit.aicp-rom.com (y/N)? y
The authenticity of host '[gerrit.aicp-rom.com]:29418 ([195.154.174.249]:29418)' can't be established.
RSA key fingerprint is 8c:9c:82:a7:4e:4f:8c:c6:c3:21:3d:c0:38:5d:25:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[gerrit.aicp-rom.com]:29418,[195.154.174.249]:29418' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Any thoughts?
I added public key to gerrit.aicp-rom.com from id_rsa.pub file too.
Click to expand...
Click to collapse
No idea. You registered on gerrit too, right?
v_superuser said:
No idea. You registered on gerrit too, right?
Click to expand...
Click to collapse
Yes I did.
Anyway, busy with other things so not trying much as of now.
Thanks for help!
Thank you OP for explainations. I see these termes (git, gerrit...) in lots of threats but never tried to understand. Now it's more clear in my head
Sent from my GT-I9305 using XDA Free mobile app
ok so i am starting to come along in my cm port for my phone, now i want to be able to upload the changes it gerrit for review,,
its for the i9305 s3,, now i have all the i9305 device tree setup for cm12.1 and its working pretty much 80% bugless..
if i go repo start it says error: project device/samsung/i9305 not found do i have to repo init the project before i can repo start
and as the s3 is officially supported up until kitkat syncing the cm12.1 source does not sync the device repos needed, would i need to repo clone the cm11 device tree and start a new branch for lollipop
I want to upload a commit for a device kernel (for example Oneplus 3) to lineage . How to do it ? I have to download lineage source code ?

LazyFlasher - make and install your own custom kernels!

INTRODUCTION
Hello Pixel C users and developers! I saw your device forum is a little lonely, so I offer you this in the hopes it may become slightly more eventful and 2017 becomes the year of the Pixel C development!
I expect that before you start, you have a Linux installation in either a virtual machine or on a physical PC.
Debian Jessie, Kali Linux, Mint, or Ubuntu are excellent choices and what I'm familiar with, so if you get stuck it'll be easier for me to help you if you use these.
NEED LINUX? I'VE GOT YOU COVERED
If you don't have a Linux installation, consider installing the latest version of Oracle VM VirtualBox.
You can download a minimal Debian VM from my site: https://build.nethunter.com/possibly-the-coolest-things/Debian.ova (SHA1SUM)
It should be fairly simple to "Import Appliance..." from VirtualBox and set up the Shared Folders properly, everything else is set up for you!
Username: root
Password: xda
Once logged in, create your own user account from LXTerminal:
Code:
adduser [b]yourname[/b]
# answer the questions, you can leave it all blank except the password if you want>
echo "[b]yourname[/b] ALL=(root) NOPASSWD: /bin/su" > /etc/sudoers.d/me
The second command will allow you to type "su" to become root whenever you need.
You should then log out and log in to your new account instead.
PREREQUISITES
First off, you'll want to download some tools necessary for building and downloading kernel sources:
bc - a tool needed by the kernel build system
git-core - you'll want git for downloading and maintaining your sources
build-essential - native gcc & tools for building (needed for build commands)
libncurses5-dev - needed to build menuconfig
diffutils - used to compare config changes
colordiff - used by diff to provide colorful human readable diff output
Code:
apt-get install bc git-core build-essential libncurses5-dev diffutils colordiff
PREPARING YOUR ENVIRONMENT
Once you've got that out of the way, you should create an organized environment for working. I like to use ~/build.
Code:
mkdir -p ~/build/toolchain ~/build/kernel
DOWNLOADING & INSTALLING A TOOLCHAIN
You'll want to download a toolchain for kernel building. I recommend using Linaro's optimized ARM64 (aarch64) toolchains.
GCC 4.9: https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/aarch64-linux-gnu/
GCC 5.X: https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/
The actual file that you want ends in -x86_64_aarch64-linux-gnu.tar.xz (assuming you have a 64-bit Linux install, seriously, 32-bit needs to go! )
We'll use the GCC 5.3.1 2016.5 toolchain in this example.
Let's download and extract it now:
Code:
cd ~/build/toolchain
wget "https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu.tar.xz"
tar xf ./*linux-gnu.tar.xz
rm ./*linux-gnu.tar.xz
That's it for installing the toolchain, easy right?
DOWNLOADING THE KERNEL
First, you'll want to create a GitHub account if you don't have one already.
This will allow you to upload your changes and share your kernel with other interested users and developers.
Once you've got your account, and you're logged in, browse to:
https://github.com/jcadduono/android_kernel_google_chromeos
You want to fork the sources to your own account, to do this simply click the [Fork | ] button near the top right of the page:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now you've got your own copy of the Google ChromeOS (dragon / ryu) 3.18 kernel sources on your GitHub!
The next step is to use git to download it to your PC.
Replace "your_username" with your actual GitHub username. Using [email protected] you can avoid being asked for your username each time you push new changes.
Code:
cd ~/build/kernel
git clone https://yo[email protected]/your_username/android_kernel_google_chromeos
cd android_kernel_google_chromeos
The default branch is android-7.1. This is what most users will want. I've added build and menuconfig scripts to assist in building for you.
There may be some additional branches available to choose from.
You can use git log <branch> to view commits, and git cherry-pick <commit id> to copy commits from those branches into yours if you like.
CONFIGURING GIT
Before you start working on your kernel, you will need to set up your git profile.
The user values show up in commit messages to tell people who authored them.
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global push.default simple
YOUR FIRST COMMIT
We'll want to check out a new branch, and give it your own cool name. I suggest adding a -7.1 suffix to it because you'll probably want to start a new branch for each time a new version of Android releases.
We're going to use "coolname" as our example, so be sure to replace that with what you really want it to be called in the next steps.
Code:
git checkout -B coolname-7.1
Next we'll need to modify the build scripts to fit our setup.
Open build.sh and menuconfig.sh.
You'll want to set the TOOLCHAIN= path in both scripts. If you're following this guide, then it's already correct!
You will also want to set your default target config name.
See the line:
Code:
[ "$TARGET" ] || TARGET=google
You'll want it to look like this:
Code:
[ "$TARGET" ] || TARGET=coolname
Now you want to copy the default Google kernel configuration so you have your own to work with:
Code:
cp arch/arm64/configs/google_dragon_defconfig arch/arm64/configs/coolname_dragon_defconfig
Now you'll have prepared your kernel source for starting work on your own custom kernel!
Let's turn that into a commit, but first look at the changes you've made using:
Code:
git diff
Does that look good? If not, fix what's broken before proceeding.
Next you'll want to add files that will be part of your commit.
For simplicity's sake, let's just add all of the changed files into the commit.
Code:
git add .
Now to make your commit:
Code:
git commit -m "My first commit, setting up my coolname kernel!"
You've done it!
CONFIGURING YOUR KERNEL
We'll use the menuconfig.sh script to launch the kernel menuconfig.
Code:
./menuconfig.sh
Change whatever options you're interested in, but don't change a lot all at once, otherwise when or if you run into issues, you won't know which option caused it.
Once you're done playing in the menuconfig, exit and save.
You'll be shown a colorful difference between your old configuration and your new one.
It will ask you if you want to save it, and you just have to type "y" and press enter for it to be saved.
At this point it's a good idea to make another commit to save your configuration changes.
If you need to edit the commit, you can easily use git commit --amend to fix it up.
BUILDING YOUR NEW KERNEL
Let's take your new config for a test drive.
To build your kernel, simply run:
Code:
./build.sh dragon
Once your kernel is finished building, the resulting files will be located at:
Code:
build/arch/arm64/boot/Image.fit
build/lib/modules/ (if modules are enabled)
INSTALLING YOUR NEW KERNEL
The LazyFlasher project comes to the rescue here. It's the swiss army knife of kernel flashing in TWRP.
To download it (feel free to fork it so you can have a copy on your GitHub to modify instead!):
Code:
cd ~/build
git clone -b kernel-flasher https://github.com/jcadduono/lazyflasher.git
cd lazyflasher
To use LazyFlasher, you'll probably want to take a look at the Makefile, config.sh, and META-INF/com/google/android/update-binary (a shell script).
There's a few things you can change there to personalize it to your needs.
(make another git commit to save your setup!)
Once the installer is set up to your liking, all you have to do to build it is copy the Image.fit from your build output into the lazyflasher folder.
If you have built with kernel modules, copy build/lib/modules -> lazyflasher/modules.
Now simply run:
Code:
make
A TWRP flashable zip and sha1sum is created!
Transfer it to TWRP and flash away, you've just lost your custom kernel development virginity.
Go have a few beers to celebrate, or to drown your sorrows in the case of a boot loop.
UPDATING THE KERNEL SOURCES
Of course my repository will become out of date after a while. In this situation, you want to add a remote that is more updated.
We'll use Google's official Pixel C kernel repository here.
Inside your kernel source directory, run the command:
Code:
git remote add google -t chromeos-3.18 https://chromium.googlesource.com/chromiumos/third_party/kernel
Every time you want to fetch updates from Google's branch, run the command:
Code:
git fetch google --tags
After fetching updates, you have to apply them. You can choose between a rebase strategy or a merge strategy.
In most cases you'll want to use the merge strategy.
The merge strategy will merge Google's updates into your branch.
The rebase strategy will move your work on top of Google's latest instead.
Code:
# the merge strategy (pick one, recommended)
git merge google/chromeos-3.18
# the rebase strategy (will require a force push and rewrite history, not recommended)
git rebase google/chromeos-3.18
JUST WANT TO DISABLE VERITY/ENCRYPTION?
You can build lazyflasher by itself, empty, without a kernel Image.fit or modules and flash it!
It's already set up to automatically disable verity and make encryption optional.
Alternatively, there's a branch already set up called no-verity-opt-encrypt. You can find prebuilt official zips at: https://build.nethunter.com/android-tools/no-verity-opt-encrypt/
It should work on any and all kernels!
PROBLEMS?
Post a reply here and I'll try to find a solution and add it to this post.
RESOURCES
Need a text editor for coding? I use gedit. It's pretty, light, and you can get some decent plugins for it.
It's a minimal editor, so don't expect anything really fancy. Configure it and enable plugins before you decide to trash it.
Code:
apt-get install gedit gedit-plugins
Here's an awesome git starter guide: http://rogerdudler.github.io/git-guide/
Lazy flasher worked great for me, on Linux.
OMFG this is a wonderfu TUT maybe it requires more knowledge than I have but I take a look this weekend (I use and love Ubuntu a lot).
Also I know you from OP 3T forums and your development is amazing, is nice to see good developers and development here.
Thanks!!!
I've followed your instructions, but I'm not finding a dtbgen.sh in the kernel/android_kernel_google_chromeos/ folder. Am I missing something? I have the build.sh and the menuconfig.sh...
michaave said:
I've followed your instructions, but I'm not finding a dtbgen.sh in the kernel/android_kernel_google_chromeos/ folder. Am I missing something? I have the build.sh and the menuconfig.sh...
Click to expand...
Click to collapse
Fixed the guide, I combined it into build.sh for simplicity at some point. It has been some time since the repository was updated, but you should be able to simply add google as a remote and fetch & rebase to be up-to-date. (I think I mentioned this already)
this looks pretty cool! :good:
Q: are the pre-built no-verity zips Pixel-C specific, or can they be used on any device?
... doesnt work for me - the compiled kernel always ends up in a boot loop
hagbardceline23 said:
... doesnt work for me - the compiled kernel always ends up in a boot loop
Click to expand...
Click to collapse
Pls try to use the sources from here ..
https://android.googlesource.com/kernel/tegra/
If you use chromeos 3.18 you need to know what to exclude
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18
Its the full 3.18 with changes for all relevant devices.
Have a try with tegra sources and start with dragon_defconfig.
It will boot
Cheers
thanks !!! works like a charm with the tegra sources
I expect that before you start, you have a Linux installation in either a virtual machine or on a physical PC.
Debian Jessie, Kali Linux, Mint, or Ubuntu are excellent choices and what I'm familiar with, so if you get stuck it'll be easier for me to help you if you use these.
Click to expand...
Click to collapse
For what it's worth, I've successfully rebuild the kernel on the Ubuntu Userspace on Windows: https://insights.ubuntu.com/2016/03...-the-ubuntu-userspace-for-windows-developers/
And then flashed it with LazyFlasher.
Thanks for your work!
I have an idea to customize the kernel, but at the moment I can't open the kernel, these are farther away for me, but I want to make it my first device developed.
Panokiaran said:
I have an idea to customize the kernel, but at the moment I can't open the kernel, these are farther away for me, but I want to make it my first device developed.
Click to expand...
Click to collapse
thank you

Categories

Resources