[Guide][CM]Where did it go? Android compile differences from ROMs. - Galaxy Ace S5830 General

UNDER CONSTRUCTION
I present you, the guide to locations in Android source in comparison to compiled ROMs.
You can of course also look this up in makefiles
I've tried to divide it into easy categories.
folders/apps
frameworks/base/core --> /system/framework/framework-res.apk
frameworks/base/policy --> /system/framework/policy.jar
frameworks/base/packages/System-UI --> /system/priv-app/SystemUI.apk
packages --> most of system/app
excluded from that: Development.apk, DocumentsUI.apk, PacProcessor.apk, PicoTts.apk, Term.apk, ThemeChooser.apk, WAPPushManager.apk, WhisperPush.apk
files
Changes to the setup
files in here are imported and used along the files your device tree specifies. Changes for all devices can therefor best be made to:
vendor/cm/config
You can change toolchains in envsetup.sh which is in build.
This commit changes the inline kernel toolchain to the 4.7 GCC Linaro toolchain.
https://github.com/TeamFun/android_build/commit/73b914051a03afd81ad8ccaf39058aa6ae5af4ea
Toolchains used for compiling ROM components are supposed to be in "prebuilts/gcc/linux-x86/arm"
If you want to contribute to this, put the info in here:
https://docs.google.com/document/d/1zun26nTWR7p54-SAP0Ol5oPX8bC4QjL9z3tm-Gz7UF8/edit?usp=sharing
Shoot me a PM and I'll make sure to put it in the guide.

You know you can write as "OP in Construction" so that there will not be any useless replies or questions
You know as this is the original Development section
Users do go mad over incomplete threads.
Just thought I do help you

Venomous Viper 119 said:
@ OP : Just PM to eagleeye uncle . He'll move it for you
Sent from my GT-S5830 using xda premium
Click to expand...
Click to collapse
That wouldn't get you anywhere as he isn't a moderator for Samsung forums.
You should PM either myself, andyharney or efrant as we are the most active moderators for Samsung International forums. Or use the report button and whichever one if us is online will deal with it.

Related

[DEV] AOSP Gingerbread Development Central

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 ^_^

[Module] X8Kconfig - Extract kernel config from running kernel | v001 | 02-05-11

This module is not for end-users. It's only valuable for kernel developers.
Intro
I wrote this module for the purpose of extracting kernel config from our running kernel 2.6.29 in my X8 (an educational purpose).
Instruction
Everyone who wants to try:
Download the module below (only for X8 with latest kernel + baseband 015)
Extract
Push to /system/lib/modules
From adb shell
Code:
insmod /system/lib/modules/x8kconfig.ko
gunzip -c /proc/config.gz > /mnt/sdcard/x8config.txt
Mount USB, open x8config.txt from your sdcard with wordpad
You will see these in some first line:
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
# Tue Jan 18 23:38:24 2011
#
Click to expand...
Click to collapse
Source was pushed to github: https://github.com/doixanh/X8Features
Licence violation will be discussed later
SE is treating it's end users like s*it as we all can see....
This will pass,only we need to spread the news.
News:Sony is hiding latest open source kernel,does sony afraid or newest source can unlock bootloader.
Because of user rights when qouastion will asked we can only guess whay they will say nothing or they can go to jail.
Sent from my X8 using XDA Premium App
Why don't you take the boot.img from the latest se rom and extract it so you can get the origenal kernel ..
then build a costom one debending on it
That's insane... I've just forwarded it to Polish android board, everyone should know this.
me using your module I obtain it:
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
# Sun Jan 30 20:24:17 2011
#
hmm, why cant we use the older kernel to unlock the bootloader?
just asking.
doixanh, are you going to contact http://gpl-violations.org/ those guys?
does the kernel tree compile with the config extracted from the device?
I think the different build dates are not really a good proof that the published archive is not the real one because they probably did multiple builds with different configs. I know that when I tried compiling kconfig support into the previous kernel/baseband it turned out to be useless and had a bunch of undefined config flags compared to the published kernel tree.
Because the configuration is newer you assume changes to source? That's pretty far fetched... Releasing updates on this big scale you don't do last minute changes to code... Gpl said release changes to code. What code is missing / changed?
Sent from my E15i using XDA Premium App
lol i posted this to SE's facebook page and it got deleted in under 5 minutes
http://www.facebook.com/sonyericsson
chewdaniel said:
lol i posted this to SE's facebook page and it got deleted in under 5 minutes
http://www.facebook.com/sonyericsson
Click to expand...
Click to collapse
what did you post? i mean the exact words.
well i said something about them abandoning us X8/10mini customers and making us stuck at 2.1 and that since they don't care about us the community will and asked them to release their code so the devs can work better
it wasn't rude or anything maybe SE just didn't like the idea of ppl developing the software for their phones
I posted this on polish sony ericsson on fb , bcause I have been blocked on english site
Sent from my Arc-X8 using Tapatalk
This is f*cking unbelievable! They were playing with us since they released 2010 products and now we see another thing.
doixanh many thanks to YOU!
They surely should be reported gpl site http://gpl-violations.org but who will do this? I don't want to be rude but YOU know what to say so why don't you do that?
Sent from my E15i using XDA Premium App
chewdaniel said:
lol i posted this to SE's facebook page and it got deleted in under 5 minutes
http://www.facebook.com/sonyericsson
Click to expand...
Click to collapse
I´ve posted similar threads there aswell and the threads got deleted.
I was starting to look at kernel stuff today for my X10 Mini Pro = and also couldn't find the latest kernel on the site.
However I downloaded the x10_x10mini_x8_eclair_2.1.A.0.390 file anyway to have a look - and according to the makefile for this it's
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION =
NAME = Temporary Tasmanian Devil
So has the kernel actually changed since this release - as this looks like a 2.6.29 to me?
cyttsp_i2c_init: Cypress TrueTouch(R) Standard Product I2C Touchscreen Driver (Built Jan 18 2011 @ 23:43:30) returned 0
got the same text too
Code:
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
# Tue Jan 18 23:38:24 2011
oisteink said:
Because the configuration is newer you assume changes to source? That's pretty far fetched... Releasing updates on this big scale you don't do last minute changes to code... Gpl said release changes to code. What code is missing / changed?
Sent from my E15i using XDA Premium App
Click to expand...
Click to collapse
It's entirely far fetched, as OP is trying to correlate something that isn't the cause.
The only thing he's proven is someone typed make oldconfig or make menuconfig, there is usually no indication of source code changes in the .config, outside of new kernel config options that may be in the running kernel vs provided defconfig (did you even check? no). The fact that you didn't even mention looking at the actual kernel build timestamp in /proc/version tells me you don't really know what you're doing, it's not in the .config...
Are there any modules that exist on stock but aren't available for compilation from source? Are there any kernel modules that are exporting tainted symbols? (i.e. is /proc/sys/kernel/tainted 0?) That would rule out any use of proprietary or missing modules. Do any of the stock modules export newer versions or kmsg info that isn't in the source? I highly doubt you looked through the source this extensively.
Most production kernel development cycles I've been a part of involve a period of code freeze before the final release. Usually during this period only absolutely show-stopping bugs are fixed and things like debugging and factory/test hardware modules are removed. It is likely that this is what happens at SE.
Do you really think they put relatively untested code in the kernel during that 5 day period from source finalization and production build? Any changes, especially the security measure you speculate were put in, would require extensive testing. Judging by the contributions that SE has provided in AOSP, they test their software and hardware for compliance more than the average vendor. It's illogical to me to assume they've snuck some code in when they spend countless man-hours doing testing and QA.
This type of speculative witch-hunt makes the community look bad, not SE. You need to provide factual evidence of a license violation, not .config file changes.

[Tutorial] Building Your First Kernel

Preface
OK a lot of people have been asking about building kernels, so here is my best shot at a tutorial. I want to preface this all by saying I AM NOT A DEVELOPER. I am a hacker and modder at best, I like doing my own thing, fiddling, and learning what I can, but I don't claim to know/understand everything about the process of building a kernel. You guys shouldn't expect my little walk through here plus another person’s source to make you a "developer", all it will prove is that you can copy/paste. Also if you follow this guide, I am not responsible for anything that you may do that results in destruction, death, or other negative side-affects. You really shouldn't be messing with this stuff unless you know what you are doing, or doing a LOT of research along the way.
However please use this guide as a springboard for knowledge, to give you some key terms to google, to turn on those lightbulbs in your head and get those gears churning.
Note: This is not a newbie's guide to Linux. Before you post your question please look at it. If it involves the syntax of the command/what a command does you need to do your own research elsewhere before attempting to continue with this guide.
​Step 1. Build Environment
A. Install Ubuntu 12.04(Not holding your hand here, if you can't do this you shouldn't be messing with kernels)
B. Required packages: git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib, and Adb.
C. Open a terminal
D. Type "mkdir android"
E. Type "cd android"
G.Type "mkdir kernel"
The above steps explained:
A. Installing a linux distro. You could really install any Linux distro(Arch = epicness ) however Ubuntu in my eyes is the easy to use and install, and widely supported.
B. Installing needed packages. I believe are these are needed(I'm sure someone will correct if they aren't), these are just the one's I was told I needed the first time I built CyanogenMod. No I can't tell you what every single package does, it is your job to research and figure that out.
C. Ummm...duh?
D-G. Building a directory structure that will help keep us organized. The "mkdir" command creates a directory, and the "cd" command moves you into that directory. You could also combine these steps using the command "mkdir -p android/kernel", however I left it broken apart up there to enforce the typing bit of this. The more you type these commands the more familiar you will become with them.
​Step 2. Your Source
A. Open your Terminal Prompt
B. Type "cd android/kernel"
C. Type "git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains"
D. Now comes the tricky part, you need to have some-type of source for your kernel. Check the following two sites for your device as appropriate. Once you have it download it is extracted/cloned into a folder in your kernel directory.
http://www.htcdev.com/
http://opensource.samsung.com/
http://developer.sonymobile.com/wportal/devworld/search-downloads/opensource
http://www.lg.com/global/support/opensource/opensource.jsp
The above steps explained: Ok all we are doing here is grabbing some tool chains and the kernel source.
A. Ok...you got this one!
B. Moving into our working directory
C. Grabbing DooMLoRD's very handy pre-built toolchains. What is a toolchain? Check this out http://en.wikipedia.org/wiki/GNU_toolchain. These toolchains are unstable, and as such they aren't completely endorsed yet. They are the versions I use though, and if you would like to use the stable version(4.5.3 as of 07/06/12) you can find links with Google.
D. I typically put my kernel in a directory like "~/android/kernel/<devicename>_<androidversion>_kernel" but that's just me.​
Step 3. Modifications
This is the part people are curious about, they want to make modifications to the kernel to make it "special". Start all these from the root directory of your kernel source.
Mod 1. Applying a patch
A. Download the patch you wish to apply, in this case this one should work.
B. Save that file as "kernelPatch" in your kernel directory.
C. Open a Terminal
D. Move into the root directory of the kernel you wish to patch.
E. Type "patch -p1 < ../kernelPatch"
The above steps explained:
A. Pretty simple, I mean we need a patch. The patch itself is quite simply a diff between the original kernel source tree and the source tree containing the changes. I'll post a quick tutorial on how to create a patch in the third post. The patch above contains multiple governors to be added to your kernel.
B. Self-explanatory
C. Self-explanatory
D. Self-explanatory
E. Basically we run the patch command on our source using the patch we downloaded previously. The "patch" portion is the binary itself, the "-p1" option allows you to control the number of forward slashes to remove from file paths(You'll need to look at this option more if you are using weird directory structures or applying the patches from a odd location). The "<" operator directs the content of our "../kernelPatch" file into the command.​ Mod 2. Adding a Governor Alone
A. Open "drivers/cpufreq/Kconfig"
B. Add the following lines in appropriate spot amongst the other govenor's
Code:
config CPU_FREQ_DEFAULT_GOV_SMARTASS
bool "smartass"
select CPU_FREQ_GOV_SMARTASS
select CPU_FREQ_GOV_PERFORMANCE
help
Use the CPUFreq governor 'smartass' as default.
Code:
config CPU_FREQ_GOV_SMARTASS
tristate "'smartass' cpufreq governor"
depends on CPU_FREQ
help
smartass' - a "smart" optimized governor!
If in doubt, say N.
C. Open "drivers/cpufreq/Makefile"
D. Add the following line in the appropriate spot.
Code:
obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS) += cpufreq_smartass.o
E. Create a file called "drivers/cpufreq/cpufreq_smartass.c"
F. Put the following code in that file.
http://pastebin.com/f0Bk9kVZ
G. open "include/linux/cpufreq.h"
H. Under the "Cpufreq Default" section add
Code:
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS)
extern struct cpufreq_governor cpufreq_gov_smartass;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartass)
Ok there is a governor added, do the exact same steps for any other one's you would like to add.
The above steps explained:
A. Just opening a file, you guys have this. The Kconfig ties into our "make menuconfig" command later, making our mod a selectable option.
B. Adding the appropriate code for our governor to get it in our .config file. The first chunk would allow us to set our governor as the default one for our kernel, the other allows us to totally remove or add it to the build as we wish.
C-D. This step tells the linker to tie our module in with the rest of the code.
E-F. Creating the actually governor itself, don't skip this step. I would suggest reading through this and trying to understand how it works, it's some pretty awesome stuff.
G-H. Open a file and add the code needed to tie our module into the rest of the source. Without this we would not be able to compile due to the rest of the source not knowing our module exists.​
Step 4. Getting a Config file
Option A. Pulling a config file from a kernel.
A. Hook up a device that is using a kernel similar to one you are using as your base.
B. Open a terminal
C. Change to your root kernel directory
D. Type "adb pull /proc/config.gz"
E. Type "gunzip config.gz"
F. Type "mv config arch/arm/configs/<your_config_name>_defconfig"
The above steps explained:
A. This will allow us to pull a base configuration file from a known working kernel. It makes it a lot easier to start out and let's us take baby steps through the whole process. As a note though not all kernel's support this, so you may have to try a few different one's to get it working. If that doesn't work, see option B.
B. Hehe, you are getting good at this step
C. Navigate to the uppermost directory of your kernel source.
D. Use adb to pull a copy of a working config file to use as your source.
E. Unzipping the config file.
F. Moving the configuration file you pulled to the config directory so we can reference it later. ​Option B. Using the manufacturers config.
Unfortunately as stated above, not all kernels support the "/proc/config.gz" method. You can typically find a manufacturer's configuration file in "arch/arm/configs". I believe the one for my HTC Flyer was called "flyer_hc_defconfig", so look for a layout similar to that one. Also read the README to get a better idea of how to modify it. I would personally make a copy of it called "<your_config_name>_defconfig" and use that as my base.​Step 5. Building
Time to start the real "build" section of this tutorial.
Part A. Pre-build Steps
A. Open terminal and change to the root of your kernel directory
B. Type "export ARCH=arm"
C. Type "export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-"
Part B. The First Build
A. Type "make <your_config_name>_defconfig"
B. Type "make menuconfig" and make the required changes to use any modules you added or similar changes.
C. Type "make -j<maximum number of jobs>"
Part C. Re-Builds
A. Type "make clean"
B. Type "make oldconfig"
C. Type "make -j<maximum number of jobs>"
Part D. Building Modules
You have two options:
A. Type "make modules"
B. Type "make path/to/your/module.ko"​
The above steps explained:Part A.(These steps are required every time you close your terminal and re-open it to build again.)
A. Ok shouldn’t need to explain this.
B. This command sets your target architecture.
C. Defines the path to the toolchain we are going to use to compile our kernel. You can change this to point towards whatever toolchain you have downloaded or feel like using, the way it is currently configured it will use the Linaro toolchain that we downloaded above.
Part B.(These only need to be run the first time you build a kernel.)
A. Load's your configuration file from earlier.
B. Open up a menu to configure your kernel. It will use the config file you loaded in the previous step as a base.
C. Viola start the build. I typically allow 1 job per core, so on my quad core machine I put "make -j4". Just raising that number will not make your build faster, your processor needs to be able to support the number of jobs you are assigning it.
Part C. (Use the command's when you are building any-time outside of the first)
A. This command gets rid of any old/outdated binaries or modules you compiled before, and let's start fresh. I like to run it every I build unless my changes are really small and localized.
B. A very awesome command, it parses through what has changed and only prompts you about new options.
C. See the explanation for the above "Part C.".
Part D.(Use these for just building kernel modules.)
A. This will re-build all modules.
B. Will rebuild just the module you need. Very useful when you need to rebuild a WiFi module.​
Step 6. Now what
Ok we have now started our build and we are waiting for it to finish, so there are two possible outcomes:
Outcome A. Build Succeds
W00t!! You have a kernel built by your self from source. There are a couple things you need in-order to use this kernel on your device any ".ko" modules and the zImage binary. If you pay attention to the output of your compiler then you will see the location of those objects. However the following commands will make your life a bit easier(Thanks Recognized Developer Hacre):
A. Open a terminal
B. Change to your root kernel directory
C. Type "mkdir ../<your_kernel>_output"
D. Type "cp arch/arm/boot/zImage ../<your_kernel>_output/zImage"
E. Type "find . -name "*.ko" -exec cp {} ../<your_kernel>_output \;"
The above steps explained:
A-C. Self-Explanatory
D. Move our kernel binary into our output folder
E. This handy bit of magic finds all ".ko" modules and also copies them into your output file.
You will also need to assemble a kernel image containing a initramfs for your device, along with the kernel binary and such. That however is beyond the scope of this tutorial. To get started though try searching the following phrases.
Code:
building android kernel image
xda build kernel image
xda unpack boot.img
Outcome B. Build Fails
Oh dear. It failed. Well guess what...this is going to happen..a LOT. Get used to it, and get used to googling and experimenting with different solutions. The following are some tips that will help you with debugging your issues.
Running a "Clean" build
A. Backup your config file(Type "cp .config ../backupConfig")
B. Re-run the build process using just your defconfig from earlier.
Limiting Output(Thanks Hacre.)
A. Another good tip is to run "make -j1" to get the error, as it will limit the amount of text you need to scroll through.​Credits
Hacre-Feedback
cdesai-Feedback
Leedroid-Being willing to answer a noob's question's
Doomlord- Having such handy Git repo's ​
Enjoy. That's all it takes to build a kernel, it's actually rather simple. I will try to answer what questions I can in this thread, and continue to add to it.
Please Read. The GPL is VERY important.
The Rules as they apply on XDA
As XDA has no legal power to uphold the GPL (and frankly we want to stay as far away from doing so as possible), we can’t force any of our users to abide by the GPL. However it is in XDA’s interests as well as the interests of our developer-base to ensure all GPL-derived materials hosted or linked on XDA comply fully with the GPL.
GPL-derived materials that do not come with the complete sources used to compile the GPL components are considered warez, and will be treated as such under forum rule 6 and 9.
If you use GPL components, but do not make any modifications to them whatsoever, you should provide a link to the original source of your GPL code.
Sources accompanying a release should be complete, and contain all the necessary source code for any modules, scripts or definition files. Complete sources will be defined as those which compile correctly and completely against the platform for which the software is distributed, and which contain any and all modifications made to the released General Public Licenced code. The source code supplied should be the exact version for which the source code is being requested, complete with all modifications.
EXAMPLE: Here’s a bit of code that could be used as a template to post your releases
<Kernel Or Author Name> <Kernel Nr>:
<Source>|<ReadMe>|<Credits>|<Other>
The Very Quick Summary of General Public License (GPL)
The text of the GPL Licence itself will be used to reach any final conclusion regarding any disputes over GPL Licenced materials. The above is a summary of what XDA expects of members using GPL code, and the complete text can be read at the GNU website.
The GPL states that anyone who modifies GPL licenced code is required to make available the sources used to compile it. This is to further improve and encourage collaborative work, as well as to ensure that the best code possible is produced, and to encourage peer-review of all work. This benefits both developers and end users in numerous ways, including:
Allowing anyone to verify the code they are trusting with their data, and its authenticity
Encouraging community collaboration to produce faster fixes and updates, and better code
Helping bring new developments from other devices and fields to your own, letting you benefit from new code that wouldn’t have been available without this sharing.
The GPL imparts great freedom for GPL end users. It ensures innovation is never stifled and no project is dependent upon any single developer.
It is in everyone’s interest for the GPL to be adhered to, as it gives us all better ROMs, better transparency, and a better atmosphere for developers to work together to make great code.
Click to expand...
Click to collapse
Grabbing this on the off chance that this thread takes off.
Tutorial coming on how to make a patch when I have time.(Hopefully later tonight.)
Would you mind if I use this tut to automate Build Kernel in the future for use in my tool StudioAndroid?
Credits will be given!
Sent from my Galaxy Nexus using Tapatalk 2
Go for it, let me know if you have any problems with it.
Sent from my SCH-R760 using Tapatalk 2
Would there be any interest in a tutorial on common Linux CLI tools?
thewadegeek said:
Would there be any interest in a tutorial on common Linux CLI tools?
Click to expand...
Click to collapse
Like what/
Sent from my Galaxy Nexus using Tapatalk 2
Oh find, grep, and sed are all one's I use on a regular basis, we could add a quick walk through on repo/git, maybe vi. And come to think of it talking about shell scripting would probably help out as well, it's pretty commonly used for tweaking around here.
thewadegeek said:
Oh find, grep, and sed are all one's I use on a regular basis, we could add a quick walk through on repo/git, maybe vi. And come to think of it talking about shell scripting would probably help out as well, it's pretty commonly used for tweaking around here.
Click to expand...
Click to collapse
A while ago I wanted to add a BASH guide. I think that it will be greatly appreciated if you create a guide for it.
If you need any help, just PM me
Remember to post 8 "reserved" posts if you create a guide for feature expanding
Sent from my Galaxy Nexus using Tapatalk 2
Hmm I'll start rolling with that then. And as to the 8 posts, I prefer to keep them separated by topic so that I can assume the questions in each thread can pertain to the topic at hand.
definatly want to do this!
one question though how can i get source from lets say FXP's github? i keep getting stuck there
like what directory do i need? staright to the kernel file the have or what/? if thats a yes what directory is it?
this is the git hub https://github.com/freexperia
ur help would be greatly appreciated
Well what type of device do you have? He has multiple kernels there so we need to make sure we grab the right one.
sorry it was arc or "anzu"
it is cm9 kernel im looking to make
or i could use the one from cyanogen mod if thats easier since it has the RC1 kernel
Either would work, just make sure it's for your device. Do you have a ready link to the CM9 one?
thewadegeek said:
Either would work, just make sure it's for your device. Do you have a ready link to the CM9 one?
Click to expand...
Click to collapse
i cant tell which it is cause none of them have arc or anzu in them so i dont know which its for
https://github.com/freexperia/semc-kernel-msm7x30-ics.git maybe
idk cause the have all sony devices on this github..... is it just a couple of files that wil be replaced that are device specific?
Ok...I do not see a kernel in there with Qualcomm MSM8255 support. Is this http://www.gsmarena.com/sony_ericsson_xperia_arc-3619.php your phone?
thewadegeek said:
Ok...I do not see a kernel in there with Qualcomm MSM8255 support. Is this http://www.gsmarena.com/sony_ericsson_xperia_arc-3619.php your phone?
Click to expand...
Click to collapse
yes but its ok i got everything workin i just dont understand step 3 part c....
Open that file, and then add that line. However I'm guessing this kernel has all the Govenor's you'll need for this. Also pay attention to the bit about the GPL, and make sure you ask the original creator's permission.
thewadegeek said:
Open that file, and then add that line. However I'm guessing this kernel has all the Govenor's you'll need for this. Also pay attention to the bit about the GPL, and make sure you ask the original creator's permission.
Click to expand...
Click to collapse
oh sorry i meamnt the next part 3 (seems u have 2) about im talking about getting config file part C
Ah good catch, updated. Ok so you know you created a "android/kernel" folder? In your terminal type "cd ~/android/kernel" and press enter. Then type "ls" and press enter again. Tell me what it says.

Integrate app into CyanogenMod

Hi,
for my own usage, I would like to integrate an app to CyanogenMod, which should be compiled with CM.
How do I do that?
Thanks,
Yannik
Any idea?
Are you building cm yourself? If so then the easy way is to place your project on github and then add the project to a manifest file in the .repo/manifests/local_manifest/ folder of your cm source, repo sync well the draw your project source code and it will be built with cm.
Or you can do it the right way and add your source into the /packages/apps folder of your source but you need to make sure everything is included correctly. Check out the link below for more info:
http://wiki.cyanogenmod.org/w/Doc:_adding_your_own_app
Adding an app to the actual cm source would be pretty hard it would have to be something pretty special that would add some real value, don't know how you could do that. Check out the cm wiki.
Sent from my PACman GT-i9100 using Xparent ICS Tapatalk 2
But by doing so.. can there be any problems with the working of the rom?? or will it work fine?
As long as your app works and compiles ok there should be no issues. I have modified a number of the stock apps from cm10.1 and added my own apps to the Rom I build from the source. I go the easy way and keep my project on github and add the details in the local_manifest folder.
Sent from my PACman GT-i9100 using Xparent ICS Tapatalk 2
Thanks for your help. I integrated everything like described in my device*.mk, but the source code is not going to compiled with CyanogenMod, dont now what to do.
Does your source code have an android.mk makefile? Check where you imported the source such as packages/apps/myproject/android.mk?
If not you will need to make one, look at an existing apps android.mk to see the details you need and just make sure you edit the following:
LOCAL_PACKAGE_NAME := PackageName
Where PackageName matches what you put into your device.mk file, then it should be included in the build and appear in your output zip.
Sent from my PACman GT-I9100 using xda premium
Got it! The Android.mk was missing on the build machine because I created the file on my mac and forgot to sync the files.

[PATCH CENTRAL] The How-To and Help Thread for kernel patches

Hi guys, a couple days ago, i spent hours sifting through pages of google searches to find the EASIEST stuff about kernel patches. This guide will be updated slowly, be patient! I welcome the help and input from the community, please feel free to pm me (to make sure i get the message ). Let me start off by saying that I will not be able to fix all the problems that you get from patching, but i have no doubt that someone in this awesome community can. So enjoy!
Patching your linux kernel!
Alright guys, i am gonna cover INCREMENTAL patches, these are fairly easy and won't take much of your time. If you plan on doing a more major update, i.e. 2.x --> 3.x, i suggest you go elsewhere because this guide WILL NOT help you.
Another important note, all 3.x updates are incrimental, you cannot skip a patch. Meaning, if i want to patch a 3.0.58 kernel to 3.0.60, i have to patch .58->.59 and then .59->.60. That took me a while to figure out which is why i brought it up early .
LETS GET STARTED!
First, get a nice kernel, one that you know compiles correctly and works, for the most part. Check the makefile, it should be in the root of the directory. Open up the makefile, in my kernel, i see this:
Code:
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 63
Ok, it looks like we have a kernel source that's on 3.0.63. Awesome, this should be simple enough. We need 2 patches, one to go up to .64 and the next to .65.
Go HERE and download the .bz2 of what you need. In this case, i am going to download patch-3.0.63-64.bz2 and patch-3.0.64-65.bz2. You'll need to "save link as" to download the files or you can you the lftp command in terminal if you know how to use that. Anyway.
Here is where the terminal fun starts, lets unpack those files so we have the patches. CD into wherever you downloaded the files and run
Code:
bzip2 -dv insertpatchname.bz2
Obviously, you change insertpatchname to your file name. You run that for as many patches you need to do.
Good, now we have the patches. Linux loves us and made it really simple to apply those patches. All you have to do is
Code:
patch -p1 > ~/path/to/the/patch
If you did it right, give you a wall of text telling you that its patching files. NICELY DONE. If you want to confirm that the patch was sucessful, go back to you makefile, you should see that your sublevel is higher. For each additional patch, just repeat the last two steps!
As always, i can't guarantee that these patches won't break compatibility but thats when the fun starts, right?
Wow, nice, you just patched your very own kernel! In the next post, we'll learn how to do the same thing, but instead, we'll cherry-pick those commits from github. PM and Post for any comments, questions, blah, blah. As always, donations are not required but they'll be paying for a new processor to replace my 1.6ghz single core crap. Thanks are appreciated!
Reserved for Github Stuff
I want this one!
Nice, just what I was looking for! Tnx
wantowan2 said:
Nice, just what I was looking for! Tnx
Click to expand...
Click to collapse
No problem, i am happy it was helpful!
Ques:
Say I put the patch in the top of the kernel dir and I cd to the kernel dir, should this work?
Code:
patch -p1 > ~/patch-3.0.49-50
That will work as long as the patch is in ~/

Categories

Resources