JetDroid JetKernel / alt kernel newby guide.

Instructions how to set up the devlopment environment and take part in the JetDroid development

Moderator: JetDroid Dev Team

JetDroid JetKernel / alt kernel newby guide.

Postby MadRocker » Fri Jan 07, 2011 9:21 pm

What is this guide about ?

PLEASE NOTE THE CHANGE OF GITHUB FROM DOPI TO JETDROID IN THE LINKS BELOW IF YOU HAVE BEEN HAVING PROBLEMS.
Make sure you have this JetDroid github version or delete your old JetKernel and JetQi folders and download again from git://github.com/JetDroid/JetKernel.git and git://github.com/JetDroid/JetQi.git.

Back to topic:
It is here to help you build your first kernel, the basics of kernel building / module building and get you started on your kernel building / testing expedition.

This is a alternative way to build the kernel, please note Dopi has build.sh or make-kernel.sh files in the kernel that does the same.
First try Dopi's method and if you get stuck then try this method.

Method:
1. Change directory to JetDroid work folder.
Code: Select all
cd ~/JetDroid

2. Clone the kernel using git.
Code: Select all
git clone -n git://github.com/JetDroid/JetKernel.git

3. Make sure you are in the correct folder.
Code: Select all
cd ~/JetDroid

4. Link JetKernel to kernel folder note capitol letters / small letter.
Code: Select all
ln -s JetKernel kernel

5. Change to JetKernel folder.
Code: Select all
cd ~/JetDroid/JetKernel

6. Pull the kernel files from the git repository.
Code: Select all
git checkout -b experimental-2.6.29-KB origin/experimental-2.6.29-KB

7. Make sure you are back in the correct folder.
Code: Select all
cd ~/JetDroid/JetKernel

8. To copy and correctly update the .config or kernel config file.
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- jet_android_defconfig

Replace /home/aaJetDroid in example with ~/ or /home/YourUserName/JetDroid .

9. No need to menuconfig at this time as this will be your first basic build and can menuconfig later
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- zImage

10. This will build your first JetDroid kernel with generic options.
Example when complete = succesfull
Code: Select all
  SHIPPED arch/arm/boot/compressed/lib1funcs.S
  AS      arch/arm/boot/compressed/lib1funcs.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready


Will this kenrel work on your JetDroid = not yet, possibly, maybe as you first need to enable / disable some features in the kernel, like setting the kernel from gzip to lzma default and disabling initrd.

Now you are ready to start with the menuconfig and start adding options to test, start with 1 or max 3 changes from default kernel you build.
Code: Select all
make menuconfig


This will do a normal x86 or x86_64 menuconfig and no s3c64 specific or arm specific options listed.
Code: Select all
make ARCH=arm menuconfig

arm and s3c64 specific options listed.

11. Example of good practice menu config
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- menuconfig

Again replace my /home/aa/JetDroid with ../ or full path name /home/elvis/JetDroid .

12. Next step is to disable inird " initram " and set gzip to lzma if not already set then save and replace .config when asked and again build the kernel with new .config .

This kernel should now work when used on your JetDroid to boot from, will it have wifi or usb not yet,we are working on getting those .config settings to you + many more. If you see errors during build and it ends up this zImage is ready then it was a successful build.

A successful build does NOT mean the kernel will work perfectly on the phone so you will need to test it.
Code: Select all
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready


Newer kernel and kernel config.
Newer kernels might be full of issues if you copy the jet_android_defconfig or .config from JetDroid so you can do 1 of 2 things either copy jet_android_defconfig to the /usr/src/linux-2.6.37-rc5/arch/arm/configs and do above steps in that new kernel local folder /usr/src/linux-2.6.37-rc5 or use the defaults in there s3c6400_defconfig and do same as above. Last time the s3c6400_defconfig worked for linux-2.6.36 .

Errors.
Next clean up if there was a error or you need to do a clean build and not just a update to last kernel build.
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- distclean

distclean similar to make clean should remove old files / garbage and get the kernel folder back to orriginal state, it will not remove your .config file that you just created or the one that did not work the last time so to go back to a good kernel look for the .config.old as this is the previous kernel menuconfig, this is the backup or onother backup you copied to a safe place.

It is always good to copy your last good kernel config + config.old to a safe place outside this working folders if anything goes wrong then you have a backup.

14. To build the modules
14.1Change to kernel folder.
Code: Select all
cd ~/JetDroid/kernel

14.2 Build the module using this below, change /home/aa to your user folder name example: /home/peter #
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- modules

NB: Using this in this way will then build the modules in this working folder if it is the JetKernel folder or in a newer kernel folder example: /usr/src/linux-2.6.37-rc5 and not interfere with your main linux files / folders.

The correct way is to use [b]./build.sh to build both the kernel and modules and edit build.sh to point to your toolchain version you prefer like the 4.4.3 example above.[/b]

Building modules is good if you want to return later to them or if you want to load drivers that is not built into the kernel.
Example:
Code: Select all
CC      sound/soc/s3c24xx/snd-soc-smdk-wm9713.mod.o 
  LD [M]  sound/soc/s3c24xx/snd-soc-smdk-wm9713.ko   
  CC      sound/soc/snd-soc-core.mod.o               
  LD [M]  sound/soc/snd-soc-core.ko


Modules where ?
This modules should then be in the JetKernel/drivers/staging folder, if you can not find then then in this JetKernel/drivers folder do a search for say s3c and look at the results dates, if they changed in the last 10 mins instead of old ones from 2 weeks ago the new ones is the ones you want.
Example search for dhd.ko in JetKernel/drivers/staging folder:
You know the last output on the modules build showed something like this
Code: Select all
CC      drivers/staging/wlan-bcm/dhd.mod.o
  LD [M]  drivers/staging/wlan-bcm/dhd.ko

So the files would then be in JetKernel/drivers/staging/wlan-bcm/dhd.ko with last build time and date example Fri 07Jan2011 08:10:10 .

Always backup old files:
It is always good to do a
Code: Select all
make ARCH=arm CROSS_COMPILE=/home/aa/JetDroid/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- distclean
before each new build after you backed up the last new files that you might need.

NB: /home/aa on example above should be replaced with your /home/??????

Hope this help to get you started.
MadRocker
Dev Team
Dev Team
 
Posts: 528
Joined: Sun Dec 12, 2010 7:15 am

Advertisement

Re: JetDroid JetKernel / alt kernel newby guide.

Postby Dopi » Fri Jan 07, 2011 10:37 pm

Hi MadRocker,

thanks for your great guide. I think this will help many people to get started with the kernel.

Cheers,
Dopi

P.S.: I moved this post to the "Development Howto" section. Please use this thread for discussion on this topic.
Ad banners support the JetDroid forum. Please consider clicking them once in a while.
User avatar
Dopi
Dev Team
Dev Team
 
Posts: 926
Joined: Sun Aug 22, 2010 9:47 pm


Return to Development Howto

Who is online

Users browsing this forum: No registered users and 1 guest

  • Advertisement
cron