[NST][CWR][RC2] Clockworkmod based Recovery - fixed backup issue

Search This thread

mali100

Senior Member
Jun 3, 2007
209
140
hv5duw.png

DISCLAMER and WARNING:
  • I'm not responsible for bricked devices, dead SD cards, lost data. Make a backup before you try anything described here!
  • Making a backup with CWM only includes the following partitions: boot, system, data, cache. It doesn't include the /rom partition which contains data thats unique for every device. Use this backup method to make a full device backup.
  • Please do not use the restore backup function to restore backups made with versions prior and including RC1. They are faulty and restoring them damages an important bootfile of your nook. It isn't important with which version you restore, if the backup was made with Beta1, Beta2 or RC1 it will fail! Please read http://xdaforums.com/showpost.php?p=19945955&postcount=37


Changelog:
  • RC2
    • changed mount options of the boot partition (fixes the bad backup issue)
    • updated sources to the newest ones from CM
    • some internal changes for the screen refresh
  • RC1
    • reboot recovery in the advanced menu is now working
    • boot to recovery is now a bit faster
    • switched to automated build environment
    • moved some files to the appropriate place
  • Beta2
    Added page refresh after pushing back or select buttons, to get rid off the ghosting. Still not perfect, but good enough for a recovery.
  • Beta1
    First release

Hi,
after some trying and hacking I was able to build a working Clockworkmod based recovery for the Nook Simple Touch.
It is still a beta-version, but everything I tested (backup, restore, mount USB, install zip) works.

If you want to try it, just write one of the imgs from the sd_xx_clockwork-....zip to a SD card with at least the capacity mentioned in the filename. Put the card in your N2E and reboot. Do not write these images directly to the Nook, it will brick your device permanetly!

To replace the standard recovery of the N2E, copy also the install_cwm_recovery_xx.zip to the sdcard, boot into CWM and use the install zip from sdcard option to install it (it just replaces uRecRam and URecImg in the /boot partition, so you can also do it manually, if you want).
There is really no need to install CWM on the device as long as you aren't developing and need it constantly. Please keep in mind that replacing the stock recovery will remove the restore function, that can be triggered by pressing the two lower buttons (or by eight failed boots). Restoring the stock recovery with install_stock_1.1_recovery.zip will bring back this function.

How to boot into recovery:
  • Power down the N2E
  • Press the power button for ca. 3 seconds, so that the device boots (you don't have to hold the power button after the 3 seconds)
  • As soon as the display changes to the "read forever" screen , push and hold the lower left and the lower right button until the screen changes again
  • Wait until you see the recovery

If you want the standard recovery back, use the install_stock_1.1_recovery.zip (See next post).


Button layout:
  • Both Buttons on the left: BACK
  • Upper button on the right: UP
  • Lower button on the right: DOWN
  • n button: SELECT
  • Power button: TOGGLE DISPLAY

Known bugs:
  • after restoring the boot partition, most of the times the recovery ends in an unresponsive state. The nook has to be rebooted by holding the power button. This is not affecting the restore!
  • "reboot system now" doesn't work always (sometimes you have to power cycle), experienced it only when booting from SD
  • Reboot to recovery by using adb reboot recovery doesn't work. (needs a new adbd binary in the uRamdisk)

DISCLAMER and WARNING: I'm not responsible for bricked devices, dead SD cards, lost data. Make a backup before you try anything described here!


Credits go to:
 

Attachments

  • install_cwm_recovery_rc2.zip
    4 MB · Views: 19,775
  • sd_2gb_clockwork-rc2.zip
    5.8 MB · Views: 42,549
  • sd_128mb_clockwork-rc2.zip
    7.6 MB · Views: 48,714
Last edited:

mali100

Senior Member
Jun 3, 2007
209
140
Useful update.zip's

rom_backup.zip
Makes a backup of all the files that are on the /rom partition. Saves it to the SD-card /backup/rom_backup.tgz.
This partition contains some important data, that is unique for every device (serial, MAC, ...).

install_stock_1.1_recovery.zip
Installs the recovery from the stock 1.1 update.

MinimalTouch
Automatic Rooting + Gapps by eded333


install_remount_commands.zip
Adds the commands systemrw (remount /system rewritable) and systemro (remount /system readonly).

If you have useful update.zip's that should be included here, please let me know.
 

Attachments

  • rom_backup.zip
    154.7 KB · Views: 2,743
  • install_stock_1.1_recovery.zip
    3.3 MB · Views: 4,727
  • install_remount_commands.zip
    155.5 KB · Views: 1,487
Last edited:

ros87

Senior Member
Oct 12, 2010
312
164
Bodø
Great work

I see you listed "install zip" as one of the features tested, does that mean we can create update.zip's and run them trough cwm?
 

mali100

Senior Member
Jun 3, 2007
209
140
I see you listed "install zip" as one of the features tested, does that mean we can create update.zip's and run them trough cwm?
Yes, you can create update.zip's and run them trough cwm, install zip works fine. That should make some of the rooting guides and changes of the framework easier.
 

ros87

Senior Member
Oct 12, 2010
312
164
Bodø
Yes, you can create update.zip's and run them trough cwm, install zip works fine. That should make some of the rooting guides and changes of the framework easier.

It sure would!

I noticed that regular update zips use "update-script" while the B&N files use "updater-script", do both work?
 

mali100

Senior Member
Jun 3, 2007
209
140
I noticed that regular update zips use "update-script" while the B&N files use "updater-script", do both work?
I think update-script is the old, no longer supported file-format. As far as I know CWM (since version 3) only supports updater-script with an updater-binary (that interprets the script). I only tested the latter.
 

user4242

Member
May 9, 2010
32
1
make it fully working without ghosting and we have the base for custom roms, this is simply great. :)
 

tebra

Senior Member
Dec 8, 2010
455
91
very good news.
I hope, a step closer to CyanogenMod or other custom Rom...
 

eded333

Senior Member
Apr 25, 2011
342
216
Thanks for taking the time into making this tool available for the NST, this opens the possibilities even more for our ereader :)
 

ros87

Senior Member
Oct 12, 2010
312
164
Bodø
Would it be possible to resize the image to fit in a smaller uSD?

Yes that should be possible, I almost fell of my chair when uncompressing the archive :D
I'm guessing he just smacked the files onto his 2GB card and made an image of it ;)

But yes it's a problem beyond SD cards, I have my Ubuntu VM on a SSD with limited space so 2GB is not a small issue for me ;)

With that said, there's a limit as to how small a fat32 partition can be, but 64MB is doable.
 
Last edited:

mali100

Senior Member
Jun 3, 2007
209
140
make it fully working without ghosting and we have the base for custom roms, this is simply great. :)
I don't think a recovery is a good base for a custom rom. If you want to build one, use the update to 1.1 as base, you should be able to install it with this recovery.

Would it be possible to resize the image to fit in a smaller uSD?
Yes it is, I made it that big because I wanted some space for the backups. I will add an 128MB version tomorrow, when i upload a new beta with less ghosting.

I'm guessing he just smacked the files onto his 2GB card and made an image of it ;)
I haven't µSD-cards that small ;)
 

FletchF

Senior Member
Aug 15, 2010
229
25
Very cool! Do you expect to submit this upstream and have it supported in ROM Manager?
 

mali100

Senior Member
Jun 3, 2007
209
140
Do you expect to submit this upstream and have it supported in ROM Manager?
Once it's stable and well tested, yes.

By the way, does someone know how the reboot to recovery from a running system works on other devices? Does this work on the Nook Color?
"adb reboot recovery" and "reboot to recovery" from CWM just cause a normal reboot to android.
 

ros87

Senior Member
Oct 12, 2010
312
164
Bodø
Once it's stable and well tested, yes.

By the way, does someone know how the reboot to recovery from a running system works on other devices? Does this work on the Nook Color?
"adb reboot recovery" and "reboot to recovery" from CWM just cause a normal reboot to android.

There's some trickery going on in u-boot:
When BootCnt is >= 8:

Code:
"checkbootcount=\
 if fatload mmc ${mmcromdev}:2 0x81c00000 devconf/BootCnt 4; then\
  calc.l *0x81c00000 + 1 0x81c00000;\
  if itest.l *0x81c00000 < 0; then\
   echo Bad Boot count (Fixed);\
   mw.l 0x81c00000 0 1;\
   fatsave mmc ${mmcromdev}:2 0x81c00000 devconf/BootCnt 4;\
  fi;\
  if itest.l *0x81c00000 > 7; then\ 
   echo Boot count exceeded;\
   echo Forced to boot into recovery mode for Factory Fallback; \
   mw.b 0x81c00000 0 0x200;\
   cp.s \"boot-recovery\" 0x81c00000 0xd;\
   cp.s \"recovery --restore=factory --update_package=MISC:factory.zip\" 0x81c00040 0x3d;\
   mw.b 0x81c00048 0xa 1; mw.b 0x81c0005a 0xa 1;\
   fatsave mmc ${mmcromdev}:2 0x81c00000 BCB 0x200;\
   mw.l 0x81c00000 0 1;\
   fatsave mmc ${mmcromdev}:2 0x81c00000 devconf/BootCnt 4;\
  else\
   echo Boot count OK;\
  fi;\
fi" \
 

FletchF

Senior Member
Aug 15, 2010
229
25
Once it's stable and well tested, yes.

By the way, does someone know how the reboot to recovery from a running system works on other devices? Does this work on the Nook Color?
"adb reboot recovery" and "reboot to recovery" from CWM just cause a normal reboot to android.

On the NC running CM7:

Boot to Recovery from Rom Manager - works
Boot to Recovery from CM power menu - works
reboot recovery from adb - works

Reboot to Recovery from CWM - boots to CM
 

mali100

Senior Member
Jun 3, 2007
209
140
There's some trickery going on in u-boot:
When BootCnt is >= 8:
Thats not what i meant. Other android devices allow it to boot from a running system directly into the recovery and I would like to know what function or switch is used for this. Or do you think they just set the boot-counter to 8?
 

ros87

Senior Member
Oct 12, 2010
312
164
Bodø
Thats not what i meant. Other android devices allow it to boot from a running system directly into the recovery and I would like to know what function or switch is used for this. Or do you think they just set the boot-counter to 8?

No, but the recovery is almost certainly not called directly.

What other devices are doing I cannot say, but on the NST you write your intentions to BCB and then reboot methinks :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 38
    hv5duw.png

    DISCLAMER and WARNING:
    • I'm not responsible for bricked devices, dead SD cards, lost data. Make a backup before you try anything described here!
    • Making a backup with CWM only includes the following partitions: boot, system, data, cache. It doesn't include the /rom partition which contains data thats unique for every device. Use this backup method to make a full device backup.
    • Please do not use the restore backup function to restore backups made with versions prior and including RC1. They are faulty and restoring them damages an important bootfile of your nook. It isn't important with which version you restore, if the backup was made with Beta1, Beta2 or RC1 it will fail! Please read http://xdaforums.com/showpost.php?p=19945955&postcount=37


    Changelog:
    • RC2
      • changed mount options of the boot partition (fixes the bad backup issue)
      • updated sources to the newest ones from CM
      • some internal changes for the screen refresh
    • RC1
      • reboot recovery in the advanced menu is now working
      • boot to recovery is now a bit faster
      • switched to automated build environment
      • moved some files to the appropriate place
    • Beta2
      Added page refresh after pushing back or select buttons, to get rid off the ghosting. Still not perfect, but good enough for a recovery.
    • Beta1
      First release

    Hi,
    after some trying and hacking I was able to build a working Clockworkmod based recovery for the Nook Simple Touch.
    It is still a beta-version, but everything I tested (backup, restore, mount USB, install zip) works.

    If you want to try it, just write one of the imgs from the sd_xx_clockwork-....zip to a SD card with at least the capacity mentioned in the filename. Put the card in your N2E and reboot. Do not write these images directly to the Nook, it will brick your device permanetly!

    To replace the standard recovery of the N2E, copy also the install_cwm_recovery_xx.zip to the sdcard, boot into CWM and use the install zip from sdcard option to install it (it just replaces uRecRam and URecImg in the /boot partition, so you can also do it manually, if you want).
    There is really no need to install CWM on the device as long as you aren't developing and need it constantly. Please keep in mind that replacing the stock recovery will remove the restore function, that can be triggered by pressing the two lower buttons (or by eight failed boots). Restoring the stock recovery with install_stock_1.1_recovery.zip will bring back this function.

    How to boot into recovery:
    • Power down the N2E
    • Press the power button for ca. 3 seconds, so that the device boots (you don't have to hold the power button after the 3 seconds)
    • As soon as the display changes to the "read forever" screen , push and hold the lower left and the lower right button until the screen changes again
    • Wait until you see the recovery

    If you want the standard recovery back, use the install_stock_1.1_recovery.zip (See next post).


    Button layout:
    • Both Buttons on the left: BACK
    • Upper button on the right: UP
    • Lower button on the right: DOWN
    • n button: SELECT
    • Power button: TOGGLE DISPLAY

    Known bugs:
    • after restoring the boot partition, most of the times the recovery ends in an unresponsive state. The nook has to be rebooted by holding the power button. This is not affecting the restore!
    • "reboot system now" doesn't work always (sometimes you have to power cycle), experienced it only when booting from SD
    • Reboot to recovery by using adb reboot recovery doesn't work. (needs a new adbd binary in the uRamdisk)

    DISCLAMER and WARNING: I'm not responsible for bricked devices, dead SD cards, lost data. Make a backup before you try anything described here!


    Credits go to:
    10
    Useful update.zip's

    rom_backup.zip
    Makes a backup of all the files that are on the /rom partition. Saves it to the SD-card /backup/rom_backup.tgz.
    This partition contains some important data, that is unique for every device (serial, MAC, ...).

    install_stock_1.1_recovery.zip
    Installs the recovery from the stock 1.1 update.

    MinimalTouch
    Automatic Rooting + Gapps by eded333


    install_remount_commands.zip
    Adds the commands systemrw (remount /system rewritable) and systemro (remount /system readonly).

    If you have useful update.zip's that should be included here, please let me know.
    2
    New version is online!

    I managed to get the recovery build by the CM-Buildenv, which means a step closer to going upstream.

    Rebooting to recovery on the NC is done by writing the string "recovery" to the address 0x40 of the BCB file, I implemented it the same way to the NST. Use the install_reboot_to_recovery.zip to use this function.
    1
    Which zip is the new, fixed one? The one at the bottom of the above posting, labeled zoom2?
    zoom2_source_rc2.zip are just the files to build the recovery yourself. The new recovery is in the opening post.
    1
    I feel a need to point out that if you replace the current recovery files on the NST's Boot Partition then you won't be able to use the recovery disk if anything goes wrong you'll be stuck relying purely on CWM.
    Thats correct, but its easily possible to switch back to the stock recovery using install_stock_1.1_recovery.zip from CWM.

    With that in mind, I'd also wait til it's in an actual release, not just RC before you decide to replace your device's recovery files.
    The only reason that it is still RC is that I can't fix the sstuck after restore bug. Everything else works fine (at least no one reported any problems, and I also didn't experienced any).

    Anyway, I will add a short warning.