yashsingh1/xdaforums huggingface dataset:
[Nook Color Android Development] j4mm3r:
Brian, the poor boot loader has no idea what so ever what /system and /data are. Its job is very simple, get the kernel from the boot device, get the ramdisk from the boot device and let them go!

Infact what you want is actually very easy to achieve, the proper way to do it is via init.

Here is the boot sequence for Android for nook color:

x-loader: the MLO file which loads the second stage loader u-boot

u-boot: loads the kernel and initial ramdisk

kernel: Now the OS actually starts, it uses the ramdisk as a starting root file system and locates the init executable.

init: reads the file init.rc / init.<board>.rc etc and is hence responsible for bringing up the rest of the android system.

Hence the proper place for deciding what to put in /system is in init.rc.

yaffs2 or anyother fs is handled by the kernel so again, the poor u-boot.bin can't do anything about it.

one of the easiest way that I can think of is to have ext3/ext4 images on the SD and have init.rc mount them as loop devices on /system or /data etc.
[Nook Color Android Development] John Kotches:
j4:

Thanks for the breakdown. Pretty simple once someone else spells it out for you ;)

Moar gees with gginggerbread and tapatalk!
[Nook Color Android Development] ganovim:
Great Job. Thanks

Is there a way to increase the font size for us older folks?
[Nook Color Android Development] j4mm3r:
Yes ofcourse there is. My implementation relies on a rudimentary LCD console implementation which was already present in the u-boot sources, the font size 16x8 is what is implemented.

I cannot promise anything, but if I get the time, then I can take a shot at interpolating what we have and make them bigger.
[Nook Color Android Development] j4mm3r:
Hi Folks, just updated the OP with a new version. Now the orientation is changed to Portrait and the key mappings are changed to suite that mode more.
[Nook Color Android Development] Hextall:
Just installed... and it looks great. Great job.
[Nook Color Android Development] waylo:
Apologies for a newbie question (I searched, I promise you).

How do I access the eMMC u-boot.bin to replace it? Or to make a backup?

The thread quoted in the first post, as the installation instructions, is not particularly revealing:

"2. If you do not plan to use a bootable sd card, replace the u-boot.bin on 1st partition of the eMMC. Again remember to make a backup."

Yes, I know it needs to be replaced. How? :P
[Nook Color Android Development] j4mm3r:
Well, since the boot partition isn't normally mounted, you can just mount it from shell.

(obtain shell)
adb shell

# mount -t vfat -o shortname=mixed /dev/block/mmcblk0p1 /data/local/tmp

After this /data/local/tmp is your eMMC boot partition so you can copy the u-boot.bin over and replace the default one.
[Nook Color Android Development] waylo:
Thanks! I figured it would involved adb and mounting somehow!
[Nook Color Android Development] racks11479:
Hi j4mm3r,

Mind if I include your boot menu in my thread?

http://xdaforums.com/showthread.php?t=998861

-Racks
[Nook Color Android Development] j4mm3r:
Ofcourse I wouldn't mind... I said it myself:
[Nook Color Android Development] racks11479:
Awesome. Thanks j4mm3r!!!
[Nook Color Android Development] ADude:
[EDITED to insert answer for other readers]

If one is running CM7 off eMMC, is there any way to make it mount "/sdcard" as the fourth partition of the physical sd card?

So we can keep sd card bootable CM7 in the NC, and have both eMMC CM7 and sd card CM7 share the same "/sdcard" folder (of books,music,documents, etc.).

I imagine it involves mount, /dev/blk/mmcblk1p4, and sdcard, but I am not sure of the necessary options in the command (if any) and more importantly, where to put it in the eMMC in order to have it run each time the eMMC boots.

UPDATE: I received this answer from verygreen, which, of course, is the same thing that we do to use that 4th partition in the SD card build itself:
[Nook Color Android Development] JeremeyN:
Is there a way to dual boot to un-rooted stock and CM7 Rc4... I am afraid if I mess with the u-boot.bin I will be unable to update to the nightlies as to update them you have to hold don the the "N" and Power button for about 5-6 seconds.I would assume if I use the u-boot.bin file for nookie froyo or HC4 it would mess up the CM7 update process? Any ideas? Or am I going to have to Backup the Cm7 u-boot.bin and restore it when ever I need to update cm7?
[Nook Color Android Development] ganovim:
How do you get the double size fonts? (larger text in boot menu)

Thanks
[Nook Color Android Development] phunzoid:
Default boot not working....

I have stock NC OS on the eMMC and CM7 on a SD card…i installed the u-boot.bin file on the SD card, and the Dual-boot Menu comes up and works fine for selecting either OS, but I would like to change the default boot to be the stock OS on eMMC, so i created a u-boot.device file with the code exactly as shown in OP

# echo -n "1" > /media/SDCARD/u-boot.device

but after the Menu countdown, "Now booting...." comes up on the screen, but then just hangs there....neither OS gets loaded...what could i be doing wrong?
[Nook Color Android Development] j4mm3r:
Sorry guys, been AFK for a while...

u-boot.bin doesn't affect the CM7 installation in any way. Unless of course you want the recent change by fattire which changes the video memory to fix the screenshot issue. Typically the same u-boot.bin can boot into any ROM version.

For that one has to modify the source code and recompile a new binary. I implemented the capability but chose to use the default size because the large size was kind of ugly.

Hmm... that's very strange. I have a similar setup where I have CM7 on eMMC and CWR on the SD card. Since I have "1" in the u-boot.device on SD card and my version of u-boot.bin on the SD card, it boots into eMMC if I don't touch any key.

Can you check the size of the u-boot.device file as given by "ls -l"? It should be exactly 1.

Sorry for not being able to help you more but have you tried the other way around? I mean put in a "0" in the u-boot.device to make it boot from SD by default and see if that works? (I just did and it worked for me)

If it does then it might indicate some sort of incompatibility with the stock kernel with my version of u-boot.bin... oh wait you said that you can boot into stock by selecting from the boot options... right?
[Nook Color Android Development] phunzoid:
yes, if i select from the Menu options, i can get both OSs to load...it's just the default boot (without pushing any keys) that isn't working

i tried with "0" instead of "1", and same result, it just hangs at "Booting, please wait..."

to be clear, the code is: # echo -n "1" > /media/SDCARD/u-boot.device

including the #, right?

also, FWIW, i have been able to change the default boot with rookie1's u-boot.bin and the "u-boot.order" file...so stumped why yours doesn't work for me :confused:
[Nook Color Android Development] jtbnet:
I believe you want to leave out the '#' as that would be a 'comment out this line' directive to a shell...
[Nook Color Android Development] phunzoid:
yeah, i thought the "#" might not be necessary, so i tried it without it also, but same result...but good to know that i shouldn't include in any future attempts
[Nook Color Android Development] j4mm3r:
Did you check the size of the u-boot.device file?

Can you try the command from the device itself? I mean either use a terminal app or obtain a shell using adb. The command is the same. And please do check the size of the file... it should be 1 byte.

Check the contents of the file after you create it. "cat u-boot.device", you should be able to see if either "1" or "0" is in it.
[Nook Color Android Development] bigbob23:
I really like the dual-boot feature and use it with stock on the eMMC and CM7 on the SD card. When I boot into stock Nook on the eMMC, under My Files -> Memory Card it sees the boot partition of the SD card, which doesn't have much available space. Is there any way to get it to see the virtual SD card partition, which is much larger?
[Nook Color Android Development] racks11479:
Is your stock rooted? If so you can always use root explorer to edit the vold.fstab file. Change auto to 4 in the sdcard mount line.

If not rooted you should also be able to use adb in CWM and pull edit And push the file back
[Nook Color Android Development] :
Hey j4mm3r,

Thanks for your work on this tool. It's saved me a lot of time recently. I'd love to be able to continue to use this to flash the roms and kernels Dalingrin is working on.

It looks like rookie1 has updated the u-boot.bin file and posted in his thread:

http://xdaforums.com/showthread.php?t=947698

I'm not at home right now to look through your files, but it looks to me like we should be able to use the same file to make your scripts compatible with Dalingrin's latest beta.

Any thoughts?
[Nook Color Android Development] victle:
Nope, rookie's new u-boot.bin doesn't work with SD special image. Tried several times and always run into recovery.
[Nook Color Android Development] AidenM:
Hey, I made a zip you can flash from CWM. Download here:

I tested it :)

http://www.mediafire.com/file/9ivs7dr59zz5ts2/nookbootmenucwm.zip
[Nook Color Android Development] victle:
What's this u-boot? Is this 1.1 or 1.2 compatible? Why do you flash it to EMMC? We need a SD 1.2 compatible u-boot.

Thanks!!
[Nook Color Android Development] AidenM:
Flash it to EMMC so when you boot it you get the options... Do I want to boot the sd the emmc, or throw the nook at the wall?

I like my stuff on the emmc.

besides, I don't know how to make a script for the sd.
[Nook Color Android Development] angomy:
... that doesn't help the issue which is that we need an updated 1.2 u-boot file for our SD card installs ? I'm glad you prefer running CM7 from emmc but I'd rather run it from SD to maintain my warranty, not to mention the fact that I like having 1.2 stock on nook for the better reader.

Neither this nor Nookie1's is working for the nightlies. Had to revert back to 7.0.3 stable and 0.2 nookie1 multiboot.

Edit: Arggh. This (j4mm3r's) works for nightlies /smackself on VG agnostic SD install. Nookie1's updated (1.2 u-boot.bin file) doesn't -- endlessly boots into recovery, at least it has the 3x I tried updating to latest nightly build. My brain is not working today.
[Nook Color Android Development] bigbob23:
I installed a nightly yesterday (70) and it installed and works using j4mm3r's menu.
[Nook Color Android Development] angomy:
Which SD install are you using? Verygreen's or doing it via Rack's method?
[Nook Color Android Development] :
Nightly, yes. Dalingrin's latest .32, probably no.
[Nook Color Android Development] AidenM:
@angomy, I'll look into the sd script
[Nook Color Android Development] j4mm3r:
Hi Everyone,

Sorry but I've been without my main computer for a while and looks like it'll be like that for some more weeks. I'll try to set something up on my traveling laptop to see if the 1.2 version can be updated with the boot-menu.

Thanks
[Nook Color Android Development] kufor:
j4mm3r, your work will be highly appreciated ;)

we all want to try new .32 kernel running from uSD cards ...

thx
[Nook Color Android Development] dweezilz:
Yes, thanks j4mm3r!! I'm on the beta build now so I'm using rookie1's multi-boot but I still prefer having your menu boot. Can't wait for you to update it!! Thanks again for your work.
[Nook Color Android Development] fattire:
Hey I had a chance to play with this and posted a test incorporating j4mm3r's amazing (and amazingly clean!) code.

Not knowing exactly which forum to post in, I posted the features and stuff on the cm7 developer thread.

Please post responses there as I probably won't check here too much. Try at your own risk. (Have a back up, bootable SD card and a replacement u-boot.bin in case things go terribly, terribly wrong.)
[Nook Color Android Development] fuzzynco:
Understanding options...

If I boot (physically) from SD card, can I use the device file to

default to emmc/normal if no key is pressed, while using the actual

boot menu to boot to SD/normal?

Ideally, I'd like the SD card recovery to be a modified for SD partitioning,

(p2 is /system (ext2), p3 is /data (ext3), p4 is /sdcard (FAT32))

CWR 3.0.2.8.

I'm running Nookie Froyo 0.6.8 SD card version. The SD card recovery

should be for the SD card OS, the emmc recovery should be for be

for the emmc OS.

This tool would let the SD card uBoot.bin actually boot any of the 4

OS versions.

Still looking for a modified for SD card partitioning ROM manager

and CWR 3.0.2.8. If anyone has seen one, could you please

post the link??

Thanks
[Nook Color Android Development] fattire:
New version here. Had some people test with SD and they say it works...
[Nook Color Android Development] bigbob23:
j4mm3r's dual boot menu works fine with kernel 2.6.32 beta on a SD card.
[Nook Color Android Development] fattire:
And a newer, improveder one is here. Someone posted a recovery update.zip version a few posts under it.
[Nook Color Android Development] TDO:
Any luck with finding one?
[Nook Color Android Development] fuzzynco:
no, not as yet. Still hopeing with so many people using SD card based ROMs,

the Dev Team for ROM Manager & CWR for NC will make an official release

with the needed mods for SD card partitioning and residence.
[Nook Color Android Development] TDO:
That's a shame.

Unfortunately I have at the moment no running Unix system.

It's only 1 file which has to be modified.

/etc/recovery.fstab
[Nook Color Android Development] fuzzynco:
How to fix it...

I use gparted from a bootable flash.

Its a mostly complete Linux style os.

Can you tell me the proper shell commands

to mount the uRecRam image on a loop device?

it would be /etc/recovery.fstab on

uRecRam?

That tells CWR where /boot /system /data and /sdcard

are, right? I'm using Nookie Froyo from SD so I have

vfat, ext2, ext3, vfat.

Wouldn't the ROM Manager app have to be patched or

rebuilt to be SD card aware (targeted)?

The current ROM Manager from Market targets eMMC

not the SD card bootable ROM. Where it places

the uRec files and what partitions are targeted

for /boot, /system, /data and /sdcard

Thanks
[Nook Color Android Development] TDO:
I have no clue why you want a new rom manager.

Just take the newest cwm für the nook. You can find it here: http://xdaforums.com/showthread.php?t=987735

And here is a tutorial how to modify a uRamdisk: http://www.denx.de/wiki/DULG/HowToAddFiles

Replace the recovery.fstab with a proper one.

E.g. that is the layout that is normally used for SDs.

/boot	vfat	/dev/block/mmcblk1p1

/system	ext4	/dev/block/mmcblk1p2	NULL	ext3

/data	ext4	/dev/block/mmcblk1p3	NULL	ext3

/cache	ext4	/dev/block/mmcblk0p7	NULL	ext3

/emmc	vfat	/dev/block/mmcblk1p4

/sdcard	vfat	/dev/block/mmcblk1p4	/dev/block/mmcblk1

/sd-ext	ext4	/dev/block/mmcblk1p4	NULL	ext3
[Nook Color Android Development] fuzzynco:
Nookie Froyo SD card CWR 3.0.2.8 /etc/recovery.fstab

OK -- I should just boot a SD bootable modded CWR 3.0.2.8

and then mount my Nookie Froyo SD Card for it to operate

on? Where would the zip files to be applied go, in NF's /sdcard

(p4) partition?

I followed the unix steps in the tutorial,

but I'm unsure about recovery.fstab's

syntax, it looks different then BSD's

/etc/fstab.

name[tab]fstype[tab]devpath[tab], I follow.

the last 2 NULL[tab]fstype I'm guessing

is an alternate file system type for the devpath

if it isn't field 2's type?

So for Nookie Froyo (0.6.8) I would use:

/boot vfat /dev/block/mmcblk1p1

/system ext2 /dev/block/mmcblk1p2

/data ext3 /dev/block/mmcblk1p3

/sdcard vfat /dev/block/mmcblk1p4

/cache ext4 /dev/block/mmcblk0p7

/emmc vfat /dev/block/mmcblk1p4

/sd-ext ext4 /dev/block/mmcblk1p4 NULL ext3 :confused:

Is that right?

Oh, where do I get the mkimage binary for an x86 Linux?

Or should I expect to be either in file system tools or

busybox?

Thanks
[Nook Color Android Development] only one haze:
how do u go about creating uAltImage and uAltRam? I am running CM7/stock 1.2 dual boot and this boot Image has been implemented into the nightlies. and now i cannot get into the stock partition. thanks for the help.
[Nook Color Android Development] fattire:
You can use any uImage/uRecImg-- just rename to uAltImg. Or if you're building your own kernel, just take the uImage out of arch/arm/boot and rename it to uAltImg

Similarly, you can rename any uRamdisk/uRecRam to uAltRam, or pack your own ramdisk and call it uAltRam.

As an example-- copy uRecImg to uAltImg and then copy uRecRam to uAltRam and you should now have two copies of your recovery that you can trigger via power-menu (regular) or vol+/vol- (alternate).

Hope this helps.

Also-- the menu/enhanced version of u-boot is not yet in the nightlies.
[Nook Color Android Development] only one haze:
where can I find these? I'm not building my own kernel, or booting from SD at all. just have CM7 on the main partition and stock1.2 on the dual boot partition and need to know how to have a uAltImg and uAltRam. I have used root explorer to search for uRecRam and uImage but cannot find anything. thanks for the help and understanding.
[Nook Color Android Development] fattire:
These files are in the first partition of your booting device (either SD or eMMC).

Normally you can't view, them, but you can mount them to make changes with the following command (either from adb or after typing "su" in the Terminal Emulator app):

first, make a mount point:

mkdir /data/boot

Then, mount partition 1 of your emmc (in this example) to that mount point.

mount /dev/block/mmcblk0p1 /data/boot

Note thats mmcbLOWERCASE-LkZEROpONE

now you can access the files...

ls -la /data/boot/

If you want to, say, copy your recovery to your alternate boot, do something like this:

cd /data/boot/
cp uRecImg uAltImg
cp uRecRam uAltRam

These are the files your device boots from, so be careful when you're playing with files in there! When you're done messing around and potentially screwing up everything forever, typing "reboot" will... well, reboot.

Hope this helps. Try at 100% your own risk. Don't blame me for problems, etc.
[Nook Color Android Development] only one haze:
thanks for that! getting me started. I cp'd the u-boot.altimg to uAltImg but cyan uboot still just sits there after saying booting into alternate. y would that not work? again, thanks for the help
[Nook Color Android Development] fattire:
You copied the wrong file. u-boot.bin (I assume that's what you meant) is not a kernel, it's a pre-kernel bootloader. The alternate boot mode requires two new files-- a kernel and a ramdisk named uAltImg and uAltRam respectively. You have two kernels in /boot currently. uImage is a kernel. So is uRecImg. You also have two ramdisks there already. uRamdisk and uRecRam. The first pair (uImage/uRamdisk) are for your regular boot, and the second pair (uRecImg/uRecRam) are for your recovery boot (clockworkmod, probably).
[Nook Color Android Development] hazridi:
hey fattire, is the source for your uboot lying around anywhere?
[Nook Color Android Development] fattire:
Yup, it's here. I should have one more small change to functionality to add today so look for that...

Here it is:

u-boot.bin (cyan plus one)

Description here.
[Nook Color Android Development] sdhotwn:
Reading through the thread and not being completely up to speed on everything for the NC I am trying to figure out one thing. Will this boot menu allow for boot selection between custom ROM on the SD and a bone stock/unrooted internal memory? Essentially just make it so you don't have to pop the SD in and out when you want to switch?
[Nook Color Android Development] :
Cool beans. Could you update your kernel so I can use the same wifi drivers as dal's 6/09 kernel? In other words can you (or someone with a rig) make a new kernel that can be used as uAltImg?

EDIT: Sorry, thought I was in your WIP usb host enabled driver...but question still applies :)
[Nook Color Android Development] fattire:
I think dal is planning on doing just that-- as you can tell, right now they use different drivers, so if you wanted to use his OC as uAltImg, you'd need to change the ramdisk's init.encore.rc on uAltRam so that it loads the wifi module from another directory.
[Nook Color Android Development] racks11479:
How is the "tiwlan_drv.ko" module loaded? I don't see a call for it in init.encore.rc anywhere.

Thanks,

Racks
[Nook Color Android Development] fattire:
It's loaded automatically I believe from /system/lib/modules/

You can manually load it with

# modprobe tiwlan_drv

or

#insmod /system/lib/modules/tiwlan_drv.ko

I can't remember which of those works but play around :)
[Nook Color Android Development] For_the_moves:
Anyone having issue when letting the Nook boot on its own, meaning not pressing anything and letting to countdown finish? I have it setup to boot to eMMC when nothing is pressed but it simply freezes once the choice countdown is over.
[Nook Color Android Development] DeanGibson:
User-defined menus added to U-Boot (BETA)

I have taken v0.4 and added a user-configurable boot menu via a companion file, u-boot.conf:

CWR install: http://www.mailpen.com/download/menuBoot-v0.5.zip

Source changes to v0.4: http://www.mailpen.com/download/menuBoot-v0.5-src.zip

u-boot.conf goes in the boot partition along with u-boot.bin, and has the following format:

Each line consists of tokens, separated by one or more of the following delimiters: "=:, \t"

Comment lines beginning with "#" and blank lines are allowed.

A line of the form "Delay: <boot-delay>" specifies the number of seconds to wait for a user button press, before booting the default system.

A line of the form "Default: <system-name>" is the user-assigned name of the default system to boot.

A line of the form "Boot: <system-name> <emmc> <kernel-image-filename> <ramdisk-filename> <user-label>" specifies one of the boot choices (see below).

<system-name> is any convenient user-assigned name (no embedded spaces) for the line. Used by the "Default:" parameter.

<emmc> is "0" for the internal, base flash memory, and "1" for an auxiliary, optional user-installed flash memory (typically an SDcard).

<user-label> is a user-assigned label that appears in the boot menu.

Here is the (working) sample u-boot.conf file included in the install:

# Das U-Boot menu options:

# Seconds
Delay: 10

# Name
Default: Primary

# Name EEMC Kernel RamDisk Label
Boot: Primary 0 uImage uRamdisk Primary Android system
Boot: Alternate 0 uAltImg uAltRam Alternate Android system
Boot: Recovery 0 uRecImg uRecRam Clockwork Recovery

So, after downloading the CWR install, you may want to edit the "u-boot.conf" file to your liking. Remember to preserve directories when unzipping and rezipping the .ZIP file.

I have not tested the support for the SDcard (eg, <emmc> of "1", or when booting from an SDcard).
[Nook Color Android Development] DeanGibson:
Minor oops!

In the original menuBoot-v0.5.zip install file above, the install script was created from another install package. While the install script in menuBoot-v0.5.zip executed correctly, it erroneously displayed during installation, the start-up message "Replicate primary partition set to alternate".

This has been fixed as of 2011-06-28 @ 00:10 UTC. Since the installed u-boot.bin did not change, I did not change the version number.

Key de-bounce and doubling prevention delay has been added to the next (pending) release ...

Comments/suggestions welcome!
[Nook Color Android Development] fattire:
Hey this is very cool... but why not use as a base the multiboot u-boot based on 1.2 which I've been modifying? It's got all of j3mm4r's enhancements to date + based off the BN 1.2 u-boot source + has an enhanced menu + fixes to the palette to support full color splashes + button-hold feedback + u-boot.altboot support (with u-boot.device moved) in /rom... it's shipping with CM7 now.

I also integrated u-boot.device and u-boot.altboot support into Dalingrin's Nook Tweaks app.

Source is here (note "menu" branch). Would love to get your patches (send pull request to verygreen), and I'm sure Dalingrin would appreciate any associated changes to his app that make it easy for users to use as well!