[UTIL] [NEW] switchrom.sh V1.1 - One step bookmark, store and restore your ROMs - G1 Android Development

Changelog:
1.1 - Allow delete/restore without a name. Choose from the list.
1.0 - Use nandroid to make it one step process.
Currently, nandroid backups do not contain the a2sd app folders. It has been painful to say the least to jump between ROMs.
This script does two things:
1. Store and tag a ROM's nandroid backup and its apps data. You can provide any name for tagging while storing.
2. Restore a tagged ROM's app data and its latest nandroid backup.
The nice side effect of this is that you have complete environments you have created nicely bookmarked with easy to understand names and version numbers, ready to be restored easily.
Requirements:
1. Two partitions in order: fat32, ext2/3
2. cyanogen's recovery image 1.4. 1.3.1 will not work with V1.0.
3. Attached script called switchrom.txt downloaded and stored in folder /system/sd/ and renamed as switchrom.sh
Usage:
1. Boot into recovery using Home + End buttons together.
2. To bookmark and tag current ROM,
Go into console with Alt+X (or do adb shell from PC)
mount /system/sd
sh /system/sd/switchrom.sh -s <name>
e.g.
I am backing up soulife-1.2.3 with
sh /system/sd/switchrom.sh -s soulife-1.2.3
3. To restore a ROM,
Go into console with Alt+X (or do 'adb shell' from PC)
mount /system/sd
sh /system/sd/switchrom.sh -r
It will give you a list of available ROMs to restore and you can choose the one you want to restore using the corresponding number.
e.g.
I am restoring soulife-roger-new-3.9.1-latest with
Code:
sh /system/sd/switchrom.sh -r
1. JACMyTouchSkiV2-mod
2. JACxROM-1.3r3
3. cm-3.9.7-best-setup
4. drizzy-hero-2.8-best
5. soulife-ion-1.2.3-mod
6. soulife-roger-new-3.9.1-latest
Choose a ROM (type in the number and press enter)...6
Restoring ROM soulife-roger-new-3.9.1-latest, proceed? (y/n) y
Cleaning up /system/sd ...
Restoring soulife-roger-new-3.9.1-latest app data in /system/sd ...
Restoring nandroid backup...
Done restoring the ROM soulife-roger-new-3.9.1-latest.
Note that no extra steps are necessary. No wipe! No nandroid restore!
Note that options have changed since last version. Make sure to read the help with '-h' or '--help' option. Compression (-c option) is supported for both the apps partition and the nandroid but the way it is done in nandroid is dumb and takes like 17 minutes, so I would not recommend it at this time but you can definitely try it. I will post patches for nandroid script to fix that.
Code:
# sh /system/sd/switchrom.sh -h
Usage: /system/sd/switchrom.sh OPTIONS <rom_name>
Options are:
-h --help
-c --compress, only used with -s
-d --delete
-l --list
-r --restore
-s --store
-v --version
Always specify options as separate words
e.g. -c -r instead of -cr. Its required!
Don't use blanks or special characetrs in rom_name.
Compress will take longer but image will be smaller.
<rom_name> is optional with -r and -d. Choose from a list.
NOTES:
Note that this is not storing the whole backup of your EXT2/3 partition. This is just storing app* and dalv* folders needed to restore the ROM behavior, apps and settings only. If you wipe your EXT2/3 partition with a formatter or manually with 'rm -rf /system/sd/*', you will loose everything on that partition and won't get it back from this backup. This backup will only restore app* and dalv* folder.
It was reported that certain versions of 'adb' hangs in the sub-shell created and it doesn't pass through the commands that are typed. Make sure to upgrade the SDK to 1.5r3.

Awesome work, I'll try this out on my next rom switch. Can't ever have too many scripts I say.

added to my collection of scripts

This may sound like a silly question but please forgive me as I have not yet flashed the haykuro spl.
Once you've flashed the new spl, instead of flashing the update.zip of the cyanogen rom, can't you use nandroid restore? Or will that restore the previous spl as well (in my case HARD SPL)?
I ask because I would like to try the spl, but I'm so comfortable with my rom and settings that I would hate to wipe just to try Hero which is still in development. Call me crazy, but I like stable and finished builds. But I am curious and with a lot of time on my hands but not so much that I'm willing to lose everything just to try something that I'm not going to keep.
With this script, it would make it so much easier and would allow us to switch roms on the fly... but would it work from Hero builds and non-Hero builds?

I don't think I know enough about the SPL image contents to comment on this. But as far as I know SPL is not touched by nandroid restore. I upgraded the radio and SPL (haykuro) first, and then went with updating my ROM. I will never flash radio and SPL unless and until I really need to.
This script is just taking the pain out of switching between ROMs (whether Hero or Cyano or official) and nicely organizes your ROM backups. So, to answer your question:
would it work from Hero builds and non-Hero builds?
Click to expand...
Click to collapse
Yes. It would! I have switched between drizzy's Hero ROM and JACMyTouchSki (my favorite) many times using this. The restore is perfect!

Binary100100 said:
Once you've flashed the new spl, instead of flashing the update.zip of the cyanogen rom, can't you use nandroid restore? Or will that restore the previous spl as well (in my case HARD SPL)?
Click to expand...
Click to collapse
Considering the most amount of bricks come from radio/spl updates, I dont think this script would integrate backing up and restoring them. Same reason why rom's themselves dont include the latest radio/spl in the update.zip when it is required by the rom.

rondey- said:
Considering the most amount of bricks come from radio/spl updates, I dont think this script would integrate backing up and restoring them. Same reason why rom's themselves dont include the latest radio/spl in the update.zip when it is required by the rom.
Click to expand...
Click to collapse
Okay... so I'm running cyanogen's rom now with hardspl.
I back it up and lable it "Cyan 3.9"
I install the Haykuro spl (I already have the radio)
I install a Hero rom.
I try the Hero rom.
I backup the Hero rom and lable it "Hero"
I can then restore "Cyan 3.9" and still have the Haykuro spl.
Correct?

Binary100100 said:
Okay... so I'm running cyanogen's rom now with hardspl.
I back it up and lable it "Cyan 3.9"
I install the Haykuro spl (I already have the radio)
I install a Hero rom.
I try the Hero rom.
I backup the Hero rom and lable it "Hero"
I can then restore "Cyan 3.9" and still have the Haykuro spl.
Correct?
Click to expand...
Click to collapse
Make sure you use labels which don't have whitespace or other special characters in the name like use Cyan-3.9 instead of "Cyan 3.9". I don't think script likes it much at this time. I need to fix that.

Binary100100 said:
Okay... so I'm running cyanogen's rom now with hardspl.
I back it up and lable it "Cyan 3.9"
I install the Haykuro spl (I already have the radio)
I install a Hero rom.
I try the Hero rom.
I backup the Hero rom and lable it "Hero"
I can then restore "Cyan 3.9" and still have the Haykuro spl.
Correct?
Click to expand...
Click to collapse
The only difference between this and a "typical" nandroid restore should just be that it copies your ext2/3/4 partition for the app data. It wasnt listed anywhere that it would backup/restore your spl/radio.
Prior to flashing the haykuro spl I made a nandroid backup of the cyanogen rom I was using. I tested a hero rom and restored a nandroid backup of the cyanogen rom I was running and the new radio/spl were in place.

I think you need to dump all of mtd6ro and extract radio/spl by hand if you need to. Nandroid doesn't touch either of them.

rondey- said:
Prior to flashing the haykuro spl I made a nandroid backup of the cyanogen rom I was using. I tested a hero rom and restored a nandroid backup of the cyanogen rom I was running and the new radio/spl were in place.
Click to expand...
Click to collapse
Sweet! This was the exact answer that I was hoping and searching for for hours. Thank you very much. I've been getting guesses and theories this whole time and I knew someone out there just had to have personal experience with it. Thank you.

WOW amazing script!! just downloaded and used it
works very well!! can't wait to see what else you can do with it.

the perfect addition to a world that includes xda devs. nice work!

This may a dumb question, but why is it necessary to do this if your app data is still sitting on your ext partition, isnt it going to look for apps there anyway if you have apps2sd setup automatically like in a CM rom?
Cheers

The current version of nandroid lets you switch
Between backups, but not all options are yet connected to the UI.
devsk said:
Currently,
A. nandroid backups do not contain the a2sd app folders.
B. nandroid backups are not tagged but instead are time stamp based, so if you forget you backed up your most stable ROM with all the setup done and apps installed at 11:01pm on Friday, you will have tough time getting it back.
It has been painful to say the least to jump between ROMs.
This script does two things:
1. Store and tag a ROM's nandroid backup and its apps data. You can provide any name for tagging while storing.
2. Restore a tagged ROM's app data and make its nandroid backup the latest so that the recovery console can restore from it.
The nice side effect of this is that you have complete environments you have created nicely bookmarked with easy to understand names and version numbers, ready to be restored easily. Eventually, this should be part of the nandroid in recovery image itself.
Requirements:
cyanogen's recovery image 1.3.1
attached script (only txt extension is allowed) downloaded to /sdcard/switchrom.sh
Usage:
1. Boot into recovery using Home + End buttons together.
2. To bookmark and tag current ROM,
Do a nandroid backup first
Go into console with Alt+X (or do adb shell from PC)
mount /sdcard
sh /sdcard/switchrom.sh store <name>
e.g.
I am backing up soulife-1.2.3 with
sh /sdcard/switchrom.sh store soulife-1.2.3
3. To restore a ROM,
Go into console with Alt+X (or do 'adb shell' from PC)
mount /sdcard
sh /sdcard/switchrom.sh restore <name>
e.g.
I am restoring soulife-1.2.3 with
sh /sdcard/switchrom.sh restore soulife-1.2.3
Go back to recovery screen (by typing 'recovery' on the shell prompt if you are on console)
Alt+w to wipe
Do a nandroid restore from latest backup
I have tested this script with cyanogen 3.9, soulife 1.2.3, drizzy's hero and JACMyTouchSki.
Click to expand...
Click to collapse

I must be missing something...
I would like to say first, I am sure there is something I am missing, but to me it would just seem easier to do this in the terminal:
Make a copy of whatever ROM you want to use and rename it to update.zip. I will use Soulife's Ion for example. Also using the assumption you have an update.zip file on hand. You can use the ls command to see what all ROMs you have on your sdcard.
$ su
# cd /sdcard
# rm -r update.zip
# cp soulife.ion.v.1.2.2.zip /sdcard/update.zip
# reboot recovery
Flash as normal
I usually keep my phone backed up using backup for root users. So I just restore all my text messages and settings from the SD card and that is it.
I guess that is more typing, but to me each individual command it simpler.

mookie3three said:
This may a dumb question, but why is it necessary to do this if your app data is still sitting on your ext partition, isnt it going to look for apps there anyway if you have apps2sd setup automatically like in a CM rom?
Cheers
Click to expand...
Click to collapse
Apps data is not portable between ROMs. You need to clean it up otherwise expect random FCs.

ccunningham83 said:
I would like to say first, I am sure there is something I am missing, but to me it would just seem easier to do this in the terminal:
Make a copy of whatever ROM you want to use and rename it to update.zip. I will use Soulife's Ion for example. Also using the assumption you have an update.zip file on hand. You can use the ls command to see what all ROMs you have on your sdcard.
$ su
# cd /sdcard
# rm -r update.zip
# cp soulife.ion.v.1.2.2.zip /sdcard/update.zip
# reboot recovery
Flash as normal
Click to expand...
Click to collapse
And lose all that you did with your current ROM. I think you did not get the point of this script.... This is for people who have setup their phone well with a ROM and don't want to lose its goodness but still want to test other ROMs and possibly have a couple of them on their phone which they can switch to & from.

ccunningham83 said:
I would like to say first, I am sure there is something I am missing, but to me it would just seem easier to do this in the terminal:
Make a copy of whatever ROM you want to use and rename it to update.zip. I will use Soulife's Ion for example. Also using the assumption you have an update.zip file on hand. You can use the ls command to see what all ROMs you have on your sdcard.
$ su
# cd /sdcard
# rm -r update.zip
# cp soulife.ion.v.1.2.2.zip /sdcard/update.zip
# reboot recovery
Flash as normal
I usually keep my phone backed up using backup for root users. So I just restore all my text messages and settings from the SD card and that is it.
I guess that is more typing, but to me each individual command it simpler.
Click to expand...
Click to collapse
The thing you are missing is that many apps do not have an option to export their settings, nor do they store them in an easily accessible place. Even if you manage to pull their settings off /data/data/ folders, you still have problems with restoring them. First off, you have to worry about their Linux permissions since they don't get preserved on the Fat32 partition. Second, simply pushing back the setting folders won't work for apps that use SQLlite database to store account info, so you're stuck with re-entering everything manually.
Take K9 Mail for example. I have 4 accounts (both IMAP and POP3) that I have to set up every time I wipe my phone or reformat the Ext partition. Same with progress on most games. A tar of the entire Ext partition combined with a Nandroid image resolves most of these issues.

I get an error during backup.
I take a nandroid backup, enter recovery terminal, type in "mount /sdcard" enter "sh /sdcard/switchrom.sh store lastramjet" type in yes at the confirmation prompt and the script starts it's magic.
However, after the "moving nandroid (or something)" I get an error saying "Cannot umount /sdcard device/resource in use/busy". After that I get a successfully bookmarked the backup message.
Not sure if this matters, but just wanted to let you know

Related

NANDROID RESTORE WITHOUT FASTBOOT?? - does it really work?

ok so im confused. I was reading the "how to flash cupcake" thread and came across this post by ridli. i tried following the instructions below but they failed, it seems like it works for him. if this truly works then there is no need for fastboot to reflash a nandroid back up. please help. thnx. BTW dudes .8 G build is awesome. (posted from my G1-modded w/root and gloss suite theme)
I tried the below on my G1 using recovery mode from JF-RC33 and i get:
error opening /sdcard/bu/system.img: no such file or directory.
I have checked the sdcard and its there, please help.
ridli said:
You can do the same without linux or any other SO.
1) Download cupcake
2) copy IMG files to a DIR in your SDCARD
3) reboot the phone in recovery mode
4) press ALT+X for go to console
5) #mount -a (for mount all partitions, without this you dont have flash_image becouse it is in /system/bin/)
6) use flash_image for flash the partitions
Code:
#flash_image system /sdcard/<dir>/system.img
#flash_image boot /sdcard/<dir>/boot.img
#flash_image userdata /sdcard/<dir>/data.img
7) #reboot
Optional: Do a backup of the phone with nandroid from the recovery mode, this do a img of system, data and boot partitions of your phone and copy to your sdcard. If you have any problem you can reflash your phone with you img.
Click to expand...
Click to collapse
It didn't work for me either, but it said I could not remount system as r/w because it was busy.
Anyway, I find instructions on how to do it via PC a lot easier. And if your phone would not boot, and you are stuck without backup, you can always pull it with adb.
Karolis:
System shouldn't be busy in recovery mode... also, it shouldn't be mounted if you're trying to write a fs image
And... no, if your phone can't boot, it can't boot. That includes starting adbd.
If you can enter recovery/spl, it's booting just fine.
flak0:
Have you checked the sdcard from the shell in android, or from your computer?
If it's the latter, you should make sure you can access the file from android.
I would recommend that you copy the flash_image binary out of /system (and /data), because you're rewriting that partition
Okay, don't use the forums when on a bad connection... my browser thought it lost connection, and decided to refresh, and send my post again... *Looks for a delete button*
this does not work
just so everyone is clear
DOES NOT WORK!
Note To Self, do not follow tutorials from junior members
arteshiftedscreen said:
this does not work
just so everyone is clear
DOES NOT WORK!
Note To Self, do not follow tutorials from junior members
Click to expand...
Click to collapse
Ummmm actually this does work if you do itcorrectly. Note to self no bashing people that are just trying to help.
so how is it done?
korndub said:
Ummmm actually this does work if you do itcorrectly. Note to self no bashing people that are just trying to help.
Click to expand...
Click to collapse
And could a Gscript or similar be written to do something like this? I'd be psyched to have the option to restore my phone on the fly. And of course, if you could do that, what would stop you from having a Nandroid restore point saved for a number of different builds? I would love that.
Out of curiosity, and I've never tried this method myself, are you just entering the following exactly?
#flash_image system /sdcard/<dir>/system.img
#flash_image boot /sdcard/<dir>/boot.img
#flash_image userdata /sdcard/<dir>/data.img
Click to expand...
Click to collapse
Or are you changing <dir> to the directory of your nandroid backup? Because if you aren't it certainly won't work.
ei8htohms said:
And could a Gscript or similar be written to do something like this? I'd be psyched to have the option to restore my phone on the fly. And of course, if you could do that, what would stop you from having a Nandroid restore point saved for a number of different builds? I would love that.
Click to expand...
Click to collapse
But it would be very unsafe to flash a fs image when the partition is actually mounted and your gscript is probably in it.
the only way is to do it in recovery mode.
one little problem though: i copied flash_image to /cache and chmod, but the shell kept telling me no such file. why is that?
billc.cn said:
But it would be very unsafe to flash a fs image when the partition is actually mounted and your gscript is probably in it.
the only way is to do it in recovery mode.
one little problem though: i copied flash_image to /cache and chmod, but the shell kept telling me no such file. why is that?
Click to expand...
Click to collapse
flash_image is a binary, should not be moved. why did you move it to cache? of course it wont work...
Unfortunately, flash_image does not support writing yaffs2 images. Look in the code, there's no support for writing the OOB data to the NAND. If it was possible I would've integrated backup AND restore in nandroid 2.0, and JesusFrekes recovery image would then also have a restore option. But alas, it's not to be.
Perhaps in a future release I can find a C coder who can add the code to the flash_image source, so that this becomes possible. But I'm not even sure if that can be done (because you need kernel driver support as well).
infernix said:
Unfortunately, flash_image does not support writing yaffs2 images. Look in the code, there's no support for writing the OOB data to the NAND. If it was possible I would've integrated backup AND restore in nandroid 2.0, and JesusFrekes recovery image would then also have a restore option. But alas, it's not to be.
Perhaps in a future release I can find a C coder who can add the code to the flash_image source, so that this becomes possible. But I'm not even sure if that can be done (because you need kernel driver support as well).
Click to expand...
Click to collapse
Can't we just use nandwrite from mtd-utils to do this? I haven't tried it yet (I'll build it for ARM when I get home from work), but it appears to be the right tool for the job. I'm really interested in getting a menu-driven restore in my recovery image.
cyanogen said:
Can't we just use nandwrite from mtd-utils to do this? I haven't tried it yet (I'll build it for ARM when I get home from work), but it appears to be the right tool for the job. I'm really interested in getting a menu-driven restore in my recovery image.
Click to expand...
Click to collapse
Oh that would be sooooooooo sweet!

[UTIL] BART-1.3.1 Backup and Restore Tool

This script is based off of devsk's switchrom.sh found here: http://forum.xda-developers.com/showthread.php?t=541183. If you are unfamiliar with switchrom, you should probably read that thread first.
Requirements:
1) cyanogen's 1.4 recovery image, Amon_Ra's recovery image, or any other that is based off of the 1.4 recovery image.
2) an extended partition isn't required but makes it easier.
Installation:
rename bart-*.txt to bart.sh
copy bart.sh to /system/sd/
for example:
Code:
mv /sdcard/download/bart-0.9.8.txt /system/sd/bart.sh
note: if using Amon_Ra's 1.2.3 recovery, bart-0.9.2 is already included. Either type 'utility' into the console or invoke bart without sh, file extension, or path. For example: "bart -s myrom" instead of "sh /system/sd/bart.sh -s myrom".
Optional: Create config file named bart.config and place in /system/sd/
Features:
ability to store/restore ROMs based on name
store/restore all made default (nandroid and entire ext partition)
ability to customize the store/restore process
The main difference between the different restores is what data is deleted before the restoration process, not what is restored. The ext backup is kept in a single tar/tar.gz file and is extracted after deleting whatever the user chose to delete.
-r: deletes entire ext partition (rm -rf *)
-b -r: deletes apps folders and dalvik cache (rm -rf app* dalv*)
-a -r: deletes apps_s and dalvik cache (rm -rf app_* dalv*)
-n -r: deletes nothing from /system/sd
This version stores backups in /sdcard/bart. If you want your old switchrom backups available to you, just copy or move them there.
Code:
mkdir /sdcard/bart
mv /sdcard/switchROM/* /sdcard/bart/
Usage:
sh /system/sd/bart.sh [--noninteractive] [options] -s|--store [rom_name]
sh /system/sd/bart.sh [--noninteractive] [options] -r|--restore [rom_name]
sh /system/sd/bart.sh [--noninteractive] -d|--delete [rom_name]
sh /system/sd/bart.sh -l
Options:
-a|--apps_s
-b|--base, nandroid apps dalvik_cache
-c|--compress, only used with -s
-e|--ext_only
-h|--help
-n|--nandroid_only
-v|--version
--verbose
--nocache
--norecovery
--noboot
--nodata
--nosystem
--noninteractive
--reboot, only used with -r or -s
--shutdown, only used with -r or -s
Always specify options as separate words"
e.g. -c -r instead of -cr. It is required!
-r and -s need to be last or followed by rom_name.
--noninteractive needs to be first.
Don't use spaces or special characters in rom_name.
Compress will take longer but image will be smaller.
Examples:
store a complete backup, prompt for rom_name (nandroid and entire ext partition)
Code:
sh /system/sd/bart.sh -s
store nandroid, /system/sd/apps*, and /system/sd/dalv* (original switchrom behavior)
Code:
sh /system/sd/bart.sh -b -s
store nandroid only and name it mycy_nand
Code:
sh /system/sd/bart.sh -n -s mycy_nand
store complete ext partition only
Code:
sh /system/sd/bart.sh -e -s
store /system/sd/apps* and system/sd/dalv* only
Code:
sh /system/sd/bart.sh -b -e -s
store nandroid, /system/sd/apps_* and system/sd/dav* only
Code:
sh /system/sd/bart.sh -n -a -s
restore complete backup (nandroid and entire ext partition)
Code:
sh /system/sd/bart.sh -r
restore nandroid, apps folder, and dalvik-cache (original switchrom behavior)
Code:
sh /system/sd/bart.sh -b -r
restore entire ext partition only
Code:
sh /system/sd/bart.sh -e -r
restore /system/sd/app* and /system/sd/dalv* (not nandroid, only apps* dalv* folders cleared first,rest of ext partition left intact)
Code:
sh /system/sd/bart.sh -b -e -r
delete a backed up rom
Code:
sh /system/sd/bart.sh -d
list available roms
Code:
sh /system/sd/bart.sh -l
Changelog:
bart-0.9.1.sh: fixed bug where old nandroid backups were retained when same name was used.
bart-0.9.2.sh: added battery level check before restoring to avoid it crapping out midway during restore process.
bart-0.9.3.sh: added ability to send nandroid norecovery, noboot, nodata, and nosystem flags. Added verbose mode option for nandroid backup/restore.
bart-0.9.4.sh: added ability to delete ext-backup or nandroid separately. Added extra output for verbose mode.
bart-0.9.5.sh: added non-interactive mode
bart-0.9.6.sh: added option to backup/restore app_s, dalvik-cache, and nandroid
bart-0.9.7.sh: no longer tries to mount ext partition when -n option is given.
bart-0.9.8.sh: checks whether or not it is in recovery mode, increased verbosity for verbose mode, code cleanup.
bart-1.0.0.sh: ability to reboot/shutdown after store/restore, minor code cleanup
bart-1.0.1.sh: removed recovery mode check since its not always accurate
bart-1.1.0.sh: can now source a user config file.
bart-1.1.1.sh: fixed the shbang
bart-1.2.0.sh: added ability to backup/restore cache.
bart-1.3.0.sh: cache backup is now default (cache option is now --nocache). Now works with recovery's that mount ext at either /sd-ext or /system/sd.
bart-1.3.1.sh: fix to properly source bart.config on sd-ext as well (/sd-ext/bart.config or /system/sd/bart.config)
Much thanks to Devsk.
_______________________________
Of course I'll take your money.
Or you could donate to others that helped me. Such as:
cyanogen, Meltus, Amon_Ra, rgv151, Rogro82, Loccy, manup456, and many more.
Use switchrom quite often (between cyanogen, xrom, and jacxhero). I am going to upgrade to this though.
Will I be able to just remove the old switchrom script and restore my backups made with switchrom? Or would I need to restore them with the switchrom script and then back them up with this script?
I just really hope cyanogen will integrate this into his recovery image soon. It works wonders. The only thing that bothers me is that I am lazy and dont like having to type to mount system/sd and what not
Edit: Nevermind see in the OP if they are moved to /sdcard/bart it will work, dont know how I missed that
rondey- said:
Use switchrom quite often (between cyanogen, xrom, and jacxhero). I am going to upgrade to this though.
Will I be able to just remove the old switchrom script and restore my backups made with switchrom? Or would I need to restore them with the switchrom script and then back them up with this script?
I just really hope cyanogen will integrate this into his recovery image soon. It works wonders. The only thing that bothers me is that I am lazy and dont like having to type to mount system/sd and what not
Click to expand...
Click to collapse
this sounds to me alot like switchrom on steroids lol... good work.
just posted bart-0.9.1. Fixes a bug where old nandroid backups are retained when same rom name is used.
IDK why, but removing the last * in the following command seemed to work better (got an error including the last *).
Code:
mkdir /sdcard/bart
mv /sdcard/switchROM/* /sdcard/bart/
overground said:
IDK why, but removing the last * in the following command seemed to work better (got an error including the last *).
Code:
mkdir /sdcard/bart
mv /sdcard/switchROM/* /sdcard/bart/
Click to expand...
Click to collapse
My bad. Thanks.
dumfuq said:
just posted bart-0.9.1. Fixes a bug where old nandroid backups are retained when same rom name is used.
Click to expand...
Click to collapse
Was this per my request in the switchrom thread? If so sweet, if not then rockon anyways cuz the damn issue is fixed, I looked one day and I had 100mb left on my sd card, the switchrom folder was like 6GB cuz old bkup NAND imgs that stacked up over a month of bouncing between CM and hero
ESKIMOn00b said:
Was this per my request in the switchrom thread? If so sweet, if not then rockon anyways cuz the damn issue is fixed, I looked one day and I had 100mb left on my sd card, the switchrom folder was like 6GB cuz old bkup NAND imgs that stacked up over a month of bouncing between CM and hero
Click to expand...
Click to collapse
Yup. You instigated that one. Figured it was kinda a big issue for people who are always juggling space (like myself).
So now if I were to be using cyanogen for three days and for whatever reason I switch to xrom, if I was gonna back up the cyanogen rom I don't need to delete my previous backup?
rondey- said:
So now if I were to be using cyanogen for three days and for whatever reason I switch to xrom, if I was gonna back up the cyanogen rom I don't need to delete my previous backup?
Click to expand...
Click to collapse
If you use the same name to store a rom, yes it will overwrite the previous backup with said name. The ext-backup.tar will be overwritten and the nandroid backup will be deleted before the new one is made.
works great, thanks!
Used it to switch back and forth between CM 4.1.11.1 and JacHEROSki today and it worked like a champ. Nice job!
Thank you sir!, any way you can point me in the direction of modifying the script so the default is just ap* dal*, versus the whole ext partition, have several files and other things in the ext partiton that I don't need older version over writing my current version by accident.... basically restore the way devsk's script backed up ext side, do I just move the variable for the condition from the conditional statement and recreate it as global and set it equal to 1? 0? I'm pretty good at c, java, and a few other languages so its not totally greek, just a little unfamilar.
thanks bro
Good Work!
I have an suggestion. I use switchrom all the time. Every time I back up, the whole of the ext is backed up every time..
I would like it if only the dalvik-cache and the app_s alone is backed up and restored, and the app and app-private is either left alone, OR restored from a central location..
This would enable me to switch between ROM's, but keep the up to date apps in their present state...
I never wipe the app and app-private when switching between ROM's so that any app updates I have previously performed, remain as they are.. The issue arises when I use switchROM.sh to restore an old build, this will restore my apps to that point in time, and I have to re-update them...
Just a thought... I was considering doing this myself, but a couple of attempts failed, so I will leave it to the PRO's to figure out..
ESKIMOn00b said:
Thank you sir!, any way you can point me in the direction of modifying the script so the default is just ap* dal*, versus the whole ext partition, have several files and other things in the ext partiton that I don't need older version over writing my current version by accident.... basically restore the way devsk's script backed up ext side, do I just move the variable for the condition from the conditional statement and recreate it as global and set it equal to 1? 0? I'm pretty good at c, java, and a few other languages so its not totally greek, just a little unfamilar.
thanks bro
Click to expand...
Click to collapse
If you throw the -b switch in there (base), it will only store/restore app* and dalv* folders to/from your EXT.
A naming convention I use is CMx.xx.x09-21-09 [store all]
CMx.xx.x09-21-09NB[nandroid-base]
CMx.xx.x09-21-09EB[EXT-base]...and so on...
I tried using BART and this is what I get:
Code:
/system/sd # sh bart.sh -s
sh bart.sh -s
Please entere name for ROM.
test
test
Storing ROM test, proceed? (y/n) y
y
Storing app data...
tar: empty archive
Error occurred during storing of app data...
tar operation failed.
Do you have enough space on the /sdcard?
I have more than 2.5GB left on my SD card, my ext partition is 300MB, switchrom is working just fine, so what do you think my problem is?
pascanu said:
I tried using BART and this is what I get:
Code:
/system/sd # sh bart.sh -s
sh bart.sh -s
Please entere name for ROM.
test
test
Storing ROM test, proceed? (y/n) y
y
Storing app data...
tar: empty archive
Error occurred during storing of app data...
tar operation failed.
Do you have enough space on the /sdcard?
I have more than 2.5GB left on my SD card, my ext partition is 300MB, switchrom is working just fine, so what do you think my problem is?
Click to expand...
Click to collapse
Are you running it through the recovery console? Also I'm not sure if it is a prerequisite to create /sdcard/bart folder prior to running the script. It says to in the OP, so that's what I did. I know switchrom created it for you. Try this in recovery:
Code:
mount /system/sd
sh /system/sd/bart.sh [-flags][romname]
pascanu said:
I tried using BART and this is what I get:
Code:
/system/sd # sh bart.sh -s
sh bart.sh -s
Please entere name for ROM.
test
test
Storing ROM test, proceed? (y/n) y
y
Storing app data...
tar: empty archive
Error occurred during storing of app data...
tar operation failed.
Do you have enough space on the /sdcard?
I have more than 2.5GB left on my SD card, my ext partition is 300MB, switchrom is working just fine, so what do you think my problem is?
Click to expand...
Click to collapse
I have been unable to recreate this.
1) Can you try from the phone itself (in recovery of course) not using adb?
2) Are you positive there is space left? `busybox df -h /sdcard`
script works flawlessly, thank you soo much for making life |------------------| that much easier.
hopefully this can be added into the next recovery image once cyanogen gets some time together for it. he's been tweaking the **** outa his other roms. lol
madunix said:
hopefully this can be added into the next recovery image once cyanogen gets some time together for it. he's been tweaking the **** outa his other roms. lol
Click to expand...
Click to collapse
I already talked to him about it, he said he's gonna work on a new recovery this week.

[GUIDE] Root Hero [MAC], Load Unofficial MoDaCo 1.2c, Nandroid Backup/Restore!

NOTE: This is a work in progress. While I have completed this guide myself SEVERAL times to ensure accuracy, It is possible that typos or errors in understanding exist. Please use at your own risk, and expect NOTHING from me. I will do my best to update this guide and improve the formatting as I find time. Feel free to leave feedback!
I cannot stress this enough: always have backups of any important information. While we may not be able to do full image-based backups until after root, you can still make sure we aren't deleting needed data. While yes, Google should hold your most important data and allow you to sync at any time, what would you do if Google went down? And I've even had trouble using the "Offline" function for some of the Apps. Therefore, Make a copy of everything on your SD card and read this excellent guide from Lifehacker about how to backup Google Apps data: Lifehacker
You will need an SD card. I recommend AT LEAST an 8GB Class 4. Most actually recommend a Class 6 for use with apps2sd, but I just wanted to let you know that it would still work with a Class 4. For those unaware, apps2sd allows you to save internal phone memory by placing after-market applications onto your SD card. Most users notice a speed benefit from this.
If you would like to purchase a Class 6 SD card, you can get a one here with three sizes available (4GB, 8GB, 16GB):
A-DATA MicroSDHC Class 6 Turbo With SD Adapter
To ensure the best possible load, perform a factory reset, and WIPE your SD card!
Code:
Menu > Settings > Security > Factory data reset > Reset phone > Erase everything
TRUE FACTORY RESET (UN-ROOT)
If you, like me, have already rooted and are trying to perform this process over again, you will unfortunately have to download the original ROM and flash it in Windows.
Download: RUU_Hero_C_Sprint_1.29.651.1_signed_release.exe
Run in Windows (I used XP through VMWare Fusion), and this will return the phone to the TRULY factory loaded state. Any other Factory data reset will simply reload the last ROM image saved, which, if you rooted and loaded MoDaCo, would be MoDaCo. I am encouraging you to follow this process to avoid any problems that may exist while the phone is rooted or loaded with the unofficial ROM. And even if you perform this process as a first-time rooter, it certainly wont hurt!
ROOT HERO [MAC]
(This is the process that allows modifications to occur on your phone):
The guide I follow and can verify is this:
Rooting CDMA Hero [Mac]
I do not use Windows as a primary platform, so I would recommend following this guide if you are on Windows:
How to root the CDMA Hero (DETAILED Windows guide)
You should be able to return to this guide after you have successfully completed the root process on Windows. Continue from the section "NANDROID BACKUP" below.
Per the purpose of this guide, I will detail my exact steps from the "Rooting CDMA Hero [Mac]" post. Thanks ajones7279!
Plug in your phone
Download Android SDK: http://developer.android.com/sdk/index.html
Unpack, Rename the extracted folder to "AndroidSDK" (This is case sensitive!), and Move it to "Applications" (I consider the Android SDK a set of applications.)
Open TextEdit, Click Format>Make Plain Text, then copy and paste the following:
Code:
export PATH=${PATH}:/Applications/AndroidSDK/tools
Save as: ".bash_profile"
On Phone: Go to Settings > Applications > Development>USB Debugging and make sure the option is checked.
On your Mac: Download asroot2: http://zenthought.org/tmp/asroot2
Save this file into: /Applications/AndroidSDK/tools
Open Terminal and run the following commands (You can copy and paste):
Code:
cd /Applications/AndroidSDK/tools
adb push asroot 2 /data/local
adb shell chmod 0755 /data/local/asroot2
adb shell
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4775 su
exit
exit
At this point, the phone has root access.
Download: http://rapidshare.com/files/303797523/recovery-RA-heroc-v1.2.3.img
Save this file into: /Applications/AndroidSDK/tools
Go back to your terminal and type:
Code:
adb push recovery-RA-heroc-v1.2.3.img /sdcard/
adb shell
su
flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
exit
exit
adb shell reboot recovery
Now, the phone will reboot into recovery mode. To preserve our freshly rooted state, we will make a Nandroid backup.
NANDROID BACKUP
*NOTE: These steps assume that you have already entered Recovery Mode on the phone through Terminal "adb shell reboot recovery" or the "Quick Boot" app.*
On phone: Using the trackball, scroll down and select "Nandroid v2.2 backup". This will create a backup of the phone in its freshly rooted state to your SD card, under the nandroid directory.
After it completes the backup, we want to make sure that we have the backup "backed up" by copying it to our Mac (Just in case anything happens to the SD card!).
Select "USB Mass storage on"
After your SD Card appears, copy the contents of the "nandroid" folder to anywhere you wish on your Mac (You are using Time Machine right?)
Once the copy is complete, eject the sdcard in mac and select "USB Mass storage off" on the phone.
NOTE: Nandroid does not backup the contents of your SD card. If you don't want to lose what's on your SD card, MAKE A BACKUP COPY!
From this point forward, if you do something that seems to really mess with the phones functionality, you can simply go back to your Nandroid backup!
RESTORE NANDROID BACKUPS
Select "Nandroid v2.2 restore" *THIS WILL ERASE EVERYTHING ON YOUR PHONE*
Your phone will be returned to the condition it was in as of the last Nandroid backup. You can control which backup is restored by deleting the unwanted, time-stamped folders within the "nandroid" directory on your SD card. If you leave only one time-stamped backup folder, that is the backup that will be restored.
Note that this will leave the custom Recovery ROM we loaded (recovery-RA-heroc-v1.2.3.img) in place.
I actually perform a Restore after every Backup. While this takes extra time, you know your Backup is intact and not corrupted in any way!
If you are looking for a complete factory reset, you will need to scroll up to "TRUE FACTORY RESET (UN-ROOT)"
PREPARE SD CARD FOR APPS2SD (A2SD)
For those unaware, apps2sd allows you to save internal phone memory by placing after-market applications onto your SD card. Most users notice a speed benefit from this.
Select "Wipe SD: fat32+ext2+swap" *THIS WILL ERASE EVERYTHING ON YOUR SDCARD*
Select "USB Mass storage on"
The mounted drive should now be empty. Double-check that it was partitioned correctly by opening Disk Utility and verifying 3 partitions on the sdcard: NONAME, disk1s2, and disk1s3. Close Disk Utility.
LOAD Unofficial MoDaCo 1.2c Core ROM
Forum Post: Unofficial MoDaCo 1.2
Download: Unofficial MoDaCo 1.2c Core
Save this file into: your SD card. (the root of your SD card, probably named "NONAME" if you didn't change it. You can change it to whatever you want though.)
Save the file as: "update.zip" (Or rename it)
Eject your sdcard and Select "USB Mass storage off"
Select "Apply sdcard:update.zip"
Select "Reboot system now"
If it successfully loaded, you now have a fresh load of the Unofficial MoDaCo 1.2c ROM! Congrats!
I would recommend that you create another Nandroid backup. Scroll back up to "NANDROID BACKUP" and follow the steps over again and come back to this point.
Now you are ready for the workarounds!
Guide: Workaround Issues (Unofficial MoDaCo 1.2c)
Why'd you make another guide?
nice guide man, no need to respond why you made another guide, the more the merry, nicely detailed as well
Shhhhhh.
I was just curious because there are like six...
I made another guide because while many of the forum posts acomplish bits and pieces, my guide provides the overall picture. Root, ROM, and Backup. And my upcoming "Workarond Issues" guide will collect scattered information in a similar fashion.
I find it ironic that I thanked you for your contribution and you find this guide excessive. Would you prefer that I removed the guide?
No not at all. Yours is nice and concise. There's just a lot, that's all. That's why I said it would be nice if a moderator could have merged all the ones that were already written at the end of mine. Didn't mean any harm.
Ah, I see what you mean. To be honest, I am also making this guide for self reference. If most all of the information I need is together its easier to help myself as well as my friends and the community. Thanks again for all your contributions.
Just to raise awareness, Nandroid does NOT back up your apps if you are using AppsToSD as in MoDaCo. You must back up your apps separately.
True, thanks for the heads up. I'll work on a separate guide that details how to backup your other apps. I believe that anything after-market can be backed up and restored through ASTRO though, and this is much easier for most than adb and Terminal commands (push/pull).
The whole 1.56.651.2 Firmware update is also making me wait to post any further guides, as some of my worksarounds may prove useless. It looks like we still have the Apps Renaming and Reverting issue though, and I didn't see the Sprint admin adress such issues specfically.
?
ok i did the update to the hero. and now found out about rooting(im new to all this) do i run that program you put in the beginning with windows? and then does that rom resolve the issue with battery with sms and other things the OTA update fixed? or should i get another rom or .img idk what to call it really and what does RUU stand for?
Alright,
A couple things to add to this guide, for the complete noob, as I can try to explain it a little more clear.
This should be done prior to doing anything within the guide.
First, connect your phone to your computer and mount your sd card. This can be done by connecting the usb cable, then on your phone, drop down the menu and chose, connect to p.c., Mount SD card. Make a folder and backup your entire sd card to this folder. Once done, delete everything off the card. if you don't, you will run into format and partitions errors later in the guide.
Eject the sd card on the computer, and end usb sharing on the phone. remove the USB cable from the computer.
Next, on the phone Go to Settings > Applications > Development>USB Debugging
Make sure that USB debugging is NOT CHECKED. If its checked later in the guide you will run into errors pushing the files onto the phone.
At this point you can start the guide from the beginning, under the main heading Root Hero [MAC]
I am running OSX 10.6.2 so i ran into a couple of issues.
Next. Under the part where you have to create the .bash file. This file should be saved in your user folder.
/Users/USERNAME where USERNAME is the name of your user account.
For instance my User account is Hamspiced so my user folder is:
/Users/Hamspiced/
when saving the file, uncheck "if no extension is provided, use .txt".
Next, I couldn't copy paste the code because it wasn't parsed properly. This is what i had to do.
And this should be a direct copy paste into terminal. If you don't know how to access terminal click the spyglass in the upper right hand of the screen, and type in terminal. then you should be able to directly copy paste this text.
Code:
cd /Applications/AndroidSDK/tools
./adb push asroot2 /data/local
./adb shell chmod 0755 /data/local/asroot2
./adb shell
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4775 su
exit
exit
As stated you should have root access on the phone. you can verify this by downloading Terminal emulator from the Market, then running the app. Once inside the app if you hold Menu, you should bring up the onscreen keyboard. if you type in "su" (stands for super user) it will change the prompt from $ to #. If yours does not change, start over, something went wrong. If it did change then you can proceed to the next part of this guide.
Next the guide is trying to put the recovery Image to your phone. This doesnt restore your phone, it just puts the recovery portion to it, and it allows you to do all the cool things to your phone, like allow you to create backups, restore backups, and load customs roms.
again i ran into issues with parsing the correct format so these are copy pastes from terminal.
Code:
./adb push recovery-RA-heroc-v1.2.3.img /sdcard/
./adb shell
su
flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
exit
exit
adb shell reboot recovery
If you get an access denied error pushing the recovery image, its because you had debugging turned on prior to connecting your phone to the computer. it must be off, then turned on once the phone is connected.
This will result in headaches, and endless google searching with no results.
Follow the rest of the guide regarding the Nandroid backup this backs up the entire phone settings. you want to save the raw phone backup as well as the backup after you load the rom. both are incredibly important!
Prepare SD Card for Apps2sd….
If when you checked Disk Utility and your SD card didnt partition properly follow these steps.
You must erase everything on your sd card for these steps to work. I ran into errors creating the partition. What i had to do was in the recovery mode chose factory recovery. when the phone restarted i had to go to Settings>Security>Factory Data Reset.
This restored EVERYTHING. THe phone, Sd Card, Etc. Everything was lost, however since in the begining, we made a backup of the SD card, and then we made a backup of our phone, we are fine.
Restart the phone in recovery mode once this finishes and restarts. (Hold Home and Power to turn on)
Next chose Part SD: fat32+ext2+swap this will partition the card properly. Then choose restart phone.
Once the phone restarts, we have to go through the normal steps that we did once we first received the phone for its first bootup. connect it to the computer, transfer over the Nandroid backup that should be saved from the first time you saved it on your phone. then restart the phone again in recovery mode.
Now you need to restore the nandroid backup. since you transferred it over, its the only nandroid backup there is, it will restore the phones origional settings. from here you can load the official MoDaCO rom fine on the SD card that is now formatted properly.
These are about all the issues and resolutions i ran into. Hopefully it helps someone else.
Guess it's subjective. I think I haven't turned off USB Debugging since shortly after I got the phone and didn't run into any problems. It's always on before I plug it in and I haven't ran into any errors while pushing a file to my sd card. Also didn't erase my sd card before I formatted (did back it up though of course) and everything went smooth. Dunno. It's always good to hear from diff people though. Also just edited my thread, thanks for the heads up.
need help rooting htc hero from sprint
i have 1.5 firmware bb version is 1.04.01.09.21 kernel version 2.6.27-533ce29dhtc [email protected] build number1.56.651.2 cl85027software 1.56 cant get root on this device can someone please help me
quis5550 said:
i have 1.5 firmware bb version is 1.04.01.09.21 kernel version 2.6.27-533ce29dhtc [email protected] build number1.56.651.2 cl85027software 1.56 cant get root on this device can someone please help me
Click to expand...
Click to collapse
Try here
http://forum.xda-developers.com/showthread.php?t=581686&highlight=root+mac
First, excellent guide! Personally, I used Universal Androot (snipurl.com/uaroot) to root my Hero, but this was a huge help in getting the SDK installed!
I'm running into a problem while trying to do the Nandroid backup. When I try to flash the recovery image, I get the following error message....
AJBlue98$ ./adb shell
$ cd /sdcard/
$ su
# flash_image recovery recovery-RA-herocv1.6.2.img
flash_image: not found
Click to expand...
Click to collapse
I even try the command with the leading "./" and I get essentially the same thing...
# ./flash_image recovery recovery-RA-herocv1.6.2.img
./flash_image: not found
Click to expand...
Click to collapse
I'm running the latest official Sprint 2.1 ROM on my Hero and Terminal on Mac OS X Snow Leopard 10.6.4 on a late-2009, 17 in. MacBook Pro. Oh, and I installed the Android SDK into another directory (had it installed before I found this tutorial), so here's my $PATH...
-bash: type: /opt/local/bin:/opt/local/sbin:/Users/AJBlue98/soylatte/bin:/Users/AJBlue98/android-sdk-mac_86:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin: not found
Click to expand...
Click to collapse
Am I missing something? I'll really appreciate the help!
—Adam
ajblue98 said:
First, excellent guide! Personally, I used Universal Androot (snipurl.com/uaroot) to root my Hero, but this was a huge help in getting the SDK installed!
I'm running into a problem while trying to do the Nandroid backup. When I try to flash the recovery image, I get the following error message....
I even try the command with the leading "./" and I get essentially the same thing...
I'm running the latest official Sprint 2.1 ROM on my Hero and Terminal on Mac OS X Snow Leopard 10.6.4 on a late-2009, 17 in. MacBook Pro. Oh, and I installed the Android SDK into another directory (had it installed before I found this tutorial), so here's my $PATH...
Am I missing something? I'll really appreciate the help!
—Adam
Click to expand...
Click to collapse
yeah, you're missing the "flash_image" binary on your phone lol search xda for it and push it to /system/bin, then try the command again.
regaw_leinad said:
yeah, you're missing the "flash_image" binary on your phone lol search xda for it and push it to /system/bin, then try the command again.
Click to expand...
Click to collapse
Thanks, regaw_leinad, for the lead! I found a copy of the flash_image file and copied it to my Android SDK folder, but when I try to push it to my phone, I get this:
AJBlue98$ ./adb push flash_image /system/bin
failed to copy 'flash_image' to '/system/bin/flash_image': Permission denied
failed to copy 'flash_image' to '/system/bin/flash_image': Read-only file system
Click to expand...
Click to collapse
(I rebooted the phone and tried again after my original post. The error message changed. BTW I'm connected via USB with debugging turned on and "Charge only" selected as my connection type.)
I've tried running adb as root, but I get this:
AJBlue98$ ./adb root
adbd cannot run as root in production builds
Click to expand...
Click to collapse
Again, any help will be greatly appreciated!
—AJBlue98
ajblue98 said:
Thanks, regaw_leinad, for the lead! I found a copy of the flash_image file and copied it to my Android SDK folder, but when I try to push it to my phone, I get this:
(I rebooted the phone and tried again after my original post. The error message changed. BTW I'm connected via USB with debugging turned on and "Charge only" selected as my connection type.)
I've tried running adb as root, but I get this:
Again, any help will be greatly appreciated!
—AJBlue98
Click to expand...
Click to collapse
ok type
adb shell
then
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
to mount it as r/w
then try the flash image command again.
Adb root or adb remount won't work, because your boot.img isn't patched yet.
regaw_leinad said:
ok type
adb shell
then
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
to mount it as r/w
then try the flash image command again.
Adb root or adb remount won't work, because your boot.img isn't patched yet.
Click to expand...
Click to collapse
Okay, I did that. I'm still charge-only and debugging turned on, and here's what happened.
(N.B.: I'm on a Mac, so I have to include "./" before running an application in the current directory. Also, I'm including "AJBlue98" in front of my "$" prompts to differentiate my Mac's local prompts from the adb shell prompts.)
AJBlue98$ ./adb shell
$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mount: Operation not permitted
Click to expand...
Click to collapse
So I tried these few things...
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /sdcard/
# mv flash_image /system/bin
failed on 'flash_image' - Cross-device link
# exit
$ exit
AJBlue98$ ./adb shell su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Permission denied
AJBlue98$ ./adb push flash_image /system/bin
failed to copy 'flash_image' to '/system/bin/flash_image': Permission denied
Click to expand...
Click to collapse
Now I'm completely flummoxed. As always, please help and thanks in advance!
Update: I got frisky, so I tried this, just for the heck of it...
AJBlue98$ ./adb shell
$ su
# cd /sdcard
# ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
./flash_image: permission denied
# chmod 755 ./flash_image
# ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
./flash_image: permission denied
# su ./flash_image recovery /sdcard/recovery-RA-heroc_v1.2.3.img
Permission denied
Click to expand...
Click to collapse
Update 2:
I got some help at irc.twit.tv from a good soul in the #twitlive channel, who pointed me to ROM Manager (downloadable from the Market). That just did the whole backup, hey-presto, no flash_image BS required.
Thanks for the help anyway, all!
ajblue98 said:
Okay, I did that. I'm still charge-only and debugging turned on, and here's what happened.
(N.B.: I'm on a Mac, so I have to include "./" before running an application in the current directory. Also, I'm including "AJBlue98" in front of my "$" prompts to differentiate my Mac's local prompts from the adb shell prompts.)
So I tried these few things...
Now I'm completely flummoxed. As always, please help and thanks in advance!
Update: I got frisky, so I tried this, just for the heck of it...
Update 2:
I got some help at irc.twit.tv from a good soul in the #twitlive channel, who pointed me to ROM Manager (downloadable from the Market). That just did the whole backup, hey-presto, no flash_image BS required.
Thanks for the help anyway, all!
Click to expand...
Click to collapse
sweet, glad you got it worked out
there were a few errors in what you did above, but looks like you got everything working without it, so that's good

[HOWTO] UnRoot MyTouch 3G

!!WARNING!! THIS PROCESS MAY REQUIRE KNOWLEDGE OF THE LINUX OS BEYOND BASIC UNDERSTANDING
I did this on my own phone (original myTouch) and it worked. What is really handy is that you can manipulate anything within /data after flashing the NBH file and PRIOR to flashing the OTA update. Here is what I did:
Within recovery I put all the /data files together (moving /sd-ext/data to /data/data etc) and then ran a script which did this (0628 is just a handy way to know when you perform the backup):
NOTE: only run these commands after "mount data", "mount sdcard" are successful
Code:
busybox mkdir -p /sdcard/my_backup_data/2010_0628
rm -r /data/data/com.google*
rm -r /data/data/com.android*
for d in app app-private data
do
busybox tar -cvzf /sdcard/my_backup_data/2010_0628/$d.tgz -C /data $d
done
The removal of com.google and com.android is mostly for compatibility with system files. You are going to an older version of the OS.
Using the goldcard generator (http://psas.revskills.de/?q=goldcard) I entered my CID from the sdcard and put the goldcard.img on the card. I also placed the sappimg.nbh file on the sdcard. Now using VOLDOWN+POWER I flashed the phone back to its original state.
So now I can put in my "normal" sdcard that has recovery flasher, recovery-RA.img, modified DRC92 update.zip, DMD64 update.zip, all placed in the /sdcard root location. Using the recovery flasher I then flashed /sdcard/recovery-RA.img and went back into recovery.
NOTE: only run these commands after "mount data", "mount sdcard" are successful
Code:
for d in app app-private data
do
busybox tar -xvzf /sdcard/my_backup_data/2010_0628/$d.tgz -C /data
done
Now I have all previous apps and data loaded. So I had to boot the phone at least once and let it do its thing and then I was able to use RA's recovery to run fix_permissions. After that, all the apps worked (minus any beyond v1.5). So the last thing is to now get to v1.6 and make sure everything worked.
Once you verify everything is proper, you can copy the signed-opal-DMD64-from-DRC92.64f7dfbc.zip file into /cache (this allows easy upgrade later) and flash the signed-opal-DRC92-from-COC10.1c95e995-testkeys.zip file like any other within RA's recovery. After flashing, you will have everything stock. Once the update is completed you should instantly receive a notice that a new update has already been downloaded and is available.
I believe I have covered everything. These are the steps I used on the original myTouch to keep all my apps and settings and data after flashing the NBH file. If I left out something or you need further clarification, please ask.
this space held
hold this space

[DEV] Custom Recovery P500/Thunderg

Full release post is here and I'll update at xda soon.
http://androidforums.com/lg-optimus...ry-optimus-one-p500-thunderg.html#post1896517
I got all the bugs worked out thanks alahkel & fughy for testing and of course Amon-Ra for original source.
New link version 2.2.1 Version 2.2.1
New version 3.06 Version 3.06
Thanks to you for the whole great work you've done!
We really appreciate that.
really GREAT WORK !!!!
Please, i need some info, how use adb on P500.
Absolute AWESOME!!!
Thanks!
Thanks !
works like a charm. I have installed your custom recovery. Backed up everything with nandroid, tried KeruROM, flashed back my original branded ROM from nandroid backup.
Everything works. I'm not going to try flash back my original recovery mtd, there is no reason to do it, but have a dd backup just in case. I don't know if it is safe to tamper with recovery mtd, cause I'm not sure if it is re-flashed after every system shutdown. I don't think so, cause I haven't found recovery.img in /system.
I have two questions regarding flashing custom recovery. I haven't used this command:
Code:
# mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
cause, i didn't found this script on my phone. Is it ok?
Second question: Is it mandatory to copy flash_image to /system/bin with this command?
Code:
cat /sdcard/flash_image > /system/bin/flash_image
Can't we use /data/local/tmp directory and running flash_image from there as we used in the process of rooting the phone? This way we don't have to remount /system in rw and do not have to modify it.
Now I'm going to explore ROM modding ;-)
Vintersorg said:
Thanks !
works like a charm. I have installed your custom recovery. Backed up everything with nandroid, tried KeruROM, flashed back my original branded ROM from nandroid backup.
Everything works. I'm not going to try flash back my original recovery mtd, there is no reason to do it, but have a dd backup just in case. I don't know if it is safe to tamper with recovery mtd, cause I'm not sure if it is re-flashed after every system shutdown. I don't think so, cause I haven't found recovery.img in /system.
I have two questions regarding flashing custom recovery. I haven't used this command:
Code:
# mv /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
cause, i didn't found this script on my phone. Is it ok?
Second question: Is it mandatory to copy flash_image to /system/bin with this command?
Code:
cat /sdcard/flash_image > /system/bin/flash_image
Can't we use /data/local/tmp directory and running flash_image from there as we used in the process of rooting the phone? This way we don't have to remount /system in rw and do not have to modify it.
Now I'm going to explore ROM modding ;-)
Click to expand...
Click to collapse
Flash_image doesn't have to be there but for simplicity I put it there so it would be in ATH. The install-recovery.sh is an evil script that will rewrite a recovery on boot with stock recovery(that only is there on some phones after an official ota update) so rom markers please remove it if it exists.
Any chance the p509 optimus t is similar enough for this to work? I'm willing to be the guinea pig if it should work.
Joeseph Mother said:
Any chance the p509 optimus t is similar enough for this to work? I'm willing to be the guinea pig if it should work.
Click to expand...
Click to collapse
Its close enough it has a very good chance of working but will take a guinea pig to verify. Kernel should be close enough to try. Only differences I saw in the ramdisk of p500 & p509 was model number and lang of en GB and en Us repectively. I had a bad/corrupt dump to work off of on the p509/T. I could use a good dump source with a md5sum to verify its not corrupted in uploading/downloading.
make sure you do this 1st to backup your stock recovery
from terminal or adb shell
Code:
dd if=/dev/mtd/mtd2 of=/sdcard/recovery-dump-T.img bs=4096
please upload that dump for me with a md5 too and I'll work on an official.
Can it be done without root? As normal user?
Thanks of all to drellisdee
I want to advertise that the custon recovery file is no more available at Media fire link that suggest us.
Waiting that the file will be restored is there someone that can upload it???
Thank's of all!!!
Are you just wanting kernel & recovery dumps, because I think I've already changed most other things on my system
Installs, starts off saying E:Bad boot message "
Button layout is correct.
Usb mounting works.
Wipe appears to have worked.
Backup fails with Error:Run 'nandroid-mobile.sh' via adb!
I was looking for just the custom recovery (recovery-RA-GNM-thunderg-1.1.0.img.zip). Now it's available again!!!!
I think that i 've to apply it anyway.
Then if you say that some new rom and kernel are incoming it could be great!!!!
I hope to learn the necessary to help in development ... in this time i accept your works...
Joeseph Mother said:
Installs, starts off saying E:Bad boot message "
Button layout is correct.
Usb mounting works.
Wipe appears to have worked.
Backup fails with Error:Run 'nandroid-mobile.sh' via adb!
Click to expand...
Click to collapse
You get that error on nandroid if battery is below 30%
Joeseph Mother said:
Are you just wanting kernel & recovery dumps, because I think I've already changed most other things on my system
Click to expand...
Click to collapse
yes I only need the recovery one.
ruigui said:
Can it be done without root? As normal user?
Click to expand...
Click to collapse
It was last post on previous page... Can these backups be done as normal user, or must it be as root?
ruigui said:
It was last post on previous page... Can these backups be done as normal user, or must it be as root?
Click to expand...
Click to collapse
Recovery menu?
Only with root settings....
drellisdee said:
You get that error on nandroid if battery is below 30%
Click to expand...
Click to collapse
I wish it was that easy, battery was 90%.
Stock T recovery:
http://www.mediafire.com/?01bleb4njbf1ccy
md5: b18bd6e79c7b962739816a2f1d4bdacf
personalweb said:
Recovery menu?
Only with root settings....
Click to expand...
Click to collapse
You didn't understand. If i am working on a terminal emulator, must the following command be done as root or can it be done as normal user?
dd if=/dev/mtd/mtd2 of=/sdcard/recovery-dump-T.img bs=4096
Click to expand...
Click to collapse

Categories

Resources