[For DEV] Samsung Galaxy S I9070 Advance kernel & platform source code - Galaxy S Advance I9070 Android Development

Hello!
This is a thread where potential developers can get kernel and platform source code for Samsung Galaxy S I9070 Advance, and other info. I will try to update this until we will have first custom rom ready. I encourage everybody with some experience with android development, to share their knowledge with other users here. Please if any of you will make any progress in rooting, making recovery or developing custom rom, to write here in this thread or even start a new one if some major break trough will be made.
Ok so here are the links to sources (I don't know the diference between those to, but I guess it is region related):
GTI9070_GB_OpenSoruce
GTI9070_LA_GB_OpenSoruce
All sources, can be found HERE.
In the attachment you can also find some other info I've pulled from my phone, which used to be rooted, cause I had some test version. I hope all this stuff will help us get root access, custom recovery and last but not least a whole bunch of custom roms.
NOW LETS HACKING AND DEVELOPING BEGIN!!!
One more thing, PLEASE take a minute to VOTE for this phone to get its own forum section here on XDA. Just make a post in THIS THREAD. The device is not in the poll yet, so you must write a post in thread. THANK YOU!

We've made a step into a right direction with a lot of help from forum I've made a working root method!
I've hard bricked my phone, so I am off the developemnt from this phone, only if by some chance I get a replacement. Sorry guys, in spirit of developing I've killed my phone .

I wish I was better at kernel development... I would love some development for this phone!
Sent from my GT-I9070 via Tapatalk 2

I've somehow managed to configure linux and pulled andorid sources from the repo, now I have to figured out how to compile a kernel. I have much to learn but if nobody else will give it a try, maybe I will succeed.

yeah...we as new wannabe devs are learning back the basics...i'm still trying to figure out what to do about the kernel source...afraid of bricking my phone in the process... hehe.. but all the kernel sources for all regions has been released...

kilsmap said:
yeah...we as new wannabe devs are learning back the basics...i'm still trying to figure out what to do about the kernel source...afraid of bricking my phone in the process... hehe.. but all the kernel sources for all regions has been released...
Click to expand...
Click to collapse
Dear friend. I come from China, now I already have a good i9070, I can help you with your test, you can send to my mailbox [email protected]

hmmm...qzem, im getting stuck at initramfs...how do we get these for our phones? because the kernel can only be flashed safely when it is compiled with initramfs files from our phone... and for the phone to get custom recovery, i think they will also need initramfs files...

kilsmap said:
hmmm...qzem, im getting stuck at initramfs...how do we get these for our phones? because the kernel can only be flashed safely when it is compiled with initramfs files from our phone... and for the phone to get custom recovery, i think they will also need initramfs files...
Click to expand...
Click to collapse
Same thing here. I have no idea how to get those, been asking around the forum an searching, but for now all the directions indicates that you need to have root access to get iniramfs. That really sucks...

hahaha...from this point of view, all Samsung phones after Galaxy S Advance will be quite hard to root... I'm waiting for the Galaxy SIII to launch, and for someone to root it... Maybe then we will be able to use the same way to root our phone... If only we can see what's inside our kernel.bin.md5... I'm sure the files we needed are in there...

the initrams? u mean ramdisk?
grab stock boot.img and extract from it.
the stock boot.img can be grabbed from odin flashable stock rom.

an0nym0us_ said:
the initrams? u mean ramdisk?
grab stock boot.img and extract from it.
the stock boot.img can be grabbed from odin flashable stock rom.
Click to expand...
Click to collapse
Yeah.. We have the stock rom, but can't figure out which one should we extract the boot.img from.. There was system.img.md5, cache.img.md5, hidden.img.md5, modem.bin.md5, and kernel.bin.md5... So which one? My suspicion lies to the kernel.bin, but I have no idea how to extract it..
Sent from my GT-I9070 using XDA

I have compiled a stock kernel from source code, so I got zImage file, now I have to find out how to build boot.img from this. I will contiue tommorow I hope I am close to the solution! Mabe few days to crack this baby .

qzem said:
I have compiled a stock kernel from source code, so I got zImage file, now I have to find out how to build boot.img from this. I will contiue tommorow I hope I am close to the solution! Mabe few days to crack this baby .
Click to expand...
Click to collapse
Good luck!
Hope you get to a solution soon
I can't work on it as I currently don't have a phone to test on, sent it in for repairs.

qzem said:
I have compiled a stock kernel from source code, so I got zImage file, now I have to find out how to build boot.img from this. I will contiue tommorow I hope I am close to the solution! Mabe few days to crack this baby .
Click to expand...
Click to collapse
Have u tried flashing it directly to the phone? You don't have to make it into a boot.img to flash it.. Because I'm afraid that the zImage will be useless if not paired with working initramfs.. Compiling the kernel is quite straightforward, the thing is to get the initramfs to turn the kernel insecure.. There are also scripts to extract initramfs from zImage, but I haven't had time to test it..
Sent from my GT-I9070 using XDA

Ok what exactly is in initramfs, that is what I am trying to figured out? I've recompiled some other samsung boot.img with dsixda kitchen, and I got zImage and a folder caled boot.img-ramdisk, which included different files like init, init.goldfish.rc init.rc, default.prop, etc. In a file default prop is the setting ro.secure=0, and this is the settign I belive, that makes kernel insecure. I've also tried to unpack the zImage that I got from thsi boot.img, with the kitchen to see if includes those so called initramfs, but it doesn't. So I think that if I figured out which files should be in ramdisk, and if those files can be pulled of the phone, that than maybe I can repack a working boot.img. What do you think?

qzem said:
Ok what exactly is in initramfs, that is what I am trying to figured out? I've recompiled some other samsung boot.img with dsixda kitchen, and I got zImage and a folder caled boot.img-ramdisk, which included different files like init, init.goldfish.rc init.rc, default.prop, etc. In a file default prop is the setting ro.secure=0, and this is the settign I belive, that makes kernel insecure. I've also tried to unpack the zImage that I got from thsi boot.img, with the kitchen to see if includes those so called initramfs, but it doesn't. So I think that if I figured out which files should be in ramdisk, and if those files can be pulled of the phone, that than maybe I can repack a working boot.img. What do you think?
Click to expand...
Click to collapse
Yep, you got everything right there, I think.. Initramfs, ramdisk are the same thing.. They should include the cpio.gz, init.rc, default.prop etc... Have you extracted these files from the source kernel? Cos I don't think we can copy directly from phone, cos we need to preserve the permissions set on the files... Can you do that with kitchen?
Sent from my GT-I9070 using XDA

I am following the topic and hoping it works out the development of kernels and roms to the device.

Come on it has to be a way to compile an insecure kernel without having the access to rooted phone. Cause all the options I found till now, required some files, that can only bee pull from rooted phone. But the whole point of an insecure kernel is the possibility to root the phone. Anybody can help us? Maybe I should start another thread, damn it!

Haha... Yeah, somehow I feel that Samsung is screwing with us, what with the new firmware format (never had kernel.bin before) and secured kernel, this is becoming impossible.. If we just have some devs good-hearted enough to port CWM recovery for us.. But without initramfs, I don't know if it's possible..
Sent from my GT-I9070 using XDA

The initramfs is inside kernel.bin.md5 (as for the Galaxy S firmware).
kernel.bin.md5 is a normal zImage Linux kernel (+md5).
the initramfs is included in the kernel image (see http://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage)
the initramfs is in our case a uncompressed cpio archive, therefore the script in the wiki does not work, but https://github.com/mistadman/Extract-Kernel-Initramfs/blob/master/unpack-initramfs can extract it without problem.
So, there should be no difficulty to root the i9070...
The easiest way would be to change the initramfs and repack everything.

Related

[Q] Backup Firmware

Hi all,
Cant find a proper answer so need to ask to be sure. Can we back up our firmware before flashing it to a new one? I have custom firmware from my operator it is JJ1 and even can not be updated with kies
kromosto said:
Hi all,
Cant find a proper answer so need to ask to be sure. Can we back up our firmware before flashing it to a new one? I have custom firmware from my operator it is JJ1 and even can not be updated with kies
Click to expand...
Click to collapse
Proper answer: Yes.
Ty but cant wait and flashed to new one before backingup the previous
Sent from my GT-P1000 using XDA App
I used rotohammer's method for backing up. I would like to put my own kernel on but stock make on the basekernel patched with SGH_I*** from samsung just results in a kernel panic on the galaxy tab. Does anybody know what configuration parameters are needed?
letolkki said:
I used rotohammer's method for backing up. I would like to put my own kernel on but stock make on the basekernel patched with SGH_I*** from samsung just results in a kernel panic on the galaxy tab. Does anybody know what configuration parameters are needed?
Click to expand...
Click to collapse
The Samsung kernel is a zImage with a initramfs appended, thats why the zImage runs around 5megs in size. Drivers that get compiled with the new kernel need to be included in the initramfs before assembly with the kernel. There should be notes out ther on how to do it. I can look later at how I did it and post notes.
@rotohammer i find a tab with my original rom so going to do a backup with it. i think i will use Roto Backup link in your sig to do that am i right?
rotohammer said:
The Samsung kernel is a zImage with a initramfs appended, thats why the zImage runs around 5megs in size. Drivers that get compiled with the new kernel need to be included in the initramfs before assembly with the kernel. There should be notes out ther on how to do it. I can look later at how I did it and post notes.
Click to expand...
Click to collapse
thanks that did the trick.
rotohammer said:
The Samsung kernel is a zImage with a initramfs appended, thats why the zImage runs around 5megs in size. Drivers that get compiled with the new kernel need to be included in the initramfs before assembly with the kernel.
Click to expand...
Click to collapse
Could you please post some instructions (or a link to existing notes) ?
I fail to build a kernel + initramfs (i.e. zImage) that doesn't boot-loop or gets stuck on the Samsung white logo
I've extracted the initramfs.cpio from Koush's CWM zImage and from the MoDaCo kernel (which also comes with ClockWorkMod Recovery)...to no avail.
Do I *have* to use the initramfs from a stock zImage ?? If yes, how do I then "inject" CWM in my build ?
Many thanks !! Dan

Nexus sense Port Help with the boot.img

Help.... with the Boot.img
I m Trying to port sense Htc desire in nexus s i m confused about the boot.img file kernel
1. Does it needs to be changed / modified
2. If yes then is there any software i can use to Extract the kernel and repack it too Windows / linux
3 i Zimage of the boot.img any clue how to edit it
Plzz... reply.
this thread is going places... >.>
but in the off chance.. of, well i dont even know, ill try to be helpful
1) yes, lots. in fact your better off not trying to port that kernel to this phone and just start a fresh one and reverse engineer it
2) windows idk, linux makebootimg scripts will unpack it
3) nope, you better have source to compile that zimage
Hmm okk i guess i try that out on the next weekend thankz,, man...

[GUIDE] How to port sense to non-HTC devices.

How to port Sense.
Source: http://forums.androidcentral.com/optimus-v-rooting-roms-hacks/164989-guide-how-i-port.html (second post)
This is NOT my guide, just posting it here!
This is a very difficult process that I hope you'll understand.
First step is to find a device that is preferably VERY similar to your device, in this instance I guess we would use the htc thunderbolt, which I've been told multiple times that it is used for the MT.
You're going to want to use CM7 for parts. Simple enough.
I will be referring the Sense ROM to SENSE and CM7 as BASE to simple things up. So remember that.
When I say replace, I would recommend deleting from one and adding it with the other
Open up Sense and Base in different windows.
Put in the boot.img from Base into Sense (make sure you put the original boot.img in some other place that you'll remember)
go into /system/usr on both
replace keylayouts and keychars from Base into Sense (this is just your keys)
download dsixda's kitchen (http://forum.xda-developers.com/showthread.php?t=633246)
Get the ROM you have so far set up in it and what not (I'm a little fuzzy at this part)
Once you get done with that, run the menu in terminal and navigate your way to decompile the boot.img (action key- "a") and then run the same thing except run the action key "w" to decompile the original boot.img. So the key here is to decompile both boot.img's.
Go into the ramdisk on both and go into init.rc
THE MOST IMPORTANT PART IN THIS (THE MATTER OF BOOT AND BOOTLOOP) IS THE LINE
"export BOOTCLASSPATH" near the top. It will have a bunch of lines after it. Now in the Base's boot.img, delete this whole line. Replace it with the lines from Sense's boot.img.
Now you can add anything else you want that looks like it belongs (preferably anything sense related)
Don't recompile the boot.img yet.
Now we add a2sd. To do this, just follow this guide (https://www.facebook.com/note.php?note_id=158823170833688)
The only thing you do in there is the edits to the init.rc, don't listen to the decompiling/recompiling mentions. Now you can go back into the menu for the kitchen and recompile the boot.img (action key - "b"). Now don't compile the WHOLE ROM, just take the new boot.img in working_** and put it into the Sense zip.
Now you're going to want to download my ROM (sorry, just don't feel like uploading each individual file) http://gannon5197.blogspot.nl/2012/03/got-sense-booted.html
And go into the /system/bin on both
these are the files you're going to need: a2sd, bash, apps2sd.hlp, busybox.a2sd, chka2sd, jita2sd, launcha2sd, starta2sd, and maybe possibly sh (try once without it)
And you're going to want to set permissions for each one of these in the updater-script (look at mine for references)
Now also look at my zip and you'll see move_cache_sd. Put that in yours and set permissions for it in updater-script (use mine for references)
After that, the other stuff is mainly just getting rid of all the bloatware, (look in /system/app and /system/media) I wouldn't delete any libs as of right now. If you try to flash it and it reboots recovery then it is too big.
If it is too big, you're probably going to want to move a lot of the apps to data. To do this, just make a file called data/app/put_your_apps_here on the root of the zip. You're going to have to set permissions for it in the updater-script, but use the test.zip I sent you in the original.
This will most likely get you booted. Nothing will likely work. Which is expected. If you have any problems, just use logcat. It will be your bestfriend. Have fun porting
Click to expand...
Click to collapse
reserved
Thanks for reopening it bro...
Sent from my LG-P500 using Tapatalk 2
No problem :thumbup:
Don't know how this above awesome thread is so blank
Have u tested if this way works
Sent from my LG-P500 using Tapatalk 2
great guide, gonna try out soon
hmm this one's new for me. saved
should come in handy sometimes
someone has to do this for the Galaxy S2.
Will it also work for ICS ROMs?
I must do this. Anybody know where I can get the firmware for the One S?
Can i use a Gingerbread ROM as a base instead of cm7?
Hello for lg p500 there is 2 sense rom but data and mic not working in both rom can you help to solving that problems????btw great tutorial.
in fact sensse porting is differnet from the tutorial showed it is a little bit more difficult and there are some libs needed that there is only for the devices you are porting to. so a general tread will not really work
QuBe2 said:
in fact sensse porting is differnet from the tutorial showed it is a little bit more difficult and there are some libs needed that there is only for the devices you are porting to. so a general tread will not really work
Click to expand...
Click to collapse
Well this is not my tutorial just found it on the internet so I don't know if it works
Lord Inglip said:
Well this is not my tutorial just found it on the internet so I don't know if it works
Click to expand...
Click to collapse
why sharing things on the internet
QuBe2 said:
why sharing things on the internet
Click to expand...
Click to collapse
Because it's the internet. This guide was the only thing I could find.
Well you ported a htc sense One x rom to the Nexus S, so can you show us how you did it?
Lord Inglip said:
How to port Sense.
Source: http://forums.androidcentral.com/optimus-v-rooting-roms-hacks/164989-guide-how-i-port.html (second post)
This is NOT my guide, just posting it here!
Click to expand...
Click to collapse
Similar phone means the same chipset,processor and gpu??
a2441918 said:
Similar phone means the same chipset,processor and gpu??
Click to expand...
Click to collapse
Yes it's better if the phones have the same hardware
Lord Inglip said:
Yes it's better if the phones have the same hardware
Click to expand...
Click to collapse
I have an xperia x10.. will the nexus one and HTC desire be suitable??
My cm7 rom which i downloaded doesn't have a boot.img file.. So how to get it?? Is it the system.img got from a nandroid backup?? and the sense rom which the post refers to is the stock sense rom of the phone in a zip format or a modded one??
Not working..stuck at boot logo

[KERNEL][I8200N] Baroni-Kernel Alpha

I can give ABSOLUTLEY no gurantee!! All you do with your phone will be on your own. I'm not responsible if your phone will brick or whatever...
Attation! This kernel is for the I8200 variant ONLY... the I8190 is absolutley not compatible !!!
Kernel should be work also for I8200/I8200Q/I8200L-Variants, but can not be gurateed as the basis was I8200! If it works then a notice will be fine!
If you are not sure about the process, the data are important on your phone or you need it as a daily phone, then LET IT BEE, and wait for the messages that it is safe to use. Its important at the beginning that users with knowledge tried it at first !
Changelog:
12.02.2016: Long time ago, but now after a lot of investigating some new things comes up. Check what was done
05.01.2014: I try to work on the kernel over x-mas in my free time, but I must say that the source of samsung which was provided on opensource.samsung.com is not really funny stuff... there are so many coding errors, which was. not able for me to solve directly. So now I started to examine other kernel sources, and will try to port a more main.tained source to the i8200. From My point of view this will be the only way to produce an more accurate kernel for our device, and get the possibility to include also selinux what is needed for a kitkat-rom. Nevertheless, it is not easy to work on that stuff, because I'm not an expert on kernel work (but I learn every day more , so if you know someone with more kernel experiences, it would be very helpful to get a contact...
Baroni-V0.1 contains:
Basis of opensource from Samsung with some bugfixing
fixed recovery-boot-loop with a config-setting which must be used special in the Recovery zImage
Loglevel pushed down to minimum
Uber-Toolchain 4.9
set onDemand-Governor to standart. just to check how that works
start implementing SmartAssV2-Gonernor, but leave it inactive, due to some compile-errors.
bringing SELinux to work for future kernel releases if needed for > 4.4
Planned:
new govenors at the moment not established (will come later)
more other stuff (depending on learning-curve
Installation:
Install a recovery for safetyreasons (I prefer TWRP https://www.dropbox.com/s/d3rnfp3vabz9ee8/twrp_i8200_corrected.7z?dl=0
Read carefully the hints of the usage in the following firts post: http://forum.xda-developers.com/galaxy-s3-mini/general/s-iii-mini-ve-i8200-n-t2826565 (There also the needed Odin (3.09) can be get)
Make backups of the complete phone, and be sure that you know what you do!
Download the right Firmware for your phone from http://www.sammobile.com/firmwares/ (just to have a other safety fallback in your hand!)
Download the file, start odin as usual (all kies-tasks closed!)
extract the file, and put it to AP
put the phone in Downloadmode (Vol-down,Home-key and powerbutton), and connect the phone with PC
flash the kernel, and let the phone reboot
pray
If things go wrong, please give everytime the following information's:
what you did before
what exactly happened (its not easy to help if you say: it did not work )
which rom in which version, which recovery and which version of my Kernel you use
try to get a /proc/last_kmsg (if a unknowen reboot appears) and/or Logcat, Build prop, CPU info, Sysctl, Kmsg, Dmesg and send it to me (or as a attachment to the post) for further analyse (you can use that tool for it: https://play.google.com/store/apps/details?id=com.bassel.andylog )
Attention: First checks seem to be that I8200 (without N or L or Q) did not work atm.
Download:
kernel_i8200n-Baroni:
https://www.androidfilehost.com/?w=files&flid=47763
kernel_i8200n-Stock.7z (to getting back to stock kernel via Odin):
https://www.dropbox.com/s/xfhufcpxl5kxmue/kernel_i8200n-Stock.7z?dl=0
Recoverys (with fixed recovery boot loop):
https://www.androidfilehost.com/?w=files&flid=49834
There was a mistake in the initramfs. was corrected now. If you download the V0.7 yesterday, please dont use it... Try V0.8.
One question.
SolarPlexus said:
There was a mistake in the initramfs. was corrected now. If you download the V0.7 yesterday, please dont use it... Try V0.8.
Click to expand...
Click to collapse
My Friend.
Yesterday I tried to install its kernel but my phone did not start properly.
I wanted to do a restore from a backup that had done, but the recovery (TRWP) did not restore the data partition.
Is there any chance that I happen again the same with this version?
Danh23 said:
My Friend.
Yesterday I tried to install its kernel but my phone did not start properly.
I wanted to do a restore from a backup that had done, but the recovery (TRWP) did not restore the data partition.
Is there any chance that I happen again the same with this version?
Click to expand...
Click to collapse
Attention with TWRP-Recovery. Data-Partition restore seems to be not right. At the moment please did not use it, because it can delete your data-partition. We have to investigate it further! Other partitions seems to be ok, but its a good Idea if you copy your important data also manually to a other storage (like PC) while you trying things of this thread.
i install the kernel ans stuck into samsung logo.if i flash the stock kernel i will fix it?
stock kernel?can you upload it?
KwstPap said:
i install the kernel ans stuck into samsung logo.if i flash the stock kernel i will fix it?
stock kernel?can you upload it?
Click to expand...
Click to collapse
Did you made a backup with twrp (as described)? If yes, then make a restore only with boot marked in the list.
Otherwise, which version did you have? Plain n/l/q? Than I can make a package for Odin...
send with my Oneplus One (bacon) SlimKat Tapatalk
About the data recovery, use aroma FM to restore. Out worked for me
hahhhahaha i forgot it to take a backup hahaha .i reflashing the stock firmware... i Have i8200N
but why the kernel doesnt work on me?
KwstPap said:
hahhhahaha i forgot it to take a backup hahaha .i reflashing the stock firmware... i Have i8200N
but why the kernel doesnt work on me?
Click to expand...
Click to collapse
You are a funny guy... Flasching things without reading the guide is something like a other guy I know from kentucky fried movie (Danger-seeker)
Nevertheless, I added in first thread the stock kernel for i8200n to flash with odin.
SolarPlexus said:
You are a funny guy... Flasching things without reading the guide is something like a other guy I know from kentucky fried movie (Danger-seeker)
Nevertheless, I added in first thread the stock kernel for i8200n to flash with odin.
Click to expand...
Click to collapse
hahahahaha always forget to take a backup .but i am very stypid .i had a backup on my pc.hahah in one weak i have reflashing the stock formware 5 times and the root recovery and other staff again hahaha
thanks for the stok kernel
SolarPlexus said:
You are a funny guy... Flasching things without reading the guide is something like a other guy I know from kentucky fried movie (Danger-seeker)
Nevertheless, I added in first thread the stock kernel for i8200n to flash with odin.
Click to expand...
Click to collapse
¿which brings benefits to install this kernel?
RodsonBorja said:
¿which brings benefits to install this kernel?
Click to expand...
Click to collapse
Atm nothing... Its alpha and not working. Unfortunately I'm a little bit blocked by illness and x-mas and was not able to work on it... Maybe next week...
send with my Oneplus One (bacon) SlimKat Tapatalk
Hi to all followers of this thread.
Just to give an update: I try to work on the kernel over x-mas in my free time, but I must say that the source of samsung which was provided on opensource.samsung.com is not really funny stuff... there are so many coding errors, which was not able for me to solve directly. So now I started to examine other kernel sources, and will try to port a more maintained source to the i8200. From My point of view this will be the only way to produce an more accurate kernel for our device, and get the possebility to include also selinux what is needed for a kitkat-rom...
Nevertheless, it is not easy to work on that stuff, because I'm not an expert on kernel work (but I learn every day more , so if you know someone with more kernel experiences, it would be very helpful to invite him/her. To ask in forums (also in xda) is something what I do, but unfortunately the responding are not every time safe...
So I wish you all a happy new year, and lets work together to bring our device a little bit forward
SolarPlexus
Ask @dtrail1 he know how the kernel thing work.
Maybe he'll support you
VallNAr said:
Ask @dtrail1 he know how the kernel thing work.
Maybe he'll support you
Click to expand...
Click to collapse
Ask MARDON he made the kernel for Galaxy Ace - maybe he support Your work.
Any progress on the kernel? Is it on github?
Why does this not suport usb flash drives or can the function be ported
Gershy353
I think it must be activated on both sides. Kernel and ROM...
send with my Oneplus One (bacon) SlimKat Tapatalk
SolarPlexus said:
I think it must be activated on both sides. Kernel and ROM...
send with my Oneplus One (bacon) SlimKat Tapatalk
Click to expand...
Click to collapse
How is this done i have the sandisk dual flash drive but its useless on my device
Gershy353
Ah, you mean otg support, not sdcard seen as USB instead of mtp?
send with my Oneplus One (bacon) SlimKat Tapatalk

[GUIDE] How to Compile Your Own CM11/CM12/AOSP Kernel

Hi guys, long time no post. I have updated this guide on how to build kernels for Falcon so that anyone can learn! It's pretty simple once you get the hang of it. So yeah, here we go!
Prerequisites:
- You must have a Linux firmware running on your computer (I suggest Builduntu because you can skip the next one [build environment setup])
- Build environment setup (Put the this in terminal and follow instructions)
- Patience and a heart willing to learn
- You need to know the languages C, C++, Java, Ruby, Python... NOT! You don't need to know ANY coding languages.
[MOTIVATIONAL SPEECH]
Truth be told, when I first started out developing, I knew NO coding languages except for HTML and a little bit of Java. Both have nothing to do with kernels! I actually learned how to do this when I suffered from a concussion. So if you really want to learn how to kernel dev and you give up halfway, just know that a 14/15 year old kid could do it..
[/MOTIVATIONAL SPEECH]
Click to expand...
Click to collapse
WARNING: I am not responsible for any damages to your phone or computer or pet unicorn. When you modify the wrong partitions, set too many jobs for your compiler, break your keyboard out of frustration etc., that is not anyone's fault but yours. Or your pet unicorn.
Your Personal Handbook to the Following:
- Anything inside "CODE" boxes, type it into your terminal. If you can't find terminal, then press CTRL, ALT, t.
- If I were you, I would write these by hand instead of copying and pasting it because after a certain amount of times, you will remember the linux commands and it will be easier for you to compile more kernels for different devices
- Use this thread as a "Help Me" button. Ask for help!
Click to expand...
Click to collapse
A New Beginning:
Let's start out with something simple, getting the actual code:
Code:
git clone https://github.com/cyanogenmod/android_kernel_motorola_msm8226
This could range from 3 minutes to 2 hours!
Once that's done, open up your file manager and rename the folder (should be android_kernel_motorola_msm8226) to whatever you want. I will refer it as "mykernel".
Click to expand...
Click to collapse
Pokemon!
For this tutorial, we will be using a Sabermod 4.7 toolchain to compile. I WOULD teach you how to compile with 4.8+, but it creates errors that will take even longer for me to write about sooooooooo :fingers-crossed:. Now to get the toolchain:
Code:
git clone https://github.com/SaberMod/android_prebuilts_gcc_linux-x86_arm_sabermod-arm-eabi-4.7
Rename this to whatever you like, but I will be referring this as "toolchain"
Now go into you folder where the kernel source is stored...
Code:
cd mykernel
Click to expand...
Click to collapse
You're Almost There!:
Time to set-up the compiler!
Code:
export CROSS_COMPILE=/home/(insert linux home name here)/toolchain/bin/arm-eabi-
This tells the toolchain that "OK, we want to make ALL this code here into a kernel".
This next line tells it that your defconfig (the toolchain's manual for compiling the kernel) that it's in the arch/arm/configs folder.
Code:
export ARCH=arm
Now to tell the it what the defconfig is!
Code:
make falcon_defconfig
Hehe, now to the hardest part of all...
MuHAHHAHAHa
Click to expand...
Click to collapse
THE HARD (coding) PART
You ready for this? HERE IT IS! TIME TO BUILD THE KERNEL!
Code:
make -j4
Now sit back, relax, and watch the code! Or you could read a book, watch ****, count your fingers, play with your toes...
If you have an error during the waterfall of code, find the part where it actually says *error* (you'll probably have to scroll upwards) and search it on Google or post it here.
Click to expand...
Click to collapse
THE BEST PART
If you manage to get something that says "the kernel zImage is ready" or something like that, that means you've made it!
You have officially compiled your own kernel from source! Now you need to put it in a flashable zip.
Download this file and open it up, but DON'T EXTRACT IT.
Now go to your kernel source then "CTRL + F" and search for "zimage-dtb".
Find it and put it in the "kernel" folder of "FalconKernel - Signed.zip". Then "CTRL + F" and search ".ko".
Copy radio-iris-transport.ko and put it in the system/lib/modules (not pronto) of the zip.
Then find wlan.ko and rename it to pronto_wlan.ko. Copy and paste it in system/lib/modules/pronto of the zip.
Click to expand...
Click to collapse
Now you can put it on your phone and flash it! ​
I will update this in a bit. What feature would you guys want in your kernel? The most votes in the POLL above will be the one I teach you here!
Here I will walk you through on how to add the intelliplug feature made by @faux123
First, fetch my Green Machine kernel source (go into your kernel folder in terminal):
Code:
git fetch https://github.com/YoshiShaPow/green_machine_falcon
Then you could cherry-pick (basically copy) all my cherry picks for intelliplug from my source.
If you do check my source out, you can see there's a little link to a history of commits near the middle of the screen, right above the files/folders. You can see at this page of my features history, you'll see a bunch of commits for intelliplug. I will use those commits and copy it to your own kernel.
This copies the initial coding/first commit of intelliplug!
Code:
git cherry-pick 01a850f
This cherry-picks the remaining commits so that your newly added intelliplug is updated.
Code:
git cherry-pick 6623f2f^..4e1ece7
One more thing though, you need to add the line to compile intelliplug!
Almost all things compiled along with the zImage are in a file called defconfig. What a defconfig does, is tell your machine to build certain modules, kernel objects, drivers, governors, etc.etc.etc.. Now, all of them are found in the folder
arch/arm/configs
Click to expand...
Click to collapse
As stated in the OP, you have to modify the defconfig you use. (CM11 Kernel is falcon_defconfig, Gummy Kernel is msm8226_mmi_defconfig). Open up the corresponding defconfig and add this to ANY line anywhere.
Code:
CONFIG_INTELLI_PLUG=m
Now, for those who are familiar with "y=yes/n=no/m=maybe", you'll see that I specifically told you to put the "m=maybe" one. That's because when you compile the kernel again, right after you're about to start your build. Since you put that "m", the terminal will prompt you with a "y=yes/n=no" question on whether or not you would like to add the following feature. Since you would like to add the feature, put in "y". Later on when you feel more comfortable with adding features to your kernel, you can go back into the defconfig and put it as
Code:
CONFIG_INTELLI_PLUG=y
So that it will compile it without asking, since you have given it an answer.
Now you have officially compiled a "Custom Kernel" and with the knowledge you know, you could create a feature packed one by just kanging (copying one's work/features).
Always remember to
Code:
make clean && make mrproper
after every build to prevent errors and such!
Click to expand...
Click to collapse
I will use this to teach you how to make your own Bash Building scripts (and save time) to make it easier for your development life to flourish... eventually....
Any guide on adding governors or hotplug driver??
Sent from my Moto G using XDA Free mobile app
Best guide but how to add features likes s2w,dt2w etc
Flashhhh said:
Any guide on adding governors or hotplug driver??
Sent from my Moto G using XDA Free mobile app
Click to expand...
Click to collapse
Vote in the poll above! I will make a guide for one or more of the top chosen picks!
Brawn_Sg said:
Best guide but how to add features likes s2w,dt2w etc
Click to expand...
Click to collapse
DT2W and S2W are more complex. They require a few other things (ex. Powersuspend). I'll wait a bit and see what feedback I get before moving forward to something a bit more complex like DT2W, or GPU Overclock.
Can i use make menuconfig?
Krizthian said:
Can i use make menuconfig?
Click to expand...
Click to collapse
Yes you can. Normally when using "make menuconfig", you use the command after making the kernel's defconfig (falcon_defconfig).
Build using Docker
If you're on Linux, take a look at this approach which uses Docker for building CyanogenMod 12.0:
http://forum.xda-developers.com/showthread.php?t=2650345
(Disclaimer: It's written by me)
YoshiShaPow said:
Hi guys, long time no post. I have updated this guide on how to build kernels for Falcon so that anyone can learn! It's pretty simple once you get the hang of it. So yeah, here we go!
WARNING: I am not responsible for any damages to your phone or computer or pet unicorn. When you modify the wrong partitions, set too many jobs for your compiler, break your keyboard out of frustration etc., that is not anyone's fault but yours. Or your pet unicorn.
Now you can put it on your phone and flash it! ​
Click to expand...
Click to collapse
when i was trying to flash cm12 rom in cwm recovery it says error in zip and getting status 1 error , installation aborted ,
pls help im using moto g gpe and when trying to flash from twrp it says error executing updater binary in zip ,
no idea what to do pls help me out
karthik432 said:
when i was trying to flash cm12 rom in cwm recovery it says error in zip and getting status 1 error , installation aborted ,
pls help im using moto g gpe and when trying to flash from twrp it says error executing updater binary in zip ,
no idea what to do pls help me out
Click to expand...
Click to collapse
When you downloaded the anykernel zip, you aren't supposed to extract it. The best way to put the kernel in the zip is to just drag and drop it while IN LINUX. It will not work for windows! Or you could try signing the zip in TWRP (I think there's an option for that somewhere).
YoshiShaPow said:
When you downloaded the anykernel zip, you aren't supposed to extract it. The best way to put the kernel in the zip is to just drag and drop it while IN LINUX. It will not work for windows! Or you could try signing the zip in TWRP (I think there's an option for that somewhere).
Click to expand...
Click to collapse
im not extracting anything , i just downloaded the official cm12 nightly and flashed but didn't workout ,any ideas
karthik432 said:
im not extracting anything , i just downloaded the official cm12 nightly and flashed but didn't workout ,any ideas
Click to expand...
Click to collapse
That has nothing to do with this thread :silly:. You probably have to sign the zip again.
@YoshiShaPow.... i need some help
i compile a kernel for my device and it booted fine but no display....
can you help me in this....
sorry for posting here..my device is Redmi 1s
Luffy.d said:
@YoshiShaPow.... i need some help
i compile a kernel for my device and it booted fine but no display....
can you help me in this....
sorry for posting here..my device is Redmi 1s
Click to expand...
Click to collapse
No problem, I welcome anyone with kernel development questions here! When booted, what do you mean? And if there's no display, how do you know it booted? Also, did you use my anykernel zip? I may be wrong but I don't think it is compatible with all phones.
YoshiShaPow said:
No problem, I welcome anyone with kernel development questions here! When booted, what do you mean? And if there's no display, how do you know it booted? Also, did you use my anykernel zip? I may be wrong but I don't think it is compatible with all phones.
Click to expand...
Click to collapse
yeah it booted bro....i can hear lock unlock sound and even i can hear incoming call ring
i was trying to fix this from a week and found out it not kernel it rom problem ...
my device is build using prebuilt kernel so any compile kernel wont work...but now they are build with this kernel source so compile kernel work
thanks bro...
and one thing bro... i m new to kernel development so how can i optimize kernel
i know about and can add governors and use custom toolchain but i don't know about o2 or o3 optimization etc and all
sorry if i m being too much
great I start today
Luffy.d said:
yeah it booted bro....i can hear lock unlock sound and even i can hear incoming call ring
i was trying to fix this from a week and found out it not kernel it rom problem ...
my device is build using prebuilt kernel so any compile kernel wont work...but now they are build with this kernel source so compile kernel work
thanks bro...
and one thing bro... i m new to kernel development so how can i optimize kernel
i know about and can add governors and use custom toolchain but i don't know about o2 or o3 optimization etc and all
sorry if i m being too much
Click to expand...
Click to collapse
Those changes are a bit more advanced because it will bring build errors. The kernel is already preoptimized with o2 changes. The errors are fixable though. I don't think I'll be able to add an explanation for those in this thread, maybe through pm?
YoshiShaPow said:
Those changes are a bit more advanced because it will bring build errors. The kernel is already preoptimized with o2 changes. The errors are fixable though. I don't think I'll be able to add an explanation for those in this thread, maybe through pm?
Click to expand...
Click to collapse
thanks bro...will pm you when i finish setuping my git
etvtaglios said:
great I start today
Click to expand...
Click to collapse
Go for it bro!!

Categories

Resources