[RECOVERY] ClockworkMod 5.0.2.7 BML Officially supported by ROM Manager for Epic 4G

DRockstar

Retired Recognized Developer
Sep 30, 2010
309
561
0
Pasadena, CA
OK guys, you have NO idea what it has taken to get to this point...

Welcome to the first officially supported ClockworkMod for the Epic 4G since cwm 2.5.1.0, I think it's been over a year now...

Changes since 3.1.0.1:

* Backups are tar files by default, with the filesystem type noted in the filename. Backups automatically reformat to the backup filesystem before restore. This will work to restore rfs and ext4 setups. So, for example, if you're currently on rfs, but your backup was done while on the ext4 filesystem, the restore will reformat back to ext4 before restoring. Older backups done by cwm 3.x and ACS Recovery can be restored by this ClockworkMod version, and will not reformat before restoring older backups.

* This cwm is not meant for mtd partition layout / yaffs2 filesystem, that is another matter entirely, and mtd will require it's own cwm build and kernel, that will most likely be in the official CM repo when it's done.

* One "No" in confirmations, for all but factory wipe: Make a blank file called .one_confirm (that is a period in the beginning of the name), and place it in /sdcard/clockworkmod directory. This works right now with 3 finger boot from power off, but will be added to the next Clockwork Recovery update in ROM Manager. When that happens, then it will also work from the option Reboot into Recovery, when called from ROM Manager. This is now official, so that in the future, anyone with ClockworkMod 5.0.27+ will be able to benefit from this. Thanks to chris41g for this edit and push to the official source.

* Keycodes were fixed to work with the gingerbread kernel... and menu was fixed up a bit.
up = vol up, keypad up, keypad left
down = vol down, keypad down, keypad right
back = back cap key, power button, keypad backspace key
select = home cap key, keypad enter key, camera button
toggle display = keypad d key
reboot = power button 5 times, no matter where you are in the cwm menu

NOTE ON KEYS:
If your current kernel is a froyo kernel, then the cap keys will be reversed... We will have some growing pains, until everyone is on board with gingerbread, and the kernel devs start implementing the kernel mod described below, to change the mode of reboot recovery to go to bml8 recovery partition. If you are running gingerbread, then you can flash this prerelease:
Clean_Kernel-2011-11-20-15.51.32.zip
md5:389f5b1745352326c9357c1252cd37b9

This isn't exactly finished yet, but it's stable, and has voodoo sound, root, busybox, etc.

* DO NOT REPARTITION YOUR SDCARD WITH CLOCKWORKMOD. There are problems associated with this that I will detail later.

* I highly recommend flashing both the new recovery kernel and the ROM Manager update... pretty soon, ROM Manager will be able to flash our favorite ROMs, by downloading and flashing from ROM Manager.

* FOR USERS OF ACS RECOVERY:
At this time, I recommend flashing the new cwm over ACS Recovery. Testing has shown that backups done when the ROM Manager fakeflash is called through ACS Recovery, is that the backups won't be in the proper format... they will probably work, but not in the way the CWM 5 intends it too, with fs saved tar backups.
I know that some of you are avid fans of ACS Recovery, and I have nothing against that. In fact, it should be pretty easy for chris41g to make a new version if he so desires... and, he did contribute to the official source, which is something I truly appreciate :) In fact, I have been working with koush, to get some other of the most requested features, into the official cwm sources, so they can benefit everyone in android. One of the first new features to be put into the next cwm update in ROM Manager, is the ability to have only one "No" in the confirmations, if the file /sdcard/clockworkmod/.one_confirm is present. chris41g authored this for the cwm sources. Also, we have been given the go ahead to implement the inclusion of reboot into download mode from the main cwm menu in the official sources as well:)

WHAT TO DO IN ROM MANAGER:

Firstly, flash the new recovery with odin/clockworkmod.

Also, I'd recommend a known working kernel for the new recovery:
Clean_Kernel-2011-11-20-15.51.32.zip
md5: 389f5b1745352326c9357c1252cd37b9

This isn't exactly finished yet, but it's stable, and has voodoo sound, root, busybox, etc.
Nubernel by nubecoder for gingerbread
other kernel devs feel free to link me to your posts!

Get ROM Manager from the market, and choose Flash ClockworkMod Recovery.
Choose the Samsung Epic4G.
It should then download, and you should see ClockworkMod version: 5.0.2.7
Now, whenever you use ROM Manager for anything, it will automatically load the latest supported ClockworkMod for the Epic.

DEVELOPERS: Please visit this forum thread, and learn all you need to know about getting your zips listed in ROM Manager, and the features available for you to use.
KERNEL DEVELOPERS: It is highly recommended at this time to use this commit, to change boot mode for reboot recovery to boot from bml8 recovery partition:
https://github.com/EpicCM/android_k...mmit/ea1dbf2c9be977aeb6f78d871e0b05d989bfad59

OK, here are the links:

cwm-5.0.2.7-epic4g.tar tar flash for odin
cwm-5.0.2.7-epic4g.tar mirror
md5: edd321a3aa2ba4c73f1d3612e9b19c05


cwm-5.0.2.7-epic4g.zip zip flash for cwm
md5: 869baf2d6a52b5604764f70556c9482e


TUTORIAL VIDEOS COURTESY OF QBKING77:

Flashing ClockworkMod Recovery Kernel:
http://www.youtube.com/watch?v=xuLWzeJ1lT4

Setting up ROM Manager for the Epic 4G:
http://www.youtube.com/watch?v=6KTZj3LOsxc

Thanks goes to:
koush - Creator of ClockworkMod, and very good guy for his patience and willingness to listen to the needs of the Epic community, and the android community at large.
mkasick - help with C code to support rfs formatting in the official cwm sources.
chris41g - inclusion of code in official sources to permit one "no" in confirmations, if file /sdcard/clockworkmod/.one_confirm is present
 
Last edited:

DRockstar

Retired Recognized Developer
Sep 30, 2010
309
561
0
Pasadena, CA
DEVELOPER NOTES:

Yes, this time there are developer notes! I will be adding more over the next couple of days.

SOURCES
ClockworkMod Binary:
https://github.com/CyanogenMod/android_bootable_recovery/tree/gingerbread
Epic4G device file sources:
https://github.com/koush/android_device_samsung_epic4g/tree/master
ClockworkMod Recovery kernel sources:
https://github.com/EpicCM/android_kernel_epic4g_gb_official/tree/cwm_5.0.2.7-rfs-ext4

I have put the branch trees in the URLs, since the masters could be subject to change in the future.

WHY CWM 5 WAS A CHALLENGE

ClockworkMod version 5 now stores the backup filesystem in the name of the tar backup files. When I first submitted my device files to koush for ROM Manager support, it became clear that now ClockworkMod would have to support the formatting of rfs volumes for the restores to work properly. This took me a while, but thankfully with the generous advice of mkasick, I wrote the function and pushed to the official source:
https://github.com/CyanogenMod/android_bootable_recovery/commit/a8f265dd6f764188d07ea2637d5638b8c64e4a6b
To experienced C programmers, this is easy stuff, but hey, admittedly, I'm a very new to C programming, and I wanted to learn... and I wanted to get it as correct as possible the first time... so this took me a while :)

RECOVERY KERNEL DETAILS

The important thing with a recovery kernel, is that it only needs to do one thing:
Load ClockworkMod, and anything ClockworkMod might need.

For this reason, there are minimal kernel modifications for the ClockworkMod Kernel. The following details, however, are worthy of note:
* This kernel supports kexec, as in the future, dual boot may become the norm.
* The boot mode for reboot recovery has been modified to reboot the bml8 recovery kernel, and not the boot kernel recovery.
* I left in the keypad timer patch by mkasick, since it really makes a difference in scrolling through the menus in ClockworkMod.
* The initramfs /sbin was modified to only have files needed for ClockworkMod, along with the following scripts and binaries that I often find useful:
bmlwrite - binary to flash kernels
bmlflash - script to flash boot or recovery kernels easily
bclean - script to clean all busybox files from /system
rclean - script to clean all busybox and root related files in /system

FOR BOOT KERNEL DEVELOPERS

It is highly recommended at this time to use this commit, to change boot mode for reboot recovery to boot from bml8 recovery partition:
https://github.com/EpicCM/android_ke...0b05d989bfad59


LESSONS FROM HAVING WORKED ON CLOCKWORKMOD RECOVERY

When I did ClockworkMod 3.1.0.1, I created a custom recovery, with some requested features. However, with time, it became apparent that having an official recovery with ROM Manager support was ultimately more favorable than having a custom one. Furthermore, with just a little effort and cooperation, the official source can be appended to include the most requested features. We're not the only ones asking for those features. I now believe that contributing to the official source benefits the entire community in the end, and not just one or two devices.

Along with my rfs formatting commit, I invited chris41g to contribute as well, and hence his following commit was also accepted, which allows only one "No" to appear in confirmations, when the blank file /sdcard/clockworkmod/.oneconfirm is detected:
https://github.com/CyanogenMod/andr...mmit/a8f265dd6f764188d07ea2637d5638b8c64e4a6b
Again, very simple here, but solves the most requested modification to ClockworkMod probably ever, and now, anyone with ClockworkMod 5.0.2.7+ can enjoy it too!

I really want to thank chris41g for taking the time to contribute. I respect and appreciate his work on the ACS Recovery, and I feel that his work will make even more of a difference in the end- to a lot more people than just the Epic 4G community.

I truly hope that my example can be an inspiration to others, to cooperate with other developers for the benefit of all. This may appear idealistic, but I believe the Epic 4G community has matured and has already started reaping the benefits of this cooperation. I also believe that in learning from others, you are also given the obligation to help others, who will, in turn, help others, and so on. I should hope that the benefits to all are obvious. And with that, I'll stop "preaching"... hehe.
 
Last edited:

zman519

Senior Member
Oct 27, 2010
2,221
249
143
the Land of Beer & Cheese
Sweeeeeet!!! Thanks Drockstar! And devs!

Could we get md5's

Sent from the Drivers Seat of my Suby txting and Driving doing 100MPH+ in a school zone! Ha.


hear the md5 from the cwm flash 869BAF2D6A52B5604764F70556C9482E
 
Last edited:

Eins7ein

Senior Member
Mar 21, 2011
85
7
0
Thank you for this. Since its official and no longer a port does this mean no more having to wipe 3x?
Sent from my SPH-D700 using Tapatalk
 

styles420

Senior Member
Nov 12, 2010
2,379
1,390
0
The version that flashes from ROM manager has one minor issue - the capacitive back button acts as a select button, but the menu key works as a back button... That's all I've noticed so far, other than the three finger salute going into my previously installed CWM 3.1...

Sent from my SPH-D700 using XDA App
 

ugothakd

Senior Member
Jun 12, 2011
1,486
407
0
O 'Fallon, MO
The version that flashes from ROM manager has one minor issue - the capacitive back button acts as a select button, but the menu key works as a back button... That's all I've noticed so far, other than the three finger salute going into my previously installed CWM 3.1...

Sent from my SPH-D700 using XDA App
Well the the finger boot to cwm 3 is sure as hell not right...

sent from my always aosp epic