Porting CWM how to Extract stock Recovery image?

Search This thread

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
Hello Xda, i own a ZTE midnight and just a few hours ago rooted it and would like to help port CWM to my device, i was looking at this https://www.facebook.com/ClockworkMod/posts/480999728601013 and wanted to start from there but i dont know how to extract the stock recovery, any help? like i said its already rooted and i think that All ZTE devices have unlocked bootloaders so this is possible. yes i have googled it please dont bark at me.
 

coder32

Member
May 22, 2014
21
1
Hi trozzul,

I too want to port it to cwm but am also not able to extract my stock recovery.

Have you tried flashify? There is an option for backup boot.img and recovery.img . I tried it but doesn't seems to work.

It does create a 0 byte file named recovery.img . Maybe it isn't working on my phone.You try it on yours.

Thankx
Yuvraj

Sent from my iris 406Q using XDA Free mobile app
 

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
Hi trozzul,

I too want to port it to cwm but am also not able to extract my stock recovery.

Have you tried flashify? There is an option for backup boot.img and recovery.img . I tried it but doesn't seems to work.

It does create a 0 byte file named recovery.img . Maybe it isn't working on my phone.You try it on yours.

Thankx
Yuvraj

Sent from my iris 406Q using XDA Free mobile app

i sorta found out myself with playing around in a terminal emulator. would you happen to know what partition your phone is? BML or MTD? i dont know what todo if your device is BML but if you think its MTD you can try in the terminal emulator app (from play market) type in
Code:
cat /proc/mtd
enter this in and you will see around 20 MTD files. find the MTD file with "Recovery" at the end, type this in for instance (DO NOT use this code, its what my device showed the Recovery MTD for.)
Code:
dd if=/dev/mtd/mtd12 of=/sdcard/recovery.img
and it will push your recovery to your SD card (in .img format), Pretty much say your recovery was MTD9 just put in that code but replace mtd12 with MTD9 mine was about 5MB i didn't know they were that small.
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
Hello Xda, i own a ZTE midnight and just a few hours ago rooted it and would like to help port CWM to my device, i was looking at this https://www.facebook.com/ClockworkMod/posts/480999728601013 and wanted to start from there but i dont know how to extract the stock recovery, any help? like i said its already rooted and i think that All ZTE devices have unlocked bootloaders so this is possible. yes i have googled it please dont bark at me.

To extract your stock recovery what you can do is the following to determine which partition is the recovery partition. From terminal emulator or adb shell, go to the /cache/recovery directory and look for a file called log or last_log if you cd into the /cache/recovery directory you can read the log file with the cat command: cat last_log. In the log file you will see a list of the partitions on your device. One of these will be your recovery partition, remember which partition block is your recovery partition and then run the command:

Code:
cat /dev/block/yourrecoveryblock > /mnt/sdcard/recovery.img

Let me know if you still have questions.
 
  • Like
Reactions: Trozzul

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
To extract your stock recovery what you can do is the following to determine which partition is the recovery partition. From terminal emulator or adb shell, go to the /cache/recovery directory and look for a file called log or last_log if you cd into the /cache/recovery directory you can read the log file with the cat command: cat last_log. In the log file you will see a list of the partitions on your device. One of these will be your recovery partition, remember which partition block is your recovery partition and then run the command:

Code:
cat /dev/block/yourrecoveryblock > /mnt/sdcard/recovery.img

Let me know if you still have questions.

thanks for the info! i got the Recovery.img but would you happen to know if this site is not in use anymore? http://builder.clockworkmod.com/ i get 404s after i have uploaded it and i try to see mine in the que.
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
thanks for the info! i got the Recovery.img but would you happen to know if this site is not in use anymore? http://builder.clockworkmod.com/ i get 404s after i have uploaded it and i try to see mine in the que.

Clockworkmod recovery builder website has been hit and miss recently. Overall I would strongly recommend taking a look at this guide here that will teach you the basics of porting Clockworkmod Recovery to a new device, you will also learn a lot more doing it this way, as well as it being easier to fix any issues.
 
  • Like
Reactions: Trozzul

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
Clockworkmod recovery builder website has been hit and miss recently. Overall I would strongly recommend taking a look at this guide here that will teach you the basics of porting Clockworkmod Recovery to a new device, you will also learn a lot more doing it this way, as well as it being easier to fix any issues.

i have to use Ubuntu? could i not use the command prompt since the codes looks like you can use them there. Could i format one of my old computers and setup Ubuntu there?
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
i have to use Ubuntu? could i not use the command prompt since the codes looks like you can use them there. Could i format one of my old computers and setup Ubuntu there?

You have to use Linux or OSX but Ubuntu is highly recommended. You can't use command prompt as the Windows architecture isn't designed to build and cross compile for the architecture Android is based on. Yes, you could format your old computer and install Ubuntu on that and proceed from there.

Sent from my SCH-I535 using XDA Premium 4 mobile app
 

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
You have to use Linux or OSX but Ubuntu is highly recommended. You can't use command prompt as the Windows architecture isn't designed to build and cross compile for the architecture Android is based on. Yes, you could format your old computer and install Ubuntu on that and proceed from there.

Sent from my SCH-I535 using XDA Premium 4 mobile app

Cool, i will try my best to figure out how to get Ubuntu on this old thing, from looking it up looks like a simple process. could you recommend a good way to learn some basic commands like that guide asks for? i am using codecademy right now for some basic java and html stuff i know you need to know some of that stuff. its a single core 512mb of ram old XP computer, i dont know the system requirements for Ubuntu.
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
Cool, i will try my best to figure out how to get Ubuntu on this old thing, from looking it up looks like a simple process. could you recommend a good way to learn some basic commands like that guide asks for? i am using codecademy right now for some basic java and html stuff i know you need to know some of that stuff. its a single core 512mb of ram old XP computer, i dont know the system requirements for Ubuntu.

Your machine meets the minimum specs for Ubuntu (Barley) you could also check out Xbuntu or Lubuntu as well, make sure you use a 64-bit version as Android building requires that. Keep in mind with those specs you should be able to build it will just take a while to compile. For learning the basics of the Linux command line, this is a great guide just ignore the parts about Windows Power Shell (Or don't ignore them and learn twice as much!). The system requirements for Ubuntu can be found here as well for your reference. Android building does't really deal with HTML, it does deal with Java but as always the more you know the better because it just makes it easier to learn from there.
 

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
Your machine meets the minimum specs for Ubuntu (Barley) you could also check out Xbuntu or Lubuntu as well, make sure you use a 64-bit version as Android building requires that. Keep in mind with those specs you should be able to build it will just take a while to compile. For learning the basics of the Linux command line, this is a great guide just ignore the parts about Windows Power Shell (Or don't ignore them and learn twice as much!). The system requirements for Ubuntu can be found here as well for your reference. Android building does't really deal with HTML, it does deal with Java but as always the more you know the better because it just makes it easier to learn from there.

im pretty sure that computer i have is 32bit, so im screwed?
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
  • Like
Reactions: Trozzul

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
Is the operating system installed 32-bit or is the the CPU itself in your computer a 32-bit processor because if it's just a 32 -bit operating system you can still install the 64-bit version. But if it's a 32-bit processor then I'm afraid your out of luck. What you can do however is setup Ubuntu in a virtual machine on your main computer using Virtualbox.

i was aware of the virtual machine ( still dont know how to do it lol) and i sorta didnt want to use it on my main computer i feel like to me it would be easier to just start linux on another computer. uh how would i tell if the processor on it is 32bit?
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
i was aware of the virtual machine ( still dont know how to do it lol) and i sorta didnt want to use it on my main computer i feel like to me it would be easier to just start linux on another computer. uh how would i tell if the processor on it is 32bit?

With Virtualbox you can setup Windows and Linux side-by-side and the good thing is if you mess something up in Virtualbox you regular windows installation is unaffected, I would highly recommend checking out this video walk though guide on how to install Ubuntu 14.04 LTS in Virtualbox. You can find out if you have a 32-bit processor or 64-bit processor by going to Accessories -> System Tools -> System Information (Or just search for System Information), then look at the System Type entry if it says x64-based PC you have a 64-bit processor if it says x86-based PC you have a 32-bit processor.
 
  • Like
Reactions: Trozzul

Trozzul

Senior Member
Jun 21, 2012
1,607
224
26
Seattle
With Virtualbox you can setup Windows and Linux side-by-side and the good thing is if you mess something up in Virtualbox you regular windows installation is unaffected, I would highly recommend checking out this video walk though guide on how to install Ubuntu 14.04 LTS in Virtualbox. You can find out if you have a 32-bit processor or 64-bit processor by going to Accessories -> System Tools -> System Information (Or just search for System Information), then look at the System Type entry if it says x64-based PC you have a 64-bit processor if it says x86-based PC you have a 32-bit processor.

ill try to post back soon, i will try out virtualbox but im going to try to still get ubuntu on another computer i own, the other one ended up being x86 based. im sure the new one is 64-bit but it needs some work on it. thanks for the help so far!
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
alright installed Ubuntu on one of my many computers, gonna try to build a setup a build environment, i have 75 gigs free on my hard drive, i heard the android source needs 100GB? could i put another hard drive in my computer thats 80gigs and would work?

My apologizes for getting back to you so late @Trozzul I just finished with my finals the other day and didn't get home till much latter then anticipated hence the delay. While you could put in another 80 GB hard drive I would recommend picking up at least a 250 GB Hard Drive (They can be found online for about $30-$40), as that way you can be sure you won't run out of room and can have your main build environment all on one drive. But you can try it with the setup you have now and you can probably get away with it. As always let me know of any questions you have happy to help :highfive:.
 
  • Like
Reactions: Trozzul

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hello Xda, i own a ZTE midnight and just a few hours ago rooted it and would like to help port CWM to my device, i was looking at this https://www.facebook.com/ClockworkMod/posts/480999728601013 and wanted to start from there but i dont know how to extract the stock recovery, any help? like i said its already rooted and i think that All ZTE devices have unlocked bootloaders so this is possible. yes i have googled it please dont bark at me.

    To extract your stock recovery what you can do is the following to determine which partition is the recovery partition. From terminal emulator or adb shell, go to the /cache/recovery directory and look for a file called log or last_log if you cd into the /cache/recovery directory you can read the log file with the cat command: cat last_log. In the log file you will see a list of the partitions on your device. One of these will be your recovery partition, remember which partition block is your recovery partition and then run the command:

    Code:
    cat /dev/block/yourrecoveryblock > /mnt/sdcard/recovery.img

    Let me know if you still have questions.
    1
    thanks for the info! i got the Recovery.img but would you happen to know if this site is not in use anymore? http://builder.clockworkmod.com/ i get 404s after i have uploaded it and i try to see mine in the que.

    Clockworkmod recovery builder website has been hit and miss recently. Overall I would strongly recommend taking a look at this guide here that will teach you the basics of porting Clockworkmod Recovery to a new device, you will also learn a lot more doing it this way, as well as it being easier to fix any issues.
    1
    im pretty sure that computer i have is 32bit, so im screwed?

    Is the operating system installed 32-bit or is the the CPU itself in your computer a 32-bit processor because if it's just a 32 -bit operating system you can still install the 64-bit version. But if it's a 32-bit processor then I'm afraid your out of luck. What you can do however is setup Ubuntu in a virtual machine on your main computer using Virtualbox.
    1
    i was aware of the virtual machine ( still dont know how to do it lol) and i sorta didnt want to use it on my main computer i feel like to me it would be easier to just start linux on another computer. uh how would i tell if the processor on it is 32bit?

    With Virtualbox you can setup Windows and Linux side-by-side and the good thing is if you mess something up in Virtualbox you regular windows installation is unaffected, I would highly recommend checking out this video walk though guide on how to install Ubuntu 14.04 LTS in Virtualbox. You can find out if you have a 32-bit processor or 64-bit processor by going to Accessories -> System Tools -> System Information (Or just search for System Information), then look at the System Type entry if it says x64-based PC you have a 64-bit processor if it says x86-based PC you have a 32-bit processor.
    1
    alright installed Ubuntu on one of my many computers, gonna try to build a setup a build environment, i have 75 gigs free on my hard drive, i heard the android source needs 100GB? could i put another hard drive in my computer thats 80gigs and would work?

    My apologizes for getting back to you so late @Trozzul I just finished with my finals the other day and didn't get home till much latter then anticipated hence the delay. While you could put in another 80 GB hard drive I would recommend picking up at least a 250 GB Hard Drive (They can be found online for about $30-$40), as that way you can be sure you won't run out of room and can have your main build environment all on one drive. But you can try it with the setup you have now and you can probably get away with it. As always let me know of any questions you have happy to help :highfive:.