Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,687 Members 40,656 Now Online
XDA Developers Android and Mobile Development Forum

Guide for Compiling a kernel for the Tubuntu app by x3maniac and TF101

Tip us?
 
TomTcom
Old
(Last edited by TomTcom; 26th March 2013 at 12:58 AM.)
#1  
TomTcom's Avatar
Recognized Contributor - OP
Thanks Meter 458
Posts: 1,049
Join Date: Mar 2011
Tutorial Guide for Compiling a kernel for the Tubuntu app by x3maniac and TF101

Guide for Compiling a kernel for use with the Tubuntu application by x3maniac and TF101.

These insturctions work with 64bit Linux laptop/PC's, version 4.5.4 for the armhf toolchain, and 2.6.36 kernel version. The toolchain and kernel from the github below is the direct source x3maniac makes the kernels we are currently using. Please understand a few things, if you add modules to this build you will need to add them to your Linux image you are using. I'll provide specifics as I work through the learning process as well. If you change compilers or upgrade the software components outside of this guide it may produce errors or problems.

If you are looking for making a version 3 kernel, hardware acceleration with nvidia and things like that you will either have to ask x3maniac or do your own research as this guide does NOT tell you how to do this.

******My directories reference my own username on my laptop, please substitute "thomas" with your username OR your /home directory, or whichever directories you wish to use. I used full paths on purpose for my own learning and to be specific for newcomers to Linux who wish to learn to compile.******

All credit goes to the time and consideration x3maniac took to assist me with doing this!

OP for Tubutnu by x3maniac

1. Open Terminal. Everything will be executed from Terminal.

2. Now type: sudo apt-get abootimg

3. Now type: mkdir /home/thomas/kernelbuild

3a. Now type: cd /home/thomas/kernelbuild

4. Now type: git clone https://github.com/novaspirit/tf101-linux-2.6.36

5. Now type: git clone https://github.com/novaspirit/Ubuntu_initrd-3.x.git

6. Now type: git clone https://github.com/novaspirit/config.git

6a. The config.git has a file called /config/boot.cfg, you could modify the last line called the command line and have it boot from alternate locations, the default is fine and set to /dev/mmcblk0p8. So let's not touch it, you can use nano to edit this file.

7. Now type: git clone https://github.com/novaspirit/androi...hain-4.5.4.git

8. Now type: cd /home/thomas/kernelbuild/tf101-linux-2.6.36

9. Copy this into Terminal and hit enter: sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

10. Copy this into Terminal and hit enter: sudo apt-get install libgtk2.0-dev libglib2.0-dev libglade2-dev (this allows you to make a GUI of the config file)

11. Now type: make help (you should see a list of build targets. You are looking to see if you have tf101_gnulinux_defconf.)

12. Now type: export ARCH=arm

13. Now type: export CROSS_COMPILE=/home/thomas/kernelbuild/android-toolchain-4.5.4/bin/arm-eabi- (understand the arm-eabi- simply ends with the hypen to include sub components, it's not a typo)

14. Now type: make tf101_gnulinux_defconfig

15. Now type: make gconfig (the GUI pops up and this is where you can select options). Click on split, the options will be on the left. This is where you can select what you wish to add. For example, web cam and GPS functions. HOWEVER, it does not mean this will work nor is it all perfectly set up. There may be some additional research by YOU the reader to find out what will or won't work with this kernel. (NOTE: you must run make gconfig even if you don't change anything otherwise an error will occur when you run make -j2 modules command).

16. If you have made changes it will ask you to save. Go ahead and save it.

17. Now type: make -j2 zImage (j2 represents jobs that can be run concurrently, determined by the kernel build. This option only works if you have 2 cores and also you can use -j4 if you have a 4 core system and so on.)

18. Now type: make -j2 modules (If the github provided by x3maniac doesn't have a module you need, this is where YOU the reader must research what you need to add and place it in the appropriate location).

19. Now type: make modules_install INSTALL_MOD_PATH=/home/thomas/kernelbuild/Ubuntu_initrd-3.x/

20. Now type: cd /home/thomas/kernelbuild/Ubuntu_initrd-3.x/

21. Now type: find .|cpio -H newc -o | gzip -9 > /home/thomas/kernelbuild/initramfs.img

21b. The output should say something similar to 1111 blocks or 14582 blocks, doesn't matter the number. The number and blocks means it has been made successfully.

22. cd /home/thomas/kernelbuild

23. Now type: abootimg --create kernel.img -f /home/thomas/kernelbuild/config/boot.cfg -r initramfs.img -k /home/thomas/kernelbuild/tf101-linux-2.6.36/arch/arm/boot/zImage

23b. abootimg is very strict and will produce an error here if anything is wrong. You are looking for the output of some files created and you should see a kernel.img file in your directory with an ls command.

24. If you are going to flash the kernel using the Tubuntu application, rename kernel.img to linux.img and flash appropriately from the app.

25. If you are going to create another kernel you need to clean it up before repeating steps 12-24. So proceed to step 26.

26. Now type: cd /home/thomas/kernelbuild/tf101-linux-2.6.36

27. Now type: make clean

28. Now type: make mrproper

29. Delete kernel.img from /home/thomas/kernelbuild/

30. If you aren't modifying additional modules and parameters you can save the created initramfs.img file. Otherwise delete it and run through the steps, doesn't take long to do anyways.

31. Profit.
The Following 8 Users Say Thank You to TomTcom For This Useful Post: [ Click to Expand ]
 
TomTcom
Old
#2  
TomTcom's Avatar
Recognized Contributor - OP
Thanks Meter 458
Posts: 1,049
Join Date: Mar 2011
My guide is complete now. Please read everything thoroughly before diving in. It's not as difficult as it looks. I will make kernels and modify the guide to weed out any errors, typos, or wrong steps. Hope everyone enjoys! I do this as much for myself as the community.
 
TomTcom
Old
#3  
TomTcom's Avatar
Recognized Contributor - OP
Thanks Meter 458
Posts: 1,049
Join Date: Mar 2011
Made some edits for consistency and clarity. Please remember to check the github to determine if X3, our dev, has made any changes possibly requiring you to git clone again. If changes have been made, it is my experience that the easiest way to get the newest is to just delete the directories and git clone again. There is probably a way to do this and only grab the changes but I really haven't looked into that.
The Following User Says Thank You to TomTcom For This Useful Post: [ Click to Expand ]
 
Lethe6
Old
#4  
Senior Member
Thanks Meter 88
Posts: 428
Join Date: Sep 2012
Thanks for this, going to see if I can add some stability in there since mine is barely usable.

You should replace /home/thomas/ with $HOME/ instead, that way it won't error out for people that don't use mkdir -p or aren't using a thomas username
The Following User Says Thank You to Lethe6 For This Useful Post: [ Click to Expand ]
 
TomTcom
Old
(Last edited by TomTcom; 25th March 2013 at 01:53 AM.)
#5  
TomTcom's Avatar
Recognized Contributor - OP
Thanks Meter 458
Posts: 1,049
Join Date: Mar 2011
Default Re: Guide for Compiling a kernel for the Tubuntu app by x3maniac and TF101

Quote:
Originally Posted by Lethe6 View Post
Thanks for this, going to see if I can add some stability in there since mine is barely usable.

You should replace /home/thomas/ with $HOME/ instead, that way it won't error out for people that don't use mkdir -p or aren't using a thomas username
I thought about that but I specified it in the beginning of the post. The purpose was to not make assumptions on what people using Linux did or did not know. For example I didn't realize ~/ represented the home directory till x3 pointed it out to me.

Since the post had such little traction I left it as is to help me out as well.


*****lol, I didn't specify the directories and why they were named that way. Must have been my other guide. I'll fix it up soon.
 
TomTcom
Old
#6  
TomTcom's Avatar
Recognized Contributor - OP
Thanks Meter 458
Posts: 1,049
Join Date: Mar 2011
I added this comment below into the OP to remove confusion on the directories I used.

******My directories reference my own username on my laptop, please substitute "thomas" with your username OR your /home directory, or whichever directories you wish to use. I used full paths on purpose for my own learning and to be specific for newcomers to Linux who wish to learn to compile.******
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes