SlateDroid.com: (How to) Build a kernel from NI source - SlateDroid.com

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

(How to) Build a kernel from NI source

#1 User is offline   blazingwolf 

  • Advanced Member
  • Group: Global Moderators
  • Topics: 60
  • Posts: 1,392
  • Joined: 05-July 10

Posted 25 June 2011 - 01:36 PM

Creating a basic kernel for the Adam (this tutorial is designed to be used with Ubuntu 11.04):

This is one way that a new kernel can be created. It might not be the best way but it is how I am learning to make them.

Set up your files and folders so that you can use them. I put my kernel files in android/kernel/Adam. This makes it easy to locate and work with them.
If you use terminal to set this up then you can do:

mkdir android/kernel/adam


You can also use the file explorer if you like though it is good to become familiar with the terminal as it will be used a lot.

Now we change directory (CD) in to the newly created directory:

CD android/kernel/adam


Now you need to download the kernel source. You can get the stock Adam kernel source from git://github.com/notionink/adam-kernel.git (92MB).
The terminal command for this is:

git clone git://github.com/notionink/adam-kernel.git


You will also need a cross compiler. You can use the base cross compiler from git://android.git.kernel.org/platform/prebuilt.git (1.10GB).

git clone git://android.git.kernel.org/platform/prebuilt.git


This will take awhile as it is a large file. It will depend on your download speed.

You will need to get the default config file from your Adam. To do this we use adb:

adb pull /proc/config.gz


Now unzip the file:

gunzip config.gz


Or do an extract from the file explorer.

Now rename the file to .config

mv config .config


Now you can try to "make" the kernel by doing the following:

make -C ~/android/kernel/adam/adam-kernel/ ARCH=arm CROSS_COMPILE=~/android/kernel/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage


In the terminal box you should see everything start to compile.

If you get the following error:

mkdir: cannot create directory `include/asm-arm/': File exists
make[1]: *** [include/asm-arm/mach-types.h] Error 1

This error occurs because the file has been zipped which creates real directories out of symlinks.

Then use this to get rid of it (thanks RaYmAn):

rm -rf include/asm-arm


Assuming everything worked correctly you should see this near the end of the text:

Kernel: arch/arm/boot/zImage is ready

You can now go to that folder to pick up the new zImage.

This next part is not necessarily needed to make a kerenl but it will make it easier to flash the new kernel to your Adam.

Now we need to repack the boot.img with the new kernel. To do this move the zImage to the same folder that has the boot.img in it. We will need to pull the boot.img apart. Make sure that you have the unpack-bootimg.pl as well as the mkbootimg file in the same folder. To unpack the boot.img use this command:

perl unpack-bootimg.pl boot.img


You should now have several files in your folder. If you want to make any changes to the init RC now is the time to do it. You will need to cd in to the boot.img-ramdisk folder before doing this. The command to rebuild the ramdisk is:

find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz


Now cd back to the main folder (the one with your all of your boot.img files) and build the boot.img. Use the following command:

./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o boot.img


If you make no changes to the ramdisk then you can do the following:

./mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.cpio.gz -o boot.img



You know have a new boot.img file that contains your new kernel. This can now be flashed to your Adam as you would normally flash an update file.

I have not gone in to adding new items to the kernel yet but I will update this tutorial as time permits. :)
0

#2 User is online   sharpe351 

  • Advanced Member
  • PipPipPip
  • Group: Jr. Member
  • Topics: 8
  • Posts: 363
  • Joined: 20-July 11
  • LocationApopka, FL

Posted 07 September 2011 - 09:57 PM

Would this or something close be used to compile a Viewsonic Kernal also?

sent from my Century Eyes Gtablet using Tapatalk
Devices: Asus Transformer running ICS no-bloat deodexed and zipaligned, Motorola Triumph on ICS/CM9 ROM, Pandigital Novel White.

Official released ROMs:PRIME Redux v1.0

If you can't get ahold of me here, check HERE...

Custom UOT file built for Brilliant Corners (BC Comb) Confirmed working on FrankenTab Alpha--HERE

Custom UOT file built for Clemsyn's Beast ROM (BeastyComb)--HERE

Member of Team Flashback

Seeking team members for Asus ICS modification... PM me for details
0

#3 User is offline   blazingwolf 

  • Advanced Member
  • Group: Global Moderators
  • Topics: 60
  • Posts: 1,392
  • Joined: 05-July 10

Posted 07 October 2011 - 05:39 PM

Not sure it would work to be honest. You could try but it might brick your device.
0

#4 User is online   sharpe351 

  • Advanced Member
  • PipPipPip
  • Group: Jr. Member
  • Topics: 8
  • Posts: 363
  • Joined: 20-July 11
  • LocationApopka, FL

Posted 08 October 2011 - 07:46 PM

View Postblazingwolf, on 07 October 2011 - 05:39 PM, said:

Not sure it would work to be honest. You could try but it might brick your device.

Thanks for the response. I think I could try it, if I dared, but I've gotten pretty good at recovering my tablet. I've semi-bricked it a few times trying things with building ROMs.

sent from my Calkulin+Clemsyn 7 Gtablet with Clemsyn Kernal using Tapatalk
Devices: Asus Transformer running ICS no-bloat deodexed and zipaligned, Motorola Triumph on ICS/CM9 ROM, Pandigital Novel White.

Official released ROMs:PRIME Redux v1.0

If you can't get ahold of me here, check HERE...

Custom UOT file built for Brilliant Corners (BC Comb) Confirmed working on FrankenTab Alpha--HERE

Custom UOT file built for Clemsyn's Beast ROM (BeastyComb)--HERE

Member of Team Flashback

Seeking team members for Asus ICS modification... PM me for details
0

#5 User is offline   rmaganti 

  • Newbie
  • Pip
  • Group: Jr. Member
  • Topics: 0
  • Posts: 1
  • Joined: 29-November 11

Posted 29 November 2011 - 03:38 PM

From where do I get the boot.img?
0

#6 User is offline   blazingwolf 

  • Advanced Member
  • Group: Global Moderators
  • Topics: 60
  • Posts: 1,392
  • Joined: 05-July 10

Posted 01 December 2011 - 11:37 PM

View Postrmaganti, on 29 November 2011 - 03:38 PM, said:

From where do I get the boot.img?


The stock one? From your device or from one of the NVFlash files that are available for the Adam. :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users