“CyanoBoot”

(aka a "second bootloader")

Quick Guide

by fattire

(



Alpha 0: "I don't have a NT" Edition (aka a "second bootloader")Quick Guideby fattire @fat__tire on Twitter)Alpha 0: "I don't have a NT" Edition

Started with “UB1” (aka u-boot, “first boot”) source code

Includes changes to support new 512MB model

Includes Bauwks’ repairs to fix “locked bootloader” malware

Many duplicate UB1 functions removed

One-build-boots-all (emmc or SD card, custom OS or stock)

Boot device indicator (top-left corner)

Bootcount indicator (top-left corner)

On-screen feedback to let you know what it’s loading.

Console-based boot menu

Support for key-combo shortcuts for menu/recovery

Alternate “Altboot” multiboot support allows 2nd OS.

Emmc setting for default boot profile (normal/altboot)

Emmc setting for default boot device (emmc or sd)

Emmc setting for automatic bootcount clearing

Boot fallback for stock firmware (0 bytes + sec. header)

Boot fallback for bauwks’ uboot (256 bytes)

Numerous visual enhancements

Unused bulky images removed (smaller file)

FASTBOOT support (w/menu selection)

On-screen build timestamp so you know version

Perhaps much more, or maybe not

E

S

#

$ fastboot flash boot boot.img

flashing_boot.img

mlo

u-boot.bin

MLO_es2.3_BN

mlo

boot.img

recovery.img

altboot.img

“flashing_boot_emmc.img

byte 0

byte 0

exactly at 512Kb

altboot.img

/bootdata

flashing_boot_emmc.img

flashing_boot.img

boot.img

recovery.img

boot.img

recovery.img

boot.img

recovery.img

uImage

uRamdisk

/boot.img

/recovery.img

/altboot.img

boot.img

recovery.img

/bootdata/altboot.img

/bootdata

$ echo -n “1” > /bootdata/u-boot.device

altboot.img

altboot.img

/bootdata/altboot.img

echo -n “1” > /bootdata/u-boot.altboot

echo -n “1” > /bootdata/u-boot.clearbc

(Thanks to indirect for the image.)CyanoBoot (working title) is a “second bootloader ” in early development, which is based on the open-source “ u-boot ” project, as further customized by BN & Bauwks . It is similar to the bootloader provided by Bauwks but has additional enhancements to make booting unsigned partitions easier and to generally enhance the booting experience on the Nook Tablet (aka “acclaim”) device.CyanoBoot is intended for use with the forthcoming CyanogenMod 9 , but it can also be used to boot CM7 or Ubuntu Linux or even the stock firmware (provided of course you are not legally or contractually bound from doing so. I haven’t read or agreed to any BN user agreements, so can’t speak to this.)CyanoBoot includes an on-screen menu system, the ability to boot into three basic modes (normal, recovery, and “altboot”), configuration options, fastboot, and more.The same version of CyanoBoot should start from both SD card and emmc (although it must be packaged and installed differently for each.) It should work on both the 1gb and 512mb RAM models. NOTE: It has been reported that some devices may require a USB cable to be plugged in to boot from SD Card. If true, this issue is not understood and is not addressed, nor is it likely to be.Whew!There are likely bugs all over the place, but this is how it'sto work:Hold down home (“n”) key for the menu.Hold down home (“n”) + “power” to have UB1 start recovery. If UB2 is also installed, it should respect this key combo and continue to load recovery.The default behavior if no keys are pressed is to boot “normally”-- if booting from emmc, the boot partition (p4) from emmc will be booted. If booting from SD the boot.img on SD file will be booted.Use the Home (“n”) key to navigate through the menu options. You can select an option with the power key.The option you choose will override any other configuration you have made.NOTE: Just so you don’t ask-- the reason the home and power keys are used to navigate through the menu rather than the volume up and down keys is due to a required driver not being included with u-boot 1. While the home and power keys use a very simple “gpio” method to detect if they are pressed, the volume keys are more like keyboard keys and thus are more difficult to detect. (The Nook Color bootloader, in contrast, did have the appropriate driver, so volume key detection was possible.)Since you can boot from either SD or EMMC, it may be difficult to ascertain which version you are starting from.Never again. You can now see whether you have loaded CyanoBoot from EMMC or SD by lookin at the top left corner:” -> CyanoBoot is starting from emmc” -> CyanoBoot is starting from SDCardThethat follows this indicator is the current “bootcount”. After 8 unsuccessful boots or so, stock behavior is to run recovery with a reflash instruction. See below for instructions on clearing the bootcount at every boot automatically.For those familiar with “fastboot”, you can select the fastboot option from the CyanoBoot menu to go into fastboot mode. You can then (hopefully) flash to the boot or recovery partitions via USB cable using a command such as:(If you are preparing your own SD card for booting, you should be aware that for OMAP devices such as the acclaim, the SDcard must be formatted using a very specific configuration, which is detailed elsewhere .)For SD Card, CyanoBoot is packaged inside a “” file to be placed in the first vfat partition of the SD-card along with the signed “” and “” files from the 1.4.2 update.zip.(I'm told the mlo file may be called calledin the BN update.zip and should be renamed to “”.)Next, the boot (“”), recovery (“”) and/or alternate boot (“”) image files may optionally be placed in this partition.To boot from emmc, the” file, which contains a packaged version of CyanoBoot, should be put atof the third partition (recovery) and ALSO atof the fourth partition (boot). Then, the boot/recovery partitions must be shifted “to the right” (to make room for Cyanoboot) so that it starts 512Kb in from the start of the file. Use a padding of zeros so that the boot image contents beginThe boot and recovery partitions are expected to use this offset. For the alternate boot from emmc, the “” may be the identical file used in an SD-boot, placed into thevfat partition without any offset.NOTE: Again, use thefile for emmc boot partitions, *not*, which is for SD card boot.Again, when used on the emmc, CyanoBoot must be placed at byte 0, at both the boot and recovery partitions. The “actual”andthat would normally be at byte 0 of those partitions should be moved so that it starts 512Kb in.Always use this offset in recovery (p3) and boot (p4) partitions. In other words, put CyanoBoot at offset 0 and then pad with zeros, then put the normalorat offset 512.)On SD Card, the “” and “” files should have no padding or offset or anything. Use as normal. This is similar to how “” and “” files are used on the NookColor, only use a single file for both with a header in front.One more time. Here are the locations for the boot images:(p1-vfat)file (no offset/padding)(p1-vfat)file (no offset/padding)(p1-vfat)file (no offset/padding)(p4-/boot partition)Nook Color Tweaks does for the encore device in CM7.Thanks to chrmhoffman, nemith, xindirect, Celtic, and loglud for testing, as I don’t have a device and have never actually run this. Thanks to j4mm3r for the first encore menu code. It was pretty much rewritten for acclaim, but the first menu was invaluable in showing me how to add the code for the console. Thx to pokey9000 for stuff that helped get fastboot working.Also thanks to BN as well as all the talented u-boot developers at Denx and elsewhere for the GPL’d code upon which this was based. http://www.denx.de/wiki/U-Boot is where you can find the main u-boot project.Also, a huge thanks to Bauwks for his code contribution as well as for making this possible in the first place!Remember, this is all experimental. I'll try to update this post if there's something that needs to be updated.If you have an issue, be sure to mention the timestamp at the bottom so everyone knows which version you're using. There will be bugs.