[Q] Compile Gingerbreak from source? - Android Software/Hacking General [Developers Only]

I've been trying to compile Gingerbreak from source using the CodeSourcery tools, but the binary always segfaults while run. Anyone have a link or know the magic incantations needed to compile it from source?

kidding
You should try to compile Gingerbread insteal sure it will not break so

Related

Which branch of kernels shoud I use to build a CyanogenMod eclair rom for G1?

I want to build an eclair rom using CyanogenMod kernel for G1. Which branch shoud I use? I find there are eight branches on github such as 2.6.29-donut,2.6.29-donut-bfs, 2.6.29-eclair in the repository.
When I checkout the 2.6.29-eclair branch and built it, I found there are some compile errors in the branch. And I found the branch had been patched for compcache. But the patch was not correct.
Would you please tell me which branch of kernels I should use to build a CyanogenMod eclair rom for G1?
Thanks.
loveheaven said:
I want to build an eclair rom using CyanogenMod kernel for G1. Which branch shoud I use? I find there are eight branches on github such as 2.6.29-donut,2.6.29-donut-bfs, 2.6.29-eclair in the repository.
When I checkout the 2.6.29-eclair branch and built it, I found there are some compile errors in the branch. And I found the branch had been patched for compcache. But the patch was not correct.
Would you please tell me which branch of kernels I should use to build a CyanogenMod eclair rom for G1?
Thanks.
Click to expand...
Click to collapse
donut will work
well, if you are wanting to make a kernel for eclair with 3D support it would make sense to use the eclair branch
compcache., didn't think it was in the eclair branch
get the compcache source, get the patch for 2.6.29 , if the patch fails manually patch, and then manually patch your Makefiles
I'm guessing the Camera won't compile,, but the Donut camera does so... move that in .. it still won't compile, but I'm sure you can track down why and make it compile
hint, two camera.h , and board-trout.c
Thank you very much! You are my super star!
Firerat said:
donut will work
well, if you are wanting to make a kernel for eclair with 3D support it would make sense to use the eclair branch
compcache., didn't think it was in the eclair branch
get the compcache source, get the patch for 2.6.29 , if the patch fails manually patch, and then manually patch your Makefiles
I'm guessing the Camera won't compile,, but the Donut camera does so... move that in .. it still won't compile, but I'm sure you can track down why and make it compile
hint, two camera.h , and board-trout.c
Click to expand...
Click to collapse
@loveheaven
I'm a real noob and don't know how to build a rom for myself. Could you share me after you done that?

[Q] Cross compiler

Are you guys rolling your own or using binaries?
Huh? You can download the source and compile your own arm-eabi- tools if thats what you want to do.
I use the prebuilts from the android source code repo.
Sent from my VEGAn-TAB-v1.0.0B5.1 using Tapatalk
I know I can compile my own, but even with crosstools getting gcc a libc, binutils and all that working is a pain if there are premade binaries. I'll check out the ones you mentioned rcgabriel.

[Q] kernel

Hi,
I am trying to extract the kernel from mmcblk0p20 using unpack-bootimg.pl
from this post: http://forum.xda-developers.com/showpost.php?p=2885020&postcount=1
I can get a valid ramdisk out of it but the kernel is not a gz file as it should be.
Any hint?
Etn40ff said:
Hi,
I am trying to extract the kernel from mmcblk0p20 using unpack-bootimg.pl
from this post: http://forum.xda-developers.com/showpost.php?p=2885020&postcount=1
I can get a valid ramdisk out of it but the kernel is not a gz file as it should be.
Any hint?
Click to expand...
Click to collapse
The kernel is not exactly a "gzipped" file because the first part of it has bootloader code that provides a mechanism to uncompress the remaining part of the kernel (which uses a form of gzip provided by a micro zlib).
More importantly, what are you trying to accomplish? The "kernel" image that comes from split_bootimg.pl (or such) is the actual file you use to re-pack, etc. Unless of course you're trying to decompile the kernel for reverse engineering purposes, but that would be pointless and you wouldn't be asking this question if that were the case.
If you're trying to get the kernel config, use extract-ikconfig from the 'scripts' directory in the Linux source tree. You have to invoke it by cd'ing into the Linux source directory and doing:
Code:
./scripts/extract-ikconfig /path/to/your/kernel-file &> /where/you/want/the/resulting-config
(you can't cd into 'scripts' and have it work).
Enjoy.
As you say unpacking the kernel to get the configuration is pointless: I could get it on htcdev without any effort.
I just had a boring night and I tried to kill it repacking my own flavour of android.
I was not able to make it boot so I started guessing which problem I was having; the kernel seemed a reasonable candidate (I was convinced that I was stripping the header away from it when unpacking)
how could you acquire that kernel? last time I checked there was no source?
You need the kernel source before a kernel can be made. Thats the sucky part.
Sent from my myTouch_4G_Slide using xda premium
Undeadk9 said:
You need the kernel source before a kernel can be made. Thats the sucky part.
Click to expand...
Click to collapse
Eh? No. A kernel exists, just in binary form. HTC has yet to release the source code, but unless you plan to modify parts of it, there's not much point.
nbetcher said:
Eh? No. A kernel exists, just in binary form. HTC has yet to release the source code, but unless you plan to modify parts of it, there's not much point.
Click to expand...
Click to collapse
A kernel source is no problem, I got it from android github.
The issue is the mods htc made and added, and the tools around it they used to compile.
I would like to compile my own, to optimize (did it on linux too).
If anyone can explain me simple how to use the binary kernel, I am happy too for now, if that makes me able to compile CM7
Anyone? Can't be too hard since a lot of folks pulled it of?
I have a lot of technical experience, just need some android specific info
I know nothing bout kernels. They scare me. I'll stick to ROM making.
Sent from my MyTouch 4G Slide using xda premium
OpenMinded said:
A kernel source is no problem, I got it from android github.
The issue is the mods htc made and added, and the tools around it they used to compile.
I would like to compile my own, to optimize (did it on linux too).
If anyone can explain me simple how to use the binary kernel, I am happy too for now, if that makes me able to compile CM7
Click to expand...
Click to collapse
It's not quite that simple. They don't just 'mod' the kernel, they add device support to it. The upstream Linux kernel does not support the latest and greatest Qualcomm-based devices, so HTC uses their own repository based on Codeaurora (http://www.codeaurora.org) which is downstream from Qualcomm. Confused yet?
Point being: Linux will not run properly on our device until we have either the HTC Sensation source, Doubleshot source, or someone sifts through and pieces together all of the various sources needed from Codeaurora.
To use the binary form, just use boot.img from our device's HBOOT image.
nbetcher said:
It's not quite that simple. They don't just 'mod' the kernel, they add device support to it. The upstream Linux kernel does not support the latest and greatest Qualcomm-based devices, so HTC uses their own repository based on Codeaurora (http://www.codeaurora.org) which is downstream from Qualcomm. Confused yet?
Point being: Linux will not run properly on our device until we have either the HTC Sensation source, Doubleshot source, or someone sifts through and pieces together all of the various sources needed from Codeaurora.
To use the binary form, just use boot.img from our device's HBOOT image.
Click to expand...
Click to collapse
Thank you for the explanation.
I have been compiling kernels on linux, I know we need drivers and that HTC patches the kernel. I did not know about codeaurora, thanks .
The HTC Sensation kernel source is on the HTC website:
http://developer.htc.com
I was wondering undead, how do you compile other ROMS? You just strip what is not needed? I thought you know how tot strip just the kernel, since you made a senseless rom.
I will try using the boot.img, thanks.
Does that mean porting a Sense rom would only require swapping the boot.img from another Sense 2.0/3.0 rom?
Thanks for the info
LOL. No its still the sense base and uses the stock boot.img from the stock ROM. It's still HTC at its core. Like I said I know 0 'zero' about kernels.
Sent from my MyTouch 4G Slide using xda premium
Undeadk9 said:
LOL. No its still the sense base and uses the stock boot.img from the stock ROM. It's still HTC at its core. Like I said I know 0 'zero' about kernels.
Sent from my MyTouch 4G Slide using xda premium
Click to expand...
Click to collapse
point taken . I think I just made a working zip containing only the stock kernel.
If I have time, I will try to put that kernel in a AOSP rom for the Sensation and see what that does. may take some time...
does any1 know how to mod the device checking of a rom?
i get an error 7, found it is because of the device check.
I modded the update script and binary from the Senation Alpha cm7 and got that error, which seems to point to a different model of phone.
I would like to work around it and see if the kernel works with cm7

[GCC 4.7]Pico Stock Kernel Source

As many of you might have already heard about it: That using the Linaro toolchain to compile a ROM increases performance. But making stock kernel sources compatible to be compiled with Linaro is no easy task. But, the steps are similar.
When it is compatible to be compiled with GCC 4.3.3, why shouldn't it compile with GCC 4.7?
The problem lies in the code. The transition from GCC 4.3.3 to GCC 4.6, lot of things changed. GCC decided that people should start writing "cleaner code". So, new errors occur when compiling with GCC 4.6+. Example: "unused-but-set-variable". This was not an error in GCC 4.3.3, but GCC 4.7 made it a big issue :crying:
As I said before, GCC 4.3 can compile it, while GCC 4.7 can't. So, I decided to use certain __attribute__'s, and #pragmas, to ignore the errors that one might encounter when trying to compile with GCC 4.7.
Mainly the lines used were:
Code:
__attribute__((__unused__))
and,
Code:
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Steps:
1. Download the GCC 4.7 toolchain using the following command, and place it inside your android-toolchains folder:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7
2. Download the kernel source compatible with GCC 4.7 from here
Code:
git clone git://github.com/vineethraj49/pico_kernel_stock.git
Edit the Makefile to correspond to the path of the GCC 4.7 toolchain :fingers-crossed:
Then, its simple,
Code:
make msm7627a_defconfig
and
Code:
make -jX
The code is compatible to be compiled with GCC 4.7 AS IS! You make modifications to code, you should & you WILL run into errors. Usually you can overcome errors by editing the required code, using #pragmas and __attribute__'s. If you ain't ready to work hard, please notify in the thread with the changes that you made to "msm7627a_defconfig", and the possibly a log, with the errors I will add the necessary __attribute__'s, and #pragmas :silly:
As for: Why didn't you make it compatible with Linaro toolchain?
The answer is that @Rishik999 is already working on making it compatible with Linaro, and I don't want to steal his idea
Credits:
Rishik999 for his idea about compiling with Linaro, and expect his kernel sources compatible with Linaro toolchain soon
http://gcc.gnu.org/gcc-4.6/porting_to.html
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html
Google
Some IBM docs, which helped.
http://web.mst.edu/~cpp/common/common_errors.html
Linus and the 2000+ people who contributed to the first Linux kernel.
Source: https://github.com/vineethraj49/pico_kernel_stock
Disclaimer: Everybody can use my work without asking permission, all my stuff comes with a "sharing is caring" xda philosophy licence... just credits would be nice ​
Reserved
Remember, kernel compilable without errors AS IS!
I will add some steps about how to ignore errors in this post, maybe. So that I don't have to edit a 100+ files again :silly:
Great work
Great work ! :good:
Why posted on general ?
All is well, but i doubt linaro toolchain makes a lot of difference while compiling kernels.
+ i dont think anyone uses stock kernel (2.3.5 android htc sense)
Yes
everyone is on kernel 3
Hpsgill said:
Yes
everyone is on kernel 3
Click to expand...
Click to collapse
im still on gingerbread..
ohh
a gb lover
only few users using gb
everyone is on ics,jb or sense 4
Hpsgill said:
ohh
a gb lover
only few users using gb
everyone is on ics,jb or sense 4
Click to expand...
Click to collapse
yes i love gingerbread IMO the most stable android version for our phone
how i wish cm7 will be complete and also im waiting for the sense 4.1 by cute prince to be stable enough like gb and waiting your sense ex build 6 too

After Compile Kernel from Source my Phone not booted

I am using Galaxy Star Advance SM-G350E
I have downloaded source code from Samsung open source and GCC 4.8 toolchain. And using Ubuntu 16.0
I am using XDA University guide to compile kernel. Using this guide everything is going right and I have successfully compiled my new kernel.
But when I put newly compiled zImage to my boot.img and modules.ko files to system/lib/modules directry my phone not booted.
Please help me.
And tell me where I am doing wrong.

Categories

Resources