See Rooting new hardware FIRST if you have a nook original with a 1003* serial# or above.
Belated congratulations to [mbm] and pokey9000 for rooting the Nook Color. Check out our Nook Color portal also.
User:TimRiker has been re-despamming. New user registration disabled for a while. Need wiki help? Contact an Administrator.

NookColor: Build the Original Kernel

From nookDevs

Jump to: navigation, search
link=NookColor portal
Part of the NookColor portal

On their legal page for the NC, Barnes & Noble generously provide the source code they used for the kernel, u-boot, x-loader, and parts of android.

The goal of this document is to take this provided source code, as well as other open-sourced tools, particularly those provided directly from Google, and create a bootable SD card from "scratch" using entirely open-sourced software. The steps taken below were performed in Ubuntu, for what it's worth.

Note that this is fairly technical. Also this page is a work in progress. It is not recommended that you follow these instructions. Nor do the author(s) of these instructions take ANY responsibility for any consequences of you doing so.

The console has been achieved only twice. Subsequent boot ups (with minor changes to init.rc) seem inconsistent. But it has been achieved, so it is known possible.


Contents

Download, and put the distro directory somewhere

So take the source code and unzip it. Dig down and move the "distro" directory somewhere.

In the example below it'll be ~/Desktop/distro

Get a cross-compile toolchain

You have several choices here. One of which is to download the Android NDK. There's also Code Sourcery (use 2008q3), the one provided in the Cyanogenmod sources, etc.

In the example below, we'll assume you're using android-ndk-r5 and you put it in ~/Desktop.

Patch and Build U-Boot

cd ~/Desktop/distro/u-boot

Next, try the following: Note that the "-j2" below should be replaced by -j# where # is the number of cores you have on your compiler. Also, if you are using something other than linux to build this, you may need to change the CROSS-COMPILER path.

If you want to be K-K00L, you can also replace ~/Desktop/distro/u-boot/tools/logos/o_nookcolor_logo-large.bmp with your own custom bootup image (sideways, on black as the example suggests...)

Then....

make -j2 ARCH=arm  CROSS_COMPILE=~/Desktop/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- omap3621_evt1a_config
make -j2 ARCH=arm CROSS_COMPILE=~/Desktop/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

(Or if you have CodeSourcery installed at /opt/arm-2008q3, it would look something like this):

make -j2 omap3621_evt1a_config 
make -j2 ARCH=arm CROSS_COMPILE=/opt/arm-2008q3/bin/arm-none-linux-gnueabi-

Note we are using omap3621_evt1a_config - Rumor has it there has been some success with other kernel sources using omap3430zoom2_config (such as nooter), but it was heavily patched.

Put the U-Boot tools you just built in your path

PATH=$PATH:~/Desktop/distro/u-boot/tools/

This lets you build the uImage below.

Build the Kernel

cd ~/Desktop/distro/kernel

then..

make -j2 ARCH=arm omap3621_evt1a_defconfig
make -j2 ARCH=arm CROSS_COMPILE=~/Desktop/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- uImage

Build (MLO) the x-loader

Might as well build MLO, since you'll need it too if you want a full bootable SDcard.

cd ~/Desktop/distro/x-loader
make -j2 ARCH=arm omap3621_evt1a_config
make -j2 ARCH=arm CROSS_COMPILE=~/Desktop/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- ift

Format a NookColor-bootable Micro-SD

The Nook requires a bootable SD must be formatted in a very particular way. Luckily the procedure has been scripted for you, in Linux anyway...

Pop a blank (it will be blank in a second, so make sure it has nothing you want on it) SD on your computer, and run the script you can find here. You must first save this file from your browser as text and then give it executable permissions. (If you don't know how to do that, you certainly aren't ready for the next steps...)

WARNING: The above script formats things!!! Be sure that you are writing to the right device!!!

sudo ./omap3-mkcard.sh /dev/sdX

where X is your sdcard slot. For example. /dev/sdb or /dev/sdc.

      • AGAIN, THIS WILL OVERWRITE YOUR DEVICE (IF YOU SCREW IT UP, YOU COULD BLOW AWAY YOUR HARD DRIVE OR SOMETHING ELSE!!!) SO BE SURE YOU POINT IT TO THE SDCARD YOU WANT TO FORMAT ONLY!!! AGAIN, SHOULD YOU DECIDE TO DO THIS, IT IS AT YOUR OWN RISK. ***

You should have two empty partitions on your SD now.

The first one is a VFAT boot partition, which will be located at /dev/block/mmc1p1 and will contain u-boot stuff. the second is an ext3 partition which will be located at /dev/block/mmc1p2.

The /dev/block/mmc1p2 is what we're going to use as our /system folder. However, the kernel expects an ext2 partition. So you will need to repartition it to be ext2. This is done easily in ubuntu w/the System->Administration->Gparted UI. Command-line instructions will have to be done by someone else, but it isn't hard.

While you are at it, you will need a third ext3 partition for /data. Go ahead and create it using Gparted.

So you'll have 3 (minimum) partitions on your SD, which must be partitions 1, 2, and 3....

  1. vfat - this will be /boot
  2. ext2 - this will be /system
  3. ext3 - this will be /data

See this page for more info about how the funky SD formatting works and some step-by-step instructions.

Use Nookie Froyo's pre-made Android filesystem to migrate /system to your SD card

Depending on what version of Android you'd like to try, you have several choices of pre-made systems that are conveniently linked below. Here's one site to try. TI has spun several pre-made images. Anything started with RLS25 is supposed to be for Zoom2/3.

The one we'll experiment with is Nookie Froyo. The following steps will make a workspace for it, and then extract it to your computer.

mkdir ~/Desktop/NF   # make a workspace
cd ~/Desktop/NF
wget http://edencomputing.com/nookcolor/nookie-froyo-base-0.5.6.tar.gz > .  #get the file
sudo tar -zxvf nookie-froyo-base-0.5.1.tar.gz
mv ramdisk_src ramdisk   #rename the folder to "ramdisk"

Now that you've "staged" everything, insert your SD card. There should be two partitions-- the first is a vFAT and the second an ext3.

sudo cp -pra system/* /path/to/your/sdcard's_ext2_system_partition

Create your uRamdisk file

You need one of these too. Yes, one's already included with Nookie Froyo. But why use that old thing when you can build one (and modify it) yourself? And to make your uRamdisk, a handy script would be nice to look at.

cd ~/Desktop/NF
nano packer.sh

And then put this in that file:

#!/bin/bash

cd ~/Desktop/NF/ramdisk
find . -regex "./.*"| cpio -ov -H newc | gzip > ../repacked-ramdisk.cpio.gz 
~/Desktop/distro/u-boot/tools/mkimage  -A ARM -T RAMDisk -n Image -d ../repacked-ramdisk.cpio.gz ../uRamdisk
cp ../uRamdisk /media/boot/
sync

Replace "/media/boot" above with the path to your sd's vFAT folder. Now

sudo ./packer.sh

And there it is! That should automatically create and copy your uRamdisk to the SD card.

Copy everything over to your freshly-formatted Micro-SD

Put the following stuff, which you built in the previous steps, on the SDCard's VFAT partition:

  • MLO
  • u-boot.bin
  • uImage
  • the uRamdisk should have been placed there in the previous step.

Safely unmount the SDcard and try booting from it.

Be careful and aware that you are likely booting a "live kernel" with write permissions to all areas of your hardware... if you have not audited the code carefully, it may do strange things to other partitions, erase things, damage things, etc. So again, try this only at your own risk and with the understanding that things may go very horribly wrong.

Be patient. After an initial "Loading..." screen (provided by u-boot and replaceable as described above) you may see a blank screen.

Wait up to 15 minutes. No idea why it takes that long. (Each service is probably timing out big-time as the errors suggest that /system is not being mounted properly. adbd can not even be found in sbin.... Probably the next thing to ascertain is why this is. Places to review-- uboot here and init.rc here -- is uboot always setting bootargs right or only sometimes?)

Eventually, you just might see some blue text scroll by. Be aware that a screensaver comes on.

Resources

Pre-Built Android Images


Source Code

GitHub Sources:

Barnes & Noble's source code:

This is a 2.6.29 kernel built with the omap3621_evt1a_defconfig config. Modified further by cicadaman. https://github.com/optware4android/nook_kernel


Android FroYo sources:

Various TI redistributable binaries (linked from omappedia) for nook hardware:

Tidbits

http://nookdevs.com/index.php?title=NookColor%3A_Build_the_Original_Kernel There's some weirdness in uboot's config:

/distro/u-boot/include/configs/omap3621_evtla.h

Rather than passing the kernel a normal boot command, we end up with this series of instructions:

#define CONFIG_BOOTCOMMAND "run autodetectmmc; run readtokens; run checkbootcount; run checkrom; run checkupdate; run checkbcb; run ${bootvar}"

This appears to have to do with counting bad boots, checking if there is an "encore-update.zip" in the vfat sdcard partition, booting into recovery and doing updates.

Personal tools
Navigation
Nook Classic
Nook Simple Touch
Nook Tablet
Google AdSense