TIME TO MOVE ON
i wil be on xperia section
i am happy that i could help this section
Best Regards, Happy Cookling and Programing!
Hy all
I started this tread because the interest to android is growing
I invite all people with linux knowledge or C programing skills to join
If you know some hardware programing is better
We need
- developpers
- testers
i will not post an guide how to setup the compiler and set variables
if you dont know this stuff please stick to Google Android thread and dont post here stupid questions as IT IS READY / WHEN WILL IT BE READY
WE DO THIS IN OUR SPARE TIME AND WE HAVE FAMILY AND LIFE
So shell we invite the penguin to our phones?
WIKI Page
(Thanks Bikor_gj)
http://wiki.xda-developers.com/index.php?pagename=Niki_Android
GIT Trees
Vogue
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-vogue
MSM
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-msm-2.6.25
Reserved For Messages
Build Instructions for the ones that want to help
- Create working dir:
Code:
mkdir ~/android-kernel
- Go to the dir:
Code:
cd ~/android-kernel
- Clone the Linuxtogo GIT:
Code:
git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git
- Go into newly created dir:
Code:
cd ~/android-kernel/kernel
- Create a new branch, call it htc-msm and link it to the official htc-msm development branch:
Code:
- Descend into the "main" android dir:
Code:
cd ~/android-kernel
- Get toolchain:
Code:
wget http://www.codesourcery.com/gnu_too...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- maybe you need to rename the just downloaded file (because after .tar.bz2 wget has added ?lite=arm). (HINT FOR LINUX-NEWBIES: USE TAB TO COMPLETE KNOWN FILENAMES!! - In this case type: mv arm(TAB) arm(TAB) -> backspace till 'bz2' is the last word)
Code:
mv arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2\?lite\=arm arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- unpack the toolchain:
Code:
tar -xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
- ascend again into the 'kernel' directory:
Code:
cd ~/android-kernel/kernel
- make the kernel:
Code:
git checkout -b htc-vogue origin/htc-vogue
You also have to use
Code:
make vogue_defconfig ARCH=arm
- export path so the newly downloaded toolchain will be used instead of your default compiler (which would compile for your computer instead of your phone):
Code:
export PATH=~/android-kernel/arm-2008q1/bin:$PATH
- make the zImage-file:
Code:
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Now the zImage file is created inside the directory kernel/arch/arm/boot.
When uploading this to your phone, remember that you only have to replace the zImage after each kernel build - the Linux environment on top of the kernel can just stay the same, so initrd (which is the ramdisk filesystem) can stay the same.
BR
Reserved For Kernel Status
Kernel status
no more power button //thanks biktor_gj
nike mtype added
audio working
call working
data working
sms unknown //due to keyboard and ts
keyboard screwed // somethings not right needs investigation
OnSreenKeyboard working
Touch screwed // SOLVED
when this kernel probelms will be solved i will release the new kernel
I have knowledge of both C and linux so I vollunteer
hi,
i can be a tester... also i have some little linux knowledge...
I have limited knowledge of both c and linux, so I possibly could help.
It seems useful however to setup an SVN or something, so even 'non-registered' developers can write patches and submit them for review. You can set up such an SVN for free at assembla.com, together with a wiki, TRAC and more. They even say you can ask for more storage space and stuff if your project is an open-source project.
If you have such an SVN developers like me can help without making any false promises of some sort.
I hope you know what I mean, it sounded better in my head
i know linux and i can do beta tester. i'm studying engineering too.
i also know linux and a bit of C...i can do testing too.
as you already know, I'm in too for development...
i will try the new kernel asap...
I tried this kernel and indeed, the keypad works on mine!
(touched the TS though, just because you said I wasn't allowed ) It froze, so reboot...
awesome! keys work all good! numbers work and also dpad and enter works!
(by the way: how will you make it possible to enter text? android is coded to enter numbers...
the_fish said:
awesome! keys work all good! numbers work and also dpad and enter works!
(by the way: how will you make it possible to enter text? android is coded to enter numbers...
Click to expand...
Click to collapse
I believe by the end of this year or somewhere in the beginning of 2009 Google is making a system for creating software input methods, which would theoretically allow us to write an application that would reroute direct hardware input. I think. We'll have to see what the future will (or the talented developers here) bring.
man, awesome!!! good job, jerpelea. keys work great!!
graey said:
I believe by the end of this year or somewhere in the beginning of 2009 Google is making a system for creating software input methods, which would theoretically allow us to write an application that would reroute direct hardware input. I think. We'll have to see what the future will (or the talented developers here) bring.
Click to expand...
Click to collapse
ok... the onscreen keyboard would be ok for the time we have to wait
Jerpelea: Why do you want Ubuntu as dev os? I'm using OpenSuSE and am able to build the kernel.
I am thinking (since 2 weeks) to try Ubuntu again (used to use it), but may take while before I get to it...
Boylen said:
Jerpelea: Why do you want Ubuntu as dev os? I'm using OpenSuSE and am able to build the kernel.
I am thinking (since 2 weeks) to try Ubuntu again (used to use it), but may take while before I get to it...
Click to expand...
Click to collapse
I think he is just saying that because it's easier for people to use??
works fine for me on vanilla debian
new kernel works fine screen still too responsive keys work calls work
it works! but after few minutes my nike is auto-turned off :O
garsim said:
it works! but after few minutes my nike is auto-turned off :O
Click to expand...
Click to collapse
i guess we have turn the auto turn off in wm to unlimited or run it on usb plug...
Android Open Source Project Gingerbread Development Central
Introduction: Many of you know me for my PhoenRom nexus rom but today I want to start a thread that hopefully will become a clear place HEAVILY ORIENTED TO AOSP DEVELOPERS where they can gather the latest fixes, kernels and mods so that they can easily be merged to the latest Gingerbread AOSP branch. This post will also provide guidance for setting up a AOSP developer machine, and all possible needed how to's that are related to the subject.
Also with time I realized that users demand always the same mods over and over between versions. So if we post the source of those modifications here it will allow them to be easily ported between versions.
This will also benefit the mods qualities itself since a community work might enhance them, amplifying their features or simply making them more stable.
What exactly WILL this post cover:
AOSP Development tools
Guidance to modifying, merging and compiling AOSP
AOSP Fixes and patches
AOSP Mods
Kernels
Useful collection of how to's links
What exactly WILL NOT cover:
Roms
Apps
Themes
About the thread: Ill personally will update this thread the best I can and test as many mods posted as possible. If anyone want to post their mods or feel that something should be posted here and its missing, feel free to do it, or private message me so I can post it. If something posted here is of special relevance and falls directly into the "WILL CONTAIN" I would post it in the opening post and hopefully will end up with a nice source library. I will also try to upload this sources to github so they are friendly mergeable.
Setting up AOSP development environment
Minimum Requirements to build Android form Source:
2GB of RAM
20GB of hard drive free space
Linux: You can use any distribution but I highly recommend Ubuntu for AOSP development.
Currently you can build AOSP in both 32bit and 64bit Ubuntu versions as long as you have the right repositories installed. Working through virtual machines its perfectly compatible, and for this purposes I personally recommend VirtualBox.
Deploying the environment, android source and compile it the easy way (default is set to CyanogenMod gingerbread branch, edit the script if you want to build from Master instead):
FOR 32 BIT LINUX ONLY:
Code:
Download this script [URL="http://dl.dropbox.com/u/6751304/androidmake"]http://dl.dropbox.com/u/6751304/androidmake[/URL]
(Courtesy of nicandris)
FOR 64 BIT LINUX ONLY:
Code:
Run this command line in terminal
apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
and then use the 32 bit script.
[URL="http://dl.dropbox.com/u/6751304/androidmake"]http://dl.dropbox.com/u/6751304/androidmake[/URL]
(Courtesy of nicandris)
Set the script permissions to executable and finally run the script.
NOTE: Downloading and compiling will take several hours.
Mac:
Visit this thread for guidance (Building CyanogenMod for Nexus One) http://forum.xda-developers.com/showthread.php?t=775505
AOSP Branches
Gingerbread Branches:
Master
repo init -u git://android.git.kernel.org/platform/manifest.git -b master
CyanogenMod
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
AOSP Fixes and issues
Master
Code:
CyanogenMod
Code:
[URL="http://forum.xda-developers.com/showpost.php?p=11161803&postcount=33"]CM7 make fails and complains about RomManager.apk[/URL]
AOSP mods
Rooting + Superuser.apk
Code:
(Courtesy of wdfowty & ChainsDD)
1) You need to clone ChainsDD's Superuser.apk into your source tree
[CODE]
cd ~/android/system/packages/apps
git clone -b gingerbread http://github.com/chainsdd/android_packages_apps_Superuser.git Superuser
2) Next, you need to disable the original su binary from being built. In a console/terminal, type
Code:
gedit ~/android/system/system/extras/su/Android.mk
Then replace all text in the file with this
Code:
ifeq ($(BUILD_ORIGINAL_SU),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= su.c
LOCAL_MODULE:= su
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libc
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := debug
include $(BUILD_EXECUTABLE)
endif
That's it. Superuser.apk and su binary are included in every build after.
More info can be found here: http://howto.ccroms.net/android_project/build/mod/root
[/CODE]
Trackball Alert
Code:
CM6 Code: [URL="https://github.com/lilHermit/ta-framework-os"]https://github.com/lilHermit/ta-framework-os[/URL]
CM7: all ready has this built in.
Gingerbread: framework can be patched with trackball alert via smali patch option.
Trackball Wake & Unlock
Code:
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/88c07d2fd8419a287d6ed56ad6b1aab583b63ed3"]https://github.com/CyanogenMod/android_frameworks_base/commit/88c07d2fd8419a287d6ed56ad6b1aab583b63ed3[/URL]
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/809be3bf813258434b98c0987e38d58b28edab6c"]https://github.com/CyanogenMod/android_frameworks_base/commit/809be3bf813258434b98c0987e38d58b28edab6c [/URL]
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/17a5669474c01b0e49b8e1dd65e92c9c0a68e2ca"]https://github.com/CyanogenMod/android_frameworks_base/commit/17a5669474c01b0e49b8e1dd65e92c9c0a68e2ca[/URL]
Battery %
Code:
1)To enable battery % we need to generate the 2 modified xml files, stat_sys_battery.xml and stat_sys_battery_charge.xml.
We can do this with this 2 bash scripts:
[B]generate-battery-xml.sh[/B]
[URL="http://android-leonextlevel.googlecode.com/hg/generate-battery-xml.sh?r=60a06f198e7e5262e0197cb645a66c507b63b5df"]http://android-leonextlevel.googlecode.com/hg/generate-battery-xml.sh?r=60a06f198e7e5262e0197cb645a66c507b63b5df[/URL]
[B]generate-battery_charge-xml.sh[/B]
[URL="http://android-leonextlevel.googlecode.com/hg/generate-battery_charge-xml.sh?r=60a06f198e7e5262e0197cb645a66c507b63b5df"]http://android-leonextlevel.googlecode.com/hg/generate-battery_charge-xml.sh?r=60a06f198e7e5262e0197cb645a66c507b63b5df[/URL]
to do so, just run in this two command lines where you created the script files and gave them executable permissions.
[B]./generate-battery-xml.sh > stat_sys_battery.xml[/B]
[B]./generate-battery_charge-xml.sh > stat_sys_battery_charge.xml[/B]
2)Now copy and replace this 2 xml to the source directory "android/system/frameworks/base/core/res/res/drawable" (you'll need root permissions")
3)Add your battery%(1-100) images to the source directory "android/system/frameworks/base/core/res/res/drawable-hdpi" (you'll need root permissions")
4)Finally compile the source
Tips: you can use UOT Kitechen to generate the battery images [URL="http://circle.glx.nl/"]http://circle.glx.nl/[/URL]
(Courtesy of leonnib4)
[URL="http://code.google.com/p/android-leonextlevel/source/detail?r=60a06f198e7e5262e0197cb645a66c507b63b5df"]http://code.google.com/p/android-leonextlevel/source/detail?r=60a06f198e7e5262e0197cb645a66c507b63b5df[/URL]
Enable transparency
Code:
[URL="http://review.cyanogenmod.com/#change,2189"]http://review.cyanogenmod.com/#change,2189[/URL]
Shut Down extra options (Recovery & Reboot)
Code:
[URL="https://github.com/CyanogenMod/android_packages_apps_CMParts/commit/e68ba6a7211c3c6a66b5e13930be7b9ce837edbd"]https://github.com/CyanogenMod/android_packages_apps_CMParts/commit/e68ba6a7211c3c6a66b5e13930be7b9ce837edbd[/URL]
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/06507942da1b847f60c162160ac1d46c78f93730"]https://github.com/CyanogenMod/android_frameworks_base/commit/06507942da1b847f60c162160ac1d46c78f93730[/URL]
Pull-down notification area power widget (Glaxsy S style power widget)
Code:
(Courtesy of Pedlar)
[URL="https://github.com/Pedlar/android_frameworks_base/commit/eb0e39732842151e947f27cf64a00480d75e5631"]https://github.com/Pedlar/android_frameworks_base/commit/eb0e39732842151e947f27cf64a00480d75e5631[/URL]
Sip Calling not only over wifi
Code:
(Courtesy of paul o'brien)
In the framework-res APK edit the following setting...
[COLOR="SeaGreen"]<bool name="config_sip_wifi_only">[COLOR="Red"]false[/COLOR]</bool>[/COLOR]
For more info visit [URL="http://android.modaco.com/content/google-nexus-s-nexuss-modaco-com/327770/using-gingerbread-internet-calling-sip-without-wifi/"]http://android.modaco.com/content/google-nexus-s-nexuss-modaco-com/327770/using-gingerbread-internet-calling-sip-without-wifi/[/URL]
BusyBox
Code:
Here you can find the latest ARM binaries:
[URL="http://busybox.net/downloads/binaries/"]http://busybox.net/downloads/binaries/[/URL]
App2SD
Code:
[URL="http://forum.xda-developers.com/showthread.php?t=715940"]http://forum.xda-developers.com/showthread.php?t=715940[/URL]
Incognito Browser
Code:
[URL="https://github.com/CyanogenMod/android_packages_apps_Browser/commit/3e82693651aa2b5a27f54ffd883177a624c09574"]https://github.com/CyanogenMod/android_packages_apps_Browser/commit/3e82693651aa2b5a27f54ffd883177a624c09574[/URL]
Proxy
Code:
Info:
(Coyrtesy of leonib4 & Ninpo)
[URL="https://github.com/leonnib4/packages_apps_Settings/commit/264954500ba24f7fe27837e731ebc4d7ae7b0d4c"]https://github.com/leonnib4/packages_apps_Settings/commit/264954500ba24f7fe27837e731ebc4d7ae7b0d4c[/URL]
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/ed99b80128f1aea8889a24f96ac33c5de0faef3a"]https://github.com/CyanogenMod/android_frameworks_base/commit/ed99b80128f1aea8889a24f96ac33c5de0faef3a[/URL]
[URL="https://github.com/CyanogenMod/android_frameworks_base/commit/c2e62d24d0f57c9315e40e9957e918e68b41bc4b"]https://github.com/CyanogenMod/android_frameworks_base/commit/c2e62d24d0f57c9315e40e9957e918e68b41bc4b[/URL]
Enable HSPA icon
Code:
(Courtesy of Rusty!)
change config_hspa_data_distinguishable to true in SytemUI.apk's /res/values/bools.xml
Add silence & vibration to volume keys
Code:
STATUS:Waiting for submit
OTHER VERY USEFULL MODS
(Courtesy of leonnib4)
http://code.google.com/p/android-leonextlevel/wiki/Progress
http://code.google.com/p/android-leonextlevel/source/list
(Courtesy of cyanogen)
http://review.cyanogenmod.com/
GingerBread Kernels
(Courtesy of redstar3894)
2.6.35.10_AVS-950mV_CFS-GB_20110110_0001 OC & UV to 950mV
2.6.35.10_AVS-925mV_CFS-GB_20110112_0025 UV to 925mV
Source Files can be found at github https://github.com/redstar3894
How to's collection
How to compile AOSP Gingerbread
Building CyanogenMod for Nexus One (Gingerbread)
How to fork in github
THIS THREAD IS UNDER CONSTRUCTION...FEEL FREE TO POST ANY MODS, IDEAS, FIXES OR WHAT EVER YOU WISH MEANWHILE. HELP IS APPRECIATED!
Reserved space
Feel Free to add my two gingerbread kernels
2.6.35.10_AVS-950mV_CFS-GB_20110110_0001 OC & UV to 950mV
2.6.35.10_AVS-925mV_CFS-GB_20110112_0025 UV to 925mV
Both are compatible with AOSP gingerbread and based off my latest source...
What about enabling internet calling not over wifi, per Paul's finding:
http://android.modaco.com/content/g...ingerbread-internet-calling-sip-without-wifi/
See CyanogenMod github account.
Also I pretty much covered those commits:
Sources: http://code.google.com/p/android-leonextlevel/wiki/Progress
My commits: http://code.google.com/p/android-leonextlevel/source/browse/LeoGingerBread/ChangeLog
Help yourself
Thanks, all.
Does anyone know where in cyanogenmod github I can find the code for the Notification area power widget (wifi, bluetooth, gps, silence) ???
mordokak said:
Does anyone know where in cyanogenmod github I can find the code for the Notification area power widget (wifi, bluetooth, gps, silence) ???
Click to expand...
Click to collapse
frameworks/base cyanogenmod see the history should be there
charnsingh_online said:
frameworks/base cyanogenmod see the history should be there
Click to expand...
Click to collapse
and also if ur working in AOSP there is no such thing as framework-res to edit, that is done using smali on an already compiled rom
If you want an HSPA icon, you need to change config_hspa_data_distinguishable to true in SytemUI.apk's /res/values/bools.xml
Rusty! said:
If you want an HSPA icon, you need to change config_hspa_data_distinguishable to true in SytemUI.apk's /res/values/bools.xml
Click to expand...
Click to collapse
Thanks, added to OP
Thanks : )
Nice thread.. thanks for sharing information mate.. It is really helpful.
What about the sources needed to get the camera fully working on Gingerbread, like is your ROM?
'cause I can't get it to work for now
That fix is actually Cyanogens Team, not mine. I just compiled their latest branch.
I guess I could have a look at cyanogenmod github and search for changes in the related files (cam and video libs)
Which is what I'm trying to do since quite some days now.
If I found the right commits, I'll PM you so you can add those to POST#1.
That would be awsome ^_^
Howdy gents,
Don't know if you're interested but I've recently spruced up the gingerbread battery. Here's the raw files if anyone's interested. You might want to change the timings as I tend to run it a little quicker.
new-gingerbread-battery.zip
This is awesome, all the info that is really hard to find and corelate in one place !!
Can I make one simple request ?
Could you (or anyone) post a recipe for actually doing development as in beyond just compiling patches. I am (and I hear I am not alone) very confused by the instructions for git/repo and various AOSP depots about how to do good development where I follow a development tree, sync regularly and make sure my patches work before I submit.
Or is there such a doc someplace and I have failed to find it ?
Actually I was planning to do so ^_^, but I would appreciate if someone could help me, if someone post a detailed git repo guide y will post it in OP. If not ill do it myself when I get back to my normal computer. I really like it when people contribute here ^_^
Hi guys. So I've had a few people PM me and ask for help cherry picking features to build a ROM from source. I've decided I might as well post a guide with what I've gathered. I'll outline the procedure for cherry-picking from both gerrit as well as GitHub, and what to do afterwards.
Once you've completed the guide, feel free to post questions/comments/advice in the thread. If you run into any issues, I will be happy to answer them (along with other helpful members of our community). If you think I should add something to the guide or change something, also feel free to let me know. I haven't noticed any good resource concerning cherry-picking on XDA, so discussion is encouraged.
Before we begin cherry-picking, I'm going to be making a few assumptions. I assume that:
you are using Ubuntu (or another Linux distribution) and you have git installed
you have the source code for your ROM downloaded on your PC
you know how to compile your ROM
you are somewhat comfortable using the terminal
Let's get started!
Table of contents:
1. Cherry-Picking from Gerrit
2. Cherry-Picking from GitHub
3. Conflict Resolution
4. Troubleshooting/After the Cherry-Pick
Cherry-Picking from Gerrit
Cherry Picking a feature from Gerrit
To begin cherry-picking, you should first go to the gerrit for your desired cherry-pick and find its entry/entries. I'll cherry-pick Halo from the ParanoidAndroid gerrit into AOSP.
Because I want Halo, I'll open go to ParanoidAndroid gerrit at http://gerrit.paranoidandroid.co and find the Halo entries. This is what it looks like:
{
"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"
}
You'll notice there are two Halo entries, one titled [1/2] Settings: HALO, and one titled [2/2] Frameworks: HALO. To get this feature, I'll need both, hence the tags 1/2 and 2/2 at the beginning. Here are the links for reference:
[1/2] Settings: HALO
[2/2] Frameworks: HALO
Great, now we have the entries for the two “commits” that we want to add to our ROM. We'll start with the first one. The page may look overwhelming at first, but there are two bits that are most important to us: the Project tag and the Download tab. Here's what they look like:
Look at the project title. It says “AOSPA/android_packages_apps_Settings”. This tells us exactly where in our source code to apply this commit. On my system, I have AOSP downloaded to the folder ~/AOSP. I open a terminal and enter the command “cd ~/AOSP”. Replace “AOSP” with your code directory.
Now, in your terminal, type:
Code:
cd packages/apps/Settings
Now that you're in the right spot, it's time to download the commit and try to apply it. Click the download tab in your browser, then from the dropdown choose “anonymous HTTP” and choose “cherry-pick”. Here's what it looks like:
When you click the clipboard next to the “Cherry-Pick” option, it'll copy to your clipboard. Now, go back to your terminal and press CTRL + Shift + V to paste it.
Code:
git fetch https://gerrit.paranoidandroid.co/AOSPA/android_packages_apps_Settings refs/changes/39/239/14 && git cherry-pick FETCH_HEAD
Chances are, unless you're very lucky, your terminal will do some work and look like this:
To continue, skip to post #4
Cherry-Picking a Feature from GitHub
Cherry-Picking a Feature from GitHub
To begin cherry-picking, you need to find the GitHub “commit” for what you want. A commit is a record of the changes that were made to achieve something, whether it be a new feature or a bug fix.
Today, I'm going to take pure AOSP and cherry-pick ParanoidAndroid's Halo. Because ParanoidAndroid gave up the feature, I can't take it from their GitHub. Conveniently, I have it in my own GitHub and will use that.
Note: you will only find things that have already been added to a project's code on GitHub. ParanoidAndroid gave up on Halo, so it is not added to their code. Because it is not already merged, it will not be in GitHub
First things first, you locate the commit. I know it's in my GitHub, so I'll open that in my browser at http://github.com/jabza-. I already know that Halo requires two commits, one for the settings and one for the frameworks. I'll open the projects “aospa_packages_apps_Settings” and “aospa_frameworks_base”. I'll start with the frameworks.
When you open the page, it's a little confusing. We want to see the commits, so we'll click “commits” toward the top.
Now, I'll have to go down the list to the Halo commit. Here's a link for reference: [2/2] Frameworks: HALO
Note: the commit name has [2/2] at the beginning, showing us that it is the 2nd commit of two. The other is in aospa_packages_apps_Settings
Note: my commit history in aospa_frameworks_base currently has two commits for Halo. The more recent one was a bug fix and I mistakenly left the commit message as it is – you want the older commit for the full change
Scroll down to the bottom of the blue commit message. Below it, there' s a list of the files and the changes made. You may use this for reference later, but it's not important now. What's important is the commit ID, which is listed at the bottom of the commit message.
Now, we go to the terminal. I have my AOSP source in ~/AOSP, so when I open my terminal first enter
Code:
cd ~/AOSP
The project name that we are working from is aospa_frameworks_base. This tells us that the commit belongs in frameworks/base. So, to begin work:
Code:
cd frameworks/base
Now, we have to “fetch” the project so we can cherry-pick the commit.
Code:
git fetch git://github.com/jabza-/aospa_frameworks_base.git
Now that we have the commit history of aospa_frameworks_base, we can tell the terminal to cherry-pick. We must use the commit ID at the bottom that we found earlier. You can copy the commit to your clipboard, and paste it in the terminal with CTRL + Shift + V.
Code:
git cherry-pick ab72e4ab36778474593ffce89150aece01d5f9c6
Obviously, when cherry-picking anything else, replace “ab72e4ab36778474593ffce89150aece01d5f9c6” with the commit ID of that commit.
Now, your terminal will do some work, and it will say it couldn't commit it automatically. It should look something like this:
Now, we get to resolve the conflicts. Continue to the next post.
Resolving Conflicts from Cherry-Picking
Resolving Conflicts from Cherry-Picking
So you've found the commit you want to cherry-pick. You've gone to the right place in your source code to apply it. You've told your computer to apply the cherry-pick. It said it couldn't. Now what?
Well let's see what's wrong.
Code:
git status
Your terminal will now tell you what files have been automatically changed for you and what you need to change yourself. In green are the files that are done, and in red are the files you need to tell it what to do with. Here's what your terminal should look like after “git status”:
If you cherry-picked from gerrit with me and did [1/2] Settings: HALO, it'll look something like this:
If you cherry-picked from GitHub with me and did [2/2] Frameworks: HALO, it'll look something like this:
In looking at the files in red, we see two different tags.
deleted by us – this means that there's a file in the commit that doesn't exist on our computer
both modified – this means that there's a file that was supposed to be modified, but that was modified on our computer from what was expected in the commit
deleted by them – this is a third tag you may see, though it's not here. This means that the commit deletes a file which we stil have on our computer
So, what do we do? Let's start with the ones tagged “both modified”. The first file in red underneath the frameworks/base commit is packages/SystemUI/res/layout/status_bar_expanded_header.xml. We'll open it in our favorite text editor and see what it's all about.
Code:
gedit packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now we search for what's messing with our cherry-pick. It's enclosed in the tags “<<<<<<< HEAD” and “>>>>>>> ab72e4a... [2/2] Frameworks: HALO”. Lines 78-118 look like this:
Code:
<<<<<<< HEAD
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
=======
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
>>>>>>> ab72e4a... [2/2] Frameworks: HALO
Between the <<<<<< HEAD and ======== is code that wasn't expected to be there. Between ====== and >>>>>> ab72e4a... [2/2] Frameworks: HALO is the code that was added in by the commit. Here is where we use our judgement to edit the code to what we need. Because I can see that the code between <<<<<< HEAD and ====== is duplicated by the commit, I can just delete that snippet altogether. We also need to delete the tags added by our cherry pick. In the end, the code looks like this:
Code:
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
Now we can save and quit.
We've resolved the conflict (assuming that was the only one), and now we can mark it as such in the terminal. To do so, we use this command:
Code:
git add packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now, we can do “git status” again and work on the next file we need to modify.
But what about the “deleted by us” files? Well, git is smart. All we need to do is determine if we need those files (hint: unless you really know what you're doing, you do need them). If we need them, git already loaded the files up, so we just have to mark them as resolved by doing
Code:
git add res/values/pa_arrays.xml
You can replace “res/values/pa_arrays.xml” with the rest of the files labeled “deleted by us”. You can also do more than one file at once, like so:
Code:
git add res/values/pa_arrays.xml res/values/pa_strings.xml whatever/files/I/want.java
Continue until you've fixed all the issues.
Note: when you open a file in gedit, it creates a file with the same name but with a ~ added to the end. When you do “git status” these files will show up as “untracked files”. You can either delete them with the command “rm path/to/file.java~” or just ignore them.
Once you do “git status” and all the files turn up green, you have finished resolving the conflicts. Now is the best time to compile your ROM and see if your changes worked. If you're in a rush (or lazy or don't feel like waiting for a ROM to compile or you've already tested it), you can now commit your changes.
Code:
git commit
It'll take you to a screen to write your commit message. It opens it in the in-terminal editor “nano”. You can edit it to say whatever you want, and when you're done press CTRL + X to exit, and then press Y to save the changes. Then your terminal will say you've committed the changes.
Congratulations! You've successfully cherry-picked a commit.
Troubleshooting/After the Cherry-Pick
Troubleshooting/After the Cherry-Pick
Once you've finished adding a cherry-pick, a whole variety of things can happen. You might:
build, and it will stop with some build erros
build, and it will complete, but something will go wrong when you flash it
want to get rid of the cherry-picks altogether
Well, what do you do?
If you build, and it stops building, there will be build errors. Your terminal will tell you what's wrong. Look/scroll up, and there will be something that says:
Code:
path/to/file/problem.java:86: some sort of error ocurred
line.of(code, that causes); a problem {
^
The first thing it says is a file. It will be a path relative to the part it was compiling, so you might have to look for a clue above that to see where it was working on. At the end of the file is a number (in this case 86). That number tells you what line the problem is on in that file. After that, it tells you what the error was that in ran into. Then, it'll print the line that had the error with a carat (^) underneath where it had an issue.
How do you fix it? Just open up the file with something like
Code:
gedit path/to/file/problem.java
and go to line 86 and see what the problem is. Usually it's something pretty straightforward, like mismatched parentheses or a dropped semicolon. Once you've fixed the issue, save the file and build again!
But what about if the build is successful, but it causes bugs in your build? Well, start up your phone plugged into your computer, and use this command:
Code:
adb logcat > errorlog
Once the phone becomes available, your computer will start recording the logcat to the file errorlog. Once you've captured the bug, then you can disconnect your phone and reflash something stable. You can also use CTRL + C to stop the logcat command. Now, you can open the logcat with the command
Code:
gedit errorlog
Reading logcats may take some getting used to. It will take quite a bit of scrolling, but the errors are probably marked with an E at the beginning of the line.
Now, what about if you've got some issues, and you just want to scrap the cherry-picks? Well, it's pretty straightforward. Just use
Code:
repo sync
and all committed cherry-picks will be wiped out and you'll be synced with the source that you're building from/
What if you want to do a repo sync and keep that commit, you ask? Don't worry! Git is smart. It remembers how you resolved the cherry-pick. You can do a repo sync and then cherry-pick again, and it'll automatically try to apply your previous resolution. Neat, huh?
Alternatively, you can fork the project to your own git repository (GitHub accounts are free for students!) and add that to your repo manifest. That's a whole different story, though, and will require extra research.
You should also mention how to cherry pick multiple commits
was looking for a guide like this for modding my build...gr8 guide...
AWSM !!
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
SleepyS40 said:
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Click to expand...
Click to collapse
Cherry-picking multiple commits is pretty straightforward. Once you've resolved any conflicts for one commit, you have to finish by using the command
Code:
git commit
if you want to add another cherry-pick in the same location.
Once you've committed that, you should be able to start the cherry-picking process over again exactly the same. If you have an issue, can you tell me what your terminal says, or post a screenshot?
Walterwhite007 said:
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
To build ParanoidAndroid, you first have to download the source to your computer. So you'd have to make a directory and use "repo init -u http://github.com/AOSPA/manifest.git -b kitkat && repo sync" to start the download. It's a big download, so be ready to wait a couple hours. There's a good guide for building ParanoidAndroid 4+ here
However, as far as forking a repository, you only need to fork the repositories that you want to make your own changes to and keep track of. Really, you don't have to fork anything.
Nicely written.
karanrajpal14 said:
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
+100
Took the workds right outta my mouth!!:laugh::highfive:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Walterwhite007 said:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Click to expand...
Click to collapse
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
jabza said:
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
Click to expand...
Click to collapse
Thanks bro. I tried many times cherry picking halo but that always messed up. Now after following this great guide I'll give it another try !!
Say my name
Thank you so much for the awesome thread..:good:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
I was hoping that someone could help me here so the problem is that I am trying to build OMNI ROM for mako but even after following the guide I dont't see any zip out/target/product/mako. I followed this guide http://docs.omnirom.org/Build_for_mako
xxLeoxx93 said:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
Click to expand...
Click to collapse
- "git commit" tells your computer it's done with editing and finishes the cherry-pick process. That is when git saves your resolution, so that if you go back and cherry-pick that commit again it can automatically apply your resolution to the problem. The ROM will compile without this command, but you won't be able to use "repo sync" to update that project or add any other cherry-picks to that location until you run "git commit" or "git cherry-pick --abort", which removes the cherry-pick altogether.
- When you rebuild the ROM, as long as you don't use "make clean" or "make clobber", it will only recompile the parts that have changed. The next build will go much faster. If you want the builds to go even faster, you should use ccache.