Related
A few weeks ago my SD card went bad on me. I have been using Gingershedbread as my ROM and see there are some updates, however, since I don't have an SD card, the "normal" method of loading the zip onto the SD card obviously won't work for me.
My question is: Is there a way to flash a ROM zip from a pc (windows) to my phone without an SD card? I know you can put the zip on the data partition, then use "recovery --update_package=DATA:rom.zip" (through adb), however, when trying to copy the rom I get a message saying that there is no space left.
As of now, the only thing I know of is to do a full wipe and factory reset, then push the ROM zip to my phone, but I don't necessarily want to do this every time.
I have also tried fastboot and using mkyaffs2image to create a system.img from the ROM's system folder in the zip file, but I am not doing something right.
I run "mkyaffs2image c:\rom\system\ c:\system.img"
then with my phone in fastboot, I "fastboot flash system c:\system.img"
and "fastboot flash boot c:\rom\boot.img".
I restart the phone in recovery mode, load gapps and xtrCache, but then it reboots, sits on black screen for a few seconds, then reboots into recovery.
I have tried erasing system and boot first, but that didn't seem to help.
I first tried just flashing system.img, but that didn't work.
Not sure what I am doing wrong. Is there a way to take a ROM zip and create a system.img and boot.img that can be flashed through fastboot without an SD card? OR, is it possible to flash a ROM zip without transferring the file to my phone first? Any help would be appreciated.
I don't think that there is an answer to your question which is both complete and also short.
So, here goes with the long answer.
First, a yaffs2 image file (e.g. system.img) is not compressed, so it is quite large - for things like the HTC factory/stock ROMs, it can be bigger than the cache partition. I don't know if the cache partition is actually used when you push things with fastboot, but experimentally, I have run into the problem that when attempting to do a
Code:
fastboot flash system my-yaffs2-system.img
fastboot gives you get an error about being out of room.
Second, and more importantly, the file modes (permissions) and user:group ownership of files in the /system mount point are extremely critical to proper operation of Android. If you have files sitting on a Windoze machine filesystem (either FAT32 or NTFS), all this information will be lost even before you create your "yaffs2" image file. (Not only that, but all symbolic links will be missing, too). This is why you observe that ROM files have instructions in their "update-script" (or "updater-script") command files for setting file & directory ownership, file permission modes, creating symlinks, et cetera.
Third - even if you use a linux OS to unpack yaffs2 images, and run as root when you are doing so, a lot of the "unyaffs" programs that are lying around do not even bother to extract things like user:group ownership or file modes - so you are basically screwed as soon as you unpack a yaffs2 image file on a PC, no matter whether it is Windows or Linux/Unix/OS-X.
Fourth, I am not sure that it is even a good idea in the first place to be "flashing" yaffs2 images. The "fastboot flash" command merely writes whatever you pass to it as a long linear blob of bytes, and there is no evidence to suggest that the yaffs formatting used in the archive is the same formatting used by the kernel. When "Nandroid" runs to restore a system.img or data.img file onto the phone, it does not write the image as a linear blob of bytes: it actually mounts the filesystem in question, cleans it up with a "rm -rf *" command, and then manually unpacks the yaffs2 image file into the mounted file system, one file at a time. (Fortunately in this case, it actually restores things like symlinks, file permissions, and file/directory user:group ownership information). This insures that the low-level yaffs2 formatting is *identical* to what the kernel expects, because it is the kernel that creates it.
There is a solution, but it is tedious enough that you really ought to ask the question, "Why don't I go out and buy a replacement SD card for 10 bucks instead of wasting a huge amount of time?"
Here's the solution:
You mount /system, clean it up manually, use adb to push the files recursively from wherever you have them stored on your PC, and then afterwards you run a custom (signed) installer .zip file which has been modified so that it only contains the "symlink" and permission-setting commands - you delete the "format" and "extract" commands from that command file, since you have manually put all the files into /system. Either that or you manually adjust the permissions and user:group ownership information by hand.
Obviously, since you don't have an /sdcard any longer, you will need to put this flashable, custom .zip file in /cache, and then create a one-line command file at /cache/recovery/command that points at the flashable .zip file in /cache. (This is the way the the OTAs work, and also how ROM Manager is able to customize the recovery when it boots).
Is this a lot of work? Yeah, you betcha.
It seems like running down to wally world to get a cheap SD card might be a little more fun.
Thanks for the info. I figured getting a new SD would be the best solution.
I knew about the symlink and file permission stuff and was trying to flash a system img then run a zip to ser that info., but couldn't get it to work. Sounds like using fastboot might be a bad idea.
For now I think I will just have to find a rom and stick with it for a while.
I am nearing an upgrade for a new phone and looking at the Thunderbolt, which comes with an SD so I don't want to buy one just yet.
Thanks for your help.
Sent from my ERIS GSBv2.1 using XDA App
kgunnIT said:
then run a zip to ser that info., but couldn't get it to work.
Click to expand...
Click to collapse
If you know how to sign ROMs, it's really not a hard hack to launch an installer of the type you mention.
And, now that I've just said that, I think I have another, simpler, idea.
But first:
[SIZE=+2]How To Launch a (smallish) .zip-based Flash That's Not On the SD Card.[/SIZE]
All of the recoveries - both the stock and custom recoveries - look for a "command" file when they first start up.
It literally is named "command", i.e.: /cache/recovery/command
... and it is a simple text file with as few as one line(s) in it.
Here is an example from the most recent OTA of the contents of /cache/recovery/command:
Code:
--update_package=CACHE:8e3b63f96149.OTA_Desire_C_Verizon_WWE_2.37.605.4_2.36.605.1_release.zip
basically, it's just a single line with the following format:
--update_package=CACHE:filename.zip
So, if you are trying to get an installer to run without an SD card, you would:
1) Boot to Amon_RA
2) Wipe the cache if necessary (wipe -> wipe data/factory reset also clears /cache)
3) Push your zip file to cache:
Code:
adb push mycustominstall.zip /cache/
4) Create a command file (say, named "command.txt") with the contents:
Code:
--update_package=CACHE:mycustominstall.zip
5) Push it to the phone:
Code:
adb push command.txt /cache/recovery/command
6) reboot directly back into recovery with
Code:
adb shell reboot recovery
When the recovery boots up again, it will immediately start unpacking your "mycustominstall.zip" file.
After I thought this all the way through, I realized, though: a lot of the ROM files are only about 100 MB, and cache is about 128 Mb, so
.... wait for it .....
... wait for it ....
it might be a worthwhile experiment to just push an untouched ROM file right to cache and then use that ROM file's name in your "command" file.
So long as /sbin/recovery does not unpack files to /cache (I can't remember if it does this or not!), you could use original ROM files -- just what you wanted originally. If it unpacks things to cache, though, it will only get part way through the install and fail.
It's worth a shot; if it fails, you'll have a mess that is no worse to clean up than what you've presently got. (If it fails, to be on the safe side it might be wise to go in using adb and clean things up in /cache a little bit so that the next recovery boot has some wiggle room in /cache - e.g. "adb shell rm -rf /cache/*" )
bftb0
bftb0 said:
If you know how to sign ROMs, it's really not a hard hack to launch an installer of the type you mention.
And, now that I've just said that, I think I have another, simpler, idea.
But first:
[SIZE=+2]How To Launch a (smallish) .zip-based Flash That's Not On the SD Card.[/SIZE]
All of the recoveries - both the stock and custom recoveries - look for a "command" file when they first start up.
It literally is named "command", i.e.: /cache/recovery/command
... and it is a simple text file with as few as one line(s) in it.
Here is an example from the most recent OTA of the contents of /cache/recovery/command:
Code:
--update_package=CACHE:8e3b63f96149.OTA_Desire_C_Verizon_WWE_2.37.605.4_2.36.605.1_release.zip
basically, it's just a single line with the following format:
--update_package=CACHE:filename.zip
So, if you are trying to get an installer to run without an SD card, you would:
1) Boot to Amon_RA
2) Wipe the cache if necessary (wipe -> wipe data/factory reset also clears /cache)
3) Push your zip file to cache:
Code:
adb push mycustominstall.zip /cache/
4) Create a command file (say, named "command.txt") with the contents:
Code:
--update_package=CACHE:mycustominstall.zip
5) Push it to the phone:
Code:
adb push command.txt /cache/recovery/command
6) reboot directly back into recovery with
Code:
adb shell reboot recovery
When the recovery boots up again, it will immediately start unpacking your "mycustominstall.zip" file.
After I thought this all the way through, I realized, though: a lot of the ROM files are only about 100 MB, and cache is about 128 Mb, so
.... wait for it .....
... wait for it ....
it might be a worthwhile experiment to just push an untouched ROM file right to cache and then use that ROM file's name in your "command" file.
So long as /sbin/recovery does not unpack files to /cache (I can't remember if it does this or not!), you could use original ROM files -- just what you wanted originally. If it unpacks things to cache, though, it will only get part way through the install and fail.
It's worth a shot; if it fails, you'll have a mess that is no worse to clean up than what you've presently got. (If it fails, to be on the safe side it might be wise to go in using adb and clean things up in /cache a little bit so that the next recovery boot has some wiggle room in /cache - e.g. "adb shell rm -rf /cache/*" )
bftb0
Click to expand...
Click to collapse
You always find the one thousand and ONETH way to skin a cat. Hehehehe...
Thankyou so much for this this alowed me to flash a rom on my phone which can't detect any sd cards and i stupidly wiped it before relising the sd card wasnt being detected!
sum_guy55 said:
Thankyou so much for this this alowed me to flash a rom on my phone which can't detect any sd cards and i stupidly wiped it before relising the sd card wasnt being detected!
Click to expand...
Click to collapse
very good, sum_guy55!
At least all that typing wasn' t in vain.
Out of curiosity, how big was the ROM file you used?
bftb0
Been meaning to post this:
Thanks for your posts roirraW "edor" ehT and bftb0 for posting this. I also was able to clear the cache and push the ROM and update.
However, I have xtrCMCache2cache on my phone, so the dalvik-cache was moved from /data/ to /cache/. After doing a wipe of dalvik-cache from Amon recovery, the folder in /cache/ was not emptied out. I went ahead and cleaned it manually, which freed up enough space to push the ROM.
Is this behavior expected using cache2cache and wiping dalvik-cache from recovery? I guess it would be since the dalvik-cache was moved.
Anyway, after clearing the dalvik folder, I was able to push GSBv2.4 to my phone, as well as gapps and xtrCMCache2cache, a total of almost 80 MB. Rebooted and all was well.
Thanks again for your help.
kgunnIT said:
Been meaning to post this:
Thanks for your posts roirraW "edor" ehT and bftb0 for posting this. I also was able to clear the cache and push the ROM and update.
However, I have xtrCMCache2cache on my phone, so the dalvik-cache was moved from /data/ to /cache/. After doing a wipe of dalvik-cache from Amon recovery, the folder in /cache/ was not emptied out. I went ahead and cleaned it manually, which freed up enough space to push the ROM.
Is this behavior expected using cache2cache and wiping dalvik-cache from recovery? I guess it would be since the dalvik-cache was moved.
Anyway, after clearing the dalvik folder, I was able to push GSBv2.4 to my phone, as well as gapps and xtrCMCache2cache, a total of almost 80 MB. Rebooted and all was well.
Thanks again for your help.
Click to expand...
Click to collapse
It was all bftb0. Interesting, I had once asked if cache was definitely wiped from Amon after it was moved. The consensus was that it should. I shall be anticipating some light shed on this.
Sent from my Gingerbread Eris via Tapatalk
Well, Amon_RA has no idea whether you are using cache2cache; I suppose we would need to look at the code to figure out how it behaves.
If it mounts /data and then does something like
rm -rf /data/dalvik-cache
there is a chance that the symbolic link is not followed, which would explain what kgunnIT observed.
Normally, if you are flashing a new ROM in a full-wipe fashion, the " wipe data/factory reset" menu option clears both /data and /cache, so in that case it is irrelevant that the "wipe dalvik-cache" is a no-op.
If you are overflashing, it's not obvious that you need to wipe the dalvik-cache... at least for the market apps normally stored in /data/app, although it seems like it would be a good idea to do so, as the system apps could be changing.
Note that even when cache2cache is not in use, the Amon_RA menu item "wipe dalvik-cache" never works as intended for froyo & gingerbread ROMs - the system apps have their dalvik-cache stored in /cache, and this never gets touched by Amon_RA with that menu operation.
BTW... for what it's worth, the ClockworkMod recoveryhas a menu entry for wiping only the cache.
bftb0
bftb0 said:
BTW... for what it's worth, the ClockworkMod recoveryhas a menu entry for wiping only the cache.
bftb0
Click to expand...
Click to collapse
Does ClockworkMod recovery work ok on the Droid Eris? I was going to load it on, but saw some people posting that it bricked their phones, so now I am skeptical. I will do more research and see if this is something I want to do. Thanks for your insight.
kgunnIT said:
Does ClockworkMod recovery work ok on the Droid Eris? I was going to load it on, but saw some people posting that it bricked their phones, so now I am skeptical. I will do more research and see if this is something I want to do. Thanks for your insight.
Click to expand...
Click to collapse
There is a version of Amon_RA (the trackball-optional version) that also allows you to format cache. You can find out more about it here: http://androidforums.com/eris-all-t...2-custom-recovery-trackball-not-required.html
That said, if you have ROM Manager, you can have Clockwork Recovery start as a stub within Amon_RA just from ROM Manager (the first option copies a file called update.zip to the root of your SD card, and the second, "Reboot into Recovery", starts Amon_RA with a script to flash update.zip, which starts Clockwork.) In fact, once update.zip is on the SD card, you can start Amon_RA as you always do, go to the Flash a zip from SD card menu, choose update .zip, and it will start Clockwork, if you want to do it that way. However, the drawback to this is that you can't go back to Amon_RA without shutting down the phone and then restarting in Recovery again, so I just find it easier to use the trackball-optional version of Amon_RA.
I think every person who has bricked their Eris while running Clockwork was running Clockwork Recovery as their main recovery image, and not in the way that I described in the last paragraph. (Though don't hold me to that ...)
kgunnIT said:
Does ClockworkMod recovery work ok on the Droid Eris? I was going to load it on, but saw some people posting that it bricked their phones, so now I am skeptical. I will do more research and see if this is something I want to do. Thanks for your insight.
Click to expand...
Click to collapse
I've been using it through ROM Manager since last August or so, I use it all the time.
I was on a hunt to make this work without losing any data and I've figured out a way that works quite nice, and all it involves is a TWRP backup, ADB, and a bit of commandline.
Thanks to TrevE for his ever evolving tweaks to Android and for making them readily available to the community at the cost of one thanks per post, and maybe a beer or two (how many people really buy beer with donations?!)
Required:
TWRP backup
ADB
The EXT4 tweaks for /data
The EXT4 tweaks for /system
(If your ROM doesn't already have them, I will be providing the zips for them courtesy of Synergy.)
Step 1:
Connect your phone to your PC and like all things of this nature, BACKUP! Use TWRP to create a nandroid of your entire phone. We will need this backup to restore data and system via commandline. TWRP is the only tested method that works, since it creates backups that are actually TAR files (God, I love TWRP for this). Stay in recovery after completing backup.
Step 2:
While still in recovery, enable USB storage mode and download the two EXT4 files below (or applicable if your ROM already has one of the partitions optimized) onto the root of your microSD card. To make things easier, you can temporarily move your data.win and system.win files to the root of your microSD card. They are located in the TWRP folder on your microSD card. Afterward, disable USB storage mode.
Next, there are TWO ways to accomplish this. Choose which way you want to go before continuing.
Method 1: Reflash your ROM(NOT RIGHT NOW, later on in the guide--depending on ROM, this may format your /system and/or data partitions, rendering the tweaks useless.)
Method 2: Use commandline to restore your ROM from TWRP backup.
Step 3:
From recovery, wipe dalvik and cache and format data and and depending on method, your system partitions as well. NOTE: formatting the partitions can be done from TWRP in the advanced menu.
Step 4:
Flash the applicable EXT4 file.
Step 5:
Mount /data, /system, (if applicable), and /sdcard with TWRP and launch an ADB shell by typing "adb shell" then press enter while in your ADB folder from command prompt/terminal.
Step 6:
Type "cd /sdcard" and press enter. To make sure you're in your sdcard, type "ls" then press enter to verify that it's listing your microSD card contents.
Step 7:
Type "cd /data" and press enter. To make sure you're in /data, type "ls" then press enter to verify that it's empty. It will probably contain a lost+found folder, if so then that's fine.
Step 8:
If you moved your data.win and system.win backups to the root of your microSD card to make this easier, simply type "tar xvpf /sdcard/data.win" then press enter and it will begin extracting the backup file onto the /data partition. Otherwise, you will have to type "tar xvpf /sdcard/TWRP/nameofHTCfolder/nameofdatefolder/data.win" then press enter. This will take a few minutes to complete.
NOTE: MAKE SURE YOU ARE IN THE /DATA PARTITION BEFORE TYPING THAT COMMAND, OTHERWISE THINGS WILL GO WRONG.
Step 9:
Either reflash your current ROM (checking to make sure it doesn't format /system before installing) OR type "cd /system" then press enter. To make sure you're in /system type "ls" then press enter to verify that it's empty. It may contain another folder, if so that's fine. It should however be empty of ROM related files.
Step 10:
If you moved your data.win and system.win backups to the root of your microSD card to make this easier, simply type "tar xvpf /sdcard/system.win" then press enter and it will begin extracting the backup file onto the /system partition. Otherwise, you will have to type "tar xvpf /sdcard/TWRP/nameofHTCfolder/nameofdatefolder/system.win" then press enter. This will take a few minutes to complete.
NOTE: MAKE SURE YOU ARE IN THE /SYSTEM PARTITION BEFORE TYPING THAT COMMAND, OTHERWISE THINGS WILL GO WRONG.
Step 11:
Once this is all complete, exit ADB shell by typing "exit" then pressing enter. Next, unmount /system, /data, and /sdcard from TWRP and head on over to the fix_permissions option in TWRP and let it run. It will take a few minutes to complete.
Step 12:
Go ahead and wipe dalvik and cache again just to make sure, then reboot.
It will take a while to boot back into android, but if all goes well, you should have your data intact with fully optimized EXT4 partitions thanks to TrevE/Synergy.
NOTE: This worked for me, and if you follow the guide precisely, it should work for you too.
NOTE2: I did not try this method with /system, ONLY data, and it worked fine. I assume the same for /system as well.
Awesome! I as many others are appreciative of Team Xposed and how you explain mods to everyone. Most of the time we get a .zip with no explanation on how the .zip is doing what it does. We just know flash this and this happens, lol. With these breakdowns we all get a better understanding on how things work in our devices
Perhaps a sticky with all Team Xposed mods/tweaks, that would be
I believe this is what i used the last time i flashed synergy. If so, then it works great.
Wow the step by step was GREAT!! Man I did this in like 5 minutes....Granted it took me about 30 minutes to download all the tools I needed. Thanks for this one!!
Edit: So how do you know it truly worked?? How do I check if I am ext4 or not?
wow. I had EXT4 on my samsung phones and I LOVED it compared to this! I will definitely try this and make a video on my success or failure! lol
so what if i didnt care to lose data could i flash this with another rom.
Ok. So just trying to gain a better understanding here. So say if the rom were running already includes the /system tweaks but not the /data tweaks and the rom doesn't erase on flash can I just flash both of the files and flash the rom?? Also if I wanted to apply the tweaks to and existing nand can I just flash both the files and do a nand restore??? Or is restoring the data from the command line needed in order for the tweaks to work effectively???
Locked & Loaded
" Shooter on Deck "
Great write up, thanks for that!
Not to be a party pooper, but isn't there a tweaked version of the EXT4 optimized zip that backs up data to sd card, formats /data with ext4, then auto restores /data for you? I found it somewhere in the Synergy thread.
Correct me if im wrong if this does something more/different.
here is a link to it:
Synergy_Format_Data_EXT4_Optimized_apps_autorestored.zip
http://forum.xda-developers.com/attachment.php?attachmentid=708982&d=1315062399
I used it to go from Warm2.3 to Steel2.3 without any issues what so ever, except having to restore XDA app, wifi/bt networks and some widgets. It kept all my screens and settings just the way i like it. YMMV! i take no credit, and assume no responsibility if it rips your phone a new one.
Our phones are already ext4, the optimization just turns on some more features for ext4.
And the tool linked before me doesn't backup everything in /data... It should probably work, but if it misses anything this method will catch it
I just took the opportunity to wipe clean and reset some things.
Sent from my PG86100 using XDA App
youngpro83 said:
Wow the step by step was GREAT!! Man I did this in like 5 minutes....Granted it took me about 30 minutes to download all the tools I needed. Thanks for this one!!
Edit: So how do you know it truly worked?? How do I check if I am ext4 or not?
Click to expand...
Click to collapse
Good question. I suppose you could run a few Quadrant benches to ease your mind. You should get much better scores than you would normally. I suppose the only real way to know for sure is if someone created an EXT4 tweak checker of some sort lol. But the Quadrant benchmark should be enough, that is if you remember what kind of scores you were getting before hand.
digitalcrash said:
so what if i didnt care to lose data could i flash this with another rom.
Click to expand...
Click to collapse
Glad you asked! If you don't care about losing data, just go ahead and format your system and data partitions with TWRP or whatever recovery you use, then apply the tweaks zips and go ahead and flash the ROM of your choice. You should double check the updater-script of your ROM to make sure it doesn't reformat the /system partition or it will render the /system tweak useless.
laie1472 said:
Ok. So just trying to gain a better understanding here. So say if the rom were running already includes the /system tweaks but not the /data tweaks and the rom doesn't erase on flash can I just flash both of the files and flash the rom?? Also if I wanted to apply the tweaks to and existing nand can I just flash both the files and do a nand restore??? Or is restoring the data from the command line needed in order for the tweaks to work effectively???
Locked & Loaded
" Shooter on Deck "
Click to expand...
Click to collapse
Well, if the ROM you're running already contains the /system tweaks then you're half-way there. You still want a backup though, because each of these zips will format its respective partitions. You only want the zip that applies. In your case, you'd only need the data tweaks, but you'd still have to follow the guide that pertains to restoring your data partition after tweaking.
MFD00M said:
Great write up, thanks for that!
Not to be a party pooper, but isn't there a tweaked version of the EXT4 optimized zip that backs up data to sd card, formats /data with ext4, then auto restores /data for you? I found it somewhere in the Synergy thread.
Correct me if im wrong if this does something more/different.
here is a link to it:
Synergy_Format_Data_EXT4_Optimized_apps_autorestored.zip
http://forum.xda-developers.com/attachment.php?attachmentid=708982&d=1315062399
Click to expand...
Click to collapse
Glad you linked that. I actually looked over this yesterday, and while it does do something similar to this guide, It actually only restores part of your data partition, which is why it's said that you will need to repair your bluetooth devices and reenter your WiFi network settings. IIRC, it doesn't restore the entire data partition, just most of the important folders. If it were to do the entire partition, well, this guide would be much shorter.
freeza said:
Glad you linked that. I actually looked over this yesterday, and while it does do something similar to this guide, It actually only restores part of your data partition, which is why it's said that you will need to repair your bluetooth devices and reenter your WiFi network settings. IIRC, it doesn't restore the entire data partition, just most of the important folders. If it were to do the entire partition, well, this guide would be much shorter.
Click to expand...
Click to collapse
Thanks for clearing that up, i will try your method as well. I need more ADB exposure to help me learn.
so my next question is if the rom does format system on boot then i would install with adb as your guide says?
digitalcrash said:
so my next question is if the rom does format system on boot then i would install with adb as your guide says?
Click to expand...
Click to collapse
Yup...pretty much.
Thank you for this. I was able to apply this without any issues.
freeza said:
Yup...pretty much.
Click to expand...
Click to collapse
What would be the process if I didn't care about losing data? Would I just flash, and resign into my Google account and go through that process again?
LiquidSolstice said:
What would be the process if I didn't care about losing data? Would I just flash, and resign into my Google account and go through that process again?
Click to expand...
Click to collapse
If you don't care about losing data, you'd format/wipe the data and system partition from recovery, apply both ext4 zips... wipe dalvik+cache, reflash your ROM, and reboot
Keep in mind that this is pretty much the same process as factory reset, so you might as well just perform one of those lol
freeza said:
If you don't care about losing data, you'd format/wipe the data and system partition from recovery, apply both ext4 zips... wipe dalvik+cache, reflash your ROM, and reboot
Keep in mind that this is pretty much the same process as factory reset, so you might as well just perform one of those lol
Click to expand...
Click to collapse
So just to be clear, all that I need to do is before I flash a ROM, Superwipe/XRON wipe like I always do, flash the ROM, flash the EX4 zips, and then clear dalvik/cache and boot?
LiquidSolstice said:
So just to be clear, all that I need to do is before I flash a ROM, Superwipe/XRON wipe like I always do, flash the ROM, flash the EX4 zips, and then clear dalvik/cache and boot?
Click to expand...
Click to collapse
You wanna flash the zips before flashing ROM, as they format the partitions with the tweaks. You also want to double check the updater-script of your ROM to make sure it doesn't format the /system partition before installing, as it would remove the tweaks.
Soo..
Superwipe/XRON
EXT4 tweaks
ROM
No need to wipe anything as Superwipe/XRON already does this.
freeza said:
You wanna flash the zips before flashing ROM, as they format the partitions with the tweaks. You also want to double check the updater-script of your ROM to make sure it doesn't format the /system partition before installing, as it would remove the tweaks.
Soo..
Superwipe/XRON
EXT4 tweaks
ROM
No need to wipe anything as Superwipe/XRON already does this.
Click to expand...
Click to collapse
EXT4 before ROM?
Bear with me, I'm still a bit confused :X. Wouldn't flashing a ROM after the EXT4 data/system zips negate the zips' function?
LiquidSolstice said:
EXT4 before ROM?
Bear with me, I'm still a bit confused :X. Wouldn't flashing a ROM after the EXT4 data/system zips negate the zips' function?
Click to expand...
Click to collapse
lol no problem.......Well, what the tweaks does is format the system and data partitions a certain way as to improve io functions and other stuff. It's like formatting a drive in Windows with cluster switches etc. It's still empty once you flash the tweaks. The ROM simply puts all the information on the newly formatted filesystem. If you were to apply the tweaks after flashing the ROM, it would format the partitions and erase all data, which is why you do it first. The updater-script in ROMs also have the ability to format partitions, which is why in Synergy ROMs, simply flashing their ROM also applies the tweak and which is why you should check your updater-script beforehand to make sure it doesn't have a format command in it, as it would negate the tweaks.
THIS ZIP WILL FORMAT YOUR INTERNAL MEMORY CARD ALONG WITH SYSTEM AND CACHE. YOU WILL HAVE NOTHING BUT RECOVERY ON YOUR PRIME!!!
IF YOU DON'T WANT THAT TO HAPPEN, MOVE ALONG, THIS AIN'T FOR YOU!!!
AS WITH ANY FLASHING PROCESS, SOMETHING COULD GO WRONG!!!
NEITHER I NOR XDA SHALL BE HELD RESPONSIBLE FOR ANY DAMAGE
THAT YOU CAUSE BY FLASHING THIS ZIP!!!
Now that's out of the way, let me explain the reasons for this zip's existence.
I personally do not like having things left hanging around on my phone's SDcard
after I flash a new ROM onto it, I usually back up my data and format the card too.
It struck me that due to the nature of having an internal SDcard in the Prime
There most surely be stuff hanging around in there from all the flashing I've done.
I also find that hunting down application folders for apps that I have since deleted
can be rather tiresome as they are not always labelled as expected.
Maybe I'm just lazy, but there you go.
Now you can simply install this Zip and all of your partitions will be fresh and clean.
So that's why this zip was born unto the world.
ONCE AGAIN, THIS ZIP WILL FORMAT YOUR INTERNAL MEMORY CARD ALONG WITH SYSTEM AND CACHE. YOU WILL HAVE NOTHING BUT RECOVERY ON YOUR PRIME!!!
BEFORE STARTING, MAKE SURE YOU CAN ACCESS YOUR PRIME THROUGH ADB IN RECOVERY!!!!
INSTRUCTIONS: (THIS GUIDE ASSUMES YOU KNOW HOW TO SETUP AND USE ADB)
1. Download prime-full-wipe.zip to your Prime.
2. Backup everything from your internal SDcard to a location that exists outside of your Prime. USB Hard drive, flash drive or another SDcard.
3. After making certain that your data is safe, reboot your Prime to recovery. (zip will work in both CWM and TWRP)
4. flash the zip.
5. Once complete, you will need to reboot to recovery manually otherwise ADB push will not behave correctly.
6. After a successful reboot to recovery, open up Terminal or Command Prompt.
7. Push a new ROM.zip to your Prime via the command
Code:
adb push /path/to/rom.zip /sdcard/
If "/sdcard/" doesn't work, which sometimes happens use
Code:
adb push path/to/rom.zip /data/media/
for some reason it seems that "/sdcard/" is not seen all the time. So far seems to be a windows issue only.
8. Install your new ROM and enjoy that factory fresh taste.
I hope that these instructions are clear enough. If anyone needs help I or someone else will be happy to assist.
I STRESS AGAIN, THIS ZIP WILL FORMAT YOUR INTERNAL MEMORY CARD ALONG WITH SYSTEM AND CACHE. YOU WILL HAVE NOTHING BUT RECOVERY ON YOUR PRIME!!!
Credits to mero01 for the original idea and Team Virtuous for some sexy code used in the zip file.
KOUSH for CWM and Team Win for TWRP
Big thanks to swiss-prime and anthonyexmouth for being patient men/windows guinea pigs!
Thanks to Nandrew for pointing out that users may need to reflash CWM if experiencing ROM Manager errors after flashing this ZIP!.
UPDATE: 31/05/12
OK, so to anyone that has had problems pushing a new rom to the SD card after using this zip file. I have found some rather odd behaviour that sometimes occurs when formatting the Prime.
After many hours of testing yesterday, I found that when using CWM I simply couldn't push a file to the sdcard no matter whether I was pushing to "/sdcard/" or "/data/media/"
The only way I was able to get a rom onto the sd card was to eventually flash TWRP using fastboot and push the file after booting into TWRP. However after doing so and then getting a rom installed on the Prime, when looking through the file structure with Root explorer I found that the sdcard symlink had not actually been re-created properly, the file was there, but it was not showing as a folder, and as such, I believe that this is where the problem some people are having stems from.
The only solution that I found was to re-flash the full-wipe.zip again in TWRP and then push a rom onto the sdcard again. After successfully getting back into a working rom, I checked out the file structure and the alias had been properly re-created this time.
The behaviour is very weird and there seems to be no rhyme or reason to it. However, if you have had issues pushing to the sd card after using my zip, I can only apologise for your worry.
I hope that the above makes sense and helps people out who feel that they are now up sh*t creak without a paddle.
To be clear I do not believe this to be an issue caused by CWM, I believe it to be a Prime issue.
Update 01/06/12
Nandrew pointed out to me that you will receive non-critical error messages from CWM about a missing log file after using this ZIP. Once you have made a backup, a log file will be created and these error messages will cease.
You may also need to reflash CWM if you experience rom manager errors.
I think I should give it a shot!
john9 said:
I think I should give it a shot!
Click to expand...
Click to collapse
I'm heading out for about 20 minutes, but I'll be around after that. If you run into any issues.
This looks really helpful Dok - thanks! I seem to have accumulated a mass of crap on my SD card and I was wondering what to do with it...
I do have one question (not directly related to your zip). I have all this stuff on my SD card but I don't know which folders contain app user data and what can be safely deleted. Will TiBu restore all necessary user data to /sdcard after using this (obviously after copying the TiBu folder back to /sdcard ) or do I need to figure out what user data I need to keep for each of my apps before I wipe?
Hope that makes sense! Thanks again for this.
paddycr said:
This looks really helpful Dok - thanks! I seem to have accumulated a mass of crap on my SD card and I was wondering what to do with it...
I do have one question (not directly related to your zip). I have all this stuff on my SD card but I don't know which folders contain app user data and what can be safely deleted. Will TiBu restore all necessary user data to /sdcard after using this (obviously after copying the TiBu folder back to /sdcard ) or do I need to figure out what user data I need to keep for each of my apps before I wipe?
Hope that makes sense! Thanks again for this.
Click to expand...
Click to collapse
I haven't used TiBU yet, I made this zip and flashed it last night, then just flashed it again earlier, so I am currently with a Prime with no ROM.
I think though that TiBU should behave as normal, You may need to re-download app data for some of the biggies like games that have a separate download after the install.
Before I flashed it last night, I backed up the entire contents of the card to a USB hard drive, to make certain that I didn't lose anything at all.
<Edit> Nevermind... I read the whole post!
Doktaphex said:
I haven't used TiBU yet, I made this zip and flashed it last night, then just flashed it again earlier, so I am currently with a Prime with no ROM.
I think though that TiBU should behave as normal, You may need to re-download app data for some of the biggies like games that have a separate download after the install.
Before I flashed it last night, I backed up the entire contents of the card to a USB hard drive, to make certain that I didn't lose anything at all.
Click to expand...
Click to collapse
Thanks. I guess I am just not quite sure how TiBu works. When you do an normal factory reset thru CWM and leave /sdcard intact does TiBu restore a link to app user data located on /sdcard or does it completely rewrite it based on whats in /sdcard/TitaniumBackup/?
Doesn't really matter. I will just back everything up before I use this. I know I need to clean up /sdcard but am a bit chicken to use this
paddycr said:
Thanks. I guess I am just not quite sure how TiBu works. When you do an normal factory reset thru CWM and leave /sdcard intact does TiBu restore a link to app user data located on /sdcard or does it completely rewrite it based on whats in /sdcard/TitaniumBackup/?
Doesn't really matter. I will just back everything up before I use this. I know I need to clean up /sdcard but am a bit chicken to use this
Click to expand...
Click to collapse
Just finished restoring my TiBU and all my apps and relevant data are intact after only copying across the TiBU folder.
Im glad someone finally made this for everyone else. I had once had a problem with my prime that no matter how many times i wiped and reflashed my status bar was not working and when i tried to return to my back up of stock it was giving me read errors restoring the data section and would stop. I had to modify a zip to format what this does and then reflash and then everything worked again. Wiped my tf201 clean but hay it worked again and thats what mattered.
I would love to try this out but I am absolutely too scared of this ADB thing to work on pushing the Zip to the Prime...I figure I will brick it..
acdcking12345 said:
I would love to try this out but I am absolutely too scared of this ADB thing to work on pushing the Zip to the Prime...I figure I will brick it..
Click to expand...
Click to collapse
What operating system do you use on your computer?
adb is easier on Linux and Mac than on windows.
Doktaphex said:
What operating system do you use on your computer?
adb is easier on Linux and Mac than on windows.
Click to expand...
Click to collapse
It is windows. :-(
acdcking12345 said:
It is windows. :-(
Click to expand...
Click to collapse
I would have a look at the naked ADB driver thread here very useful for windows users and should help put some of those fears to rest.
Yes and if you follow this guide to install ADB it will be easy:
http://dottech.org/tipsntricks/2153...ows-computer-for-use-with-your-android-phone/
ok, when you say reboot into recovery do you mean "fastboot"
cant find device in adb. using win7 with naked drivers.
Yeah, I dont think I am that gutsy to take this risk. But Ill keep researching it. I would like to start fresh as possible..
anthonyexmouth said:
ok, when you say reboot into recovery do you mean "fastboot"
cant find device in adb. using win7 with naked drivers.
Click to expand...
Click to collapse
No I mean exactly as I said. After flashing in recovery, you have to reboot back into recovery. It is a funny quirk that I may need to look into further.
No then, to your problem. Do you have an irc client on your computer? If so, come over to #asus-transformer on freenode irc and we can talk in real time.
If not, then I will endeavour to assist you here.
Gonna take the zip down for a moment until we can sort this out.
ok, rebooted into recovery and it now sees it in adb. i get a load of E: cant open lines but i guess thats cuz they aint there.
adb push "rom" /sdcard
all looks like its doing it but been stuck there for 20 mins.
leaving it just in case.
anthonyexmouth said:
ok, rebooted into recovery and it now sees it in adb. i get a load of E: cant open lines but i guess thats cuz they aint there.
adb push "rom" /sdcard
all looks like its doing it but been stuck there for 20 mins.
leaving it just in case.
Click to expand...
Click to collapse
I assume that you are abbreviating when you say adb push "rom" /sdcard
It should take no more than 3 minutes to push the rom
yeah full path is adb push c:\android\virtuousprime.zip \sdcard
Recently I was studying android recovery mode, and I have some questions. Anyone knows the answer? Thanks very much.
1. Can recovery flash bootloader?
From this link====>http://forum.xda-developers.com/showthread.php?t=2321310, I think it can do that. But I'm not sure.
2. Can recovery flash recovery partition itself?
I think it can not do this. Not confirm that.
3. We know in update.zip, boot.img is corresponding boot partition, but why system is a folder, not system.img? There is a system partition also.
4. While OTA upgrade system, why the update package downloaded under /cache path? Can we change it to sdcard?
5. Most important, what exactly update-script do things under recovery mode? How the command executed?
BTW, there are other questions, but not related to Recovery Mode.
1. How can I see the flash partitions? I know to use the command cat /proc/mtd, but as Samsung, it use emmc flash, while I type that command, no results printed. How to see?
2. About userdata partition, we know that when first run android OS, system will copy files from /system to /data, but does it do it every time that we turn on the phone or just do it once after the first booting after we update our system?
Hello,
I can answer some questions, and I hope someone else can fill the blanks.
1. Can recovery flash bootloader?
=> Yes, you have to modify your boot image, but it still possible, just include the modified boot image in the update file, and give good command in update.zip
2. Can recovery flash recovery partition itself?
=> I am not sure, but I think its possible, I saw code of recovery in Android code, so if you modify it, and include the good image in update.zip, I think you will see the modification. Never tried for now.
3. We know in update.zip, boot.img is corresponding boot partition, but why system is a folder, not system.img? There is a system partition also.
=> In fact is depend witch compilation system you use. For Cyanogen, yes in fact its a folder, but for AOSP its System.img
The difference comes from the command file in update, theire not the same. But finally the result in the same. We have a system partition.
4. While OTA upgrade system, why the update package downloaded under /cache path? Can we change it to sdcard?
=> Reasons I can see :
--> In past, sdcard was not mounted by default in recovery mode, so can't see the update.zip file
--> sdcard can be removed at any time, its dangerous, when do the update to loose the file
--> To be sure have right to remove the update.zip when installation done
--> Old phone didn't have all a sdcard, cache is sure to exists
=>Yes we can change it, but we have to be sure the sdcard is mounted on recovery mode. And be sure of the path of sdcard on recovery mode. For exemple in Nexus one it is /sdcard, in Samsung Galaxy S2 is /emmc/, in Samsung S4 mini its /sdcard/0/ ... So it could be a reason why its not in sdcard, because the path is not generic.
5. Most important, what exactly update-script do things under recovery mode? How the command executed?
=>It does lot of stufs, like mount partitions, copy system files, ...
The update-script is in elf script. Generally, an elf interpreter is given just next to the update-script.
I hope it helped you,
JHelp
1 yes, but flashing firmware from recovery can be dangerous and all though unlikely I have seen many brick there phone doing so
2. Yes, rather easily so long as the .zip is put together properly. But like bootloader, it is safest so flash through fastboot or download mode but a very unlikely brick so mostly safe
3. This is how a ROM gets built from source but it needs not be in this setup. At the same note I can't see a better way to flash through recovery than like it is. Using flash_raw_image would work but due to size a system.img shouldn't be flashed in recovery rather through fastboot, bootloader or download mode
4 mostly because you couldn't have an oem ota update without an SD card which isn't a prerequisite for using a phone. Also I believe there is some added safety flashing directly from nand, but in truth this is all speculation. Yes with a rooted phone this could be changed but most often it isn't wise to flash an oem ota on a rooted device
5 lots of things, take a look at my threads for a guide I made explaining this
1 cat /proc/partitions
mount
ls -l /dev/block/
And then keep searching until you get /by-name which many phones have, but this isn't always the same path so if you need further help ask and I'll walk you through it
2 I think this depends on a lot of things, but I don't have a good answer so rather than speculating I'll choose not to answer
Feel free to ask other questions
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
1 yes, but flashing firmware from recovery can be dangerous and all though unlikely I have seen many brick there phone doing so
2. Yes, rather easily so long as the .zip is put together properly. But like bootloader, it is safest so flash through fastboot or download mode but a very unlikely brick so mostly safe
3. This is how a ROM gets built from source but it needs not be in this setup. At the same note I can't see a better way to flash through recovery than like it is. Using flash_raw_image would work but due to size a system.img shouldn't be flashed in recovery rather through fastboot, bootloader or download mode
4 mostly because you couldn't have an oem ota update without an SD card which isn't a prerequisite for using a phone. Also I believe there is some added safety flashing directly from nand, but in truth this is all speculation. Yes with a rooted phone this could be changed but most often it isn't wise to flash an oem ota on a rooted device
5 lots of things, take a look at my threads for a guide I made explaining this
1 cat /proc/partitions
mount
ls -l /dev/block/
And then keep searching until you get /by-name which many phones have, but this isn't always the same path so if you need further help ask and I'll walk you through it
2 I think this depends on a lot of things, but I don't have a good answer so rather than speculating I'll choose not to answer
Feel free to ask other questions
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I've got /by-num, but no /by-name, device is Sansumg GT-9288
not sure what a Sansumg GT-9288 is, gsmarena and google dont give me results
what happens with
cat /proc/partitions
or just
mount
?
demkantor said:
not sure what a Sansumg GT-9288 is, gsmarena and google dont give me results
what happens with
cat /proc/partitions
or just
mount
?
Click to expand...
Click to collapse
Sorry, type wrong, should be GT-9228, it's a customer made smartphone only for CMCC.
I can get the partition info by GT-9220, so I think it's because of the customer made that I can not get the by-name folder.
Thanks again.
Hey everyone,
A few days ago, I decided to downgrade from AICP 11 back to 10 (Android 6.0.1 to 5.1.1), wiped everything but internal storage. When flashing, I got an error, saying that the /vendor partition was missing, and indeed, while it existed, I could only mount it forcefully, because the device was busy.
This lead to a complete wipe, as after a reboot, TWRP asked for an encryption password, which I didn't set. Here, I did a factory reset & wiped everything. After that, I tried flashing again (5.1.1), but after it was completed, I got a line, which said "Couldn't unmount /system", which is true, as it's already unmounted. But when I mount it, all the files that are supposed to be installed seem to be there.
When I reboot the device, it gets stuck on the Google logo.
Frankly, I'm afraid to even flash back to stock, so I was hoping that someone more experienced could help me out.
It should be noted, that I still have access to fastboot, and TWRP.
Thanks in advance,
DecentM
How did you force mount /vendor?
Can you clarify where you are seeing these problems? (TWRP or within Android)
Do you have any nandroid backups to test and see if they work?
dmantilal said:
How did you force mount /vendor?
Can you clarify where you are seeing these problems? (TWRP or within Android)
Do you have any nandroid backups to test and see if they work?
Click to expand...
Click to collapse
I used mount -f and umount -f in the TWRP terminal
I see all these problems in TWRP, since I can't boot/get past the initial Google logo.
I do have a nandroid backuip on my laptop (as I had to wipe the tablet clean), but that's currently unavailable for me to use, I'll reply back when I tried it.
I doubt it will work, because it just extracts data to a predefined path, which seems like the same thing an installer zip does.
DecentM said:
I used mount -f and umount -f in the TWRP terminal
I see all these problems in TWRP, since I can't boot/get past the initial Google logo.
I do have a nandroid backuip on my laptop (as I had to wipe the tablet clean), but that's currently unavailable for me to use, I'll reply back when I tried it.
I doubt it will work, because it just extracts data to a predefined path, which seems like the same thing an installer zip does.
Click to expand...
Click to collapse
Why did you need /vendor mounted in TWRP?
I thought flashing used dd (command) or similar to copy the *.img file to the partition (or, more accurately, the block device). If /vendor is mounted during *.img copy, that would most likely cause errors.
dmantilal said:
Why did you need /vendor mounted in TWRP?
I thought flashing used dd (command) or similar to copy the *.img file to the partition (or, more accurately, the block device). If /vendor is mounted during *.img copy, that would most likely cause errors.
Click to expand...
Click to collapse
I mounted it, because when I initially restored the 5.1.1 rom, I got an error, saying that the /vendor partition wasn't mounted.
DecentM said:
I mounted it, because when I initially restored the 5.1.1 rom, I got an error, saying that the /vendor partition wasn't mounted.
Click to expand...
Click to collapse
You are sure it was complaining about "unmounted", rather than "mounted"?
Do these roms include a vendor.img? You may need to flash the stock 5.1.1 vendor.img.
Either way, unless you mkfs'ed or resize2fs'ed the partitions, they should be fine. Full wipe & go.
dmantilal said:
You are sure it was complaining about "unmounted", rather than "mounted"?
Do these roms include a vendor.img? You may need to flash the stock 5.1.1 vendor.img.
Either way, unless you mkfs'ed or resize2fs'ed the partitions, they should be fine. Full wipe & go.
Click to expand...
Click to collapse
I'm not sure.
I already did a full wipe, but it still had issues. I'll try again tomorrow, and report back on how it went.
DecentM said:
I'm not sure.
I already did a full wipe, but it still had issues. I'll try again tomorrow, and report back how it went.
Click to expand...
Click to collapse
Having a mismatched vendor.img could be your problem.
No ROM I know of includes a vendor.img. I think it is a legal issue, like including GApps with a ROM.
dmantilal said:
Having a mismatched vendor.img could be your problem.
No ROM I know of includes a vendor.img. I think it is a legal issue, like including GApps with a ROM.
Click to expand...
Click to collapse
I don't think that the issue is with the vendor image anymore, but with the partitions in general. I always had a mismatched vendor image, as it only results in a modal box after boot.
My problem is again, with the /system partition not being visible to flashable zip files.
Mismatched vendor.img can also cause bootloops and other quirks like battery-charge percentage inaccuracies.