Jump to content

[mod] [2011-03-22] TPT NAND Backup & Partition Tool - alpha3 [Gen1]


Guest wbaw

Recommended Posts

Blade Backup version 0.1alpha3 - 22/03/2011

This is experimental software, don't blame me if you break your phone with it.

This is only for 'Gen1' UK & European ZTE Blades & Orange San Franciscos that came with a 2.1 version stock rom. It wont work on new 'Gen2' Blades. It will automatically detect if you have one of the newer type of Blades & refuse to run if you do. See this thread for more details & ask Mr Pigfish if you're still unsure.

This script will be updated to work on TPT upgraded Gen2 phones, but at the moment it's incompatible. TPTs generated by this Script are missing the full set of .mbn files, so they wont work on Gen2 phones either. Making it work on 'proper' Gen2 phones will be a difficult task & I'll need to buy one first, or I'll need a lot of help from somebody willing to risk their proper Gen2 phone & spend a lot of time testing.

This is a script to be run with clockworkmod 3 (in the same way you'd flash a new rom) that will create a tpt backup of your phone with new internal nand memory partition sizes. This can be used to give you more space to install apps on your phone's internal memory.

It doesn't touch the sdcard, it wont backup any apps2sd apps, but it wont harm them either. Because of this it is not suitable as a long term backup solution, if you chose to 'wipe data/factory reset' in clockwork or similar, then a backup created with this script will not restore any apps you had on your sd card, use clockworkmod to create backups for that. It also wont create, alter or delete any apps2sd on it's own & it isn't for partitioning your sd card, it's only for the internal storage.

It will calculate the partition sizes automatically, based on how much space your current rom is using, it should always give you around 11mb free space on /system which should be plenty for any rom updates.

There are 3 versions of this -

blade_backup_alpha3-nocache-auto-10.zip mirror mirror (MD5: 92ef876d30faaaff9c1e12789abfaf49)

The nocache version will shrink your cache partition to 2mb, to give you an extra 40mb for your data partition. This works fine on CM7, it already has the scripts to take care of it. On Froyo (2.2) this new version of blade backup will patch your current rom, but if you install another froyo rom later, then you'll also need to install this patch, or your market wont work: cache2tmpfs mirror mirror (md5sum: c89cb62c10e6ff622d1a4c1809596e91). It wont work on Eclair (2.1) roms. You should get about 100mb more free internal storage space with this version compared to stock.

blade_backup_alpha3-cache-auto-10.zip mirror mirror (MD5: ccc8ee73eb999b2d5fc1b65b5884f864)

The cache version leaves you with a standard 41mb /cache partition & just resizes the system partition, giving you about 60mb extra internal storage space, over stock sizes. It should work with any rom (including 2.1 Eclair roms) with no extra patches.

blade_backup_alpha3-return-to-stock.zip mirror mirror (MD5: 90ed88463adf6b771a097db6aadb8cb6)

The return to stock version resets your partition sizes to stock sizes (41mb cache 207mb system 208mb data)

Method

Install clockworkmod 3. Use Rom Manager or download here & flash with fastboot.

Copy the blade backup .zip to your sdcard.

You will need at least 500mb free space on your sdcard & plenty of charge in your battery.

Turn off your phone & leave it for 30 seconds.

Turn it on with vol - held to go into clockwork.

Flash zip from sdcard -> choose zip from sdcard -> blade_backup.zip

Wait for the backup to complete, it will take a few minutes.

Reboot.

Look in the /image directory of your sdcard, if everything went ok, then it should have a file named '00-PART-XX-XXX-XXX' the Xs are the partition sizes. If you dont see that file, there may be a different one describing an error.

Turn off your phone & leave it for 30 seconds.

Turn it on with vol+ & menu held to flash the new partition sizes.

Delete or rename the image directory on your sd card after installing, to prevent installing it again accidentally.

Other stuff

As a side effect this will also allow newer 'B10' type phones to boot into fastboot mode by holding vol+ & power on (make sure you delete the image directory first!), just like the old blades.

It should fix 256mb Greek blades to 512mb.

It may fix the touch screen problems on new 'B20' blades.

Power Users

There are some more (mostly untested) options which you can set in META-INF/com/google/android/updater-script

On line 19 you should see this line...

run_program("/tmp/image/backup-script.sh", "fast", "nocache", "auto", "10");

The first option can be set to "fast", "full", or "nodata". fast is standard, it backs up boot system & userdata. full backs up the splash & recovery images too. nodata replaces userdata with a blank image.

The second option is cache or nocache, cache gives you a 42mb cache partition, nocache gives you 2mb

The third option is either "auto" "manual" or "stock". auto calculates a size for the system partition based on how big the backed up system.img is. manual lets you set a manual size for system. stock sets stock partition sizes, you must also use "cache" with the stock option.

The final option is either the amount of free space added to the system partition, for auto mode, or the size of the system partition in manual mode. In megabytes. Does nothing if previous option is set to stock.

If you're going to edit that line, then you can download any of the versions, that's the only difference between them.

Like this script? Want to see more of my work?

btn_donateCC_LG.gif

blade_backup_alpha3_nocache_auto_10.zip

blade_backup_alpha3_cache_auto_10.zip

blade_backup_alpha3_return_to_stock.zip

Edited by wbaw
Link to comment
Share on other sites

Guest Rotmann

Nice MOD. As I understand this, the cache will be redirected to the card, will this have a negative impact on the performance? Also how big was the cache partition, around 50 MB?

Edited by Rotmann
Link to comment
Share on other sites

Guest ergo911
will be working without step -> shrink_cache.zip ?

the install will work but then you won't get 333mb for data you get 286mb and just waste space for not used cache partition.

Link to comment
Share on other sites

Nice MOD. As I understand this, the cache will be redirected to the card, will this have a negative impact on the performance? Also how big was the cache partition, around 50 MB?

No it redirects your phone's /cache partition, which is a mostly wasted 42mb of space only used for downloading apps from the market, to your phones internal /data partition. it doesn't touch the sd card.

Link to comment
Share on other sites

will be working without step -> shrink_cache.zip ?

No, shrink cache does the partitioning, redirect-cache is just a fix so that doesn't break your phone.

If you don't repartition your phone before running redirect-cache then it'd just be a waste of space, your phone will still work, but you'll get no benefit & it'll use up space on your data partition each time you install an app for no reason.

Link to comment
Share on other sites

Guest kallt_kaffe

Nice one, but RLS9 has some more new stuff in userinit.sh so you may want to update.

But more importantly, change the order of the stuff in userinit.sh to make sure this line:

# Done here
/system/bin/setprop userinit.filesystem.ready 1[/code]

Is run as the last thing it does.

Before that property is set the whole startup is put on hold so it's propably safer to keep it on hold while redirecting the cache and release it after you are done.

Link to comment
Share on other sites

Nice one, but RLS9 has some more new stuff in userinit.sh so you may want to update.

But more importantly, change the order of the stuff in userinit.sh to make sure this line:

# Done here

/system/bin/setprop userinit.filesystem.ready 1

Is run as the last thing it does.

Before that property is set the whole startup is put on hold so it's propably safer to keep it on hold while redirecting the cache and release it after you are done.

Thanks, kallt, I'll update it soon.

Link to comment
Share on other sites

silly question: will /Data get wiped?

Yes, the Japanese Jellyfish image install already does that.

Backup with Titanium & also do a nandroid backup too, before trying this. You should wipe all data before installing - the install will wipe /cache /data & /system, but it wont touch anything on your sd card, so you may want to clear sd-ext & .android-secure too.

If you're going to try to restore a nandroid backup, or install another rom over the top of this (check the size first!), you'll need to re-install redirect-cache-jj9.zip afterwards.

Edited by wbaw
Link to comment
Share on other sites

Guest shadowninty
Yes, the Japanese Jellyfish image install already does that.

Backup with Titanium & also do a nandroid backup too, before trying this. You should wipe all data before installing - the install will wipe /cache /data & /system, but it wont touch anything on your sd card, so you may want to clear sd-ext & .android-secure too.

If you're going to try to restore a nandroid backup, or install another rom over the top of this (check the size first!), you'll need to re-install redirect-cache-jj9.zip afterwards.

thanks mate, have RLS9 installed, Backing up with Titanium, I'll do a Nandroid when that's done :lol:
Link to comment
Share on other sites

thanks mate, have RLS9 installed, Backing up with Titanium, I'll do a Nandroid when that's done :lol:

If you already have rls9 installed, then you should be able to copy data.img from your nandroid backup, rename it userdata.img & overwrite the userdata.img in the jj9 image folder with it. That would preserve your data, so don't wipe sd-ext or .android-secure if you do that. The mod doesn't make any changes to userdata, but it does need to rewrite it in a different location on the phone's internal flash.

If you made any changes to /system, you can replace system.img with the one from your nandroid backup too, as long as it isn't above 122mb. That should preserve any themes, battery indicator mods, or any other extras you've installed. Don't do it if your system partition is over 122mb, this mod also shrinks the system partition.

You can also replace boot.img with the one from the ahb overclocking zip, if you want the ahb overclocked kernel.

Anybody that doesn't already have JJ9 installed will probably need to wipe their user data.

Edited by wbaw
Link to comment
Share on other sites

Guest oh!dougal

There is an important warning that needs to be made explicit.

When you install your NEXT rom, you have to remember that you have done this!

Changing the size of /cache is "sticky" -- it will persist until your next TPT-type install.

BUT -- the redirection (using space on /data when cache is needed) is a special addition (patch) to the software that the rom needs to run every time it boots up.

If the special patch does not run (for example because that scripting is not in the new rom that you want to install), then you WILL have problems, notably with installing apk's.

Its ONLY going to bite you when you install your NEXT rom!

The simple solution, before installing a different rom without the special bootup script, is to run a TPT-type install that restores your /cache to its standard size!

"Just a word to the wise... !" :lol:

Edited by oh!dougal
Link to comment
Share on other sites

There is an important warning that needs to be made explicit.

When you install your NEXT rom, you have to remember that you have done this!

Changing the size of /cache is "sticky" -- it will persist until your next TPT-type install.

BUT -- the redirection (using space on /data when cache is needed) is a special addition (patch) to the software that the rom needs to run every time it boots up.

If the special patch does not run (for example because that scripting is not in the new rom that you want to install), then you WILL have problems, notably with installing apk's.

Its ONLY going to bite you when you install your NEXT rom!

The simple solution, before installing a different rom without the special bootup script, is to run a TPT-type install that restores your /cache to its standard size!

"Just a word to the wise... !" :lol:

Thanks, I'll add some more warnings to my original post.

The only side effect appears to be that downloading apps from the market wont work, if you don't run the redirect script, but that's a pretty big thing.

The good news is the redirect script should work on other roms too, I just haven't tested it.

It also shrinks the system partition to 122mb, which is a tight fit for Japanese Jellyfish, which is one of the smallest froyo roms. So you'll probably have to change the partition sizes before installing another rom anyway. There are instructions in the Japanese Jellyfish post for how to reset your partitions back to the standard layout, or a clean JJ image install will give you the cache back & a 128mb system partition.

If you update to a later version of Japanese Jellyfish, you will need to install the redirect-cache zip again too, unless kalt includes it in his release & you may need to wait for me to update it to the latest version if he changes userinit.sh.

One last thing, if you make any changes to userinit.sh do it after applying the redirect-cache zip, otherwise you'll lose them.

Edited by wbaw
Link to comment
Share on other sites

Guest oh!dougal
...

It also shrinks the system partition to 122mb, which is a tight fit for Japanese Jellyfish, which is one of the smallest froyo roms. ...

Would that potentially make for difficulties for "themers" ? (Or even installing other keyboards/languages/dictionaries?)

I rather like Vlingo (amazing free dictation app) and I believe it wants to stick stuff into /system ...

Edited by oh!dougal
Link to comment
Share on other sites

Would that potentially make for difficulties for "themers" ? (Or even installing other keyboards/languages/dictionaries?)

I rather like Vlingo (amazing free dictation app) and I believe it wants to stick stuff into /system ...

Themes should be ok, as long as they don't add a lot of extra stuff. I think there's still about 3.5mb free space on JJ9 & the themes are replacing files, they don't seem to add a huge amount of extra data. I think you could install all the addons & themes from this site without any trouble, but i haven't tested them all. You'll only run into trouble if you're adding large apps to your system partition manually for some reason, then you'll just have to remove a bit of crud to make room.

If you install another keyboard from the market, it'll go in /data so that's fine too. /system is read only in android, so you don't really need any free space, nothing gets installed there under normal circumstances, unless you flash it in recovery mode, root it & remount system r/w, or do a tpt. JJ comes with gingerbread & htc keyboards, so theres no reason to add any to /system.

Link to comment
Share on other sites

Guest shadowninty
If you already have rls9 installed, then you should be able to copy data.img from your nandroid backup, rename it userdata.img & overwrite the userdata.img in the jj9 image folder with it. That would preserve your data, so don't wipe sd-ext or .android-secure if you do that. The mod doesn't make any changes to userdata, but it does need to rewrite it in a different location on the phone's internal flash.

If you made any changes to /system, you can replace system.img with the one from your nandroid backup too, as long as it isn't above 122mb. That should preserve any themes, battery indicator mods, or any other extras you've installed. Don't do it if your system partition is over 122mb, this mod also shrinks the system partition.

You can also replace boot.img with the one from the ahb overclocking zip, if you want the ahb overclocked kernel.

Anybody that doesn't already have JJ9 installed will probably need to wipe their user data.

yup copying Boot.img, Data.img (renamed to userdata.img) and System.img into TPT Image\ folder worked perfectly!

thanks again :lol:

Edited by shadowninty
Link to comment
Share on other sites

I can confirm that themes & the 0x90 mod work fine with this mod. They're overwriting existing files, so there's no space problem. I left a bit of free space on /system with jj8 or 9 & this mod to allow for installing a few addons & also because the system.img files seem to be a couple of mb bigger than the actual system. This is why it's a 122mb /system partition & not 120mb.

Link to comment
Share on other sites

Guest rufree2talk

EDIT: Please ignore as I figured out how to mount the system in rw mode. Doofus me :lol:

My query is not particularly related to this mod, but I am using kallt's JapJelly9 and have this issue of not being able to modify files under /system inspite of having root access. It claims to be a read-only file system (drwxr-xr-x). I can't even use chmod to change the access permissions. I have used Paul's r11 and haven't faced this problem. I am not exactly a newbie with unix but in no way an expert. What could be going wrong.

For the more curious, I am trying to replace the font files under /system/fonts, as simple as that!

Edited by rufree2talk
Link to comment
Share on other sites

EDIT: Please ignore as I figured out how to mount the system in rw mode. Doofus me ;)

My query is not particularly related to this mod, but I am using kallt's JapJelly9 and have this issue of not being able to modify files under /system inspite of having root access. It claims to be a read-only file system (drwxr-xr-x). I can't even use chmod to change the access permissions. I have used Paul's r11 and haven't faced this problem. I am not exactly a newbie with unix but in no way an expert. What could be going wrong.

For the more curious, I am trying to replace the font files under /system/fonts, as simple as that!

/system is mounted read only, you need to remount it (r/w). RootExplorer will do it if you tap a button on the top right, if you use adb it's just 'adb remount', or there's a mount command to do it from the terminal, you can search for that.

Link to comment
Share on other sites

Guest socialworker

oh!dougal:

Your warning seems to be quite accurate.

I repartioned some time ago, installed FLB7 today.

For some reason the userinit trick doesn't work with that ROM.

All downloads from market larger than ~4mb fail and there's nothing in /data.

If the redirect works, shouldn't there be a 'cache' directory in /data?

Any idea what could be wrong?

I'm not really feeling like repartitioning again.

Edit: fyi, I looked at the actual userinit.sh in my /system/bin, it has everything in there needed for the cache redirect.

Edited by socialworker
Link to comment
Share on other sites

Guest Assaf a

this rom is cool but since ive installed it i got problems with my battery ,it wont charge to 100% but only to 50% max and it drains fast

does anyone else but me got this problem?

anyway thanks for the hard work...

Link to comment
Share on other sites

Guest shadowninty
this rom is cool but since ive installed it i got problems with my battery ,it wont charge to 100% but only to 50% max and it drains fast

does anyone else but me got this problem?

anyway thanks for the hard work...

wrong thread ;)

have you wiped /Data and /Cache?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.