C5 Ultra fastboot system image - Sony Xperia C5 Ultra

Can this be done? fastboot flash system system.ext4 or system.sin? i have tried with numerous and upto date fastboot executables but always receive fail with error FAILED (remote: Unknown chunk type). I have created sparse image chunks and even those won't flash with same error about chunk type. Am i doing something wrong or is fastboot no longer a good way to flash system images on newer S1 bootloaders? I understand that i can do this via custom recovery but for a project of mine i need fastboot to work. Any ideas gentlemen?

While In TWRP recovery you could try adb shell > su then dd the system.ext4.img.
I am not 100% but I don't think the system.ext4 that is produced by FlashTool from the .sin is a sparsed .img but is a normal .img. I think fastboot may need sparse.img's
Backup as always of course
Example:
Code:
adb shell
Code:
su
(su Probably not needed in TWRP)
Code:
dd if=/sdcard/system.ext4.img of=/dev/block/platform/mtk-msdc.0/by-name/system
EDIT: Sorry should of read your post better that will teach me for speed reading :laugh:
Still think it requires a proper sparse .img not sure what method you used.
PS: I assume you tried to rename it with the ext4 removed eg: just system.img

Related

[SOLVED][$300][BOUNTY] Making your own PG05IMG, Flashing Roms with ADB

** ADMINS/MODS, if your going to delete this thread, if you dont' mind please advising me on the correct way to post this or correct place, Thanks **
******************************************************
QUESTION: How can I create a update.zip (i.e., PG05IMG.zip) for the thunderbolt and then flash it with fastboot or in bootloader.
ANSWER: Flash a rom on your phone and then using adb
adb shell dd if=/dev/block/mmcblk0p25 of=/sdcard/system.img
Make a zip folder and put in it system.img along with boot.img from the
rom zip and whatever other partitions you want, perhaps a radio
mdm9k.img and radio.img along with a recovery.img and you can
make your own little custom rom to be flashed with fastboot or as an
update, then you can either put it on the sd card as an PG05IMG.zip and do
a bootloader update (s-off only) or fastboot flash zip (zipname.zip)
for eng-hboot only... really cool.
******************************************************
******************************************************
******************************************************
******************************************************************************************************************************************************************
1. Ok I've been trying dilligently in the past to do 2 things. I want to create my own SYSTEM.img from the roms i'm making so I can create PG05IMG's instead of .zips to flash, that way i can include the radio etc., this is for learning purposes (PLEASE DO NOT SUGGEST WELL KNOWN METHODS OR SIMPLY QUESTION WHY IM DOING THIS UNLESS ITS INVOLVED IN THE SOLUTION PROCESS.)
I have tried several different methods for backing up my system.img etc., I need someone to help me with this, and I'm willing to donate to get this done.
2. Secondly, I need to figure out a way to flash roms from command line using adb while the phone is in recovery, I don't have any problem flashing roms with fastboot if someone can show me or explain how to make the system.img actually work.
Already tried this:
Code:
adb push C:\ROM.zip /data/
adb shell
recovery --update_package=DATA:ROM.zip
This would simply make the thunderbolt go to an exclamation point and do nothing.
I was however able to get this to work on the same version of recovery 5.0.2.1 on a Nexus S I9020T, but not on the Thunderbolt ADR6400L.
Simple anlysis of questions
1. How can I turn a rom.zip (system folder) into a (system.img) "fastboot flashable"
2. How can I take a rom.zip and flash it in recovery using adb
Donation negotiable, and I appreciate any time/clues/answers/suggestions, but I really need to figure this out.
Hi there,
I have a plan in the works already since the beginning of last month. I call it CASUAL. Cross-platform Adb Scripting, Unified Android Loader. Its purpose is to do exactly what you wish. This is a project I intend to begin work on next month. I've set up a repository for the work and I will begin soon. Basically, it will do exactly what you want.
Edit: I do not intend on rushing for the bounty. My goal is to do it right. If someone wishes to rush it, go ahead and collect the bounty. My goal is to provide something which will create an infrastructure contained within a single cross-platform java file. I've got most of the heavy lifting already done from my Heimdall one-click project. However, in order to complete the job, it seems that I must reformat my desktop because my IDEs are acting wonkey.
AdamOutler said:
Hi there,
I have a plan in the works already since the beginning of last month. I call it CASUAL. Cross-platform Adb Scripting, Unified Android Loader. Its purpose is to do exactly what you wish. This is a project I intend to begin work on next month. I've set up a repository for the work and I will begin soon. Basically, it will do exactly what you want.
Edit: I do not intend on rushing for the bounty. My goal is to do it right. If someone wishes to rush it, go ahead and collect the bounty. My goal is to provide something which will create an infrastructure contained within a single cross-platform java file. I've got most of the heavy lifting already done from my Heimdall one-click project. However, in order to complete the job, it seems that I must reformat my desktop because my IDEs are acting wonkey.
Click to expand...
Click to collapse
Adam thanks for your response, really great to hear and the fact that your not rushing for money is great too I understand. But hey, without regard to the cross platform ADB rom flasher, can you just point me in the right direction as far as where to go to learn how to say, "make a system.img of a rom" so I can fastboot flash it..
Like so I can take a rom zip and be able to turn it into a system image that is fastboot flashable on the thunderbolt... at that point i can just manually flash the boot.img and radio and i'm good to go.
So if i can just figure out how to do that one little thing that would be huge and much appreciated... thanks so much man. I will gladly donate for an answer to this question.
halfcab123 said:
Adam thanks for your response, really great to hear and the fact that your not rushing for money is great too I understand. But hey, without regard to the cross platform ADB rom flasher, can you just point me in the right direction as far as where to go to learn how to say, "make a system.img of a rom" so I can fastboot flash it..
Like so I can take a rom zip and be able to turn it into a system image that is fastboot flashable on the thunderbolt... at that point i can just manually flash the boot.img and radio and i'm good to go.
So if i can just figure out how to do that one little thing that would be huge and much appreciated... thanks so much man. I will gladly donate for an answer to this question.
Click to expand...
Click to collapse
Generally, to flash a ROM, you type:
Code:
adb reboot bootloader
then on your desktop you use fastboot and type
Code:
fastboot oem unlock
fastboot flash your partition your file...
I'd follow this guide to get S-OFF: http://forum.xda-developers.com/showthread.php?t=1310014 then find your neato-bandito rom from this forum: http://forum.xda-developers.com/forumdisplay.php?f=943 and flash it.
AdamOutler said:
Generally, to flash a ROM, you type:
Code:
adb reboot bootloader
then on your desktop you use fastboot and type
Code:
fastboot oem unlock
fastboot flash your partition your file...
I'd follow this guide to get S-OFF: http://forum.xda-developers.com/showthread.php?t=1310014 then find your neato-bandito rom from this forum: http://forum.xda-developers.com/forumdisplay.php?f=943 and flash it.
Click to expand...
Click to collapse
Thanks Adam, but, I already know how to flash partitions in fastboot, but what i need to know is how to "make" partitions. as in like, take a system folder and turn it in to a system.img so i can fastboot flash system system.img
Please please need to know thanks
halfcab123 said:
Thanks Adam, but, I already know how to flash partitions in fastboot, but what i need to know is how to "make" partitions. as in like, take a system folder and turn it in to a system.img so i can fastboot flash system system.img
Please please need to know thanks
Click to expand...
Click to collapse
That's not overly hard to do. There's a guide I think on the cyanogen website for how to do it. Basically you use the "dd" tool in linux.
yareally said:
That's not overly hard to do. There's a guide I think on the cyanogen website for how to do it. Basically you use the "dd" tool in linux.
Click to expand...
Click to collapse
Dude please, can you walk me through it, like I said I'll donate. Or alteast give me a link to where its at, then i'll turn this post into a how to for noobs. I learn at 300,000,000 m/s^2
halfcab123 said:
Dude please, can you walk me through it, like I said I'll donate. Or alteast give me a link to where its at, then i'll turn this post into a how to for noobs. I learn at 300,000,000 m/s^2
Click to expand...
Click to collapse
It looks like there's a stupidly large amount of partitions on the Thunderbolt. if you can do this:
Code:
adb shell mount
and get the partition information, I can tell you how to do a backup and restore.
it will be something like this.. this gets run once to get a temporary storage area on the /sdcard
Code:
adb shell mkdir /sdcard/mybackup
Code:
mkdir /PATH/TO/YOUR/DESKTOP/backup
adb shell dd if=/dev/block/mmcblk0p25 of=/sdcard/mybackup/system.img
adb pull /sdcard/mybackup/system.img /PATH/TO/YOUR/DESKTOP/backup/system.img
These commands do: make a new folder for working on your desktop. direct disk backup of mmcblk0p25 (SYSTEM partition). Pull the system.img to your working folder on your desktop.
If you have your image on a Linux or Mac desktop, you can mount it like this..
Code:
cd /PATH/TO/YOUR/DESKTOP/backup
mkdir MountFolder
sudo mount ./system.img ./MountFolder
#if this doesnt work, then do this
sudo mont -o loop -t ext3 ./system.img ./MountFolder
you can make changes to the system which has been mounted onto your computer. Then unmount it and push it back to your device.
to unmount and flash it back you do this:
Code:
sudo umount ./MountFolder
adb push /PATH/TO/YOUR/DESKTOP/backup/system.img /sdcard/mybackup/system.img
adb shell dd if=/sdcard/mybackup/system.img of=/dev/block/mmcblk0p25
This pushes your backup to your device, then does a direct disk write of the image file to the disk partition
↑ last poster pretty much sums it up in detail
AdamOutler said:
It looks like there's a stupidly large amount of partitions on the Thunderbolt. if you can do this:
Code:
adb shell mount
and get the partition information, I can tell you how to do a backup and restore.
it will be something like this.. this gets run once to get a temporary storage area on the /sdcard
Code:
adb shell mkdir /sdcard/mybackup
Code:
mkdir /PATH/TO/YOUR/DESKTOP/backup
adb shell dd if=/dev/block/mmcblk0p25 of=/sdcard/mybackup/system.img
adb pull /sdcard/mybackup/system.img /PATH/TO/YOUR/DESKTOP/backup/system.img
These commands do: make a new folder for working on your desktop. direct disk backup of mmcblk0p25 (SYSTEM partition). Pull the system.img to your working folder on your desktop.
If you have your image on a Linux or Mac desktop, you can mount it like this..
Code:
cd /PATH/TO/YOUR/DESKTOP/backup
mkdir MountFolder
sudo mount ./system.img ./MountFolder
#if this doesnt work, then do this
sudo mont -o loop -t ext3 ./system.img ./MountFolder
you can make changes to the system which has been mounted onto your computer. Then unmount it and push it back to your device.
to unmount and flash it back you do this:
Code:
sudo umount ./MountFolder
adb push /PATH/TO/YOUR/DESKTOP/backup/system.img /sdcard/mybackup/system.img
adb shell dd if=/sdcard/mybackup/system.img of=/dev/block/mmcblk0p25
This pushes your backup to your device, then does a direct disk write of the image file to the disk partition
Click to expand...
Click to collapse
This is very informative and I actually realized something that I think will definitely help me, however its kinda not really the answer to my question.. and at the same time it is kind of another solution to the question that I asked.
What I asked was how to turn the system folder from a *.zip "rom" into a system.img that was fastboot flashable
You basically told me how to make a backup of the system, modify, and flash back to my phone.... which is interesting...
Basically what I take from this, please let me know if i'm on the right track here:
If the goal is to flash a rom on an htcdev unlocked phone one would:
(assuming system.img already created from backup, flashing to another phone)
Code:
adb reboot recovery
adb shell dd if=/dev/zero of=/dev/block/mmcblk0p6 (data wipe)
adb shell mount /sdcard/
adb shell dd if=/sdcard/system.img of=/dev/block/mmcblk0p25
adb reboot bootloader
fastboot erase cache
fastboot flash boot boot.img
fastboot reboot
After trying this, I was both unable to mount sd card for some odd reason
using adb shell mount /sdcard/ and I was also unable to wipe data
at partition mmcblk0p6 with /dev/zero it just hung for 4 minutes.. does it take longer ? I ended it.
My only other option that I can think of is to downgrade the thunderbolt and run revo to get s-off and then make a PG05IMG.zip with a custom system.img and boot.img and flash it as a PG05IMG.zip in bootloader... so coming from this direction which seems to be much much easier, if I say took a PG05IMG for the MR4 (2.11.605.9) replaced the hboot with an eng-hboot, replaced the system.img and the boot.img would it work ??? I'm going to try it lol, probably going to be an epic fail.. any comments appreciated.
UPDATE: after posting this I realized that with a revolutionary s-off, the hboot is protected from being updated with an RUU, in bootloader so I would not have to worry about replacing the HBOOT, the only reason I even mentioned it was because I know that the hboot in the official MR4 RUU is the dev method supported hboot and would probably throw a security warning after flashing... etc., once again any help is great.
There is no direct 1:1 way to convert. However, you can use the update script in the Meta folder as a guide. It will have information to copy files into the system folder and applysymlinks. The commands used by recovery all have a Linux equal.
Delete = rm
Delete recursive = rm -rf
symlink = ln -s
copy = cp
These are android recovery commands which must be translated to their Linux shell equivalants.
AdamOutler said:
There is no direct 1:1 way to convert. However, you can use the update script in the Meta folder as a guide. It will have information to copy files into the system folder and applysymlinks. The commands used by recovery all have a Linux equal.
Delete = rm
Delete recursive = rm -rf
symlink = ln -s
copy = cp
These are android recovery commands which must be translated to their Linux shell equivalants.
Click to expand...
Click to collapse
what if i just straight take the system.img and boot.img and throw them in a PG05IMG.zip and use bootloader to update, will that work ?
halfcab123 said:
what if i just straight take the system.img and boot.img and throw them in a PG05IMG.zip and use bootloader to update, will that work ?
Click to expand...
Click to collapse
I don't know what a pg05img is. However, with samsung devices, we use dd'd system images to flash with Odin. Odin works sorta like fastboot. I don't know if that will help you because I generally use Samsung devices and Samsung does things differently than the rest of Android. From what I understand, fastboot flashing is similar, but I don't know if you can DD an image from a device and just fastboot flash it back onto a device. You can do this with Odin. I don't think there are provisions for flashing images in recovery directly. They DO have executables encorperated within zip files for flashing modems and bootloaders. Before trying a non-standard flashing method, you need to do some reading. It can be risky.
AdamOutler said:
I don't know what a pg05img is. However, with samsung devices, we use dd'd system images to flash with Odin. Odin works sorta like fastboot. I don't know if that will help you because I generally use Samsung devices and Samsung does things differently than the rest of Android. From what I understand, fastboot flashing is similar, but I don't know if you can DD an image from a device and just fastboot flash it back onto a device. You can do this with Odin. I don't think there are provisions for flashing images in recovery directly. They DO have executables encorperated within zip files for flashing modems and bootloaders. Before trying a non-standard flashing method, you need to do some reading. It can be risky.
Click to expand...
Click to collapse
I just made my own PG05IMG.zip and updated in bootloader and it booted into a custom rom, and this is after i erased userdata, cache, system, so i know it works, i even
fastboot oem rebootRUU
fastboot flash zip "customzip.zip"
and that worked too, so stoked man, I can't believe I finally figured it out.
As soon as you told me the mmcblk0p25 could be backed up, it clicked, funny thing is I knew that but I guess I just didn't think it was that simple.

[Q] Build system.img or Update.zip from OTA package

The situation:
System partition has been wiped, would like to restore it using OTA.zip available from OEM
What I have
Access to fastboot and adb sideload in stock recovery
OTA zip package from OEM
What I have tried and my background
I have been on the client side of mods\recoveries\dev for android platforms on various devices for 4-5 years. I'm capable with Linux, and self teach quickly, I know just enough to get myself into trouble at the moment(hence the trouble I'm in).
1. I have tried to convert the system data in the OEM package to a yaffs etx4 style .img and send via fastboot, but I get "Invalid sparse file format at header magi" this led down a road to a tool called sparse converter that compressed the img into smaller parts, but then I get a more generic error "FAILED (remote: flash_cmds error!) For giggles , even know I know this would have been useless even if it had worked I tried it with the stock SDK 4.4.2 system.img just to see if I could fastboot any system files, same result.
2. So then I thought perhaps I could go the ADB side-load approach, first I tried just sending over the provided OTA zip package, but I get an error on the device after if finishes transferring "end of footer from /tmp/update.zip not 0xffff (file exists)" and "Signature verification failed" this led me to using a tool called "UpdatezipCreator" to generate a zip with the system files and sign the package, this also was a dead end.
So i'm turning to the wisdom and experience of XDA for some guidance, I'm willing to put in the leg work, I just need some direction.
TF103C Update
A couple of things. Im having the same issues with creating a yaffs ext4 .img and have the same error when i got to flash the image. Intel actually has a repo some place for bay trail (with bay lake included) device setup (https://01.org/android-ia). I did the same thing you did with AOSP and as expected it tries to boot but fails and boot loops.
I have however been able to flash the update.zip that is on the Asus website through recovery. First question did you unzip the the first zip file? The zip that is the link contains another zip which is the one you upload and update (sideload worked for me).
Im wondering if you can help me out too. I got an OTA about a day ago and hit the back button but it decided to update anyway. The tablet rebooted and just flashed a red bar at me then turned off. I can get to the droidboot to load images but I cant boot into recovery and im not sure why. Ive tried using the zenRoot recoveries that were used for rooting, but no luck. Booting to system or recovery produces a red bar and turns off. Do you by chance have a recovery I could try? Thanks.
Hope that was helpful.
Eclipse00 said:
The situation:
System partition has been wiped, would like to restore it using OTA.zip available from OEM
What I have
Access to fastboot and adb sideload in stock recovery
OTA zip package from OEM
What I have tried and my background
I have been on the client side of mods\recoveries\dev for android platforms on various devices for 4-5 years. I'm capable with Linux, and self teach quickly, I know just enough to get myself into trouble at the moment(hence the trouble I'm in).
1. I have tried to convert the system data in the OEM package to a yaffs etx4 style .img and send via fastboot, but I get "Invalid sparse file format at header magi" this led down a road to a tool called sparse converter that compressed the img into smaller parts, but then I get a more generic error "FAILED (remote: flash_cmds error!) For giggles , even know I know this would have been useless even if it had worked I tried it with the stock SDK 4.4.2 system.img just to see if I could fastboot any system files, same result.
2. So then I thought perhaps I could go the ADB side-load approach, first I tried just sending over the provided OTA zip package, but I get an error on the device after if finishes transferring "end of footer from /tmp/update.zip not 0xffff (file exists)" and "Signature verification failed" this led me to using a tool called "UpdatezipCreator" to generate a zip with the system files and sign the package, this also was a dead end.
So i'm turning to the wisdom and experience of XDA for some guidance, I'm willing to put in the leg work, I just need some direction.
Click to expand...
Click to collapse
I have the same problem, keysersoza42. I did a "fastboot wipe system" and now I only have access to fastboot. Just need to find a way to put system back
keysersoza42 said:
I have however been able to flash the update.zip that is on the Asus website through recovery. First question did you unzip the the first zip file? The zip that is the link contains another zip which is the one you upload and update (sideload worked for me).
Click to expand...
Click to collapse
Can you please tell me the exact steps you used to get sideload to work? I have the same problem as Eclipse00 : "after if finishes transferring "end of footer from /tmp/update.zip not 0xffff (file exists)" and "Signature verification failed""
Asus TF103C update.zip
UPDATE: Link to system.img
goo.gl/Oz2X7o
Honestly all i did was follow the normal steps to do a side load. One thing to make sure of is that you have the correct version of the firmware; BBY, WW, etc. When you first download it it is a Zip file in a zip file so the second one is the one you need to side load. To step this out:
1) Download from Asus the correct update. If you dont know which version you have you can boot into the bootloader and one of the versions will say BBY, WW, etc...
2) Unzip the contents of the download from Asus. This should be another zip file.
3) Boot into recovery. If you get the 'dead android' press and hold vol down for about 5 seconds then press vol up.
4) In recovery enter sideload mode
5) adb sideload innerUpdate.zip file (the zip file you unzipped from the downloaded file).
6) works???
This is what worked for me. The other option is to fastboot a system.img. This is hard b\c Asus doesnt release them and when i dd'ed a system image off of the partition it wouldn't load. I did however find a way to get a system image on there through fastboot. If it comes down to this let me know and ill post more on it. Good luck!
RaVe-N said:
Can you please tell me the exact steps you used to get sideload to work? I have the same problem as Eclipse00 : "after if finishes transferring "end of footer from /tmp/update.zip not 0xffff (file exists)" and "Signature verification failed""
Click to expand...
Click to collapse
---------- Post added at 08:55 PM ---------- Previous post was at 08:36 PM ----------
Sorry this is old, but just a couple of weeks ago i got the fastboot system.img to load. Here are the steps I did to produce this.
Some times its helpful to unpack a system image and/or repack to be flashed to an android device. For example the Asus tf103c required special compressing for parsing.
Tools you will need:
simg2img
make_ext4fs
Windows
SparseConverter_1.0.0.exe
Note: There were system.img files that were pulled directly from a rooted device using dd. These images would always give an error (flash_cmds_error!) while trying to write the image even if it had been compressed. The only way I got around this was to mount and unpack an image known to flash correctly (in my case the Intel BayTrail image from the intel android repo). The replace the contents with what every you wish to be in there (in my case the system folder from the Asus update.zip). The limitation here is you are limited to the size of the original flashable .img. Usually you can remove odex files to get around this and push those later if needed.
For the Asus images the NFC was removed from the list of features b\c it didnt have NFC which resulted in the settings app to crash during onCreate. These files were removed from the system directory.
/system/etc/permission/*.nfc*
Step-by-step guide
Steps 1-6 may be done in linux but step 7 and 11-15 must be done in windows.
In your workspace create a dir. mkdir sys
./simg2img system.img sys.raw
If you get : "Invalid sparse file format at header magi Failed to read sparse file"
You must decompress the image first with SparseConverter.
go to step 9 except replace 14 with this: SparseConverter.exe /decompress [.img to decompress] [.img to write to] then return to this step and continue.
SparseConverter.exe /decompress E:\system.img_sparsechunk1 D:\system.img
sudo mount -t ext4 -o loop sys.raw sys/
sudo ./make_ext4fs -s -l 1638M -a system new.img sys/
Note: The size needs to change depending on how big of an im age it is.
You may try to push the image as is, but if you get a "Invalid Sparse File Format At Header Magi" you have a compression error in the system image and can not be separated properly.
In windows open a command prompt window
Navigate to the SparseConverter_1.0.0.exe
SparseConverter.exe /compress [.img to compress] [.img to write to] [size in MB]
SparseConverter.exe /compress D:\system.img E:\ 256MB
Good Luck!
AndroidDestoryer said:
I have the same problem, keysersoza42. I did a "fastboot wipe system" and now I only have access to fastboot. Just need to find a way to put system back
Click to expand...
Click to collapse
Thanks.
I think the reason sideload isn't working is that my OTA update version is higher than the version downloadable as a zip...
Those are the steps I followed but it just doesn't work.
What exactly is the system image file you have linked to? Has it already gone through all the steps mentioned below? Is it plain old AOSP?
Thanks for all the help.
keysersoza42 said:
UPDATE: Link to system.img
goo.gl/Oz2X7o
Honestly all i did was follow the normal steps to do a side load. One thing to make sure of is that you have the correct version of the firmware; BBY, WW, etc. When you first download it it is a Zip file in a zip file so the second one is the one you need to side load. To step this out:
1) Download from Asus the correct update. If you dont know which version you have you can boot into the bootloader and one of the versions will say BBY, WW, etc...
2) Unzip the contents of the download from Asus. This should be another zip file.
3) Boot into recovery. If you get the 'dead android' press and hold vol down for about 5 seconds then press vol up.
4) In recovery enter sideload mode
5) adb sideload innerUpdate.zip file (the zip file you unzipped from the downloaded file).
6) works???
This is what worked for me. The other option is to fastboot a system.img. This is hard b\c Asus doesnt release them and when i dd'ed a system image off of the partition it wouldn't load. I did however find a way to get a system image on there through fastboot. If it comes down to this let me know and ill post more on it. Good luck!
---------- Post added at 08:55 PM ---------- Previous post was at 08:36 PM ----------
Sorry this is old, but just a couple of weeks ago i got the fastboot system.img to load. Here are the steps I did to produce this.
Some times its helpful to unpack a system image and/or repack to be flashed to an android device. For example the Asus tf103c required special compressing for parsing.
Tools you will need:
simg2img
make_ext4fs
Windows
SparseConverter_1.0.0.exe
Note: There were system.img files that were pulled directly from a rooted device using dd. These images would always give an error (flash_cmds_error!) while trying to write the image even if it had been compressed. The only way I got around this was to mount and unpack an image known to flash correctly (in my case the Intel BayTrail image from the intel android repo). The replace the contents with what every you wish to be in there (in my case the system folder from the Asus update.zip). The limitation here is you are limited to the size of the original flashable .img. Usually you can remove odex files to get around this and push those later if needed.
For the Asus images the NFC was removed from the list of features b\c it didnt have NFC which resulted in the settings app to crash during onCreate. These files were removed from the system directory.
/system/etc/permission/*.nfc*
Step-by-step guide
Steps 1-6 may be done in linux but step 7 and 11-15 must be done in windows.
In your workspace create a dir. mkdir sys
./simg2img system.img sys.raw
If you get : "Invalid sparse file format at header magi Failed to read sparse file"
You must decompress the image first with SparseConverter.
go to step 9 except replace 14 with this: SparseConverter.exe /decompress [.img to decompress] [.img to write to] then return to this step and continue.
SparseConverter.exe /decompress E:\system.img_sparsechunk1 D:\system.img
sudo mount -t ext4 -o loop sys.raw sys/
sudo ./make_ext4fs -s -l 1638M -a system new.img sys/
Note: The size needs to change depending on how big of an im age it is.
You may try to push the image as is, but if you get a "Invalid Sparse File Format At Header Magi" you have a compression error in the system image and can not be separated properly.
In windows open a command prompt window
Navigate to the SparseConverter_1.0.0.exe
SparseConverter.exe /compress [.img to compress] [.img to write to] [size in MB]
SparseConverter.exe /compress D:\system.img E:\ 256MB
Good Luck!
Click to expand...
Click to collapse
Versions and system.img
Oh yeah i forgot about that. If you are ahead of the update then it will reject the load. Last i checked there was an "2.0.33.80" and a "2.0.33.101" on the asus website. I think 101 is 4.4.4, but not 100% sure on that.
The system.img is a stock image of the ASUS TF103C. It has no NFC b\c the device does not have NFC and if you leave some of the files in there the settings app will crash b\c it thinks its a feature it should find. The version should be "80" or 4.4.2. This will load regardless of the version that is currently loaded since you are loading it through the bootloader. I have tried this on both the WW and BBY versions and it worked. It has already gone through the steps i listed below.
RaVe-N said:
Thanks.
I think the reason sideload isn't working is that my OTA update version is higher than the version downloadable as a zip...
Those are the steps I followed but it just doesn't work.
What exactly is the system image file you have linked to? Has it already gone through all the steps mentioned below? Is it plain old AOSP?
Thanks for all the help.
Click to expand...
Click to collapse
Thanks mate.
I'll give it a whirl tonight and see how it goes. I should just be able to use "fastboot flash system system.img" correct?
keysersoza42 said:
Oh yeah i forgot about that. If you are ahead of the update then it will reject the load. Last i checked there was an "2.0.33.80" and a "2.0.33.101" on the asus website. I think 101 is 4.4.4, but not 100% sure on that.
The system.img is a stock image of the ASUS TF103C. It has no NFC b\c the device does not have NFC and if you leave some of the files in there the settings app will crash b\c it thinks its a feature it should find. The version should be "80" or 4.4.2. This will load regardless of the version that is currently loaded since you are loading it through the bootloader. I have tried this on both the WW and BBY versions and it worked. It has already gone through the steps i listed below.
Click to expand...
Click to collapse
fastboot
Yes that is correct and in the bootloader.
Did you give this a try? Did it work?
RaVe-N said:
Thanks mate.
I'll give it a whirl tonight and see how it goes. I should just be able to use "fastboot flash system system.img" correct?
Click to expand...
Click to collapse
keysersoza42 said:
Yes that is correct and in the bootloader.
Did you give this a try? Did it work?
Click to expand...
Click to collapse
YES! Thanks so much! had to fastboot erase cache and data as well but it works!
Cheers!
keysersoza42 said:
Yes that is correct and in the bootloader.
Did you give this a try? Did it work?
Click to expand...
Click to collapse
Hi again.
So after a couple of days usage I've noticed a few things...
There appears to be no camera driver. The camera app just complains that you need to have a camera to use it...
Also some things that used to work don't anymore: So far I've noticed the Google Inbox app doesn't work, and any dosbox app doesn't work. They just FC.
Should I retry again, maybe redo the factory reset. Maybe wipe the data partition from fastboot?
Camera and other crashes
Ill have to take a look at it. I hadnt used any of those so ill have to checkout it out. Ill try to get some time this week.
RaVe-N said:
Hi again.
So after a couple of days usage I've noticed a few things...
There appears to be no camera driver. The camera app just complains that you need to have a camera to use it...
Also some things that used to work don't anymore: So far I've noticed the Google Inbox app doesn't work, and any dosbox app doesn't work. They just FC.
Should I retry again, maybe redo the factory reset. Maybe wipe the data partition from fastboot?
Click to expand...
Click to collapse
Same issue
Hi guys,
Just noticed this thread, and gave the uploaded system.img a try using fastboot command.
It gives me the error that the system img cannot exceed a certain amount of bytes (500 mb'ish)
any tips?
Brick3d said:
Hi guys,
Just noticed this thread, and gave the uploaded system.img a try using fastboot command.
It gives me the error that the system img cannot exceed a certain amount of bytes (500 mb'ish)
any tips?
Click to expand...
Click to collapse
Try this: http://forum.xda-developers.com/showpost.php?p=60638910&postcount=78
RaVe-N said:
Try this: http://forum.xda-developers.com/showpost.php?p=60638910&postcount=78
Click to expand...
Click to collapse
If you need to unbrick your tablet, have a look at my simple guide here!
http://forum.xda-developers.com/android/help/comprehensive-guide-unbricking-asus-t3106719
keysersoza42 said:
Asus TF103C update.zip
UPDATE: Link to system.img
goo.gl/Oz2X7o
Honestly all i did was follow the normal steps to do a side load. One thing to make sure of is that you have the correct version of the firmware; BBY, WW, etc. When you first download it it is a Zip file in a zip file so the second one is the one you need to side load. To step this out:
1) Download from Asus the correct update. If you dont know which version you have you can boot into the bootloader and one of the versions will say BBY, WW, etc...
2) Unzip the contents of the download from Asus. This should be another zip file.
3) Boot into recovery. If you get the 'dead android' press and hold vol down for about 5 seconds then press vol up.
4) In recovery enter sideload mode
5) adb sideload innerUpdate.zip file (the zip file you unzipped from the downloaded file).
6) works???
This is what worked for me. The other option is to fastboot a system.img. This is hard b\c Asus doesnt release them and when i dd'ed a system image off of the partition it wouldn't load. I did however find a way to get a system image on there through fastboot. If it comes down to this let me know and ill post more on it. Good luck!
---------- Post added at 08:55 PM ---------- Previous post was at 08:36 PM ----------
Sorry this is old, but just a couple of weeks ago i got the fastboot system.img to load. Here are the steps I did to produce this.
Some times its helpful to unpack a system image and/or repack to be flashed to an android device. For example the Asus tf103c required special compressing for parsing.
Tools you will need:
simg2img
make_ext4fs
Windows
SparseConverter_1.0.0.exe
Note: There were system.img files that were pulled directly from a rooted device using dd. These images would always give an error (flash_cmds_error!) while trying to write the image even if it had been compressed. The only way I got around this was to mount and unpack an image known to flash correctly (in my case the Intel BayTrail image from the intel android repo). The replace the contents with what every you wish to be in there (in my case the system folder from the Asus update.zip). The limitation here is you are limited to the size of the original flashable .img. Usually you can remove odex files to get around this and push those later if needed.
For the Asus images the NFC was removed from the list of features b\c it didnt have NFC which resulted in the settings app to crash during onCreate. These files were removed from the system directory.
/system/etc/permission/*.nfc*
Step-by-step guide
Steps 1-6 may be done in linux but step 7 and 11-15 must be done in windows.
In your workspace create a dir. mkdir sys
./simg2img system.img sys.raw
If you get : "Invalid sparse file format at header magi Failed to read sparse file"
You must decompress the image first with SparseConverter.
go to step 9 except replace 14 with this: SparseConverter.exe /decompress [.img to decompress] [.img to write to] then return to this step and continue.
SparseConverter.exe /decompress E:\system.img_sparsechunk1 D:\system.img
sudo mount -t ext4 -o loop sys.raw sys/
sudo ./make_ext4fs -s -l 1638M -a system new.img sys/
Note: The size needs to change depending on how big of an im age it is.
You may try to push the image as is, but if you get a "Invalid Sparse File Format At Header Magi" you have a compression error in the system image and can not be separated properly.
In windows open a command prompt window
Navigate to the SparseConverter_1.0.0.exe
SparseConverter.exe /compress [.img to compress] [.img to write to] [size in MB]
SparseConverter.exe /compress D:\system.img E:\ 256MB
Good Luck!
Click to expand...
Click to collapse
the link to system.img is not working

Changing Image to get root

Hello,
i have a Wiko PULP 3G, without a working root method.
I take a look at the Firmware files, there seems no CRC Protection. Even a Satellite Receiver or a TV Firmware have such.
I changed Text in the image with a HEX Editor(ro.sys.usb.storage.type) to get Massstorage. I flashed the modified image.
The Program just done it. Okay i have still no Massstorage. But on the Mobile i can see the build.prop has really changed
like i edit it.
I wonder if i can change Textfiles, it may possible to mount system as r/w.
Its a 1.9GB image difficult to find the Init/fstab.
Questions:
1. What do i need to modify to get mass_storage ?
2. How are the typical Textlines for a phone to make system read-only?
3. If i have write access to /system i can put a "su" file(any?) to system install SuperSU and have root?
Okay i have modified a boot.img, repack it and flashed it.
I set ro.secure=0, ro.debuggable=1 and massstorage in build.prop.
I got masstorage )))))
But how do i get the su to xbin. In the extracted Boot.img or Recovery.img there is no xbin.
Other .img files cant be xtracted.
With adb push this dont work, no permission.
Ideas?
If this is a raw system partition ext4 image, you can just mount it (with -o loop) on your Linux PC and modify the contents.
_that said:
If this is a raw system partition ext4 image, you can just mount it (with -o loop) on your Linux PC and modify the contents.
Click to expand...
Click to collapse
Thanks, but its not a raw image. I think its Android Sparse Image Format.
Linux cant mount it. Yaffey is not able to handle it.
I wonder why there i no tool where you can put a Firmware in and click on "Root it" and ready is the new one?!
Now i found tools to depack/pack the system image.
But the Phone dont boot, it starts and restart in Recovery.
If i do a root filecheck in Recovery it says 1 file added and 1 file changed - FAIL.
There must be something like a modify protection

Boot.img modification is required for root ?

Hello,
I use the rooted system.img which is provided in
http://forum.xda-developers.com/wat...everything-urbane-root-how-tos-files-t3243975
But I then get error on doing su from "adb shell" :
Error: only position independent executables (PIE) are supported.
So, I wander if it's becuase I did not program boot.img too ?
On trying to flash boot.img (or recovery.img) both fail to start on my watch. Not sure yet why.
I should also mention that also with system.img I had to manipulate so that the same size of image will be left and I just replaced the files with rsync (not sure if it is the simplest way to do that, but it worked )
So, not the only problem is the error on doing su (from adb shell).
Can anyone help ?
Regards,
Ranchu

Flash boot.img using TWRP openrecoveryscript

Hey,
is there a simple way to flash a new kernel / boot.img using TWRP by script / openrecoveryscript? I can select "Install Image" in the UI and flash the boot.img just fine, but I want to script that so I can flash devices easily or even remotely just by uploading the openrecoveryscript and the image to flash.
The documentation at https://twrp.me/faq/openrecoveryscript.html is pretty useless, it doesn't even mention that '/cache/recovery/openrecoveryscript' will be executed by TWRP.
The install command expects a zip file, the restore command a TWRP backup.
Any ideas? Thx
TWRP's OpenRecoveryScript ( read: command line ) support is great.
It's source code here:
Team-Win-Recovery-Project/openrecoveryscript.cpp at android-5.0 · TeamWin/Team-Win-Recovery-Project
Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/ - Team-Win-Recovery-Project/openrecoverysc...
github.com
IMO the mentioned TWRP recovery command line guide isn't useless as you claim.
Using a simple text file, saved in the /cache/recovery/ directory with the name openrecoveryscript, the TWRP recovery can be instructed to execute the described set of commands during the startup, e.g. the installation of a ZIP archive such as a ROM, or the deletion of a partition.
@jwoegerbauer I think you want to refer to https://github.com/TeamWin/android_bootable_recovery/blob/android-10.0/openrecoveryscript.cpp instead, as https://github.com/TeamWin/Team-Win-Recovery-Project ist not maintained if I understand it correctly.
However, I don't want to read the source to find out how to (not) flash a boot.img using TWRP without the UI.
If I understand the docs correctly, TWRP does not support flashing images. It supports restoring backups and installing zips.
I've also tried to find out if there is an easy way to convert the boot.img to an installable zip or TWRP recovery, but so far I've not succeeded.
Do you know an answer to this?
Use Fastboot to flash boot.img
I can't use fastboot as the device (Samsung) does not support it and it would also require physical access.
So far my workflow is to flash the image to a device I have by hand (manually), create a backup of the boot partition with TWRP (manually), download it and then deploy the backup to remote devices via adb and restore them on reboot via the openrecoveryscript.
My workflow would be simplified if could remove the need for the manual process that creates an image/backup that can be flashed remotely.
Well, I found a simpler way to flash the kernel / boot.img directly within the os. I can simply overwrite the partition:
adb push boot.img /sdcard/boot.img
adb shell su -c "dd if=/sdcard/boot.img of=/dev/block/mmcblk0p14"
Don't even have to reboot the device...
For those wondering from where to get the block-device... See ls -l /dev/block/platform/msm_sdcc.1/by-name/ ("msm_sdcc.1" part may be different)

Categories

Resources