[GUIDE] Compiling and Installing Custom Kernel (based on pershoot's Kernel from git)

Search This thread

blackSwanBB

Member
Dec 15, 2010
15
19
This is a intermediate guide for anyone who wants to manually compile their own kernel for the GTablet. If you merely want to use a prebuilt kernel then this is not for you. Personally, I am no expert on kernel development or bash scripting (which I will reference) but I get a kick out of analyzing and modifying bits and pieces here and there. I will not be covering retrieving all dependencies. This guide was written to work with pershoot's kernel repository. Every step has been tested using a fresh installation of Ubuntu 10.10 x64.

Step 1 - Obtaining tools and kernel source:
Install git-core.
[optional] Install ncurses-dev (if you want to use menuconfig to modify the kernel selections).
[optional] Install lib32stdc++ (if your development machine is running a x64 variant of linux). This is a necessary step to use the prebuilt android toolchain as it is compiled for a 32 bit machine.
Code:
sudo apt-get install git-core libncurses-dev lib32stdc++6

[optional] The next git clone steps will copy the repositories to the current directory, all following example will assume that you are cloning to "/usr/src/tegratab".
Code:
mkdir /usr/src/tegratab
Note: You need to be a member of the "src" group to modify the contents of "/usr/src" without sudoing. After adding yourself to the "src" group you need to restart for the permissions to take effect.
Code:
usermod -a -G src `whoami`
sudo reboot

Retrieve the prebuilt android toolchain.
Code:
git clone git://android.git.kernel.org/platform/prebuilt.git

Clone pershoot's "Gtablet Kernel 2.6.32" source repository.
Code:
git clone https://github.com/pershoot/gtab-2632.git

Note: We'll continue with the assumption of the following directory structure. Subsequent code snipets will use absolute paths so if your installation differs, just update the commands to adjust.
Code:
/usr/src/tegratab
/usr/src/tegratab/gtab-2632
/usr/src/tegratab/prebuilt

Step 2 - Kernel Configuration:
During the kernel compilation, the make utility utilizes the ".config" file in the kernel source's root directory to determine how the kernel should be compiled.
So before we begin the actual kernel compilation we need to perform the configuration.

To use pershoot's kernel configuration do the following:
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm pershoot_tegra_harmony_android_defconfig
Note: When specifying the defconfig file, the make utility searches the arch/$ARCH/configs directory.

This will simply copy pershoot's defconfig file to the .config file (and update the timestamp). We could have bypassed the make utility and done this manually as follows:
Code:
cp /usr/src/tegratab/gtab-2632/arch/arm/configs/pershoot_tegra_harmony_android_defconfig /usr/src/tegratab/gtab-2632/.config

To manually modify the kernel configuration you have several options:
1. Generate the ".config" file (described above) and manually edit it.
Code:
vi /usr/src/tegratab/gtab-2632/.config

2. Create your own defconfig file and manually edit it.
Code:
cp /usr/src/tegratab/gtab-2632/arch/arm/configs/pershoot_tegra_harmony_android_defconfig /usr/src/tegratab/gtab-2632/arch/arm/configs/custom_tegra_harmony_android_defconfig
vi /usr/src/tegratab/gtab-2632/arch/arm/configs/custom_tegra_harmony_android_defconfig

Then use the make utility to generate (i.e. copy to the ".config") based on the new defconfig file.
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm custom_tegra_harmony_android_defconfig

3. Use the menuconfig tool which comes with the linux source. This is the recommended solution to manually configuring the kernel. The menuconfig's initial kernel configuration selections are based on the ".config" file, so it should be generated first. After configuring the kernel as you please, you will have option when exiting the menuconfig tool to save your selections to the ".config" file.
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm menuconfig
The optimal solution would be to define the initial kernel configuration selection and menuconfig simulaneously, the previous listings are mostly for educational purposes.
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm pershoot_tegra_harmony_android_defconfig menuconfig

Step 3 - Kernel Compilation:

Now that the kernel has been configured it can finally compiled.

Make the kernel image itself (the resulting kernel image will be located at /usr/src/tegratab/gtab-2632/arch/arm/boot/zImage):
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm CROSS_COMPILE=/usr/src/tegratab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage

To make the kernel modules (typically used to add support for new hardware and/or filesystems, or for adding system calls):
Code:
make -C /usr/src/tegratab/gtab-2632/ ARCH=arm CROSS_COMPILE=/usr/src/tegratab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules


Step 4 - Packaging the Kernel for Deployment to the GTablet:

Now it's time to create the package file that will be used to install the new kernel.
This is where it used to get a bit tricky but luckily some great work from Pershoot and Koush has made it much easier.

Alternate Methods / References:
[FAQ] Flashing UPDATE.ZIP the old fashioned way (How and Did It Work?) http://forum.xda-developers.com/showthread.php?t=892090
HOWTO: Unpack, Edit, and Re-Pack Boot Images) http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Building Android kernel images) http://www.cianer.com/androidg1/28-building-android-kernel-images

Ignore those, we'll do it the easy way:

Save a copy of pershoot's boot- zip from http://droidbasement.com/ to use as a template:
Code:
wget http://droidbasement.com/gtab/kernels/2632/1/boot-cm_2632.27-xtra-vfpv3_fp-010711.zip -O /usr/src/tegratab/boot-template.zip

Make a temporary directory so we can perform the staging:
Code:
mkdir /usr/src/tegratab/staging

Unzip the boot template here:
Code:
unzip -d /usr/src/tegratab/staging /usr/src/tegratab/boot-template.zip

Copy the kernel image which was built to this staging directory:
Code:
cp -v /usr/src/tegratab/gtab-2632/arch/arm/boot/zImage /usr/src/tegratab/staging/kernel/zImage

Install the kernel modules which were built:
Code:
 make -C /usr/src/tegratab/gtab-2632/ ARCH=arm INSTALL_MOD_PATH=/usr/src/tegratab/staging/system modules_install

Replace the original bcm4329 kernel module which was extracted from the boot-template with the newly compiled kernel module:
Code:
 cp -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/kernel/drivers/net/wireless/bcm4329/dhd.ko /usr/src/tegratab/staging/system/lib/hw/wlan/bcm4329.ko

Remove the two symlink directories in our staging directory, these were created during the kernel module installation:
Code:
rm -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/source
rm -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/build

Zip the result:
Code:
cd /usr/src/tegratab/staging
zip -r /usr/src/tegratab/boot-custom-kernel *

[optional]Cleanup the staging directory:
Code:
cd /usr/src/tegratab
rm -R /usr/src/tegratab/staging


Step 5 - Package Installation

Boot into Clockwork Recovery.
Navigate to "mounts and storage".
Select "mount USB storage".


Copy /usr/src/tegratab/boot-custom-kernel.zip to the mounted filesystem.
Select "Unmount USB storage".


Navigate to "install zip from sdcard" => "choose zip from sdcard" => "boot-custom-kernel.zip".
Select "Yes - Install boot-custom-kernel.zip".


Select "reboot system now".
It's now installed!


Once reboot is complete navigate to the "Settings" => "About device".
Check "Kernel version", it should specify the some details about your new build.

2.6.32.28-cyanogenmod
[email protected] #1​


References:

Android Development: http://source.android.com/source/download.html

Here's a brief description of the command line options which were used:
Code:
-C dir, --directory=dir
    Change to directory dir before reading the makefiles or doing anything else.  If multiple -C options are specified, each is interpreted relative to the previous one: -C  /
    -C etc is equivalent to -C /etc.  This is typically used with recursive invocations of make.

ARCH=<architecture>

# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.


CROSS_COMPILE=<toolchain>

# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH            ?= $(SUBARCH)
CROSS_COMPILE   ?=
#ARCH           ?= arm
#CROSS_COMPILE  ?=$(CURDIR)/../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

	
INSTALL_MOD_PATH=<module-target-path>

# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
# relocations required by build roots.  This is not defined in the
# makefile but the argument can be passed to make if needed.

Scripts:
Kernel Configuration Script:
Code:
[size=3]AR[color=#000000]=[/color]arm

[color=#000080][b]if[/b][/color] [color=#000000][ -[/color]n [color=#ddbb00]"$1"[/color] [color=#000000]] && [ -[/color]n [color=#ddbb00]"$2"[/color] [color=#000000]][/color]
[color=#000080][b]then[/b][/color]
   [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$1[/color] ARCH[color=#000000]=[/color][color=#000000]$AR $2[/color] menuconfig
[color=#000080][b]else[/b][/color]
   [color=#000080]echo[/color] [color=#ddbb00]"Usage: $0 [source-dir] [defconfig]"[/color]
[color=#000080][b]fi[/b][/color]
[/size]

Kernel Compilation / Packing Script:
Code:
[size=3][color=#ff0000][i]#!/bin/sh[/i][/color]
CC[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color]prebuilt[color=#000000]/[/color]linux[color=#000000]-[/color]x86[color=#000000]/[/color]toolchain[color=#000000]/[/color]arm[color=#000000]-[/color]eabi[color=#000000]-[/color][color=#008800]4.4.0[/color][color=#000000]/[/color]bin[color=#000000]/[/color]arm[color=#000000]-[/color]eabi[color=#000000]-[/color]
AR[color=#000000]=[/color]arm

PREFIX[color=#000000]=[/color][color=#ddbb00]`echo $1 | sed -e 's/[/]*$//' -e 's/[/]/_/'`[/color]
POSTFIX[color=#000000]=[/color][color=#ddbb00]`date +%Y_%m_%e_%H%M%S`[/color]

KSOURCE_DIR[color=#000000]=[/color][color=#000000]$1[/color]
TARGET_NAME[color=#000000]=[/color][color=#000000]$PREFIX[/color][color=#000000]-[/color][color=#000000]$POSTFIX[/color]
SAMPLE_ZIP[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color]boot[color=#000000]-[/color]template.[color=#0000ff]zip[/color]

OUTPUT_ZIP[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color][color=#000000]$TARGET_NAME[/color]
STAGING_DIR[color=#000000]=/[/color]tmp[color=#000000]/[/color][color=#000000]$TARGET_NAME[/color]

do_compile[color=#000000]()[/color]
[color=#000000]{[/color]
   [color=#000080]echo[/color] [color=#ddbb00]"do_compile()"[/color]

   [color=#ff0000][i]# Build the kernel image.[/i][/color]
   [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] CROSS_COMPILE[color=#000000]=[/color][color=#000000]$CC[/color] zImage
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#ff0000][i]# Build the kernel modules.[/i][/color]
   [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] CROSS_COMPILE[color=#000000]=[/color][color=#000000]$CC[/color] modules
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

[color=#000000]}[/color]

do_staging[color=#000000]()[/color]
[color=#000000]{[/color]
   [color=#000080]echo[/color] [color=#ddbb00]"do_staging()"[/color]

   [color=#ff0000][i]# Unzip the sample update zip to create update structure[/i][/color]
   [color=#ff0000][i]# and provide update scripts / utilities.[/i][/color]
   [color=#0000ff]unzip[/color] [color=#000000]-[/color]d [color=#000000]$STAGING_DIR $SAMPLE_ZIP[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
[color=#000000]}[/color]

do_populate[color=#000000]()[/color]
[color=#000000]{[/color]   
   [color=#000080]echo[/color] [color=#ddbb00]"do_populate()"[/color]

   [color=#ff0000][i]# Copy the resulting image to the staging dir.[/i][/color]
   [color=#0000ff]cp[/color] [color=#000000]-[/color]v [color=#000000]$KSOURCE_DIR[/color][color=#000000]/[/color]arch[color=#000000]/[/color][color=#000000]$AR[/color][color=#000000]/[/color]boot[color=#000000]/[/color]zImage [color=#000000]$STAGING_DIR[/color][color=#000000]/[/color]kernel[color=#000000]/[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#ff0000][i]# Install the built modules to the staging dir.[/i][/color]
   [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] INSTALL_MOD_PATH[color=#000000]=[/color][color=#000000]$STAGING_DIR[/color][color=#000000]/[/color]system modules_install
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#ff0000][i]# Remove symlinks.[/i][/color]
   [color=#0000ff]rm[/color] [color=#000000]-[/color]v  [color=#ddbb00]`find $STAGING_DIR -type l`[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#ff0000][i]# Zip up the results. [/i][/color]
   [color=#000080]cd[/color] [color=#000000]$STAGING_DIR[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#0000ff]zip[/color] [color=#000000]-[/color]r [color=#000000]$OUTPUT_ZIP[/color] [color=#000000]*[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]

   [color=#000080]cd[/color] [color=#000000]-[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
[color=#000000]}[/color]

do_cleanup[color=#000000]()[/color]
[color=#000000]{[/color]
   [color=#000080]echo[/color] [color=#ddbb00]"do_cleanup()"[/color]

   [color=#0000ff]rm[/color] [color=#000000]-[/color]v [color=#000000]-[/color]r [color=#000000]$STAGING_DIR[/color]
   [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
[color=#000000]}[/color]

[color=#000080][b]if[/b][/color] [color=#000000][ -[/color]z [color=#000000]$1[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]echo[/color] [color=#ddbb00]"Usage: $0 [source-dir]"[/color][color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
do_compile[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color] 
do_staging[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] do_cleanup[color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
do_populate[color=#000000];[/color] [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] do_cleanup[color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
do_cleanup[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
[color=#000080]exit[/color] [color=#008800]0[/color]
[/size]
 
Last edited:

browner

Member
Jan 14, 2011
6
0
Great instructions but I think you are missing one thing. In staging/system/lib/hw/wlan/bcm4329.ko it is the original .ko from the boot-template.zip file.
I think you need to move and rename kernel/drivers/net/wireless/bcm4329/dhd.ko and use it to overwrite bcm4329.ko. I haven't tried it yet but that's my theory.
 
Jan 20, 2011
11
0
If this is intermediate tutorial is there something more basic? I'm interested in learning more, but not sure where to start.
 

blackSwanBB

Member
Dec 15, 2010
15
19
If this is intermediate tutorial is there something more basic? I'm interested in learning more, but not sure where to start.

Is there a certain step that alludes you, or where you taking aback due to the guide being labeled as an "intermediate tutorial"?

How well do you understand computers and linux?
Do you know anything about computer programming?
What sort of things do you want to learn more about?
 

blackSwanBB

Member
Dec 15, 2010
15
19
Great instructions but I think you are missing one thing. In staging/system/lib/hw/wlan/bcm4329.ko it is the original .ko from the boot-template.zip file.
I think you need to move and rename kernel/drivers/net/wireless/bcm4329/dhd.ko and use it to overwrite bcm4329.ko. I haven't tried it yet but that's my theory.


I agree that to utilize the bcm4329 module which was compiled during the "make modules" step that you would need to replace the bcm4329.ko from the boot-template.

I haven't done much analysis of this yet, but my assumption is that the rom knows to explicitly load that module. A quick vbindiff shows that the bcm4329.ko (from the latest pershoot release) and the dhd.ko (built from pershoot's git repository) are not identical.

As such, I did not include a step to explicitly remove the bcm4329 kernel module from the boot-template.

I do however, recommend that you pull the latest pershoot release and update the boot-template.zip or wget the latest copy of pershoot's release and use it as the boot-template.zip (I didn't want to have to update the tutorial with each pershoot release to reference the latest package, so I referenced his first release).

I'll research this a bit more this weekend so I have a better understanding. If you want to test out the dhd.ko you should be able to use adb to rmmod bcm4329 and insmod the dhd.ko.

See this thread: http://forum.xda-developers.com/showthread.php?t=906628
 

browner

Member
Jan 14, 2011
6
0
I overwrote the bcm4329.ko with dhd.ko and things are working for me. I found this because I was using pershoot's .27 update.zip as a boot-template but building pershoot's .28 kernel. Wifi did not work in this case until I replaced the bcm4329.ko
 

blackSwanBB

Member
Dec 15, 2010
15
19
I overwrote the bcm4329.ko with dhd.ko and things are working for me. I found this because I was using pershoot's .27 update.zip as a boot-template but building pershoot's .28 kernel. Wifi did not work in this case until I replaced the bcm4329.ko

Thanks for the update. I update the guide with the step.
 

jmdearras

Senior Member
Aug 20, 2008
453
19
RIchmond, Virginia
[optional] The next git clone steps will copy the repositories to the current directory, all following example will assume that you are cloning to "/usr/src/tegratab".
Code:
mkdir /usr/src/tegratab
Note: You need to be a member of the "src" group to modify the contents of "/usr/src" without sudoing. After adding yourself to the "src" group you need to restart for the permissions to take effect.
Code:
usermod -a -G src `whoami`
sudo reboot

These steps are reversed, you can't create the dir in /src until you are a member of src.

Also a reminder to then cd to that dir would be good.

I'm starting with a fresh ubuntu 10.10 install.

Thanks!

Jim
 

blackSwanBB

Member
Dec 15, 2010
15
19
[optional] The next git clone steps will copy the repositories to the current directory, all following example will assume that you are cloning to "/usr/src/tegratab".
Code:
mkdir /usr/src/tegratab
Note: You need to be a member of the "src" group to modify the contents of "/usr/src" without sudoing. After adding yourself to the "src" group you need to restart for the permissions to take effect.
Code:
usermod -a -G src `whoami`
sudo reboot

These steps are reversed, you can't create the dir in /src until you are a member of src.

Also a reminder to then cd to that dir would be good.

I'm starting with a fresh ubuntu 10.10 install.

Thanks!

Jim
Thanks for the feedback, I'll update the guide when I get on a proper computer. Let me know if you run into any other inconsistencies or issues.
 

dony71

Senior Member
Dec 1, 2010
282
14
blackswanBB,
I'm new in this android compile
I want to compile rfcomm and dun daemon utility
I have pulled aosp from
repo init -u git://github.com/aosp-gtablet/gtablet-aosp.git
and find source in /external/bluetooth/bluez/rfcomm
Can you assist me what's full command to compile this for gtablet?
 

sargorn

Retired Recognized Developer
Aug 26, 2010
282
136
Osaka-shi
Hi,

I have a zpad and not a gtab. gtab kernels generally work but often limit my 1024mb of ram down to 512 (which the gtab has).

Is available ram changeable in the kernel config? I'm assuming there or when you nvflash.



Sent from my GT-I9000 using XDA Premium App
 

pershoot

Inactive Recognized Developer
Dec 1, 2008
7,985
4,358
Hi,

I have a zpad and not a gtab. gtab kernels generally work but often limit my 1024mb of ram down to 512 (which the gtab has).

Is available ram changeable in the kernel config? I'm assuming there or when you nvflash.



Sent from my GT-I9000 using XDA Premium App

HIGHMEM is enabled.

it should detect all of the available ram in your ZPAD T2.

please flash the latest kernel, -040511 (http://droidbasement.com/db-blog/?p=1728), and type:
adb shell free

please paste output here.

note:
if you are on the new bootloader for your zpad T2, your downloads will be labelled:
zpad_newbl ([New Bootloader])

thx.
 

sargorn

Retired Recognized Developer
Aug 26, 2010
282
136
Osaka-shi
HIGHMEM is enabled.

it should detect all of the available ram in your ZPAD T2.

please flash the latest kernel, -040511 (http://droidbasement.com/db-blog/?p=1728), and type:
adb shell free

please paste output here.

note:
if you are on the new bootloader for your zpad T2, your downloads will be labelled:
zpad_newbl ([New Bootloader])

thx.

Hi,

It's odd actually. The only rom(s) that will give me the full 1gb of ram are stock zpad, bigideas (obviously) and VEGAn 5.1. This is with or without your kernel.

All the other roms I've tried limit the ram down to 512mb. (All the CM7 variants, Zpad clean, stock gtab).

VEGAn 5.1
Code:
              total         used         free       shared      buffers
  Mem:       966656       205964       760692            0         3896
 Swap:            0            0            0
Total:       966656       205964       760692

Zpad Clean w/ latest pershoot kernel.
Code:
              total         used         free       shared      buffers
  Mem:       446868       178456       268412            0         8072
 Swap:            0            0            0
Total:       446868       178456       268412
 

pershoot

Inactive Recognized Developer
Dec 1, 2008
7,985
4,358
Hi,

It's odd actually. The only rom(s) that will give me the full 1gb of ram are stock zpad, bigideas (obviously) and VEGAn 5.1. This is with or without your kernel.

All the other roms I've tried limit the ram down to 512mb. (All the CM7 variants, Zpad clean, stock gtab).

VEGAn 5.1
Code:
              total         used         free       shared      buffers
  Mem:       966656       205964       760692            0         3896
 Swap:            0            0            0
Total:       966656       205964       760692

Zpad Clean w/ latest pershoot kernel.
Code:
              total         used         free       shared      buffers
  Mem:       446868       178456       268412            0         8072
 Swap:            0            0            0
Total:       446868       178456       268412

that is because of the CMD line used when packing the rom/boot.

if you build from src, you can just update your cmd line in BoardConfig.mk, rebuild, and you'll be good.
 
  • Like
Reactions: sargorn

enigma0456

Senior Member
Feb 11, 2011
154
10
Wetware Kernel Panic

Being a curious kind of guy, I printed out the instructions and worked my way through them. Had a couple of permissions issues and discovered the files downloaded to my home directory so I had to move them. I worked my way up to the gui kernel configurator and had a wetware kernel panic. Lots of options, checkboxes, etc. but I realized that although the instructions were good, I was not equipped to do anything with the tool presented to me. So.... reading some of the posts here, there are obviously others to who this is familiar ground. While I know some knowledge is acquired over years, I also suspect that there are other guides that would help the less informed reach a point where this tutorial could be useful. So - this is an intermediate guide. Where could a padawan find the beginners guide to help make this one more comprehensible? I'm willing to study but I'm not sure where or what. Using the gtab as a model, I'd like to learn how to manipulate all the various components or at least understand how they are manipulated. Anyone want to throw me a line?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    This is a intermediate guide for anyone who wants to manually compile their own kernel for the GTablet. If you merely want to use a prebuilt kernel then this is not for you. Personally, I am no expert on kernel development or bash scripting (which I will reference) but I get a kick out of analyzing and modifying bits and pieces here and there. I will not be covering retrieving all dependencies. This guide was written to work with pershoot's kernel repository. Every step has been tested using a fresh installation of Ubuntu 10.10 x64.

    Step 1 - Obtaining tools and kernel source:
    Install git-core.
    [optional] Install ncurses-dev (if you want to use menuconfig to modify the kernel selections).
    [optional] Install lib32stdc++ (if your development machine is running a x64 variant of linux). This is a necessary step to use the prebuilt android toolchain as it is compiled for a 32 bit machine.
    Code:
    sudo apt-get install git-core libncurses-dev lib32stdc++6

    [optional] The next git clone steps will copy the repositories to the current directory, all following example will assume that you are cloning to "/usr/src/tegratab".
    Code:
    mkdir /usr/src/tegratab
    Note: You need to be a member of the "src" group to modify the contents of "/usr/src" without sudoing. After adding yourself to the "src" group you need to restart for the permissions to take effect.
    Code:
    usermod -a -G src `whoami`
    sudo reboot

    Retrieve the prebuilt android toolchain.
    Code:
    git clone git://android.git.kernel.org/platform/prebuilt.git

    Clone pershoot's "Gtablet Kernel 2.6.32" source repository.
    Code:
    git clone https://github.com/pershoot/gtab-2632.git

    Note: We'll continue with the assumption of the following directory structure. Subsequent code snipets will use absolute paths so if your installation differs, just update the commands to adjust.
    Code:
    /usr/src/tegratab
    /usr/src/tegratab/gtab-2632
    /usr/src/tegratab/prebuilt

    Step 2 - Kernel Configuration:
    During the kernel compilation, the make utility utilizes the ".config" file in the kernel source's root directory to determine how the kernel should be compiled.
    So before we begin the actual kernel compilation we need to perform the configuration.

    To use pershoot's kernel configuration do the following:
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm pershoot_tegra_harmony_android_defconfig
    Note: When specifying the defconfig file, the make utility searches the arch/$ARCH/configs directory.

    This will simply copy pershoot's defconfig file to the .config file (and update the timestamp). We could have bypassed the make utility and done this manually as follows:
    Code:
    cp /usr/src/tegratab/gtab-2632/arch/arm/configs/pershoot_tegra_harmony_android_defconfig /usr/src/tegratab/gtab-2632/.config

    To manually modify the kernel configuration you have several options:
    1. Generate the ".config" file (described above) and manually edit it.
    Code:
    vi /usr/src/tegratab/gtab-2632/.config

    2. Create your own defconfig file and manually edit it.
    Code:
    cp /usr/src/tegratab/gtab-2632/arch/arm/configs/pershoot_tegra_harmony_android_defconfig /usr/src/tegratab/gtab-2632/arch/arm/configs/custom_tegra_harmony_android_defconfig
    vi /usr/src/tegratab/gtab-2632/arch/arm/configs/custom_tegra_harmony_android_defconfig

    Then use the make utility to generate (i.e. copy to the ".config") based on the new defconfig file.
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm custom_tegra_harmony_android_defconfig

    3. Use the menuconfig tool which comes with the linux source. This is the recommended solution to manually configuring the kernel. The menuconfig's initial kernel configuration selections are based on the ".config" file, so it should be generated first. After configuring the kernel as you please, you will have option when exiting the menuconfig tool to save your selections to the ".config" file.
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm menuconfig
    The optimal solution would be to define the initial kernel configuration selection and menuconfig simulaneously, the previous listings are mostly for educational purposes.
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm pershoot_tegra_harmony_android_defconfig menuconfig

    Step 3 - Kernel Compilation:

    Now that the kernel has been configured it can finally compiled.

    Make the kernel image itself (the resulting kernel image will be located at /usr/src/tegratab/gtab-2632/arch/arm/boot/zImage):
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm CROSS_COMPILE=/usr/src/tegratab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage

    To make the kernel modules (typically used to add support for new hardware and/or filesystems, or for adding system calls):
    Code:
    make -C /usr/src/tegratab/gtab-2632/ ARCH=arm CROSS_COMPILE=/usr/src/tegratab/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules


    Step 4 - Packaging the Kernel for Deployment to the GTablet:

    Now it's time to create the package file that will be used to install the new kernel.
    This is where it used to get a bit tricky but luckily some great work from Pershoot and Koush has made it much easier.

    Alternate Methods / References:
    [FAQ] Flashing UPDATE.ZIP the old fashioned way (How and Did It Work?) http://forum.xda-developers.com/showthread.php?t=892090
    HOWTO: Unpack, Edit, and Re-Pack Boot Images) http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
    Building Android kernel images) http://www.cianer.com/androidg1/28-building-android-kernel-images

    Ignore those, we'll do it the easy way:

    Save a copy of pershoot's boot- zip from http://droidbasement.com/ to use as a template:
    Code:
    wget http://droidbasement.com/gtab/kernels/2632/1/boot-cm_2632.27-xtra-vfpv3_fp-010711.zip -O /usr/src/tegratab/boot-template.zip

    Make a temporary directory so we can perform the staging:
    Code:
    mkdir /usr/src/tegratab/staging

    Unzip the boot template here:
    Code:
    unzip -d /usr/src/tegratab/staging /usr/src/tegratab/boot-template.zip

    Copy the kernel image which was built to this staging directory:
    Code:
    cp -v /usr/src/tegratab/gtab-2632/arch/arm/boot/zImage /usr/src/tegratab/staging/kernel/zImage

    Install the kernel modules which were built:
    Code:
     make -C /usr/src/tegratab/gtab-2632/ ARCH=arm INSTALL_MOD_PATH=/usr/src/tegratab/staging/system modules_install

    Replace the original bcm4329 kernel module which was extracted from the boot-template with the newly compiled kernel module:
    Code:
     cp -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/kernel/drivers/net/wireless/bcm4329/dhd.ko /usr/src/tegratab/staging/system/lib/hw/wlan/bcm4329.ko

    Remove the two symlink directories in our staging directory, these were created during the kernel module installation:
    Code:
    rm -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/source
    rm -v /usr/src/tegratab/staging/system/lib/modules/2.6.32.28-cyanogenmod/build

    Zip the result:
    Code:
    cd /usr/src/tegratab/staging
    zip -r /usr/src/tegratab/boot-custom-kernel *

    [optional]Cleanup the staging directory:
    Code:
    cd /usr/src/tegratab
    rm -R /usr/src/tegratab/staging


    Step 5 - Package Installation

    Boot into Clockwork Recovery.
    Navigate to "mounts and storage".
    Select "mount USB storage".


    Copy /usr/src/tegratab/boot-custom-kernel.zip to the mounted filesystem.
    Select "Unmount USB storage".


    Navigate to "install zip from sdcard" => "choose zip from sdcard" => "boot-custom-kernel.zip".
    Select "Yes - Install boot-custom-kernel.zip".


    Select "reboot system now".
    It's now installed!


    Once reboot is complete navigate to the "Settings" => "About device".
    Check "Kernel version", it should specify the some details about your new build.

    2.6.32.28-cyanogenmod
    [email protected] #1​


    References:

    Android Development: http://source.android.com/source/download.html

    Here's a brief description of the command line options which were used:
    Code:
    -C dir, --directory=dir
        Change to directory dir before reading the makefiles or doing anything else.  If multiple -C options are specified, each is interpreted relative to the previous one: -C  /
        -C etc is equivalent to -C /etc.  This is typically used with recursive invocations of make.
    
    ARCH=<architecture>
    
    # When performing cross compilation for other architectures ARCH shall be set
    # to the target architecture. (See arch/* for the possibilities).
    # ARCH can be set during invocation of make:
    # make ARCH=ia64
    # Another way is to have ARCH set in the environment.
    # The default ARCH is the host where make is executed.
    
    
    CROSS_COMPILE=<toolchain>
    
    # CROSS_COMPILE specify the prefix used for all executables used
    # during compilation. Only gcc and related bin-utils executables
    # are prefixed with $(CROSS_COMPILE).
    # CROSS_COMPILE can be set on the command line
    # make CROSS_COMPILE=ia64-linux-
    # Alternatively CROSS_COMPILE can be set in the environment.
    # Default value for CROSS_COMPILE is not to prefix executables
    # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
    export KBUILD_BUILDHOST := $(SUBARCH)
    ARCH            ?= $(SUBARCH)
    CROSS_COMPILE   ?=
    #ARCH           ?= arm
    #CROSS_COMPILE  ?=$(CURDIR)/../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
    
    	
    INSTALL_MOD_PATH=<module-target-path>
    
    # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
    # relocations required by build roots.  This is not defined in the
    # makefile but the argument can be passed to make if needed.

    Scripts:
    Kernel Configuration Script:
    Code:
    [size=3]AR[color=#000000]=[/color]arm
    
    [color=#000080][b]if[/b][/color] [color=#000000][ -[/color]n [color=#ddbb00]"$1"[/color] [color=#000000]] && [ -[/color]n [color=#ddbb00]"$2"[/color] [color=#000000]][/color]
    [color=#000080][b]then[/b][/color]
       [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$1[/color] ARCH[color=#000000]=[/color][color=#000000]$AR $2[/color] menuconfig
    [color=#000080][b]else[/b][/color]
       [color=#000080]echo[/color] [color=#ddbb00]"Usage: $0 [source-dir] [defconfig]"[/color]
    [color=#000080][b]fi[/b][/color]
    [/size]

    Kernel Compilation / Packing Script:
    Code:
    [size=3][color=#ff0000][i]#!/bin/sh[/i][/color]
    CC[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color]prebuilt[color=#000000]/[/color]linux[color=#000000]-[/color]x86[color=#000000]/[/color]toolchain[color=#000000]/[/color]arm[color=#000000]-[/color]eabi[color=#000000]-[/color][color=#008800]4.4.0[/color][color=#000000]/[/color]bin[color=#000000]/[/color]arm[color=#000000]-[/color]eabi[color=#000000]-[/color]
    AR[color=#000000]=[/color]arm
    
    PREFIX[color=#000000]=[/color][color=#ddbb00]`echo $1 | sed -e 's/[/]*$//' -e 's/[/]/_/'`[/color]
    POSTFIX[color=#000000]=[/color][color=#ddbb00]`date +%Y_%m_%e_%H%M%S`[/color]
    
    KSOURCE_DIR[color=#000000]=[/color][color=#000000]$1[/color]
    TARGET_NAME[color=#000000]=[/color][color=#000000]$PREFIX[/color][color=#000000]-[/color][color=#000000]$POSTFIX[/color]
    SAMPLE_ZIP[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color]boot[color=#000000]-[/color]template.[color=#0000ff]zip[/color]
    
    OUTPUT_ZIP[color=#000000]=/[/color]usr[color=#000000]/[/color]src[color=#000000]/[/color]tegratab[color=#000000]/[/color][color=#000000]$TARGET_NAME[/color]
    STAGING_DIR[color=#000000]=/[/color]tmp[color=#000000]/[/color][color=#000000]$TARGET_NAME[/color]
    
    do_compile[color=#000000]()[/color]
    [color=#000000]{[/color]
       [color=#000080]echo[/color] [color=#ddbb00]"do_compile()"[/color]
    
       [color=#ff0000][i]# Build the kernel image.[/i][/color]
       [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] CROSS_COMPILE[color=#000000]=[/color][color=#000000]$CC[/color] zImage
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#ff0000][i]# Build the kernel modules.[/i][/color]
       [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] CROSS_COMPILE[color=#000000]=[/color][color=#000000]$CC[/color] modules
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
    [color=#000000]}[/color]
    
    do_staging[color=#000000]()[/color]
    [color=#000000]{[/color]
       [color=#000080]echo[/color] [color=#ddbb00]"do_staging()"[/color]
    
       [color=#ff0000][i]# Unzip the sample update zip to create update structure[/i][/color]
       [color=#ff0000][i]# and provide update scripts / utilities.[/i][/color]
       [color=#0000ff]unzip[/color] [color=#000000]-[/color]d [color=#000000]$STAGING_DIR $SAMPLE_ZIP[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    [color=#000000]}[/color]
    
    do_populate[color=#000000]()[/color]
    [color=#000000]{[/color]   
       [color=#000080]echo[/color] [color=#ddbb00]"do_populate()"[/color]
    
       [color=#ff0000][i]# Copy the resulting image to the staging dir.[/i][/color]
       [color=#0000ff]cp[/color] [color=#000000]-[/color]v [color=#000000]$KSOURCE_DIR[/color][color=#000000]/[/color]arch[color=#000000]/[/color][color=#000000]$AR[/color][color=#000000]/[/color]boot[color=#000000]/[/color]zImage [color=#000000]$STAGING_DIR[/color][color=#000000]/[/color]kernel[color=#000000]/[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#ff0000][i]# Install the built modules to the staging dir.[/i][/color]
       [color=#0000ff]make[/color] [color=#000000]-[/color]C [color=#000000]$KSOURCE_DIR[/color] ARCH[color=#000000]=[/color][color=#000000]$AR[/color] INSTALL_MOD_PATH[color=#000000]=[/color][color=#000000]$STAGING_DIR[/color][color=#000000]/[/color]system modules_install
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#ff0000][i]# Remove symlinks.[/i][/color]
       [color=#0000ff]rm[/color] [color=#000000]-[/color]v  [color=#ddbb00]`find $STAGING_DIR -type l`[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#ff0000][i]# Zip up the results. [/i][/color]
       [color=#000080]cd[/color] [color=#000000]$STAGING_DIR[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#0000ff]zip[/color] [color=#000000]-[/color]r [color=#000000]$OUTPUT_ZIP[/color] [color=#000000]*[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    
       [color=#000080]cd[/color] [color=#000000]-[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    [color=#000000]}[/color]
    
    do_cleanup[color=#000000]()[/color]
    [color=#000000]{[/color]
       [color=#000080]echo[/color] [color=#ddbb00]"do_cleanup()"[/color]
    
       [color=#0000ff]rm[/color] [color=#000000]-[/color]v [color=#000000]-[/color]r [color=#000000]$STAGING_DIR[/color]
       [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]return[/color] $?[color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    [color=#000000]}[/color]
    
    [color=#000080][b]if[/b][/color] [color=#000000][ -[/color]z [color=#000000]$1[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]echo[/color] [color=#ddbb00]"Usage: $0 [source-dir]"[/color][color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    do_compile[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color] 
    do_staging[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] do_cleanup[color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    do_populate[color=#000000];[/color] [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] do_cleanup[color=#000000];[/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    do_cleanup[color=#000000];[/color]  [color=#000080][b]if[/b][/color] [color=#000000][[/color] $? [color=#000000]-[/color]ne [color=#008800]0[/color] [color=#000000]];[/color] [color=#000080][b]then[/b][/color] [color=#000080]exit[/color] [color=#008800]1[/color][color=#000000];[/color] [color=#000080][b]fi[/b][/color]
    [color=#000080]exit[/color] [color=#008800]0[/color]
    [/size]
    1
    Hi,

    It's odd actually. The only rom(s) that will give me the full 1gb of ram are stock zpad, bigideas (obviously) and VEGAn 5.1. This is with or without your kernel.

    All the other roms I've tried limit the ram down to 512mb. (All the CM7 variants, Zpad clean, stock gtab).

    VEGAn 5.1
    Code:
                  total         used         free       shared      buffers
      Mem:       966656       205964       760692            0         3896
     Swap:            0            0            0
    Total:       966656       205964       760692

    Zpad Clean w/ latest pershoot kernel.
    Code:
                  total         used         free       shared      buffers
      Mem:       446868       178456       268412            0         8072
     Swap:            0            0            0
    Total:       446868       178456       268412

    that is because of the CMD line used when packing the rom/boot.

    if you build from src, you can just update your cmd line in BoardConfig.mk, rebuild, and you'll be good.
    1
    load up the big ideas rom.

    cat /proc/cmdline

    put that as the CMD value, but leave the end (if building CM7): androidboot.hardware=harmony
    1
    When compiling the kernel I get a lot more modules than the normal kernel.
    What to do with these?
    That's up to you, really. My suggestion is to do what pershoot does with his kernels. He has 2 files for download. The first is the flashable zip file which has the kernel image and the WLAN-related files (the kernel module and WiFi firmware blobs). The other is a tar gzipped file containing the rest of the compiled kernel modules.

    After compiling (unchanged) a well working (no Sleep of Death) kernel I get a lot more Sleep of Death.

    Does anybody have a clue where they come from?
    Opinions are divided at the moment. Pershoot thinks its a Tegra 2 hardware bug for his kernels. Clemsyn thinks its related to the WiFi module and the CPU governor for his kernels. I think its badly coded nVidia/VS/Malata kernel source. There is a dedicated SOD thread on slatedroid.com where Clemsyn has trial kernels which seem to fix the SOD problem (for his kernel).

    Try using the same compiler, compiler flags, optimization levels as the originally compiled kernel.

    ---------- Post added at 10:02 PM ---------- Previous post was at 09:55 PM ----------

    I was wondering what steps changed if you have a 1.2 bootloader vs. a 1.1 bootloader. Do I need to add any additional config lines or commands when building the image?
    Answered here.
    1
    when I try to compile a cm7 kernel I get the following error message can you help me please

    cannot make it out

    [email protected]:~/android/kernel/cm-kernel$ make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
    Make sure the value of CCOMPILER is correct, or, explicitly set CROSS_COMPILE to the ARM cross compiler that's installed on your system--see first post for examples.

    Add the V=1 parameter to make to find out the actual compiler command line being used.