yashsingh1/xdaforums huggingface dataset:
[Barnes & Noble Nook Tablet] fattire:
You're describing a recovery. Remember-- the bootloader loads BEFORE any operating system-- before even a kernel is loaded! It has full access to the hardware, but few drivers at this point, and it can't do much-- the only file system it can read I think is vfat, and it can't even create a file from scratch, only read or modify an existing file by copying its contents directly into memory or dump memory into the file.

Think of the bootloader, programatically, as sorta like a big program that runs in a primitive DOS environment. Most of what it does is initialize hardware and then start the kernel, but it has a very limited ability to read files and detect what should happen as far as which kernel it should load.

The fact that it has a console (ie, can write text to the screen) and a menu system and all that is stuff I (crudely) added... it's not using any kind of API or screen drawing libraries or anything-- it's just one big C program calling functions that draw the characters to the screen as a bitmap pixel by pixel, and it's reading raw input from the button presses.... The menu all had to be written starting with a blank file called "menu.c" and going from there... I used parts of the stuff I did for nook color (which was in turn based on stuff from J4mm3r), but it was kind of a rethink.

To do installation of zips pretty much is perfectly suited for a recovery environment, and everything you propose would be great for someone enhancing CWM. But for the bootloader, it should be simple and lightweight, I think.

For the feature where you talk about "custom profiles for your favorite ROMs"-- that is what the altboot configuration is for. You can set up a 2nd kernel/ramdisk to be whatever you want-- a recovery, or another OS, or whatever.

This is being used to great effect in Nook Colorworld, where user "racks" has created a dualboot cm7/cm9 SD card. So you can boot from either at will off SD. It works well with CyanBoot :)
[Barnes & Noble Nook Tablet] brianf21:
It is, would you like it to also install cyanoboot as well?
[Barnes & Noble Nook Tablet] SCClockDr:
Indeed, sounds like a plan! :D

TY pressed!
[Barnes & Noble Nook Tablet] nerdyjim:
So I could create "racks" dualboot CM7/CM9 SDcard and run this on the NT or is this a usecase for cyanoboot on the NC?
[Barnes & Noble Nook Tablet] fattire:
Yeah, you could theoretically use cb to create a dual boot cm7/cm9 sd... although at the moment cm9 is configured for emmc install only. But it could be any 2 oses or recoveries or experimental kernels or whatever you like :)
[Barnes & Noble Nook Tablet] nerdyjim:
I would love to get altboot working at some point on an SDcard. There hasn't been any img's around that would be compatible for this yet I think. I'm pretty sure I would need to modify the altboot.img somehow to get it to work properly. It was explained to me a few days ago but i have been busy and forgot the specifics.
[Barnes & Noble Nook Tablet] nook_lover:
Hello, everybody. I have CM9 installed to EMMC and I am having a problem booting off the CM7 SD-card with "CyanoBoot". The only successful booting of CM7 is the first initial one. Any subsequent booting from the SD fails with the black screen. Am I missing something?
[Barnes & Noble Nook Tablet] nerdyjim:
did you swap out the flashing_boot.img that comes with the CM7 SDcard img with cyanoboot's flashing_boot.img?
[Barnes & Noble Nook Tablet] nook_lover:
No, I didn't do anything to it. Cyanoboot + CM9 are installed to EMMC as I mentioned above. Do I have to do some swapping?
[Barnes & Noble Nook Tablet] nerdyjim:
This is probably why it is not booting to CM7 using you're SDcard. You need to install Cyanoboot on the SDcard as well.

Edit: basicly all you have to do is swap flashing_boot.img that is currently on you're sdcard with the flashing_boot.img from cyanoboot. It needs to be placed in p1 of you're SDcard (same spot where CM7 flashing_boot.img resides) download it from the OP. The u-boot.bin and mlo that is included on the CM7 Sdcard you have made will be sufficient enough.
[Barnes & Noble Nook Tablet] nook_lover:
Ok. I am gonna try it tonight, but how the initial successfull booting of CM7 can be explained?
[Barnes & Noble Nook Tablet] nerdyjim:
I honestly have no idea. I know that to dual-boot using Cyanoboot with a SDcard version of CM7 you need to install Cyanoboot on the SDcard as well. Fattire posted the instructions in the CM9 thread I believe. It states to make sure you are using a SDversion of Cyanoboot on the CM7 bootable SDcard. Maybe a dev could explain you're question.
[Barnes & Noble Nook Tablet] Thibor69:
Any chance you could show me the commands to do this via adb ?

Personally I would like it to boot of SD since it checks there first.

I currently have U-Boot installed ... and running Stock 1.4.2 on eMMMC and CM7 on SD.

Just thought I would ask .....

Peace
[Barnes & Noble Nook Tablet] Demetris:
Fattire:

When you flash an incompatible kernel with NT the cyanoboot menu dont let you do anything the N button is void and it boots straight into cwm.

Can anything be done to correct this?

Like a hardcoded N+power button mapping

We cant play with crossflashing kernels until this is fixed ;)

Thanks
[Barnes & Noble Nook Tablet] i9o:
How can I remove cyanoboot?

I do not need anymore a double boot system and cannot find out how to uninstall this anyway useful loader.

Thanks
[Barnes & Noble Nook Tablet] lavero.burgos:
Hmm i dont know if you have it installed internal but i personally have used it in my sdcard if that is your case then all you need to do is format your sdcard.

~ Veronica
[Barnes & Noble Nook Tablet] i9o:
No, I actually have internally. And I would like to preserve my current Android installation.
[Barnes & Noble Nook Tablet] fattire:
Sorry I've been at Coachella the last few days so may have missed some messages, etc.

Can you explain what you mean that the "N" button is "void"? It should never be void-- it doesn't currently check whether there is a kernel there or not before looking for a held-down "N"/menu. so not sure what that means.
[Barnes & Noble Nook Tablet] fattire:
I'm not sure why you'd uninstall it as you don't have to double-boot from it. You can just leave it as the default bootloader and it will work just as bauwks does (or as stock does). The menu and other features are add-ons to stock behavior, and it should continue to work with a stock installation.

(in other words, it will load the boot and system partition using a fallback technique to look at a 512 block (cyanoboot), 256 block (bauwks), and 0 block (stock) offset.)
[Barnes & Noble Nook Tablet] Demetris:
The N button doesnt work.

It shows Cyanoboot screen and then load up cwm, pressing N button doesnt stop this.

And of my supprise also in cwm i couldnt mount sd card so i had to go into adb magic to mount media to mmcblk0p10 and then push cm9.zip and flash from there as i didnt have any rom on the internal.

Edit:

After flashing cm9 with correct boot.img all back to normal.

Edit 2:

Just for report.

After trying to flash Kindle fire kernel, my NT never reached cyanoboot bootloader, it showed N screen then bootloop.

So something needs fixing in Cyanoboot.

What i mean is, even with wrong kernel wouldn't be normal to pass cyanoboot loader and bootloop after trying to load from emmc.

Why kernel messes up bootloader? Weird! :)
[Barnes & Noble Nook Tablet] fattire:
A few thoughts.

1. Cyanoboot is not meant to work on the kindle fire, and the kindle file kernel should not be used with the nook tablet. The only devices cyanoboot works with is 1. Nook Color 2. Nook Tablet, and there has been development on 3. The lenovo A1.

2. The kernel must be added to the boot.img (sd) or boot partition (emmc) in a very specific way. If you did not do it properly, you will not see past the "N" if you are booting from emmc. This is described in the OP in some detail.

3. It would not be normal to get past the cyanoboot loader if the kernel was not properly added to the boot image. Again, see the OP for how it should work. It would not be expected to do anything with a kindle fire kernel.

4. It's extremely hard to make an evaluation, especially without knowing exactly what you did to "flash" this kernel. What makes you think a kfire kernel would work? If you're interested in using an experimental 3.x kernel, see the 3.x kernel thread.
[Barnes & Noble Nook Tablet] Demetris:
Thanks for the quick answer.

As I clear out ,cyanoboot behavior depend on the kernel. So the kernel must be cyanoboot-aware.

P.s

I knew kf wouldnt boot :) I was just testing if I can recover via cyanoboot if I flash a "almost compatible" kernel, let's say bionic 3 .

And if I could fastboot flash boot boot.img

But never reached there ;)
[Barnes & Noble Nook Tablet] flamingsamurai:
Having some trouble with Cyanoboot. I selected emmc recovery in the menu and now it is in a loop. It attempts to boot the recovery (Loading recovery from emmc...), then powers off and then reattempts to boot into recovery when it gets back into cyanoboot. It continues to loop, and doesn't cut out after 8 restarts.

I held the menu button to interrupt it and it won't respond at all. Also tried booting from SD but it boots straight into cyanoboot.

Any help would be great, thanks.
[Barnes & Noble Nook Tablet] Demetris:
Do you have cwm recovery installed and tested to work?
[Barnes & Noble Nook Tablet] fattire:
If it's attempting to boot into recovery with every boot, this is due to an uncleared instruction in the /bootdata/bcb file that was NOT set by cyanoboot (it does not do this) and is not being cleared with every boot-- if you tried to boot into recovery from the reboot menu and do not have a valid recovery to boot into (and thus clear this instruction), this can happen...

Do you have a valid recovery image or other bootable SD? If you can boot into it, or any other valid image (boot off SD), this command from the shell should clear the bcb instruction:

dd if=/dev/zero of=/bootdata/BCB bs=1 count=1088
[Barnes & Noble Nook Tablet] Kuzma30:
Is it easy way to leave "Start fastboot" menu after sending image? (Pressing to power button is very long :) )
[Barnes & Noble Nook Tablet] Demetris:
fastboot reboot
[Barnes & Noble Nook Tablet] mik_os:
"fastboot continue" does not supported?
[Barnes & Noble Nook Tablet] Demetris:
Didn't check, i will and post back

Edit:

It fails gracefully :)

C:\adb>fastboot devices

XXXX00XX0000000X fastboot

C:\adb>fastboot continue

resuming boot...

FAILED (remote failure)

finished. total time: 0.001s
[Barnes & Noble Nook Tablet] mik_os:
I think I know how to fix this (or at least how to activate menu again), but how to pack u-boot into that flash_image.img file? Found this, will try to make something usefull.
[Barnes & Noble Nook Tablet] mik_os:
Successful.

Now command "continue" will bring you back to menu. Emmc version for testing attached. Sources, more info, and corrected file size will be available when I get some sleep (it's 4 a.m. for me) :)
[Barnes & Noble Nook Tablet] fattire:
Wanna crash your bootloader?

Yeah having it continue the boot post-fastboot is an easy fix. I didn't realize you could continue once fastboot ran. All you'd really have to do is find the menu option in.. I think it was mmc.c... and then just have it call another boot profile after it executes fastboot (or re-run the menu). If you need help with this I can show you how to do it.

Incidentally a few days ago I posted a first attempt to an update to the menu, based on refinements to cyanoboot nookcolor from tonsofquestions and then adapted to the NT. . Chrmhoffmann was supposed to take a look, but I don't think he had a chance yet. It's up on goo-inside.me if someone wants to try it. Somehow I'm guessing it will crash hard, but if someone is feeling adventurous, there's a flashing_boot.img up there which includes the source.

The big difference is basically that it will grey out menu items that don't apply (based on whether the files are available on the sdcard), but there are some other optimizations to the menu interface as well.

That plus the fastboot recover I think might warrant a new "major" release. I hesitated to post it until someone tested it-- I still dont' have a nook tablet. But since a patch to the previous source is available, if it's not working, someone might want to debug it as necessary.

There is also a discussion on the cyanboot nookcolor thread about whether a portrait or landscape configuration is more desirable. There is a horizontal version implemented, but consensus seemed to be portrait was preferred.

Anyway, the probably-will-crash experimental version, along with the source diff, is here.
[Barnes & Noble Nook Tablet] fattire:
Hah, I guess i missed this post.

Great.. so that's done, awesome. Can you try the new menu changes? Issues that crop up should be pretty easy to fix.
[Barnes & Noble Nook Tablet] mik_os:
I will try new menu at weekend.

p.s. located my patch here: https://github.com/mik9/acclaim_cyanoboot/commit/709916eb0bbbd70b8469404600837b4c8b027c1b.

p.p.s. attached new image.
[Barnes & Noble Nook Tablet] Demetris:
How to flash this?

dd it to mmcblk0p2 is ok?
[Barnes & Noble Nook Tablet] mik_os:
In same way as provided in first post.

I did not tried but sounds too dangerous. Do not do it.
[Barnes & Noble Nook Tablet] Demetris:
Will this work?

dd if=/dev/zero of=flashing_boot_emmc.img bs=1 seek=524287 count=1

cat flashing_boot_emmc.img boot.img > new_boot.img

fastboot flash boot new_boot.img
[Barnes & Noble Nook Tablet] mik_os:
If you don't worry about your boot partition you can directly flash with "fastboot flash boot flashing_boot_emmc.img".

If you already have cyanoboot on boot partition this will probably work too.

If you don't have cyanobot on boot partition you need to get boot.img, shift it to 512Kb, and place on first byte content of flashing_boot_emmc.img.
[Barnes & Noble Nook Tablet] Demetris:
What do you mean if i dont worry, what is the worst thing that can happen?

I have cyanoboot already, q. can fastboot replace it self when in use like recovery?

I mean can i update fastboot from fastboot? lol
[Barnes & Noble Nook Tablet] mik_os:
Yes, you can. I mean that this opeartion will replace first N bytes of partition and if there was android's boot it became corrupted, but cyanoboot will work.
[Barnes & Noble Nook Tablet] succulent:
Triple boot on nook tablet, fun stuff. :eek:

http://www.youtube.com/watch?v=x6syVkhPQaM

[YOUTUBE]x6syVkhPQaM[/YOUTUBE]

Demo of triple boot on nook tablet using fattire's cyanoboot, chrmhoffmann's CM9 and my CM7.2 RC1. Don't expect anything out of this. I am just doing it for fun. I had to edit cm9 boot.img and rom to make this work.
[Barnes & Noble Nook Tablet] damnoregonian:
Aha! I needed this :)

I tried wiping out the BCB, making it empty... wasn't sure what would get it to stop looping.

I tried to go into recovery after my release had expired (to upgrade) - and apparently my recovery was not working.

Perhaps cyanoboot should still allow a hard-key override of BCB boot instructions?

scotty2
[Barnes & Noble Nook Tablet] fattire:
scotty2--

Yeah there was talk of adding this, and in fact someone is working on it for nook color. So hopefully a clear bcb file option will show up. If it doesn't, I'll add it...
[Barnes & Noble Nook Tablet] Rebellos:
https://github.com/Rebell/acclaim_cyanoboot/commit/33228462ece75fe8274f76ad368c333130c02174

Added some more things I just remind:

Please check it out.
[Barnes & Noble Nook Tablet] fattire:
This is quite awesome stuff. People, test it!
[Barnes & Noble Nook Tablet] meghd00t:
I just built rebellos' cyanoboot and booted it from sdcard, I can confirm vol keys up down select and boot internal emmc, emmc recovery, sdcard boot (twrp 2.2), sdcard recovery & sdcard altboot work fine, I have not installed /rom/altboot and so that remains greyed out. but I did change the KERNEL_OFFSET back to 0x120 before it would work

http://pastebin.com/znaEZy53

has my build steps

on the sdcard - format fat32, lba set bootable, copy MLO u-boot.bin from b&N 1.4.2 or 1.4.3 and add flashing_boot.img from the output of my script and whatever boot / recovery images you want to test
[Barnes & Noble Nook Tablet] Rebellos:
Thanks meghd00t. Guess something with loading is broken so it cant handle 0x200 offset. We don't need it for now anyway I guess.

Oh yes. List of expected files it's looking for is of course:

/emmc/altboot.img

/sdcard/boot.img

/sdcard/recovery.img

/sdcard/altboot.img
[Barnes & Noble Nook Tablet] fattire:
so what's the consensus? Works?
[Barnes & Noble Nook Tablet] succulent:
It work for the most part like you intended thanks to Rebellos, but not everything. The detection of altboot.img on emmc isn't working. It can detect if altboot.img and boot.img are present on sdcard. It grey out like it should if they are not present. The volume keys moves to next item and home key select. I don’t know why “0x200 offset” was added to bauwks’s script, but I didn’t use it.

Edit: Attached pic, CB with own edits.
[Barnes & Noble Nook Tablet] fattire:
Anyway... there are a few offsets that we're talking about-- the 256 & 512 offset inthe boot.img and if I remember right there is the security header offset used for bauwks' workaround for the locked bootloader. I may have errantly confused them in IRC when talking to rebellos.

Also, who is "HD"? Not that it matters, but the menu itself was written first by j3mm4r, then I redid it for NC and redid it again for NT starting w/fresh BN/Den code, adding bauwks' bootloader hack, and menu-wise starting with a fresh menu.c. That version was enhanced by mik_os (fastboot and other mprovements), then the menu was ported back to NC by me and then refactored by "Ogilvy" on NC... and now "Rebellos" applied those refactoring and other changes back to NT. Phew! I don't know who "HD" is at all, but maybe someone will remind me...

Source is here btw and the NC version is here if anyone is curious of the history.
[Barnes & Noble Nook Tablet] TheForceUnleashed:
"HD" is succulent bro :P
[Barnes & Noble Nook Tablet] fattire:
Hah! That explains the top billing :cool:

j/k
[Barnes & Noble Nook Tablet] succulent:
Yea, it's just my initial and all I did was the menu. I've added Ogilvy to credits.

Anyway, I've fixed the emmc altboot problem by introducing char vax with my little knowledge of programming. Emmc Altboot is now detected and it worked.

int check_device_image(enum image_dev device, const char* file) {
char res = ((device == DEV_SD) ? 0 : 1); //0=sdcard, 1=emmc
char vax = ((device == DEV_SD) ? 1 : 5); //1=p1, 5=p5 (bootdata partition)
lcd_is_enabled = 0;
sprintf(buf, "mmcinit %d; fatload mmc %d:%d 0x%08x %s 1", res, res, vax, &res, file);
if (run_command(buf, 0)) { //no such file
res = 0;
} else {
res = 1;
}
lcd_is_enabled = 1;
return res;
}
[Barnes & Noble Nook Tablet] Rebellos:
Thank you. Added your code and added your initials (HD) in the bottom lines. ;)

Binaries built previously this day had just hit repo so new menu will show-up in all future builds.

Could anyone test out flashing_boot.img ? (the SD card one)
[Barnes & Noble Nook Tablet] fattire:
Nice job on the coding. I guess I was considering the whole of "cyanoboot" as the "menu" (even though it's way more than that, obviously). It all started because on the very first version of any menu j4mm3r included his name so I kept the tradition as I went along. So it started out with only two names specific to a very basic boot menu, but at this point so many people have pitched in that I don't think we really need any credit up front or the list will get ridiculously long. If someone wants to add a credits menu option, we can put whatever we want there.

I would argue though that we should keep the timestamp for sure as it is very helpful for debugging (ie, "which version are you using") since without it, there's no real way to tell from a simple CB binary.

This is really exciting to see how it's coming together.
[Barnes & Noble Nook Tablet] succulent:
I only test with the sdcard one (flashing_boot.img) and it work.

One more thing, I think "mmc 1:2" need to be "mmc 1:5" in menu.c. mmc 1:2 on NC is rom partition, on NT it's bootloader partition. 1:5 point to bootdata on NT even though p5 is rom partition. I haven't test u-boot.device/u-boot.altboot so I can't verify that this work.

char read_u_boot_file(const char* file) {
char res;
lcd_is_enabled = 0;
//sprintf(buf, "mmcinit 1; fatload mmc 1:2 0x%08x %s 1", &res, file);
sprintf(buf, "mmcinit 1; fatload mmc 1:5 0x%08x %s 1", &res, file);
if (run_command(buf, 0)) { //no such file
res = 'X'; // this is going to mean no such file, or I guess the file could have 'X'...
}
lcd_is_enabled = 1;
return res;
}

int write_u_boot_file(const char* file, char value) {
lcd_is_enabled = 0;
//sprintf(buf, "mmcinit 1; fatsave mmc 1:2 0x%08x %s 1", &value, file);
sprintf(buf, "mmcinit 1; fatsave mmc 1:5 0x%08x %s 1", &value, file);
if (run_command(buf, 0)) {
printf("Error: Cannot write /bootdata/%s.\n", file);
value = 0;
}
lcd_is_enabled = 1;
return value;
}
[Barnes & Noble Nook Tablet] fattire:
That's exactly right. /rom is p2 on NC... so that's probably a (minor) bug.
[Barnes & Noble Nook Tablet] Rebellos:
Commited patch. Together with fix for fastboot screen corruption during loading big files (moved framebuffer far away from it).

Binaries are already in ics and jb branch. :)
[Barnes & Noble Nook Tablet] fattire:
You rock.. thx!

(that last part means those binaries should automatically show up in new cm10 builds from chrmhoffmann.. :) )
[Barnes & Noble Nook Tablet] michaelmab88:
I was wondering if someone could post CyanoBoot up again? The link is dead.. Thanks
[Barnes & Noble Nook Tablet] Demetris:
https://github.com/CMNookTablet/acclaim_cyanoboot
[Barnes & Noble Nook Tablet] Rebellos:
There are also prebuilt binaries there:

https://github.com/CMNookTablet/android_device_bn_acclaim/tree/ics/prebuilt/boot/
[Barnes & Noble Nook Tablet] scgt1:
So does anyone have this running on a 16GB NT with the Nook being stock and the CM7 on SD? I would really like the option to choose on start up which OS I want to use rather then pulling the microSD out all the time. :confused:

If so what did you do to get it working?
[Barnes & Noble Nook Tablet] Solar.Plexus:
1.) Download the cyanoboot zip from the first post of this thread.

2.) Navigate to the first partition (boot partition) of the dual boot SD card you have made.

3.) Replace the old flashing_boot.img with the new flashing_boot.img file from inside the cyanoboot zip you just downloaded.

4.) Done.
[Barnes & Noble Nook Tablet] scgt1:
Is this done via the NT or windows PC?

Also is this ok for 1.4.3? It said it was for 1.4.1 just making sure I don't screw anything up is all.

Also the link for the file in the OP is dead as someone stated a few posts above mine. The link someone put up a post or two after it leads to the source files for uboot instead of the actual cyanoboot files.
[Barnes & Noble Nook Tablet] Solar.Plexus:
Probably better off just doing it on your PC.

Oops, didn't notice that file was down. I'll try to find another one for you.
[Barnes & Noble Nook Tablet] scgt1:
Can that be read on the computer though? I think all it shows that you can get into is the last partition of the SD card. I could be wrong. I can't check right now because I'm copying over books right now so the SD card isn't in the NT right this second. :(
[Barnes & Noble Nook Tablet] Solar.Plexus:
If you use a microSD-SD or microSD-USB adapter, the first partition will be the only one to mount in Windows. Which is what we want anyway.
[Barnes & Noble Nook Tablet] scgt1:
Yea just gotta find the cyanoboot files now. lol
[Barnes & Noble Nook Tablet] Solar.Plexus:
Attached to this post is the file you need.

Please note that this is for your SD card only. Not for cyanoboot on EMMC.