Showing posts with label kernel. Show all posts
Showing posts with label kernel. Show all posts

Tuesday, September 11, 2012

HowTo - Compile Linux kernel 3.5 under Ubuntu 12.04


1. Dependencies


$ sudo apt-get install gcc libncurses5-dev git-core kernel-package fakeroot build-essential

$ sudo apt-get update && sudo apt-get upgrade


2. Download kernel source


$ wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.5.tar.bz2

$ tar -xvf linux-3.5.tar.bz2

$ cd linux-3.5/


3. Compile


If you want to use your current kernel configuration:

$ cp /boot/config-`uname -r` ./.config

$ make menuconfig

Compile the kernel and modules to be .deb packages so that we can easily install/uninstall them.

$ make-kpkg clean

$ fakeroot make-kpkg --initrd --append-to-version=-spica kernel_image kernel_headers


4. Install


Now you have two .deb packages generated, one is to install the kernel headers, another one is to install the kernel image. 

$ sudo dpkg -i linux-*.deb


5. Reboot


During reboot, choose the new kernel in your grub menu. Once you finish rebooting, check your new kernel information by typing in:

$ uname -r

Monday, April 9, 2012

HowTo - Building Android kernel modules (bcm4329.ko)


This document tells us how to build individual modules instead of compiling the whole kernel. 

bcm4329.ko is the wireless driver module for Google Nexus One. It is located in the kernel files. 

Under kernel directory:

1. Include the arm-eabi- tool directory into the path.

$ export PATH=$PATH:~/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/

2. Generate the configuration file.

2.1 Use herring_defconfig as the default configuration file.

$ make ARCH=arm herring_defconfig

2.2 Modify the configuration file.

vi .config

Make changes as follows:

CONFIG_CROSS_COMPILE = "arm-eabi-"
CONFIG_LOCAL_VERSION = "-cyanogenmod"
#CONFIG_LOCALVERSION_AUTO
set all CONFIG_BCM* to m

3. Change another file (and I don't know why)

$ vi scripts/setlocalversion
Locate the following line

if $short; then
echo "+"

and change echo "+" to echo ""

5. Set building architecture to be arm.

$ export ARCH=arm

6. Make.

$ make modules

7. Push the new module into the phone.

7.1 Remount to be writable.
  
$ adb remount

7.2 Push.

adb push drivers/net/wireless/bcm4329/bcm4320.ko /system/modules



Ref: http://stevechui.blogspot.com/2011/10/compiling-kernel-modules-tunko-for.html

Thursday, March 29, 2012

HowTo - Building Android Kernel


Again I personally recommend CyanogenMod version.

Partly referred to : http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source

Notice: Kernel Source Code is : https://github.com/CyanogenMod/samsung-kernel-crespo

configure file: herring_defconfig

Unpack original image, pack new image: http://forums.androidcentral.com/t-mobile-nexus-s-rooting-roms-hacks/48675-how-compile-nexus-s-kernel-source.html

Notice: Don't use the image pulled from the device, use the one in the installation zip file.

Copy 
~/android/kernel/samsung-kernel-crespo/drivers/net/wireless/bcm4329/bcm4329.ko 
into /system/modules/