Packing a kernel - Galaxy S Plus I9001 Android Development

Ok so I finally figured out the whole ubuntu setup, and how to compile a kernel to a zImage, but now I need to make that zImage into a boot.img, I tried using an "extracted kernel" and then replace the zImage and recompile (with kitchen) but then I get a hang at Samsung, is there any specific way of packing it?
I tried it with Feacore Phoenix but it failed, going to try the open source kernel from opensource.samsung.com now.
What I did.
Code:
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
sudo git clone https://android.googlesource.com/platform/prebuilt.git
tar xvfz GT-I9001_Kernel.tar.gz
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
cd kernel
make xconfig (set localversion to broodKernel)
make -j4
I noticed that I got some warnings etc while compiling, is that normal?
The one from Feacore Phoenix: http://broodplank.net/imgupload/up/zImage
The one from Samsung sources: http://broodplank.net/imgupload/up/zImage-Samsung
Edit: woooooooo!!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Performance is not bad either!

Gratulations !
Nice to see a new kernel maker
Gesendet von meinem GT-I9001 mit Tapatalk 2

Are you open for suggestions to add to your kernel?
If you are I would like to suggest Back Light Notification!
it will make the menu and back button light up when you receive a message or something, this way even when you have your sound turned of and your screen off, you see that you have a message.
http://forum.xda-developers.com/showthread.php?t=1080529
In section source you will find the github which contains a howto, to show how to implement this in a gingerbread kernel.

... voodoo sound would be nice

drummer1839 said:
... voodoo sound would be nice
Click to expand...
Click to collapse
The developer of voodoo writes in his description on google play:
Galaxy SLC LCD, Galaxy S Plus: GT-I9003 / GT-I9001 is not supported because its hardware platform is entirely different.
Click to expand...
Click to collapse

broodplank1337 said:
Ok so I finally figured out the whole ubuntu setup, and how to compile a kernel to a zImage, but now I need to make that zImage into a boot.img, I tried using an "extracted kernel" and then replace the zImage and recompile (with kitchen) but then I get a hang at Samsung, is there any specific way of packing it?
I tried it with Feacore Phoenix but it failed, going to try the open source kernel from opensource.samsung.com now.
What I did.
Code:
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
sudo git clone https://android.googlesource.com/platform/prebuilt.git
tar xvfz GT-I9001_Kernel.tar.gz
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
cd kernel
make xconfig (set localversion to broodKernel)
make -j4
I noticed that I got some warnings etc while compiling, is that normal?
The one from Feacore Phoenix: http://broodplank.net/imgupload/up/zImage
The one from Samsung sources: http://broodplank.net/imgupload/up/zImage-Samsung
Edit: woooooooo!!
Performance is not bad either!
Click to expand...
Click to collapse
Congrats!
I have the same problem you had,after recompiling it hangs at samsung :|......
I am trying to modify Vitality Kernel (from the open source of course).

Work on cm7 ? Radio is présent ? Thank for UR job

spawk said:
Work on cm7 ? Radio is présent ? Thank for UR job
Click to expand...
Click to collapse
Compiled from samsung sources, so don't think it's compatible with CM7

If anyone wants to try out:
http://www.mediafire.com/?gdv4t19octq4iyh
but basically it's just stock

broodplank1337 said:
If anyone wants to try out:
http://www.mediafire.com/?gdv4t19octq4iyh
but basically it's just stock
Click to expand...
Click to collapse
maybe you can have a look at cm7 kernel sources, the ones that are uploaded on github founded at this post?

chasemyass said:
maybe you can have a look at cm7 kernel sources, the ones that are uploaded on github founded at this post?
Click to expand...
Click to collapse
Ok thnx

broodplank1337 said:
Ok thnx
Click to expand...
Click to collapse
no no...I say thanx ...
You are becoming an total developer if you are keepin` this way lol...
OT I`m at the point where I need to buy another ~100 Gb HDD to run Linux on it ... I`m starting to learn more abt theese too ... lol

chasemyass said:
no no...I say thanx ...
You are becoming an total developer if you are keepin` this way lol...
OT I`m at the point where I need to buy another ~100 Gb HDD to run Linux on it ... I`m starting to learn more abt theese too ... lol
Click to expand...
Click to collapse
Hehe ^^
I want to become a real developer one day, and I think that won't be a big problem I just ran it from an ubuntu virutal machine lol. takes a while to compile, but it worked

please write the fully instruction

xewier said:
please write the fully instruction
Click to expand...
Click to collapse
To be honest, the instructions are not much more then this:
1. Install ubuntu, setup a user account besides root
2. Start terminal and do this:
Code:
sudo apt-get update
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
git clone https://android.googlesource.com/platform/prebuilt.git
This will download the needed things to compile
3. Now download the i9001 open source kernel from opensource.samsung.com
extract the GT-I9001_Kernel.tar.gz to the root and go in the terminal again, enter this to extract it to /kernel:
Code:
tar xvfz GT-I9001_Kernel.tar.gz
4. Now set the variables in the terminal, so that it will look in the right directory:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
5. Now enter the following commands in the terminal:
Code:
cd kernel
make xconfig
make -j4
xconfig = a graphical interface for the kernel configuration
make -j4 = compile with 4 cores
Then you will get a zImage in /kernel/arch/arm/boot/.
I copied that zImage to an extracted boot.img in kitchen, and replaced it, then packed it again.

broodplank1337 said:
To be honest, the instructions are not much more then this:
1. Install ubuntu, setup a user account besides root
2. Start terminal and do this:
Code:
sudo apt-get update
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
git clone https://android.googlesource.com/platform/prebuilt.git
This will download the needed things to compile
3. Now download the i9001 open source kernel from opensource.samsung.com
extract the GT-I9001_Kernel.tar.gz to the root and go in the terminal again, enter this to extract it to /kernel:
Code:
tar xvfz GT-I9001_Kernel.tar.gz
4. Now set the variables in the terminal, so that it will look in the right directory:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
5. Now enter the following commands in the terminal:
Code:
cd kernel
make xconfig
make -j4
xconfig = a graphical interface for the kernel configuration
make -j4 = compile with 4 cores
Then you will get a zImage in /kernel/arch/arm/boot/.
I copied that zImage to an extracted boot.img in kitchen, and replaced it, then packed it again.
Click to expand...
Click to collapse
How to make overclock?

xewier said:
How to make overclock?
Click to expand...
Click to collapse
No idea.. just found out how to compile it

broodplank1337 said:
No idea.. just found out how to compile it
Click to expand...
Click to collapse
okay thanx brood

xewier said:
How to make overclock?
Click to expand...
Click to collapse
Study how manveru0 did it:
https://github.com/manveru0/FeaCore_Phoenix/commit/5dcb208453600f1d4882ea50b77d19bc81e40689
The basic idea is to extend the CPU frequency table with more higher values.
Before:
Code:
static struct cpufreq_frequency_table freq_table[] = {
{ 0, 122880 },
{ 1, 245760 },
{ 2, 368640 },
{ 3, 768000 },
/* 806.4MHz is updated to 1024MHz at runtime for MSM8x55. */
{ 4, 806400 },
{ 5, CPUFREQ_TABLE_END },
};
After:
Code:
static struct cpufreq_frequency_table freq_table[] = {
{ 0, 122880 },
{ 1, 245760 },
{ 2, 368640 },
{ 3, 768000 },
/* 806.4MHz is updated to 1024MHz at runtime for MSM8x55. */
{ 4, 806400 },
{ 5, 1017600 },
{ 6, 1113600 },
{ 7, 1209600 },
{ 8, 1305600 },
{ 9, 1401600 },
{ 10, 1497600 },
{ 11, 1516800 },
{ 12, 1612800 },
{ 13, 1708800 },
{ 14, 1804800 },
{ 15, CPUFREQ_TABLE_END },
};

And what are the commits for undervolt???? As i had also compiled a stock kernel successfully but i was not able to overclock and undervolt. Thanks for.the values^^
Sent from my GT-I9001 using Tapatalk 2

Related

[Bounty] Compiled Adreno drivers

I am offering a 25$ bounty to whoever can compile the adreno drivers for the huawei U8150. The device has a msm7225 which includes the Adreno 200 but no drivers have been written for it. I am including the kernel source and the Adreno driver source as well as the specs.
Phone Huawei U8150 Ideos
cpu msm7225 overclocked to 600 mhz in factory
256 mb of ram
froyo 2.2.1
.32 kernel
Kernel source (Please compile with the overclock frequency unlocked using the documentation that is included in the text file with this source) http://www.mediafire.com/?s2djub4571hjs
Adreno Source from GIT https://www.codeaurora.org/gitweb/qu...oid-msm-2.6.32
Thanks and I will be sharing this work with the rest of the U8150 users when it is completed! Starting with my build. Good luck and thank you!
Nice
Sent from my Desire HD using XDA Premium App
Found this in the android kernel source for my mobile. It's the Galaxy ace which also has an Adreno200.
Maybe it is of use to you.
The kernel module source for the gpu is attached.
That does help but I have no idea how to compile that driver, let alone how to tell the kernel to initialize it. That is why I am asking for someone to compile the kernel with the driver.
I will try to compile them for you, no guarantees It creates a xxxx.ko module so you can insmod xxxx.ko into your kernel.
Sounds great, I appreciate the effort. So in the kernel I just type Insmod in the init file? I have an extracted boot.img of my kernel but thats about the best I can do atm.
I downloaded the source and discovered that the MSM Ardeno drivers are already included in your kernel source. You just have to turn them on in the kernel makemenuconfig.
I compiled the 3d driver for your kernel source(2.6.32, critical only works for this kernel version). Now copy extracted file to your sdcard and try:
* insmod msm_kgsl.ko
in adb or terminal.
Don't know if it works, can't test it. I guess you just have to try and see. And hope you don't get a kernel panic.
I got a no such directory error when I tried to install it.
I copied the ko file to the root of my SD, went to my terminal on my phone and typed SU > cd sdcard and then insmod msm_kgsl.ko
Hmm that's weird, should work. Try and copy to a different path.
Are you sure your kernel version is 2.6.32?
It is indeed a .32 kernel. I am going to try baking the .ko file into my rom, as well as the kernel if I can figure out how.
I just opened the rom in my kitchen and saw that bash support wasn't enabled. I guess that would explain why I couldn't even get my odex script to work. Enabling bash and going to try again.
did you get the adreno to work? i have a similar problem with a XT300 from Motorola, the hardware is there but it's not functional...
If you eventually gonna compile your own kernel, you can build the drivers in the kernel yourself. This are the settings I copied from my own phone's kernel settings.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You find these settings under Device Drivers --> Graphics Support.
PS. Set the buildoptions for the driver to a * instead of M to include them natively in you kernel
PPS. You can instantly set all the correct settings for your device by issuing this command: make hw_msm7x25_defconfig (Huwai devices with MSM 7225 processor)
cant do insmod msm_kgsl.ko from anywhere ..
insmod: init_module 'msm_kgls.ko' failed (no such file or dir...)
tried sdcard, /system/lib/modules, various random plases. same thing.
Can anyone try: busybox insmod msm_kgls.ko
Busybox insmod gives more debugging data. Also try adding -v to be verbose and -p to test if the module can be inserted
I added busybox support to my build and when I typed busybox insmod -f -v msm_kgsl.ko I got can't insert msm_kgsl.ko : unknown symbol in module or invalid parameter. I am really hoping you might be able to compile a kernel for us with it already enabled so I can just throw it in the build. I can test a compiled kernel but I am not having any luck adding it through insmod.
It almost seems as if there is something wrong with that module.
I'm interested in that module for the XT300/Spice.
My kernel is the 2.6.29, 2.1-update1...
How do I compile the module ? What do I need?
Thanks for any help.
Is there possibility that these devices are made from chips with faulty gpu part?
Doubtful that there was any bad parts. Anyways, I am getting conflicting information as to whether it is an adreno 130 or adreno 200 inside of it. I read in the kernel mentions of msm7225 and other parts say 7201a.
Wouldn't it just be enough to get the libGLES and maybe gralloc files from another hardware, like htc buzz, which has the msm7225/adreno200 integration?
I tried it, but quadrant is not showing qcom as the renderer. I had to create the egl.cfg, which was not present. Perhaps it's not loading the egl.cfg:
0 0 android
0 1 qcom
with the files:
egl/libGLES_android.so
egl/libGLES_qcom.so(from htc buzz)
hw/gralloc.msm7k.so(from htc buzz)
hw/gralloc.default.so(from htc buzz)
On neocore the score is 3FPS...
EDIT:
CRAP, flashed the libEGL.so from htc buzz, stuck in bootloop... great, will try to recover =/

[BINARY] GNU Nano editor v2.2.6 for Android

I have managed to successfully cross-compile GNU Nano editor 2.2.6 to run on Android and decided to share it here.
Please note that you need to set up terminfo (if your ROM doesn't have it already), by running:
Code:
export TERMINFO=/system/etc/terminfo
export TERM=linux
Unfortunately, it doesn't fully work through adb shell due to the fact that [enter]-key can't be used (this is a bug of adb shell).
It works flawlessly over ssh, although.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
EDIT: Fully working version is here.
You will need this patch to fix the enter key:
https://github.com/Evervolv/android...b568f0b417c1fe3fe8597c600bdbcda4837013f.patch
Great! Thanks for the information. :good:
As soon as I have time for that I will apply the patch and release a new binary.
bgcngm said:
Great! Thanks for the information. :good:
As soon as I have time for that I will apply the patch and release a new binary.
Click to expand...
Click to collapse
You are welcome.
I guess you will like this patch too:
http://www.faircode.eu/freexperia/update/terminfo.patch
(I have composed it for CM9, but I guess you known how to modify it, when needed)
Edit: use git apply instead of patch
how do i install this in my phone?
ARM cross-compiling how-to
Assuming a toolchain is already present on the build environment, here are the instructions on how to cross-compile Nano 2.2.6 for ARM devices:
Set the path to C compiler:
Code:
export CC=~/toolchain/bin/arm-none-linux-gnueabi-gcc
After you have unpacked the sources change to the source directory:
Code:
cd nano-2.2.6
Now configure the source:
Code:
./configure --host=arm-none-linux-gnueabi
To compile the sources (statically) type this:
Code:
make LDFLAGS=--static
Here is the fully working version of Nano 2.2.6 for Android (without the [enter]-key bug). Enjoy. :victory:
Great job!
I went ahead and packaged this in a flashable zip for people, it also adds a script to /sbin so you can (temporarily) use nano from the recovery console in AROMA Filemanager during that recovery session.
http://forum.xda-developers.com/showpost.php?p=47402916&postcount=133
Good idea! Thank you.
@bgcngm Any way to fix the output when used through AROMA Filemanager's Terminal Console? Scrolling borks things.
Mention me back when you get the chance.
bgcngm said:
I have managed to successfully cross-compile GNU Nano editor 2.2.6 to run on Android and decided to share it here.
Please note that you need to set up terminfo (if your ROM doesn't have it already), by running:
Code:
export TERMINFO=/system/etc/terminfo
export TERM=linux
Unfortunately, it doesn't fully work through adb shell due to the fact that [enter]-key can't be used (this is a bug of adb shell).
It works flawlessly over ssh, although.
EDIT: Fully working version is here.
Click to expand...
Click to collapse
How do I exit Nano in the android Terminal emulator
Edit: I found out hacker's keyboard's ctrl key helps with this problem
If anyone has this issue, let me help out:
In Windows, running nano and vim through ADB returns weird characters on the terminal, and you need ansicon.
Or better use ConEmu.
That's right. It is documented on the internet, that Ansicon is a requirement for Windows if you use command prompt. As you say, better go with a good terminal emulator.
@bgcngm will u update it to v2.4.2 plz?
Just tried to install through CWM on Cyanogenmod 10.1 Unofficial for Samsung Infuse, and got "installation aborted." Any idea what my problem might be?
The .zip that is available is not to be installed from recovery and that's why you are not able to do it.
osm0sis said:
@bgcngm Any way to fix the output when used through AROMA Filemanager's Terminal Console? Scrolling borks things.
Click to expand...
Click to collapse
bgcngm said:
The .zip that is available is not to be installed from recovery and that's why you are not able to do it.
Click to expand...
Click to collapse
Fixed both of these issues and compiled nano 2.5.0.
http://forum.xda-developers.com/showthread.php?p=64247691#post64247691
If you are a termux user and want to install a nano or vi or any other binaries of termux in Andriod su mode. Here is the link to Termux superuser.
Give it a star if it was helpful !!!
bgcngm said:
ARM cross-compiling how-to
Assuming a toolchain is already present on the build environment, here are the instructions on how to cross-compile Nano 2.2.6 for ARM devices:
Set the path to C compiler:
Code:
export CC=~/toolchain/bin/arm-none-linux-gnueabi-gcc
After you have unpacked the sources change to the source directory:
Code:
cd nano-2.2.6
Now configure the source:
Code:
./configure --host=arm-none-linux-gnueabi
To compile the sources (statically) type this:
Code:
make LDFLAGS=--static
Click to expand...
Click to collapse
How to do this on termux? @bgcngm I got the latest 6.4 tarball.

[REF] Create boot.img for the One S

As mentioned before, there's something wrong with creating boot images for the HTC One S. They just don't boot.
I did some hexdumping, editing and finally found out what's really wrong.
When unpacking a boot.img you get the base_addr 80400000.
In cyanogenmod/system/core/mkbootimg/mkbootimg.c:146 you have the line
Code:
hdr.ramdisk_addr = base + 0x01000000;
When using mkbootimg with the given base_addr of 80400000 this results in a ramdisk_addr of 81400000 whereas the correct address would be 81800000.
To create a boot.img you execute:
Code:
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 80400000 --ramdiskaddr 81800000 --cmdline console=ttyHSL0,115200,n8 -o boot.img
And it's important to specify --base BEFORE --ramdiskaddr as otherwise it gets overwritten.
Hope you can put this to good use
xkonni said:
As mentioned before, there's something wrong with creating boot images for the HTC One S. They just don't boot.
I did some hexdumping, editing and finally found out what's really wrong.
When unpacking a boot.img you get the base_addr 80400000.
In cyanogenmod/system/core/mkbootimg/mkbootimg.c:146 you have the line
Code:
hdr.ramdisk_addr = base + 0x01000000;
When using mkbootimg with the given base_addr of 80400000 this results in a ramdisk_addr of 81400000 whereas the correct address would be 81800000.
To create a boot.img you execute:
Code:
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 80400000 --ramdiskaddr 81800000 --cmdline console=ttyHSL0,115200,n8 -o boot.img
And it's important to specify --base BEFORE --ramdiskaddr as otherwise it gets overwritten.
Hope you can put this to good use
Click to expand...
Click to collapse
Wow thank you! I was having such trouble with it I was about to post about this actually.
Me too. Took quite some time to figure it out, though once you know it's rather easy.
Sent from my HTC One S
someone could download your boot.ini? I have a problem with my htc one s
tnk
fulky said:
someone could download your boot.ini? I have a problem with my htc one s
tnk
Click to expand...
Click to collapse
i'm not entirely sure how that would help you, its basically the same those you can find in any rom around here. but there you go: boot.img - mediafire
xkonni said:
i'm not entirely sure how that would help you, its basically the same those you can find in any rom around here. but there you go: boot.img - mediafire
Click to expand...
Click to collapse
you are my savior, it works.
thank you very much
fulky said:
you are my savior, it works.
thank you very much
Click to expand...
Click to collapse
ok... glad to help!
I got one problem.....I did a mistake with Rooting my S....Everytime when I tried to restart, it hangs...so I must always go to bootloader back, installing this superboot form Modaco...So I flashed RUUs, all three, but failed....
So, does this .img-file do what?
its just a slightly modified stock boot.img with changed parameters in default.prop that allow adb shell as root. nothing fancy...
not doing this, would it cause a error in CWM as status 0? when I try to flash a rom.
No, it would flash just fine but then it will not boot...
Sent from my HTC One S
Hi,
With the binary mkbootimg the command --ramdiskaddr 81800000 don't work
m!k3 said:
Hi,
With the binary mkbootimg the command --ramdiskaddr 81800000 don't work
Click to expand...
Click to collapse
where does this binary come from?
did you speficy --ramdiskaddr after --base?
did you hexedit the boot.img to check the ramdiskaddr? maybe something else is wrong with your kernel/ramdisk.
xkonni said:
where does this binary come from?
did you speficy --ramdiskaddr after --base?
did you hexedit the boot.img to check the ramdiskaddr? maybe something else is wrong with your kernel/ramdisk.
Click to expand...
Click to collapse
where does this binary come from? --> Google
did you speficy --ramdiskaddr after --base? --> yes
did you hexedit the boot.img to check the ramdiskaddr? --> how to?
m!k3 said:
where does this binary come from? --> Google
Click to expand...
Click to collapse
a link to the binary might be helpful, i did not find an official one released by google.
if you downloaded it from some third party, maybe its based on outdated source code.
the one that compiles out of recent aosp/cm source code works fine.
m!k3 said:
did you hexedit the boot.img to check the ramdiskaddr? --> how to?
Click to expand...
Click to collapse
use any hexeditor for your OS. i'm using bviplus on archlinux, but it really doesn't matter.
hexedit the boot.img and see if address 0x16 contains 40 (wrong, results in ramdiskaddr 8140 0000) or 80 (correct, results in ramdiskaddr 8180 0000).
example of a boot.img with correct ramdiskaddr:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
you could also upload it somewhere and let me have a look.
or join irc for further questions
#cyanogenmod-ville on irc.freenode.org
Thank you for this guide. It saved me a lot of time as I was trying to figure out why my compiled kernels wouldn't boot. I am used to samsungs, which have no boot.imgs so this is new to me.
Glad it helped
Sent from my HTC One S

Crosscompiling glibc for the Note 2, native GNU tools on the phone, runnig problem?

I've followed the steps from http://forum.xda-developers.com/showthread.php?t=1299962 basically, and crosscompiled glibc and some basic GNU tools, to run natively on the Note 2.
Now, I'm running into some problems, which I need help with from crosscompiling gurus...
Basically, what I did:
- Setup crosstool-ng on the PC.
- Downloaded the Note 2 source from Samsung.
- Got include/drm/exynos_drm.h elsewhere on the web, as it was bombing without it, and for some reason, it's not in Samsung sources.
- Built a crosscompiling toolchain. I set:
target architecture - arm
endianness - little
fpu - neon
instruction set mode - arm
eabi - enabled
vendor string - exynos
alias - arm-linux
os - linux
c library - glibc
threading - nptl
- With it, built glibc for the Note, built no prob. Built also GNU tar to start experimenting.
Now, I transfered glibc and the tar dirs to the Note.
As the author says at http://forum.xda-developers.com/showthread.php?t=1299962:
What I've found so far, the cross compiled executable (like simple Hello world), when dynamically linked, gives "no such file or directory" error when tried to be run at the device (WTF, right ). However, when when I do run it with the cross-compiled ld-linux.so (the linker of C library) it runs perfectly...
EUREKA! Found the solution! It's as simple as symbolically linking the library folder of your GlibC as /lib to root file system. You can edit ramdisk accordingly to do this process automatically.
Click to expand...
Click to collapse
Anyhow for me now, when I try to run the tar executable, I get:
Code:
No such file or directory
This even with the glibc lib dir symlinked to /lib, and/or setting LD_LIBRARY_PATH to the glibc lib dir.
file tar gives me:
ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.0.31, stripped
Click to expand...
Click to collapse
so all's looking right.
Why can't I get it to run?
This is proving to be a somewhat great course on crosscompiling for me.
So, messing with it, and making advances - was able to get the compiled executables to run after bindmounting arm-exynos-linux-gnueabi/sysroot/lib dir, which was built by the toolchain to the phone's /lib directory.
Now getting mixed errors and failures caused by ld etc when running GNU tools built against androids libc, so need to mess with terminal on the phone to get just the glibc to loaded on running, but it's progressing...
It seems I'll be able to do this.
Looking forward to that. Highly interested in php lighttpd mc busybox dropbear that kinda ****.
--
Sent from my N7100 with Perseus 25.4 Omega 5.0 and some stuff of Raubkatze
I'm almost there, I just need to crosscompile gcc and then I can build the necessary GNU tools natively.
I'm just figuring out how to crosscompile gcc, as it depends on mpc, gmp, and mpfr, and having no experience with crosstompiling I'm figuring out how to compile depends and link against them, whether they should be native or crosscompiled...
But I should be able to figure it out soon, very close now towards full working GNU tools on the Note 2.
OK, need help, have asked for it at http://stackoverflow.com/questions/...with-crosstool-ng-have-toolchain-which-archit also.
If anyone could assist, here goes:
I've built the crosscompiling toolchain with crosstools-ng.
I've cross compiled glibc, fine.
Have built a couple native arm (arm-exynos-linux-gnueabi) utils, like tar etc. and confirmed they work on the Android phone, when symlinking the built x-tools sysroot's lib directory to /lib on the android machine.
Now I need to build the native gcc, so I can develop on the machine. I'm having some philosophical problems with crosscompiling, as I'm relatively inexperienced in it.
I'd therefore like to ask how to proceed in steps exactly, as I've already spent two days with a trial-by-error approach, and so far no luck.
So: gcc depends on mpc, which depends on mpfr, which depends on gmp.
So, how do I proceed?
Which architecture deps do I build, with which host target and build options?
make a tools dir and build these deps there, so as not to mess with the functioning toolchain?
gmp (no host, build, target?)
mpfr (same?)
mpc (same?)
then gcc, how? --host=arm-exynos-linux-gnueabi --build=i686-build_pc-linux-gnu --target=arm-exynos-linux-gnueabi ?
Is this right, or am I messing up in some of the above steps?
Incidentally, I've followed this guide http://forum.xda-developers.com/showthread.php?t=1299962 to build the crosstool-ng toolchain, and it recommends compiling the native apps just with --host=arm...
I've been doing that, and they do work on the Android system, though it doesn't seem right to me, shouldn't it be --target=arm...?
nyarnon said:
Looking forward to that. Highly interested in php lighttpd mc busybox dropbear that kinda ****.
--
Sent from my N7100 with Perseus 25.4 Omega 5.0 and some stuff of Raubkatze
Click to expand...
Click to collapse
+1 ... I'm interested too, keep it up OP... So far I've only successfully build my own perl/libperl.so and runs great on my note2 from http://code.google.com/p/perldroid
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I've proceeded further, have built glibc 2.14 for the N7100, works, compiled gcc and some utils. The problem for now is that there is a bug in glibc 2.14 making statically compiled binaries fail on dynamic calls to libraries... It should be fixed in glibc 2.16...
So am experimenting now, trying to figure out how to add the latest glibc version support to crosstool-ng... If anyone knows, chime in.

[GUIDE][HOW-TO] Add Koush SuperUser In Settings Of AOSP Or Any Source Built Rom

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is for people who build AOSP or any roms from source for general public or for personal use. Koushik Dutta has given quite a good explanation here but some more things are needed to get it fully working. You should know what you are doing before you read ahead. I am not responsible if you mess up your device or any of your personal belongings
Click to expand...
Click to collapse
​
This guide will focus on Nexus 5 but the same procedure should work on Nexus 4, Nexus 7 (2012 & 2013) or any other device with little or no modifications.
Prerequisite:
Knowledge about building roms from source
knowledge about cherry-picking commits and resolving the conflicts
basic knowledge about device trees
A logical and working brain
Click to expand...
Click to collapse
Step 1: Add the required packages into your source:
You need to add the Superuser related repos from cyanogenmod into your rom source. This can be done using a local manifest. Make a local manifest by any name say su.xml and place it in .repo/local_manifests/su.xml. If the "local_manifests" folder doesn't exists in .repo then make one. Copy paste the following lines in su.xml
Code:
Step 2: Cherry-pick commits
There are many commits to refer. I would link some to you. You can cherry-pick, for example,this or this. You can refer any of such commits. Cherry-pick is to be done in packages/apps/Settings. There might be conflicts in Android.mk & proguard.flags. Just compare the files from the ones in the above linked commits and fix them.
Step 3 : Add some required flags to device make file
To make Superuser to go under Settings, the most important flag needed is this :
Code:
SUPERUSER_EMBEDDED := true
Without this, superuser won't get embedded into Settings.apk. You can add this flag in any ".mk" file. I have added it under device/lge/hammerhead/device.mk. Some build.prop lines are also needed to get root working. Also you need to make the Superuser and su binary packages to be built. All the lines needed are summarized as follows:
Code:
# SU Support
SUPERUSER_EMBEDDED := true
PRODUCT_PACKAGES += \
Superuser \
su
PRODUCT_PROPERTY_OVERRIDES += \
persist.sys.root_access=3
# Enable ADB authentication
PRODUCT_PROPERTY_OVERRIDES += \
ro.adb.secure=1
Add all of them on the same location device/lge/hammerhead/device.mk.
Step 4[MOST IMPORTANT] : Import init.superuser.rc in init.rc or similar file.
People do everything properly upto step 3 but they never get superuser to work properly. When you try opening any root app, ADB gives the following error :
Code:
D/su ( 2529): su invoked.
D/su ( 2529): starting daemon client 10019 10019
E/su ( 2529): connect failed with 2: No such file or directory
su daemon is started by init.superuser.rc. You need to import it in init.rc or in this case init.hammerhead.rc or any similar init file like this :
Code:
import init.hammerhead.usb.rc
import init.superuser.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
chown system system /sys/kernel/debug/kgsl/proc
If you don't do this, system won't know that a file "init.superuser.rc" even exists. Hence, the daemon fails, failing root access eventually
DONE!!!! Just build the rom as you normally do and you have # Superuser under Settings. I hope it was clear enough. I have tried to add everything I recollect but if you find anything missing then please let me know. Thank you!!!! And enjoy coding​
Reserved
One more
Wouldn't this be better to add to a general android hacking section as it could also apply to more devices?
Somcom3X said:
Wouldn't this be better to add to a general android hacking section as it could also apply to more devices?
Click to expand...
Click to collapse
Yeah that's right. I kept nexus 5 as example so i added it up here. You can report it to get to general section. I am not near the pc atm
Looks like it was moved

Categories

Resources