[DEV] [FAQ] NKC - Native Kernel Compile - Hero, G2 Touch Android Development

This is ONLY a sketch.
This method (and others based on it) will be further developed in due time.
You DON'T need to setup YET another environment on your PC just to compile an Android kernel, or whatever utility/program you want to use.
The downside? A slow CPU and limited RAM (to circumvent this, repartition your sdcard and allocate some swap)
Now, WHY gentoo?
- because it's the distro I've been using @home for ~5 years?
- it's a good distro for dev. default includes development tools and headers.
Quick instructions:
1: Download the gentoo stage 3 from here
http://gentoo.prz.rzeszow.pl/releas...at-linux-gnu/stage3-armv5tel-20091023.tar.bz2
EDIT: For some reason, none of the gentoo arm stages want to run.
Devving in debian for now. Link here: http://www.filefactory.com/file/af5g7eg/n/debian_v21_zip
Thanks to ghostwalker for the package.
2: make a new folder (chroot) untar the stage along with kernel sources to the new folder (be sure it's on an ext partition - CHECK for noexec etc !!)
3: chroot & play around, that is, make menuconfig && make && make modules, whatever.
4: build kernel as usual (merge with ramdisk)
5: You can try other distros for arm6 optimisations, or build your own.
;]

Related

[Q] Cant build kernel modules for Android Desire CM6

Hi All
While I am a relative noob when it comes to Android development (I have been an embedded developer for over 25 years), I am pretty good at creating custom embedded kernels for MIPs targets. However, this issue seems to be getting the best of me.
Environment:
Ubuntu 10.04 + any automatic upgrades
HTC desire phone, rooted, running cyanogenmod 6.0.1 (and 6.1.0 from the daily builds)
Issue: I am trying to add batman-adv to the phone, but I cannot create a batman-adv.ko that insmod will load. When I put my ko file on the phone and try to load it I get "insmod: init_module 'batman-adv.ko' failed (Exec format error)" (Yes I am in su mode). I know that this generally indicates that I have built for the incorrect architecture and I suppose that is the real question. How do I GET the correct architecture.
I extracted a ko from the phone that works on the phone and ran 'file' on it:
ah6.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
and this is what I get on my ko
batman-adv.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
Based on this, the architecture is correct (or appears to be correct).
EDIT1:
I am getting a bit closer. I get this in dmesg
batman_adv: version magic '2.6.35.4-cyanogenmod-gb7da4b8-dirty preempt mod_unload ARMv7 ' should be '2.6.35.4-cyanogenmod preempt mod_unload ARMv7
Looks like I need a way to remove the "-gb7da4b8-dirty" portion of the string (actually avoid having it there in the first place).
End EDIT1
Build environment:
I have downloaded (via repo / git) and built the cyanogenmod SDK (daily build from 9/11/2010 kern: 2.6.35.4). The output of a build of this repo is an update-foo.zip file which I loaded on the phone and verified that it works properly. The repo includes a kernel-msm directory with (an apparently) fully functional kernel build tree (as well as the sdk and ndk trees).
I have pulled the config.gz file from the (working nicely) phone (update-foo.zip version), unzipped it and fed it into the build system. Answered the annoying questions you get when you merge in a new config file and added batman-adv to the selected loadable modules list to be built (also had to play with the file to fix a few other issues).
Build script looks like this (CCOMPILER points to the pre-built compiler in the sdk):
cd $SYSTEM_PATH || exit
. build/envsetup.sh
lunch cyanogen_bravo-eng
cd $SYSTEM_PATH/kernel-msm || exit
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j$CPU_COUNT clean || exit
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j$CPU_COUNT | tee build.log ||
The build completes just fine and I get all of the expected ko's. I have not tested the kernel itself since I am not really interested in it. It should be the same as the kernel built by the SDK and included in the update-foo.zip file. Worst case the KO would load and crash if the ko and the kernel on the phone were incompatible (I would be happy to get that far).
Issue is resolved.
While the insmod function returned a bad format error, it was really complaining about the magic number mismatch. Once I took care of matching the ARMv5 vs ARMv7 issue and then did an over ride on the KERNELVERSION string, I was able to load and execute the ko without any additional issues.
Wow! You do like to write don't you mate?
I'm glad it got resolved....should I close this thread or you want to get some more input?
Cheers,
We can close the thread. I write so much because I see so many post with insufficiant information to make a good diagnosis. In addition, those threads also tend to wander off the subject, making them a bit less than usefull.
Martin
I believe I am trying to do the same thing here, but for a different phone.
You say you're adding your module to the selected loadable modules to be built. Isn't there a way to build a loadable module by itself without rebuilding or changing kernel settings?
I have been able to compile/install modules for ubuntu linux but I haven't been able to figure out how to compile them for my android device. I have the source tree for the kernel build I'm using but I'm not quite sure how to go about cross compiling my module for it...

[KITCHEN] Minimal kernel building VM with scripts

I added some convenience scripts to the config. Read the new tutorial here
The old one still works:
I put together a small virtualbox vm with a very minimal debian config with which I was able to compile a working kernel. This is for all the people who are running Windows, and want to try modifying kernels/initramfs's. As this is a minimal config there are some drawbacks (like it doesn't have a graphical interface), but you can always install additional packages, if you want to.
The VM includes: debian, build essentials, git, vb guest additions, mc, vim and codesourcery 2010q1 gnu-eabi. (it's larger than the simple eabi version, but can be used to compile non-kernel applications too)
First of all I hate both SunOracle VirtualBox and debian, but VB is free, and debian is lean, so they'll do the job.
To get the image running do the following:
First download and install VirtualBox
Next download the VM image: http://android.sztupy.hu/dl/KernelCompilerVM-1.1.7z and extract it. (it's a large download. If you can please put it up a mirror)
Mirrors: (thanks to the people mirroring it)
- http://www.multiupload.com/THJV19BJ9X
- http://bote.ro/sztupy/KernelCompilerVM-1.1.7z
After this run virtualbox, and import this VM.
Run the VM. The username/passwords are: root/root and kernel/kernel. Login with kernel. (you can always switch to root using sudo)
Next choose what kernel/initramfs you want to compile.
Here are some links to kernels:
The original sources can be found at supercurio's git:
Code:
git://github.com/project-voodoo/linux_gt-i9000.git
froyo-samsung branch
The kernel of the voodoo project can be found at the same place:
Code:
git://github.com/project-voodoo/linux_gt-i9000.git
froyo-voodoo branch
The ULTK kernel can be found at my account:
Code:
git://github.com/sztupy/universal_lagfix_kernel.git
Here are some links to initramfs files:
The original froyo initramfs can be found at supercurio's git page:
Code:
http://github.com/project-voodoo/samsung_ramdisks.git
afaik the voodoo initramfs is build using scripts from these images, so you have to apply them.
The ULTK initramfs can be found here:
Code:
git://github.com/sztupy/universal_lagfix_kernel_initramfs.git
For the rest of the tutorial I'll be showing how to compile ULTK:
First get the kernel sources using git:
Code:
git clone git://github.com/sztupy/universal_lagfix_kernel.git kernel
Unfortunately no copy-paste function is available, so you have to write this manually...
Next get the initramfs using git:
Code:
git clone git://github.com/sztupy/universal_lagfix_kernel_initramfs.git initramfs
If everything goes well you'll have two directoryes, called kernel and initramfs. Next we have to modify some values in the kernel configs.
Nano, mcedit and vim are installed, use the one that suits you best. (mcedit is the most user friendly)
Switch to the kernel directory and edit the Makefile there:
Code:
cd kernel
nano Makefile
Find the row that says
Code:
CROSS_COMPILE ?= some value
Replace it to
Code:
CROSS_COMPILE ?= /home/kernel/arm-2010q1/bin/arm-none-linux-gnueabi-
(if using nano make sure it won't add a line break into the row)
Next load the default config:
Code:
make aries_eur_defconfig
And edit it:
Code:
nano .config
We have to supply the directory of the initramfs. Search for the line:
Code:
CONFIG_INITRAMFS_SOURCE=some value
and replace it to
Code:
CONFIG_INITRAMFS_SOURCE=/home/kernel/initramfs/out
(this is for the ULTK. For voodoo the initramfs locations are "froyo-xxjp6" and "froyo-xxjpm" instead of "out")
if you've managed to do that too, let's compile the kernel:
Code:
make
If everything goes fine after a while you will have your shiny new kernel. Now let's get it to your computer, so it can be flashed:
First, you have to create a shared folder in VirtualBox. Simply create a directory somewhere on your computer, and add it as a shared folder in virtualbox. The name of the shared folder should be simple, for example "shr".
Next, you have to mount that directory inside the VM. To do this enter:
Code:
sudo mount -t vboxsf shr ~/share
After it has been mounted you can copy the fresh kernel to your host OS:
Code:
cp arch/arm/boot/zImage ~/share
If everything goes well you have a zImage ready at the folder you've just shared. TAR it, fire up odin, and flash.
---------------------------------
Now that you've succesfully compiled a working kernel try to modify it. You can use "make menuconfig" in the kernel directory to switch some kernel functions (like filesystem supports) on and off. You can edit .config by hand to add or remove some configuration values. And you can edit the files in the initramfs directory. After modifications you only have to enter "make" in the kernel directory to get your kernel inside the "arch/arm/boot/zImage" dir ready.
You can also copy files from your host OS, to the guest OS, by putting the file inside the shared folder and copying it:
Code:
cp ~/share/thefile ~/initramfs/copyithere
Hope this guide was useful.
Impressive, thanks. Even a noob like me can try this.
Oh god, not only a talented developer, but a community helper!
STICKY!!
Gonna try it laters <3
oh yea, nice!
DocRambone said:
Impressive, thanks. Even a noob like me can try this.
Click to expand...
Click to collapse
If you're a noob, then I'm a baby
Darkyy said:
If you're a noob, then I'm a baby
Click to expand...
Click to collapse
high time you start compiling kernels
tnx
its very usefull
Magnificent!
I just came to take a quick look, but the thread deserves a closer one.
Thank you for sharing knowledge.
Worthy of a sticky.
Hopefully this will solve all those "I want this in a kernel but not that" scenarios.
This is VERY nice for the devs.. but.. i think this will make this forum spammed with 69 diff kernels with just minor changes.. as with the roms
Its better to let other people brick their phone than you brick your own
Just kidding! I for one will try and compile different versions with different lag-schemes to find the fastest combination. Including /system with fastest reading. I think I will add a benchmark to the recovery menu directly. Benchmarking each mount for read and for write speeds. Maybe I can use backup/restore code and just time it without writing (cp to null). Lets get to work
Thanks sztupy!
Sent from my GT-I9000 using XDA App
_JKay_ said:
Its better to let other people brick their phone than you brick your own
Just kidding! I for one will try and compile different versions with different lag-schemes to find the fastest combination. Including /system with fastest reading. I think I will add a benchmark to the recovery menu directly. Benchmarking each mount for read and for write speeds. Maybe I can use backup/restore code and just time it without writing (cp to null). Lets get to work
Thanks sztupy!
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
You cannot brick your phone with a bad kernel
@sztupy
I am impressed how productive master mind and kind person you are sharing all your knowledge and developments with us.
Congratulation, with you contributions you push Android Development forward.
Thank you
this is really cool, if i need minimal GUI, what would you suggest? xfce ? or there is something smaller and lighter? thx again.
avary said:
this is really cool, if i need minimal GUI, what would you suggest? xfce ? or there is something smaller and lighter? thx again.
Click to expand...
Click to collapse
Fluxbox/Openbox. However I don't see the need for one, if you're running the machine just for compiling.
Also, shouldn't gpm+guest additions solve the copy-paste problem?
E: Apparently not. Meh, stupid virtualbox.. sshd+putty then!
Awesome! Thanks for this sztupy! The more people we can get involved in this stuff, the better the end result will be. Always!
aziztcf said:
Fluxbox/Openbox. However I don't see the need for one, if you're running the machine just for compiling.
Also, shouldn't gpm+guest additions solve the copy-paste problem?
E: Apparently not. Meh, stupid virtualbox.. sshd+putty then!
Click to expand...
Click to collapse
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
avary said:
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
Click to expand...
Click to collapse
I'd use a shared folder+IDE/editor/whatever on windows. But that's just because I have so awful experiences about X in VMs, things might be better nowadays
Thanks a lot sztupy, will try it now. Sunday is enough time for testing
Each morning i have a look at XDA and you have brought out a new very helpfully posting, kernel, rom or else!
So let me ask you one question: when do YOU sleep?
avary said:
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
Click to expand...
Click to collapse
The advantage of using X is that afaik guest additions has copy-paste support, that would make modifying easier.
I also plan on making some simple scripts inside the default home directory one can run to communicate with the shared folder. After that we could provide simple scripts that you only have to put inside the shared folder, which will download, modify and run the compilation.

[DEV HOWTO] Use Voodoo in your kernel - Easy method - ready to use.

Until now Voodoo lagfix and tools required to be built from sources: https://github.com/project-voodoo/lagfix
As it's still the preferred and most powerful method, a much easier one exist now.
HOWTO:
1/ Pick your initramfs (ramdisk)
downloads / voodoo initramfs list
This directory contains ready-to-use initramfs for a lot of models and Firmware/Kernel versions.
full-uncompressed.cpio.gz is the recommended option. you can also gunzip it or recompress the .cpio to lzma
full-lzma-loader.cpio.gz allow you to build smaller kernels for Eclair, at the expense of loading time.
Benefit of using direct .cpio images is that you don't have to worry about permissions.
2/ Make menuconfig
General setup --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
(/choose/your/full-uncompressed.cpio.gz) Initramfs source file(s)
Make sure you also enabled the Ext4 driver in
File systems --->
<*> The Extended 4 (ext4) filesystem
Exit
3/ Build the kernel
nice -n 20 make -j8
Congratulations !
You now have a Voodoo able kernel
Very good work supercurio. Love it.
I think Samsung needs to appoint a whole cell of staff to interact here on XDA. That would be an ultimate.
XDA <-> Samsung. Lug it out boys, let the best come out.
Angry Birds <-> Lazy Pigs.
Edit : Competition brings out the best. But who should tell them???
Samsung developers work also their ass off.
supercurio said:
Samsung developers work also their ass off.
Click to expand...
Click to collapse
This has a touch of genius.
I'm replying just to give ragin some company.
Ps. supercurio rocks! Ds.
Thanks curio!
awesome, thanks supercurio

5/6 <DEV> [WIP] {ROM} 'AOSEP' Community Development "Build your own cm7/cm9/?"

5/6 <DEV> [WIP] {ROM} 'AOSEP' Community Development "Build your own cm7/cm9/?"
AOSEP V2.5​
Android Open Source Education Project​See post #191 for updated scripts
By following these instructions and/or using this set of files, you
proceed at your own risk. Under no circumstances would you hold
dizgustipated or anyone, except yourself, responsible for any negative consequences.[/COLOR][/I][/B]
################
***********************
################
I came across a "new" way of thinking over on a different thread, and have decided to adopt it.
I will still be developing and releasing roms,
but
Basically, I want to get you more involved in developing.
Allow you the chance to learn, contribute, and take pride in your accomplishments.
Possibly further the development of android, and see a whole new world open up to you.
That's why and how I got into developing. In was very curious, and unhappy with current rooms and update frequency. Or just with features available.
see post 2 for more info on the philosophy
I'd like to share a little script I found, and modified (with permission, and is still a work in progress) to automate the sync/build/package cycle, and to push the XDA community to get involved on a deeper level.
This whole process is designed for the latest stable Ubuntu (10.04/11.10), though it might work with Debian as well (or even other distros, if you have all the prerequisites already installed).
Alternatively, on tbe last post, you will find a handy script that gives a good shot at automating the whole prerequisites ordeal.
Place it in your root directory, navigate to it in terminal and type
Code:
Code:
sudo ~/installer.sh
Any brave souls willing to try?
I know you're impatient to get started, this script also contains a little guide, so check it out. I haven't had much opportunity to test this script because it takes so much time to start from scratch, so please help me out!
As of now, I have made many full builds this way, as well as a few incremental updates. Feel free to modify the MIT-licensed script. There are two time-consuming steps (4 and 6), so I'd recommend planning accordingly. Also make sure you have plenty of space on your disk; my working directory currently contains about 23GB.
0. I prefer you to start from scratch, (we want a clean start) as follows:
1. Make a folder for all your Android-building needs.
In your home directory, make a folder called "android"
Code:
Code:
mkdir android
and drop the text file in there, (in the new "android" directory, named Makefile (with no extension).
(Alternatively, you can open the make file, and edit the repo init to your preferred sgt7 repo sourcecode. Also, if you change repo address, you will need to make Bacon, instead of make package.)
Then open your favorite terminal app and navigate to that folder.
Code:
Code:
cd android
2. If you don't have any of the tools installed yet, and you're on Ubuntu, do this:
Code:
Code:
sudo apt-get install build-essential
sudo make apt
3. Initialize your working directory:
Code:
Code:
make init
4. Fetch the source code:
Code:
Code:
make sync
nb: It might take a while to fetch ~5.7GB of code off the Internet, depending on your connection. It might also hang, in which case you gotta stop the process, and retry (make sync) until you have everything. When you retry, you might want to do `make sync J=4` to reduce the concurrency. If it then complains about corrupt repositories ("not a repository"), you must delete the corrupt repositories and retry. You'd know it's frozen if "Fetching projects" does not progress for a minute or so.
(after a sync, seeing:
if ! grep -q "<stddef.h>" /home/diz/android/system/external/mesa3d/src/glsl/linker.cpp; then \
sed -i '1i #include <stddef.h>' /home/diz/android/system/external/mesa3d/src/glsl/linker.cpp; \
fi
is normal, it is patching so you can build)
5. (This step is done for you in the sync)
Alternatively, if you are looking to get deeper into dev-ing, you can back up the files, boot into CM7 and do the following to start making your own device files.
Plug in your SGT7 via USB, boot into CM7/BOCA RC1, and make sure debugging is enabled... to get some vendor-specific files (proprietary bits from Samsung and prebuilt bits from CyanogenMod):
Code:*
Code:
make vendor
*This will overwrite my device files, if you do not wish to do so, move on to the next step.
6
Build that stuff:
Code:
Code:
make build
This takes a while, depending on your hardware... perhaps a few hours. It's best to do this step overnight.
*if you error out in the build on: android_reboot.c, download THIS and replace the file already in android/system/system/core/licutils(android_reboot.c)
7. Save a snapshot for later:
Code:
Code:
make snapshot
This is actually required for the next step. But don't worry: snapshots are incremental, so they don't use too much space; and it's safe to remove any snapshot except "current".
8a. Package it up:
Code:
Code:
make package CLEAN=1
Check the snapshots directory for your shiny new update.zip
8b.Or simply make Bacon.
Code:
make bacon
9. It's even easier to keep your source up-to-date:
Code:
Code:
make sync
make build
make snapshot
make package CLEAN=1
(unsigned)
or
Code:
make package CLEAN=1 SIGN=1
(signed)
Or
Code:
make bacon
This makes a GSM P-1000 flashable zip, you can easily exchange the zImage for a L or N kernel, in the zip, & then flash in recovery after clearing user data, dalvic cache and cache then flash ICS gapps
10.
Be joy full and post a screen shot or a build.
11.
Continue developing/contributing to the android community
... and don't forget to thank FatTire and inportb for allowing me to alter and post this script, which made this possible
5/6
Reserved for instructions on how to use different sourcecodes
And things of that nature.
What works if you start building here:
The beginnings of the stuff that makes it BOCA, which include:
auto beagleboard patch
auto cherry pick of cyanogen vold that allows the use of the 4th vold partition (this has been merged)
A bit more HW accel
better video playback in YouTube and your movie files.
better quadrant score
better linpack score
address space layout randomization, as part of the install
WIFI (but takes a long time for the first connection)
Bluetooth
GPS
Accelerometer
Gyroscope
Light
Magnetic field
Orientation
Battery stats
Sound and sound recording
root
a bit of HW acceloration
better video playback (encode/decode)
recent apps button
Auto rotation (for launcher rotation, enable it in CM launcher)
Gallery
Flash
DSP Manager!!!
USB pc trickle charge
Market
Voodoo Sound
sdcard mounts are: internal (sdcard) and emmc (external sd)
USB PC mounting
NOT WORKING SO FAR:
Phone?
Things may/may not be added at some point in the future. You should have no expectations that they will. Anyone who asks for an ETA for something or other gets collectively stoned by the crowd.
Hopefully this project will push some to help fix a few things, as all that is on the NOT WORKING list is NOT WORKING in all and any SGT7 CM9 ports
DO NOT POST BUGS!!!!
ONLY POST "FIXES, OR THINGS THAT HELP FURTHER DEVELOPMENT
THANKS:
JT1134
Fattire
inportb
Spacemoose1
Teknomancer
Github
AOSP
Google (both its search engine and os)
Especially all the sgt7 tab developers
& all android Developers
This list could go on forever!​
Diz, you did it again. Cheers.
Sent from my GT-P1000 using xda premium
massive thread update
REMEMBER, this is still a WIP
We are so lucky to have you here diz. I will send my fourth donation to you at the end of this month! Thank you for educating us so we can learn how to contribute. I would not be surprised if this will be adopted by the whole XDA-community.
EDIT: Happy birthday!
EDIT 2: Is this related to the repo problem at the top of post #1? http://pastebin.com/Hb5rAUFr
Sent from my GT-P1000 using xda premium
stekarson said:
EDIT 2: Is this related to the repo problem at the top of post #1? http://pastebin.com/Hb5rAUFr
Sent from my GT-P1000 using xda premium
Click to expand...
Click to collapse
EDIT
open the makefile
look for these lines:
Code:
else
cd ${SYSTEM}; repo init -u git://github.com/CyanogenMod/android.git -b ics
endif
curl http://pastebin.com/raw.php?i=AGP6wn42 > ${SYSTEM}/.repo/local_manifest.xml
## removes old files and allows init to start from scratch
change it to:
Code:
cd ${SYSTEM}; repo init -u git://github.com/CyanogenMod/android.git -b ics
endif
## removes old files and allows init to start from scratch
then go to android folder, press Ctrl H (to see all the files) and delete everything except the make file.
Then:
in your terminal, in the android directory:
Code:
make init
make sync
Now get the needed files, from the location on the top of the OP.
Place them.
THEN:
Code:
make build
make snapshot
make package CLEAN=1
As soon as its second party verified, I'll update op
From http://review.cyanogenmod.com/p/CyanogenMod/android_system_vold
* branch refs/changes/77/11277/1 -> FETCH_HEAD
# Not currently on any branch.
nothing to commit (working directory clean)
make: *** [sync] Error 1
That just means it has been merged, there is no longer a need to cherry pick it.
Ill take the code out.
This does not ruin your sync.
simple proceed to make build
http://
www.teamovercome.net/common/xDA-Badge-ProudUser.png[/
IMG][/URL]
[B][url]www.teamovercome.net[/
url][/B]: [I][COLOR="Red"]Home of The Overcome ROM
Overcome Kernel ![/COLOR][/I][/LEFT]​
op updated with new directions and a new makefile.
this way we can sync pure cm9 source, and add the vendor and device files of our choice.
And we also don't ever have to worry about "make sync" conflicting with any of the device specific files and causing a sync error.
Although, at this time, I do recommend the files listed in the instructions to get the results implied in post #3
update 1/9
uploaded new makefile:
removed cherry pick vold, it was merged, so no need to clutter the script and get empty repo errors.
First of all thanks for your great work. Im trying to use your guide but got stuck at the "make init" command. If I use this command I get the following error:
Code:
rm /home/lesley/android/sign.tgz /home/lesley/android/update-lite.tgz
if ! grep -q "0x2080" /home/lesley/android/.android/adb_usb.ini; then echo 0x2080 >> /home/lesley/android/.android/adb_usb.ini; fi
cd /home/lesley/android/system; repo init -u git://github.com/CyanogenMod/android.git -b ics
/bin/sh: repo: Permission denied
make: *** [init] Error 126
Nevermind deleted all the folders in the android folder except the make file. After that I did "make init" and it run great.
The make file chmods the bin folder,
Sometimes a reboot is needed for it to take effect.
But sometimes you will still get an issue with bin permissions or paths
Then try this in terminal in the same directory you use the make init command.
Code:
PATH="$HOME/bin:$PATH"
Then
Make build as usual
dizgustipated said:
The make file chmods the bin folder,
Sometimes a reboot is needed for it to take effect.
But sometimes you will still get an issue with bin permissions or paths
Try his in terminal in the same directory you use the make init command.
Code:
PATH="$HOME/bin:$PATH"
Click to expand...
Click to collapse
Thanks, I deleted the folders/files in the android directory except the make file. After that it worked great it's now syncing.
Thank you so much diz !
Making my own CM9 is so damn exciting !!
looking at the instructions , looks easy
Thanks again .
To do list on 15th Jan ( after exam )
Make my own CM9
Diz you are the best !!
Oh btw sorry for this useless post !
I'm stuck at step 5.. how can I download these files....
And what files should be in these folders
Sent from my LG-P999 using Tapatalk
---------- Post added at 05:44 PM ---------- Previous post was at 05:29 PM ----------
tried to follow from step 5 and got this....
http://pastebin.com/vRw7U0Zq
Edit: downloaded whole commit from your git. Included is android folder, device_Samsung_galaxytab folder and Samsung/galaxytab folder
Using cdesi cm9 folder as reference, copied contents in device_Samsung_galaxytab folder. Into Samsung/galaxytab folder then.put that into device folder under android/system then ran step 6b and now it seems to be building since.I have a out folder atm
Edit 2: got same error again. Can you be more specific in your instructions?
Just for p1000 tabs, right? Or for p1010 too?
samcortez said:
Just for p1000 tabs, right? Or for p1010 too?
Click to expand...
Click to collapse
There wont.be support for wifi only.tab......
Sent from my LG-P999 using Tapatalk
samcortez said:
Just for p1000 tabs, right? Or for p1010 too?
Click to expand...
Click to collapse
as the title states, GSM/CDMA?
your device is basically a different device, altogether.
Does your device have cm7 yet?
ayysir said:
tried to follow from step 5 and got this....
http://pastebin.com/vRw7U0Zq
Click to expand...
Click to collapse
yeah thats all part of the original repo error, that i will be fixing today.
But in the mean-time,
navigate to android/system/vendor/cm
open: vendorsetup.sh
add:
add_lunch_combo cm_galaxytab-userdebug
close and save
now make build again
dizgustipated said:
as the title states, GSM/CDMA?
your device is basically a different device, altogether.
Does your device have cm7 yet?
yeah thats all part of the original repo error, that i will be fixing today.
But in the mean-time,
navigate to android/system/vendor/cm
open: vendorsetup.sh
add:
add_lunch_combo cm_galaxytab-userdebug
close and save
now make build again
Click to expand...
Click to collapse
What about galaxytab folder
Sent from my LG-P999 using Tapatalk
The links at step 5 is 404.

[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands

[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands
Well Hello again another day, another do it yourself guide for the people like me with ORD
Search it up to see what am on about
Today there will be two guides they are very easy I promise - One on how to compile just the kernel image(zImage) and the other on how to use some common git commands.
Kernel Guide
1. Downloading the sources & packages needed :
Before we start we need to make sure you have the necessary packages required for you to compile the kernel.
If you already have an android build environment setup then we are good to go
If not then you can either use my guide and get an android build setup going just incase you want to compile your own nightly later on or you can just download the necessary packages required for compiling the kernel.
Packages needed - 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.
So for ubuntu based system it will be -
$ sudo apt-get install 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
For arch linux -
$ sudo yaourt 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
Most of the packages are found in the AUR repository so you need a frontend to AUR like yaourt.
Once you have the packages installed we are going to clone the kernel tree into our computer.
I feel it's best you make a new directory for which you will use to compile kernels.
Once you are in your directory of choice we can now download the kernel sources
For Quarx kernel - $ git clone https://github.com/Quarx2k/jordan-kernel
For Blechd0se kernel - $ git clone https://github.com/Blechd0se/jordan-kernel
One thing to note is after the git clone command you can name the folder in which the sources will be saved to.
For example git clone https://github.com/Blechd0se/jordan-kernel blechd0se. This will renamed the folder to Blechd0se which the kernel sources will be saved to instead of the default name of jordan-kernel.
2. Downloading the toolchain/s
If you have one of the rom sources (CM10, SB, CNA) synced up then you can just point the cross compile to that directory.
$ git clone https://github.com/Quarx2k/platform_prebuilt
Here you have a choice of two toolchains either the default google one (4.4.3) or the recently added linaro toolchain(4.5.4) by Quarx
3. Setting up configuration
Now cd into the kernel folder so for me -
$ cd ~/Kernel/Blech0se
Then run the follwing commands -
$ export ARCH=arm
$ export CROSS_COMPILE=~/<location of toolchain>
- For the linaro toolchain it will be export CROSS_COMPILE=~/Kernel/arm-eabi-4.5.4-linaro/bin/arm-eabi-
- For google's iw will be export CROSS_COMPILE=~/Kernel/arm-eabi-4.4.3/bin/arm-eabi-
make mapphone_defconfig
If you are compiling Blechd0se kernel then you can choose what process schedulers you want BFS or CFS the default is CFS.
To enable BFQ you need to do the following things
make menuconfig this will bring up a menu which you can use to customise the kernel if you know what you are doing this can also be used on Quarx's the difference is you don't have as much choice as in Blechd0se's.
Scroll down and select enable block layer then IO schedulers the scroll down to BFS and type "Y" a star will appear in the checkbox showing it will use BFS now.
Once that's done you can compile own kernel image using the make command
make -jx <maximum number of jobs>
Replace the x with the amount of jobs you want. I usually use -j8 but you can use higher but it can slow down you PC.
Read this post for more info on effectively using make -jx
You kernel will be finished into a couple of minutes to hours depending on the amount of jobs you used and how many cores you have in your processor.
Now we need to package the kernel into a zip to flash recovery.
I recommend you download one of Blechd0se's zips and modify it.
You need to delete the config folder if you don't want your overclock settings getting overwritten and also you can modify the updater script found in META-INF/com/google/android.
Then replace the zImage in the folder system/2ndboot/ with your new one.
You can find your zImage into the arch/arm/boot folder in your kernel source folder.
4. Updating and rebuilding -
To update your sources with the latest changes you can use the git pull origin command from the kernel source folder.
So for me it will be -
$ cd ~/Kernel/Blechd0se
$ git pull origin
Once it's being updated we need to first use
$ make clean
$ export ARCH=arm
$ export CROSS_COMPILE=~/<location of toolchain>
$ make mapphone_defconfig
$ make -j8
Credits & Thanks-
To XDA as always for being an awesome resource and playground
To Google for all they awesomeness
To Blechd0se for being an awesome kernel dev
To Quarx for his amazing work on the kernel so far
To thewadegeek for his guide which I have adapted this from Thank him here ​
Git Commands​
The following git commands are the essential ones are feel that are needed to be able to use git effectively allowing you to help contribute back to the community...... With these commands you can help with things such as rom translation, bug fixes etc......
Commands -
1. git clone
This is used to clone a remote repository like here onto your local drive allowing you to edit/add files.
e.g
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common
This will clone the repository android_device_moto_jordan-common into a new folder called android_device_moto_jordan-common but if you want the folder to be called something else just add the name after the url like so....
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common Defy-common
Additionally, you can also specify downloading one branch by using the -b command you can also still has a custom name for the folder by putting the name at the end of the branch name. E.g
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common -b jb_2ndboot Defy-common
2. git
HAHA again
Last one for a party
I just finished syncing CM10 sources, I'll do this one too now
Thanks, you rock!
mark,thanks
Sent from my MB526 using xda premium
Thank you Kayant for this nice guide Hope to see some additional dev's soon
Maybe you can add how to push a commit
And if you only want to rebuild modified modules you can simply run the "mmm" command, safes time
Btw: BFQ and CFQ are I/O-Scheulders, CFS and BFS are process schedulers
When I used to have defy (good old days) this was something I want to share with everyone but I couldn't because I lost my defy when I have doing some progress in custom kernel. Then I lost track of this great community and stop to make things for defy. It's great to see this kind of tutorials for help other users as well. As always, very thanks kayant!!!
Enviado desde mi MT27i usando Tapatalk 2
Thought I might add. on that make -jx command, x should be your max threads + 1 -- eg, I have a quad core w\o hyper threading so I use 5.
use the "nproc" command to find out how many threads you have
the make jx is different than sync jx, where sync jx is how many files you'll concurrently download. I figure most of us know that, but I figured I'd make the distinction.
number of cores + 1 is recommended on a lot of faqs; your results may vary, but using j5 (my recommend setting) versus not setting it (j4 by default, i think -- needs fact checking) speeds up compile time by 20-30 minutes (Quarx CM 10). using too many threads will slow you down and using too little is inefficient and thus slower.
Thank you very much for your informative guides Kayant always learn something from it and really appreciate it:thumbup:
Sent from my MB526 using xda premium
skeevy420 said:
Thought I might add. on that make -jx command, x should be your max threads + 1 -- eg, I have a quad core w\o hyper threading so I use 5.
use the "nproc" command to find out how many threads you have
the make jx is different than sync jx, where sync jx is how many files you'll concurrently download. I figure most of us know that, but I figured I'd make the distinction.
number of cores + 1 is recommended on a lot of faqs; your results may vary, but using j5 (my recommend setting) versus not setting it (j4 by default, i think -- needs fact checking) speeds up compile time by 20-30 minutes (Quarx CM 10). using too many threads will slow you down and using too little is inefficient and thus slower.
Click to expand...
Click to collapse
Thanks for the infromative post as always
In this situation I feel it doesn't matter too much since it takes minutes to compile just the kernel even on my core 2 duo but I will add your hint your post to the OP. Thanks again ^_^
Kayant said:
Thanks for the infromative post as always
In this situation I feel it doesn't matter too much since it takes minutes to compile just the kernel even on my core 2 duo but I will add your hint your post to the OP. Thanks again ^_^
Click to expand...
Click to collapse
You're completely right about the kernel and time -- but for full rom builds and a Funtoo "emerge -uDNav world" it helps. I just saw that j8 and thought "My dual core Athlon 64 would hate me if I did that".
Great guide as always
That does it.
I'm studying Linux in earnest. Enough of this dabbling around the edges... :cyclops:
renoob said:
That does it.
I'm studying Linux in earnest. Enough of this dabbling around the edges... :cyclops:
Click to expand...
Click to collapse
That's the best thing I ever did. I hated XP, wish it was more like Win2k -- I'd gladly pay for Win8 if it had a 2kPro interface. Win2k was awesome, and the only Windows OS I'll give praise to.
I recommend starting out with Ubuntu or Mint (Mint based on Ubuntu, not Debian). There's better support for Ubuntu and distros based on Ubuntu. After about 4-6 months, once you start learning apt, the command line (bash), and some Linux basics; switch to Pure Debian or Mint Debian -- much better than Ubuntu, but not as user friendly (or AptoSid\Sidux -- they're based on Debian Unstable (Sid) -- which is actually pretty stable, ya just gotta be able to fix it if it breaks). I've found that the easiest way to learn it is to just do it. Reading up on it only goes so far without putting it to practice.
After a year or so, try out Gentoo\Funtoo and you'll learn a lot about Linux -- but those distros are not for the faint hearted and require time and dedication to get a GOOD working environment. Once you have it how you like it, it WILL be the fastest desktop you can use with the fastest compile time -- well, WILL should be shall or can. I'm about to turn my old compile PC into a generic x64 Funtoo box (one of my 64's is AMD, the other Intel). A generic build will allow me to use the same base system on both PC's and allow me to rebuild them to they're specific architecture after its all set up. It took me 3 tries to get a good Gentoo box running -- miss one step in that install guide and you can be up that creek.
11 years on Linux now, 9 years with only maybe 25 boots into Windows -- past 10-15 were to flash an sbf and to reboot back to Linux -- so glad I stumbled across the sbf_flash Linux tool. Last time I booted Windows was after installing Win7 and its drivers....seriously, all I've done is installed it and the drivers and haven't booted it up since. I've used Red Had, Fedora, Ubuntu, Arch, Mint, Debian, Suse, Mandrake, Gentoo, Funtoo, Sabiyon, Aptosid, Sidux -- after using all of them, I find that I prefer Debian\based systems (not Ubuntu\based systems -- I actually don't like Ubuntu, well, since 0910 -- it was a good distro up until then imho). And I like Funtoo for the source based distros -- I've messed around with other source based ones (Sorcerer, Arch) and like Futnoo over Gentoo and the rest in the end.
//You might already know enough Linux, I'm just posting what I think is the easiest way to start using and, therefore, leaning Linux.
///I'm also surprised that there isn't an XDA based Linux distro -- designed by XDA members to make it easier to get into Linux\rom hacking
rom compiling with all the tools we all need an apt-get away.
EDIT
I've been meaning to ask, Do any of you programmers have any good books to recommend? I'm finding myself of the border of power user and programmer and need to start learning some code skills to cross over. I'd like to learn something C, Python3, and Java; but there are a ton of books on them and I'd like a recommendation from someone HERE who knows a bit of programming and what they'd use to learn nowadays. I'm sure I'm not the only one with that question either. Something C and Java for Android, Python3 for Linux (maybe Android if that project has gained some ground). Thanks.
/Bolded that so it sticks out.
@skeevy
I use Arch Linux ATM and a love it but yh I have read about gentoo and how you can build it to your system.... Once I get a new PC in the near future hopefully very soon am going to try that and freebsd... Thanks for the advice
Let's Go ^_^
Kayant said:
@skeevy
I use Arch Linux ATM and a love it but yh I have read about gentoo and how you can build it to your system.... Once I get a new PC in the near future hopefully very soon am going to try that and freebsd... Thanks for the advice
Let's Go ^_^
Click to expand...
Click to collapse
Never tried BSD. Arch was OK, but I started on Debian, jumped around different ones for a few years, stuck with Ubuntu 7.10 for 6 months, hated their update, and been on Debian or Mint Debian ever since; testing or Sid usually -- I transcode my DVD's and stable has older codecs . Arch was a year ago for a month -- if I gave it more of a chance I'd probably like it as much as I do Debian. I've used almost all major distros, desktop environments, window managers, etc; but I always find myself back with Debian\XFCE -- it just works for me.
If you didn't know, Debian has a freeBSD based distro as well. That'll make it easy to try out BSD in an Debian style environment.
Hoped I could say the same. School is a real Linux killer.
Even for software that has a linux port, they only give us the installer/license for the Windows version. :/
PLC and robotics software tend to only run on Windows anyhow. As 3D drawing.
Always have the need to change my partition setup Linux-Windows after installing such an application on my laptop.
I am now using Ubuntu for 3 years. I like the look and don't want to spend time on my PC installation so it's good for me . I can imagine that it's different if you really want to get to know Linux or Unix.
What I hear most for learning to program (me not so much) is just try to do what you plan to do with it(an android application, ...) and searching how to get there. Don't know many that read books. Except for guidelines for memory management and security for example later on.
I've been programming for nearly 20 years. Only had a few classes in the basics. The rest has been trial by fire. Use Google a lot to figure out how to do stuff, but I can't really TALK about code as I don't know what to call some of the things I do. I highly recommend taking formal classes and reading books.
Sent from my SPH-L900 using xda premium
I compiled my own kernels on my phone and it's running
ps:My english is not so good:crying:
labsin said:
Hoped I could say the same. School is a real Linux killer.
Even for software that has a linux port, they only give us the installer/license for the Windows version. :/
PLC and robotics software tend to only run on Windows anyhow. As 3D drawing.
Always have the need to change my partition setup Linux-Windows after installing such an application on my laptop.
I am now using Ubuntu for 3 years. I like the look and don't want to spend time on my PC installation so it's good for me . I can imagine that it's different if you really want to get to know Linux or Unix.
What I hear most for learning to program (me not so much) is just try to do what you plan to do with it(an android application, ...) and searching how to get there. Don't know many that read books. Except for guidelines for memory management and security for example later on.
Click to expand...
Click to collapse
That's what I've been doing up until now, but Google only helps so much -- I can do a search on learning Java and come up with 1000's of faqs, guides, ect -- weather its worth reading or full of it is unknown too me since. A good book can be worth its weight in gold. With a bad internet faq, ya might as well change the faq's a to a u and bend over, cause that's what you're doing to yourself by learning from bad sources.
While I don't know what apps you're using, I know that some apps have a license isn't limited to the platform -- the Win License works on Linux\Mac\Unix as well. Or just use the Lin version and not feel guilty since you have the Win license .
Ubuntu was great until it started getting too bloated for my tastes -- and they're XFCE editions usually use much more resources than doing the same thing with Pure Debian installed from the command line up. On compile\dev boxes you want as little running as possible for obvious reasons. Not to mention the UI can greatly change from release to release with Ubuntu. Buntu was my 2nd Linux to run; Debian first -- Learned more on Ubuntu then went back to Debian. Pure Debian can be daunting if its your first distro.
Malcont3nt said:
I've been programming for nearly 20 years. Only had a few classes in the basics. The rest has been trial by fire. Use Google a lot to figure out how to do stuff, but I can't really TALK about code as I don't know what to call some of the things I do. I highly recommend taking formal classes and reading books.
Sent from my SPH-L900 using xda premium
Click to expand...
Click to collapse
Thanks. I'd be taking classes if I could. I don't qualify for any grants and I don't want to go for a loan because of the uncertainty of being able to pay it off.
Something I'm seriously thinking about doing is this -- free online classes from MIT. That has to be good information.
@All
I'm thinking of starting a generic x64 Funtoo box and get it to where XFCE is working, Nvidia graphics (all I buy is Nvidia Cards ), Android SDK is up and running, and all the required scripts, apps, udev rules, etc are already installed set up (repo, sbf_flash, apktool, etc). Then upload that as a zip so all you'd have to do is extract the zip to a blank partition, edit its fstab, update grub, set the build environment variables to your own, reboot, set users\passwords, and recompile the system.
I'm already going to do all of that except for the upload as a zip part -- I have 2 64 bit pc's -- one amd, one intel -- so I have to build it as a generic 64 in order to use the same system on both boxes. I was just wondering if anyone else would be interested in something like that once its all done.
---------- Post added at 09:22 AM ---------- Previous post was at 08:25 AM ----------
I normally don't post my PM's, but the last half on this one I sent out might be useful to some of you looking for the essential git commands
I have a couple of good sites I use for github reference. Here & here
Typing "man git" in the command line has helped me a lot as well. I've learned most of my Linux knowledge by typing "man name_of_program" and Googling what it said that I didn't fully understand -- especially with video encoding, ffmpeg and mplayer are some long reads, so is git. Git also has a "git help name_of_git_command" program that's helpful as well.
There's also a few threads on the Defy forums dedicated to helping out people trying to do exactly what you're wanting to do. The nightly builds link is a really good place to start with -- contains pretty much all you need to know to be able to compile roms. Kayant's an awesome dude and really helpful. His threads are great for users wanting to learn and\or contribute back.
[Guide] Compile your own nightly builds - AOKP, CM10, CM9, CNA, Slim Bean, P.A.C
[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands
I learned git from forums like the ones above, those reference sites and man pages\help program. Took about a week of trial and error before I got the hang of it. I still have a hard time remembering to start a branch before editing crap after the initial sync .
Honestly, the hardest thing to do, in regards to PA, is adding in FM. Almost everything else Defy\Bravo related just cherry picks right in with no\ very little and easy to fix conflicts. The FM commits are old and those files have changed a lot from when Quarx & Maniac did the patches -- especially between Quarx's and PA's current.
Cherry picking is pretty easy, navigate to the base directory -- like frameworks/base -- then its "git cherry-pick a_ton_of_hex" and it'll either pick right in or you have conflicts. If I get conflicts, I use the app "git-cola" ran from command line in the /frameworks/base directory; and its a gui app that'll list what files have conflicts (and a lot more) -- I then open up the conflicting file with tkdiff (or whatever diff you like) and fix the conflicts, "git commit -a" (saves changes), and push to github. If you don't get conflicts, just commit and push. Btw, the ton of hex is all the hex code next to the commit on github.com, review.cyanogen-mod.com.
Making changes on your own is done simply be navigaitng to the base directory -- frameworks/base for the android_frameworks_base repo, device/moto/mb520 for the Bravo repo -- and opening a terminal, starting or pointing to a branch (git checkout -b name_of_new_branch is a good command to run before you do anything -- checkout -b n_o_b creates a new branch and places you on it), then do what ever changes you need to do, then do "git commit -a", enter a description, and push. Once you have different brances going, you can use "git checkout name_of_branch" to switch between them. Read up on branching, cause theres a lot to it.
There's a lot of different ways to do git, and my way might not work for you.
Good luck and have fun reading -- you'll be doing a lot of it :silly:

Categories

Resources