[ROM][CM7] [v1.3] Size-agnostic SD Card image and CM7 installer for SD Cards.

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
Due to popular demand I have created a size-agnostic SDCard CM7 installer.
Also allows to install unmodified CM7 builds on SD card.

Current version: 1.3

Grab the installer image here:
http://crimea.edu/~green/nook/generic-sdcard-v1.3.img.gz
it's a ~9M image that would unpack into ~130M disk image.

Also note - not all SD cards are created equal. Here is a thread of interest is you have not bought one yet: http://forum.xda-developers.com/showthread.php?p=12964262
Short version: buy Sandisk-branded class 4 microSD cards.

Write the image on your SD card. I tested with 2G, 4G and 8G cards and all worked.
Any uSD card of 1G or bigger in size should work if it is recognized by your nook.
Write on Windows by using WinImage and on Linux/MacOS X by using dd (to the entire device, not one of the partitions. The device name should not have any numbers at the end. The command is something like dd if=/somewhere/generic-sdcard.img of=/dev/sdX bs=1024k)

After done with writing, eject and then re-insert the uSD card into your computer.

Download a CM nightly build from here http://download.cyanogenmod.com/?device=encore (It is recommended to choose -87 nightly or later. If you plan to use prior version for initial install, stick with installer 1.2.1 for a different u-boot version)

Or just use your own update-cm-*-KANG-signed.zip file that is produced if you do your own builds.
The image would correctly detect unmodified CM7 builds and would make necessary adjustments to make them work on SD card.

Put the file to the SD card (there is only one partition). Don't change the name of the file.

unmount the uSD card and insert it into the nook.
Boot from this SD card. It'll boot and will update you on progress.
When it's done, it'll power off.

That's it, you now have CM7 on your SD card.

How to install market and gapps:
After you have booted into the CM7 on SD card for the first time and set up wifi access (important!)
Go to http://wiki.cyanogenmod.com/index.php?title=Latest_Version and at the end there is a table with various google apps versions. Get the one suitable for your cyanogen version (CM7 is the latest for now). The file is named gapps-....zip
shutdown your nook and take the SD card out, insert it into your computer.
Copy the gapps-... file to the SD card on the first partition (titled boot) without changing the file name.
Insert the uSD card back into the NOOK and boot into "Recovery mode" (hold nook N key and then press and hold power until the "Loading..." message appears and then disappears with screen going blank. Release power button, then press it again and hold for ~5 seconds, the bootloader "Loading..." message should be on the screen for three seconds or so before you release power button, keep holding N button until screen blanks again. If the screen went off while you were holding the power key, that means you were holding it for too long).
Alternatively if you do not want to fight the timing, boot normally into Android, then from desktop hold power key until a poweroff menu appears, In the poweroff menu choose "reboot", in the next menu choose "recovery" and press "OK". The nook would reboot straight into recovery.

How to update to a new build:
put the new build you want to try on the first partition. (the name must be update-cm-*.zip or cm_encore_full*.zip or just update-*.zip)
Boot from the SDcard in the recovery mode (see above) and the new snapshot would be installed.
The partition layout would be preserved, filesystems are NOT reformatted, so your data should be safe.

Installing other stuff:
Booting in recovery mode would install all files that are named "update-..." and end with .zip The files would then be deleted! Most of the packages should work, but I only tested a subset and not entire syntax of updater script is implemented. Certainly format and delete are not implemented.

OC Kernel installation instructions:
Starting with v1.2.1 there are no special instructions, install normally as described above.

Partition layout for the SD cards depends on size:
Less than 600M - unsupported.
up to 1G cards gets: system of ~300M and data of the rest of space. No FAT partition
2G cards (more than 1G up to 1800M) gets: 300M system, 612M data, rest is FAT sdcard
more than 2G cards gets: 460M system, 975M data, rest is FAT for sdcard.

How to update if you already installed using older version of the installer and don't want to reinstall (understandably):
  • Get update zip from http://crimea.edu/~green/nook/update-genimage-1.3.zip
  • Put the zip file as is onto the first partition of your sdcard..
  • reboot into recovery (triggered by the keys, the reboot into recovery does not work yet).
  • The new version would be installed and you are done.
  • You can combine this installation together with updating to .32 kernel in one step. Just put the update-cm file and the update-genimage-1.3.zip to the first partition. Make sure there is still at least 1M of space left!

Changes in 1.3
  • Install u-boot.bin and MLO loaders if provided.
  • Fixed a problem that led to overwrite of recovery kernel if a nightly was installed more than once)
  • (only in full image) updated u-boot to ignore BCB as that was a common source of problems. (that's why this version is not recommended for initial install with older nightlies, those don't provide a more correct u-boot for later operations. It's fine to do the update from older installer release, though)

Changes in 1.2.1
  • Really fixed dalingrin kernel packages installation
  • A bit more robust handling of install scripts

Changes in 1.2
  • Updated to new u-boot from B&N 1.2 update
  • Ability to obey BCB in eMMC (allows reboot into recovery from CM7)
  • Hopefully simplified the timing to trigger recovery boots from keyboard
  • Added support for Dalingrin's kernel update packages

The v1.1 version that is known good to work with 2.6.29 kernel releases is located at http://crimea.edu/~green/nook/generic-sdcard-v1.1.img.gz
 
Last edited:

JigSawMan

Member
Sep 28, 2007
34
11
28
This is very cool, thanks! My father bought a nook color after seeing mine, and after hearing what I have been able to get mine to do (thanks to the efforts of all the devs here) he has wanted to play a little more with his. Thanks to you, I have an easy way to set up the SD card and then ship it up to him. I can give him a taste without having to force him to even root his yet. Thanks again!
 
  • Like
Reactions: chad11

12paq

Senior Member
Aug 16, 2010
1,150
364
113
Colorado
www.DonAshcraft.com
Very nice! Thanks.


Care to share the dates and differences between your build and say CM's? or perhaps a link to your builds progress?
I know you have done great work with BT, didn't want to get off topic, but I'm curious.
Thanks again.
 
Last edited:

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
Very nice! Thanks.


Care to share the dates and differences between your build and say CM's? or perhaps a link to your builds progress?
I know you have done great work with BT, didn't want to get off topic, but I'm curious.
Thanks again.
I did not work on BT (other than helping with testing), so I don't claim any credits there.
The difference between standard build and my build so far is only that my build has patched init files to boot from SD right in the zip file. (CM7 checkout as of today ~12pm), it was only created for testing, before I rolled the code that could update vanilla builds to work on SD cards.

You can use unmodified CM7 nightlies with this sdcard image now. The image itself does not contain any CM7 code, you need to copy zip file with it after writing the image to the SD card, but before attempting to boot.
 
  • Like
Reactions: Tschumi and 12paq

atomclock

Senior Member
Apr 22, 2006
62
4
0
First off, this works very well! Thanks!

Now, after getting CM7 running on the sdcard, I plug the device into the usb port on my computer and instruct it to mount the sdcard. But, instead of the sdcard partition being mounted, the emmc partition is mounted.

Was that intentional or is it a bug?

Thanks
 

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
First off, this works very well! Thanks!

Now, after getting CM7 running on the sdcard, I plug the device into the usb port on my computer and instruct it to mount the sdcard. But, instead of the sdcard partition being mounted, the emmc partition is mounted.

Was that intentional or is it a bug?

Thanks
New code in CM7 actually should cause both internal MMC AND sdcard to be mounted.
That is unless you used 1G sdcard, 1G sdcard does not have any mountable free space and then you'd only see emmc content as mountable.
 

atomclock

Senior Member
Apr 22, 2006
62
4
0
New code in CM7 actually should cause both internal MMC AND sdcard to be mounted.
That is unless you used 1G sdcard, 1G sdcard does not have any mountable free space and then you'd only see emmc content as mountable.
I'm using an 8Gb sdcard and I can access both the emmc and sdcard partitions through ADB but only the emmc partition is mounted.

So, I just need to try this with a different nightly build until I find one where the issue is corrected?

Well, I tried it with both cm_encore_full-25 and cm_encore_full-26 and still only the emmc partition is mounted.
 
Last edited:

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
I'm using an 8Gb sdcard and I can access both the emmc and sdcard partitions through ADB but only the emmc partition is mounted.

So, I just need to try this with a different nightly build until I find one where the issue is corrected?

Well, I tried it with both cm_encore_full-25 and cm_encore_full-26 and still only the emmc partition is mounted.
As long as everything is mounted internally I don't think my changes broke anything else, so if there is a bug it's in the CM7 build itself.
I don't actually mount my nook on the computer, so I don't even know how to enable it by default come think of it. ;)
I just know there was an ongoing work in this area to allow simultaneous mounting of multiple volumes and I heard it was already included, though I am not 100% sure about that.
 
  • Like
Reactions: sushigeek

aludal

Senior Member
Aug 17, 2010
315
12
48
Capitola CA
fineoils.blogspot.com
To verygreen:
Well, I'm certainly doing something wrong here:
1. Using Win32DiskImager release 0.2 r23, i burnt my 2 GB with your generic.... .img image.
2. Copied your update.... .zip (on a second attempt an original cm_encore... .zip, plus gapps-GB-20110307-...zip, as installer was asking for it, at least to inflate), now I suspect your "put" is not equal to my "copy".
3. Tried to boot, enjoyed the penguin and boot scroll, but after everything was finished and prepared to "really" boot the boot was executed from my eMMC instead.
 

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
To verygreen:
Well, I'm certainly doing something wrong here:
1. Using Win32DiskImager release 0.2 r23, i burnt my 2 GB with your generic.... .img image.
2. Copied your update.... .zip (on a second attempt an original cm_encore... .zip, plus gapps-GB-20110307-...zip, as installer was asking for it, at least to inflate), now I suspect your "put" is not equal to my "copy".
3. Tried to boot, enjoyed the penguin and boot scroll, but after everything was finished and prepared to "really" boot the boot was executed from my eMMC instead.
Yes, the automatic reboot boots into eMMC for now, I am looking into it.
So just reboot again with the card in.
also, don't put gapps on the card at the first try. This combination does not boot for me into the desktop for some reason that I did not get to the root of. Possibly because it want internet connection setup that still is not if you try it on your first boot.
 

aludal

Senior Member
Aug 17, 2010
315
12
48
Capitola CA
fineoils.blogspot.com
Yes, the automatic reboot boots into eMMC for now, I am looking into it.
So just reboot again with the card in.
also, don't put gapps on the card at the first try. This combination does not boot for me into the desktop for some reason that I did not get to the root of. Possibly because it want internet connection setup that still is not if you try it on your first boot.
Somehow I went into non-booting phase, lol. My guess is after booting into my rooted Eclair with bookmarks-and-other-stuff-to SD I've got me an SD card not really good for "second" boot. Just have no idea what Eclair might do to that EXT4.

Anyways, repeated the experiment, now with pressing Power for >5 sec. Has booted into CyanogenMod 7 without a problem.

Can't do whatever testing: missing GAPPS very mucho! Please, Mr. verygreen, compile it into your image. In any case, I'm not really interested in swapping nightlies on this card -- by the last commits they didn't change much/significantly since n18. Just a static SD image of CM7 n26 + latest (03072011) Gapps will be a very desirable "mod" of yours. In any case you did exactly that (minus Gapps) for n17. Sure, there's a complete procedure of building SD image, but it's obviously much better followed when with a Linux box, and I don't have it.
 

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
0
TN
linuxhacker.ru
Somehow I went into non-booting phase, lol. My guess is after booting into my rooted Eclair with bookmarks-and-other-stuff-to SD I've got me an SD card not really good for "second" boot. Just have no idea what Eclair might do to that EXT4.
Supposedly nothing. I routinely boot into eclair and then insert CM7 sdcard and it's fine.

Can't do whatever testing: missing GAPPS very mucho! Please, Mr. verygreen, compile it into your image. In any case, I'm not really interested in swapping nightlies on this card -- by the last commits they didn't change much/significantly since n18. Just a static SD image of CM7 n26 + latest (03072011) Gapps will be a very desirable "mod" of yours. In any case you did exactly that (minus Gapps) for n17. Sure, there's a complete procedure of building SD image, but it's obviously much better followed when with a Linux box, and I don't have it.
I can't distribute gapps, like I said
Well, until I figure out why recovery boot does not work what you can try to do is this:
after initial install was successful (and you setup your wireless), power off the nook, get the sd card.
Download gapps-gb-...zip and put it on the first partition.
move the uImage file to uImage.bak and uRamdisk to uRamdisk.bak.
Copy uRecImage to uImage and uRecRam to uRamdisk.
boot with the resulting image. It should say that it found the gapps archive and unpack it.
After it flushes caches and reboots, power off, put the sd card back into the computer
move uImage.bak to uImage and uRamdisk.bak to uRamdisk
boot off the card again, hopefully the gapps are working after that.

Please let me know if any problems arise.
 

Modra76

Senior Member
Sep 29, 2010
55
9
0
Michigan
Supposedly nothing. I routinely boot into eclair and then insert CM7 sdcard and it's fine.


I can't distribute gapps, like I said
Well, until I figure out why recovery boot does not work what you can try to do is this:
after initial install was successful (and you setup your wireless), power off the nook, get the sd card.
Download gapps-gb-...zip and put it on the first partition.
move the uImage file to uImage.bak and uRamdisk to uRamdisk.bak.
Copy uRecImage to uImage and uRecRam to uRamdisk.
boot with the resulting image. It should say that it found the gapps archive and unpack it.
After it flushes caches and reboots, power off, put the sd card back into the computer
move uImage.bak to uImage and uRamdisk.bak to uRamdisk
boot off the card again, hopefully the gapps are working after that.

Please let me know if any problems arise.
I just tried following your directions for installing the gapps zip file. After renaming the uImage and the uRamdisk files the nook boots to your recovery with the penguin shows up with the follow:

Populating /dev using udev: done
Initializing random number generator....done
modprobe: chdir (2.6.32.9): No such file or directory
Starting network...
Detected Standard B&N nook layout, emmc first
It appears the SD card is already properly formatted
Skipping format
Mounting /dev/mmcblk1p1 as /boot
Looking for the install images....
Initial Install files not found
Please download it from nook.linuxhacker.ru
and put on first partition of this SD card
the name should start with updatei-cm and end with .zip

Then the cursor just sits. No installation of the .zip file. Do I have to have the original cm zip file on the sd card with the gapp zip file? I thought it was posted that doesn't work.

Also thanks for the great work on this so far.
 
Last edited:

cybertimber2007

Senior Member
Oct 31, 2007
313
69
0
I just tried following your directions for installing the gapps zip file. After renaming the uImage and the uRamdisk files the nook boots to your recovery with the penguin shows up with the follow:

Populating /dev using udev: done
Initializing random number generator....done
modprobe: chdir (2.6.32.9): No such file or directory
Starting network...
Detected Standard B&N nook layout, emmc first
It appears the SD card is already properly formatted
Skipping format
Mounting /dev/mmcblk1p1 as /boot
Looking for the install images....
Initial Install files not found
Please download it from nook.linuxhacker.ru
and put on first partition of this SD card
the name should start with updatei-cm and end with .zip

Then the cursor just sits. No installation of the .zip file. Do I have to have the original cm zip file on the sd card with the gapp zip file? I thought it was posted that doesn't work.

Also thanks for the great work on this so far.
Seeing the same. Also tried naming the gapps file "update.zip", to no avail.