Android Dev. How-To Guide: Compiling the Android/Linux kernel for the Epic Touch 4G

Search This thread

shanenielsen1234

Senior Member
Jan 10, 2012
52
145
Temecula,CA
Sorry for all the questions, once I figure this out ill be good. When I do step 5 it only took like 10 seconds, the op states it should take a while.....

Im on 64 bit ubuntu if it makes any difference.. Im using the initramfs from desperado kernel github.

michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make c1_rev05_na_spr_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_sym’:
scripts/kconfig/conf.c:159:6: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:231:6: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c:307:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:105:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
HOSTCC scripts/kconfig/kxgettext.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/genksyms/genksyms.o
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/lex.o
HOSTCC scripts/genksyms/parse.o
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2

Try this:
After you enter : "sudo make clean" and that goes through and its done, retype the "export CROSS_COMPILE=Path to toolchain" command then hit enter and type: "make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs" Then see if it compiles after that.
 

MikeC84

Senior Member
Jun 21, 2010
1,513
836
Tucson
Google Pixel 6
Try this:
After you enter : "sudo make clean" and that goes through and its done, retype the "export CROSS_COMPILE=Path to toolchain" command then hit enter and type: "make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs" Then see if it compiles after that.

Same thing. Here my entire terminal session:


michaelc@michaelc-iMac:~$ cd /home/michaelc/Desktop/SPH-D710_GB_Kernel
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ sudo make clean
[sudo] password for michaelc:
make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
CLEAN .tmp_versions
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
CHK include/generated/utsrelease.h
HOSTCC scripts/basic/hash
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
make: *** wait: No child processes. Stop.
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$


Not sure if it the initramfs file I used from desperado github but it doesnt have the lib folder like the one does you liked to.
 
Last edited:

shanenielsen1234

Senior Member
Jan 10, 2012
52
145
Temecula,CA
Same thing. Here my entire terminal session:


michaelc@michaelc-iMac:~$ cd /home/michaelc/Desktop/SPH-D710_GB_Kernel
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ sudo make clean
[sudo] password for michaelc:
make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
CLEAN .tmp_versions
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
CHK include/generated/utsrelease.h
HOSTCC scripts/basic/hash
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
make: *** wait: No child processes. Stop.
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$

Lets start over:
Open a new terminal window and cd again: cd /home/michaelc/Desktop/SPH-D710_GB_Kernel

Then enter: CROSS_COMPILE command: export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-

Enter: sudo make clean
*ignore any Make: errors*

enter again: CROSS_COMPILE command: export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-

enter: make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs

Now see with a clean slate if it works now or what errors you get.
 

MikeC84

Senior Member
Jun 21, 2010
1,513
836
Tucson
Google Pixel 6
Lets start over:
Open a new terminal window and cd again: cd /home/michaelc/Desktop/SPH-D710_GB_Kernel

Then enter: CROSS_COMPILE command: export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-

Enter: sudo make clean
*ignore any Make: errors*

enter again: CROSS_COMPILE command: export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-

enter: make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs

Now see with a clean slate if it works now or what errors you get.

Restarted terminal and get this;


michaelc@michaelc-iMac:~$ cd /home/michaelc/Desktop/SPH-D710_GB_Kernel
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ sudo make clean
[sudo] password for michaelc:
make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
CLEAN .tmp_versions
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$

arm-non-eabi-gcc is in the folder so i dont know why it says not found
 

chris41g

Inactive Recognized Developer
Sep 10, 2009
2,073
3,613
its the path to your cross compiler.. something is wrong with it...
 

dtm_stretch

Senior Member
Dec 22, 2010
477
163
Albany
Not sure if it the initramfs file I used from desperado github but it doesnt have the lib folder like the one does you liked to.

I am trying it now with the desperado github, I just added the lib/modules folder and copied the created modules to there. It is compiling now I'll let you know how it works.

Also I did a complete restart then tried again before it worked.


**Oh and did you unpack the toolchain?
 
Last edited:

shanenielsen1234

Senior Member
Jan 10, 2012
52
145
Temecula,CA
Restarted terminal and get this;


michaelc@michaelc-iMac:~$ cd /home/michaelc/Desktop/SPH-D710_GB_Kernel
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ sudo make clean
[sudo] password for michaelc:
make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
CLEAN .tmp_versions
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$

arm-non-eabi-gcc is in the folder so i dont know why it says not found

Are you using the tool chain linked on the guide or a differrent one? Double check that the path is correct to. Go to your homefolder look for the desktop folder then look for the toolchain.
 

chris41g

Inactive Recognized Developer
Sep 10, 2009
2,073
3,613
I just realised this, you are using a linux toolchain on a mac..

you need a mac toolchain..
 

MikeC84

Senior Member
Jun 21, 2010
1,513
836
Tucson
Google Pixel 6
Are you using the tool chain linked on the guide or a differrent one? Double check that the path is correct to. Go to your homefolder look for the desktop folder then look for the toolchain.

I am using the one you provided.

Screenshotat2012-01-13151949.png
 

shanenielsen1234

Senior Member
Jan 10, 2012
52
145
Temecula,CA
Restarted terminal and get this;


michaelc@michaelc-iMac:~$ cd /home/michaelc/Desktop/SPH-D710_GB_Kernel
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ sudo make clean
[sudo] password for michaelc:
make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found
CLEAN .tmp_versions
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ export CROSS_COMPILE=/home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$ make -j5 CONFIG_INITRAMFS_SOURCE=/home/michaelc/Desktop/initramfs
make: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: Command not found
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
CC scripts/mod/empty.o
/bin/sh: /home/michaelc/Desktop/arm-2009q3/bin/arm-none-eabi-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
michaelc@michaelc-iMac:~/Desktop/SPH-D710_GB_Kernel$



Edit: You are on ubuntu? okay never mind what i just said...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 85
    Android Development How-To: Compiling the Android/Linux kernel for the Epic Touch 4G.

    NOW INCLUDES ROOT!!!

    Introduction: This guide is meant for people who want to get started with android development and don't know where to start. This thread can also be used as a reference place for android development on the et4g. This guide well first be on compiling the android kernel and flashing it to your phone and, I well update it on a regular basis for more complex mods and such to get you familiar with the android platform. If at anytime anyone would like to add more to this, pm me with what you would like to add or fix. Android is an open-source wonderland and I feel like more people should experience the fun of android development. Just remember I am not responsible if you do something stupid and break your phone!

    First, we are going to get familiar with the android kernel by compiling a stock build and flashing it with Odin to your et4g.


    What you need to download to compile the kernel:

    Samsung open-source kernel and platform files. Available at: Samsung Open Source
    Type in: Sph-d710 in the search bar in the link and download latest source.

    initramfs files (More on this later) (includes cwm, busy box, and of course root! Thanks to chris41g for his help.) Files available at: Initramfs Files

    Tool chain for compiling: Available at: Arm-toolchain

    Preferably Ubuntu or another Distro. Of Linux running on a partition or Virtual machine.




    Step 1: Were going to unzip the source you got from Samsung and take a short look around.

    unzip the source and unzip the file that says, “SPH-D710_GB_Kernel.tar.gz” and, open it up. You are now looking at the kernel source for the Epic touch 4g! Okay I well not go over to much whats is here but, I well add a more in depth look in the kernel soon.

    Scroll to the bottom of the source and you should see a document that says, "makefile". We are just going to add a name for your stock compile of the kernel, to make it a little more special. Open it and go to where it says Extra version and add your last name ,just make it all lower case letters or it wont compile correctly. When you flash it to your phone, the about phone panel in setting well say: Kernel version: 2.6 [last name you chose] now.




    Step 2: Lets get started!

    Open terminal in Linux and change your directory to the kernel. You do this by putting,
    “cd” and then typing where your kernel source is then hit enter. My terminal looked like this:

    cd /home/shane/Desktop/SPH-D710_GB_Kernel



    Step 3: Tell terminal where your tool chains you downloaded are located.

    The kernel is compiled using a tool chain, and the terminal needs to know where the tool chain is to compile. (The tool chain is the folder called “arm-2009q3” )Start by typing this in the terminal:
    export CROSS_COMPILE=
    Then after that put where your tool chain is located. Also when you are entering where it is at, you need to put a “/bin/arm-none-eabi-” at the end of the directory. This shows the terminal that the compiling tools are under the folder bin and starts with arm-none-eabi- and the android compilation adds the last word for the compiler program it needs. (you can see this if you go into the bin folder under the “arm-2009q3 folder.) For adding the tool chain I entered this:

    export CROSS_COMPILE=/home/shane/Desktop/arm-2009q3/bin/arm-none-eabi-

    Then hit enter.

    Step 4: Clean the kernel, enter configuration files and make the modules.

    Enter this command:

    Then enter password and hit enter.

    Then it well say something like:
    make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found

    IGNORE THIS! It is just a fragment in a configuration file that says the toolchain is not in the default location. But, we changed the tool chain location in step 3 so it well compile correctly.

    This cleans up and organizes the kernel for compilation.

    Now enter this command in terminal:
    make c1_rev05_na_spr_defconfig

    This is the configuration files for the epic touch 4g and well compile the kernel based off what is in these files.

    Now were going to compile all the modules so wifi,vibration... work.
    Enter this in terminal:


    Step 5: Moving the newly compiled modules to the initramfs/lib/modules folder.
    We are now going to move the modules from the newly compiled modules to the initramfs files. So that wifi and vibration well be working in our kernel.

    *Initramfs files are the root filesystem of the kernel and does processes the kernel can't do itself while its booting.

    You can do this by terminal or by hand. We are just moving the modules to the initramfs to be used when compiling the kernel.
    You can type this into terminal (Where it says “Path to initramfs” you need to replace with your own path to the initramfs folder + /lib/modules) :


    cp drivers/samsung/j4fs/j4fs.ko Path to initramfs/lib/modules
    cp drivers/scsi/scsi_wait_scan.ko Path to initramfs/lib/modules
    cp drivers/bluetooth/bthid/bthid.ko Path to initramfs/lib/modules
    cp drivers/net/wireless/bcm4330/dhd.ko Path to initramfs/lib/modules
    cp drivers/samsung/vibetonz/vibrator.ko Path to initramfs/lib/modules
    cp drivers/staging/westbridge/astoria/switch/cyasswitch.ko Path to initramfs/lib/modules

    This copies the new modules out of the kernel source and puts them in the initramfs/lib/modules folder to be used later.

    Now once you enter that press enter.

    Step 7: Compiling the android kernel with initramfs.

    Type this in terminal:
    make -j5 CONFIG_INITRAMFS_SOURCE=Path to initramfs file

    *Remember to replace the “path to initramfs file” with the path to the initramfs file.


    Okay this well take anywhere from 5-15 mins. to compile depending on your system.

    Step 8: Were done compiling, lets make something flashable for Odin!

    Just type in terminal:

    Then type:
    tar cvf MyKernel.tar zImage

    This well zip up the zimage (the kernel) you just compiled to something flashable in odin.

    If you open up the kernel source file and go to arch/arm/boot you well see the zimage you compiled and, the Mykernel.tar file for Odin. Double check and right click on the zimage and make sure it is around 5-6 MB before flashing.


    Step 9: Flashing to your phone.

    Go to a windows computer and download Odin.(if you have rooted your phone using zedomax's method you should have it installed already)

    Okay now open it up and place the Mykernel.tar file in the PDA section of Odin. Now download the drivers for your phone if you haven't.(I assume you already have.) Then put your phone in download mode (hold volume down button and power button on start up and push volume up button when the warning pops up) Now plug your phone into the computer and make sure “auto-reboot” is the only box checked in Odin. Hit start and your phone well be flashed with a kernel you compiled yourself! If you did this right your phone should start up. If it is stuck in a boot loop, immediately put back in download mode and flash to stock. Link available here to stock files:

    http://xdaforums.com/showthread.php?t=1409634
    and, try to figure out what you did wrong while compiling and try again!

    Good job you have finished! :D:D:D


    Step 10: The future and your new phone!

    I would like to include more android kernel mods and stuff in the future but, wanted to get this out there to get people familiar with the android compiling process. I want this guide to be something people reference as they start to develop, by using the methods here along with kernel and U.I mods on the platform being implemented in the future. My ultimate goal is to at least know I helped at least one person get into android development so, if I helped you please leave a reply or say thanks. If anyone has ideas to add to the post, please pm me.
    Have fun developing!
    62
    I'd strongly recommend adding some documentation on using git - any kernel developer should be using git to maintain their kernels. It makes bringing in upstream patches MUCH easier, and also publishing source is a lot easier.

    Doing "git push origin" to a public repository like github or gitorious (I prefer github, gitorious seems buggy to me) take a LOT less time and bandwidth than pushing an entire new tarball for a given kernel release.

    A few git tips:
    • Try to keep changes to "one feature, one commit". In addition to making the lives of other developers who want to apply your feature to another device easier, it will make your OWN life easier if you start working on another device.
    • Keep defconfig changes separate from the kernel commit that adds the feature being enabled/disabled/configured using the defconfig change. Otherwise the defconfig change will make the commit unlikely to apply cleanly to another source tree
    • To get a properly formatted git-am commitable patch, append .patch to the URL of a github page - example: https://github.com/Entropy512/linux_kernel_sgh-i777/commit/fc9eb85807302583259e27013ed184a43107bb67 becomes https://github.com/Entropy512/linux...c9eb85807302583259e27013ed184a43107bb67.patch
    • Patches made as described above can be committed using "git am filename.patch" - this preserves attribution to the original author of the commit. It's not required (Edit: Actually, on further thought, some of the legal rules relating to copyrights may require that authorship be preserved - better safe than sorry!) but a nice thing to do and makes other kernel maintainers more likely to cooperate with you. They may even start coming to your kernel thread and posting useful patches.
    • DO NOT rebase commits you've already pushed to a public repo, this practice is considered mortal git-sin, even Torvalds has written rants against this practice - Worst case this means more than one commit for a given feature. (e.g. initial feature commit, cleanup/bugfix commit). If you do this, ideally reference the commit you're fixing up.
    • When reverting something, make a comment why you're doing the revert - Otherwise someone will wonder what was wrong with the feature you reverted
    • In general, try to be descriptive with your changes in the commit description - what you're changing and why - I suggest doing some research and looking at how commits are made on the mainline Linux kernel.

    One which I should be doing, but have been lazy about:
    When you do a release, you can tag that branch/revision so it is easily identifiable as the branch for this release. I admit I haven't done this nearly as often as I should.
    13