Monday, November 19, 2012

Compiling Nook Color Kernel


Setup and Building Nook Kernel

Setup working directory
mkdir ~/nc
cd ~/nc

Grab kernel and arm-toolkit
git clone https://github.com/CyanogenMod/android_kernel_bn_encore.git
git clone https://android.googlesource.com/platform/prebuilt

Copy config file from nook device to our kernel directory.
Make sure you nook is plugged into the computer via USB with ADB enabled.
cd ~/nc/android_kernel_bn_encore
adb pull /proc/config.gz .
gunzip config.gz
mv config .config

Setup environmental variable to for our ARM toolchain
export ARMTOOLCHAIN=~/nc/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-

Run menuconfig and select your kernel options
make ARCH=arm CROSS_COMPILE=$ARMTOOLCHAIN menuconfig


Build the kernel to uImage format (replace -jX where X is the number of CPU's you have)
make ARCH=arm CROSS_COMPILE=$ARMTOOLCHAIN -j4 uImage

You will now have built a kernel, the uImage is located at ~/nc/android_kernel_bn_encore/arch/arm/boot/uImage

Installing Kernel uImage

Grab a kernel-update zip file, such as the 1.2GHZ overclock kernel update zip below.
You can use a nightly update zip as well, it doesn't really matter as long as there is a ./kernel file to replace in the zip archive.
mkdir -p ~/nc/update
Download update zip from here: https://docs.google.com/open?id=0B471Nt_V1052eHpuS05oWTIzZ3M and place it into ~/nc/update
unzip *.zip
rm kernel
cp ~/nc/android_kernel_bn_encore/arch/arm/boot/uImage kernel
zip -r update.zip kernel MLO ramdisk.img u-boot.bin META-INF/
adb push ./update.zip /sdcard/update.zip

Installing Update
Boot into recovery mode and install the /sdcard/update.zip

Conclusion
You should now be running a custom compiled kernel, you now have complete control of your device. 

Other repositories:
https://github.com/thomas41546/android_kernel_bn_encore - Here is the github of my over-clocked and stable 1.2ghz kernel, a note of caution I used 1.4v overvolt -- which should be fine but I am not liable for any damages.

https://github.com/dalingrin/nook_kernel/commits/encore-32 - Here is the github of the dalingrin kernel for CM7, you can use this information to port features in your kernel.