create .img file from directory? - Android Q&A, Help & Troubleshooting

Is it possible to create an .img file from a directory? Lets say a system.img from /system?
Or userdata.img from the userdata?
To have some kind of backup and easily restore the system with fastboot flash ....

Related

[Q] How to extract files from *.img files?

I downloaded roms from samfirmware, after I unrar it, these are the file list
boot.img bootloader.bin cache.img hidden.img modem.bin recovery.img system.img
So How can I extract some files from system.img? I've tried unyaffs, but it segfaulted.
another stupid question is , how I can flash these files using odin? just select *.img in
pda and start?
yo
hi darren.hoo, i faced the same problem as yours and i realised that we should actually boot our tab to the downloading mode before we launch Odin3,pda.Turn on the usb debugging too(i dont know if this is necessary or not).Anyway happy flashing!
*Odin can only read .tar / .md5 extension ,you dont have to extract everything.
Kruel
Hi Darren.hoo,
To read the image files - It depends.
boot.img and recovery.img requires potentially a script to seperate the ramdisk and also the kernel. There are many good article on many wikis that explains which hex point is the seperator between the two.
system.img - I haven't really played with this too much as I don't usually create ROMS or anything - have you tried to mount it normally on a linux system? as if the system.img is just a ISO? (e.g. mount -o loop system.img /mnt). To rebuild this to become "flashable" is a different story (i believe you need the unayffs2 tools).
bootloader.bin - you'll need a hexeditor of some sort. This is as is a bin file (data file)
Not sure about the others. (cache - i'd assume you can recreate anyway and the modem i guess is another binary that requires a hexeditor.)
In terms of flashing the IMG - you need to tar up the *.img files, then do something like md5sum -t #name of tar# >> #name of tar#. Basically, it just appends the hash in md5 format to the tar. rename the file to something like *.tar.md5, and use that to flash as PDA.
Hope this helps.
Really great tips!
frankus0512 said:
system.img - I haven't really played with this too much as I don't usually create ROMS or anything - have you tried to mount it normally on a linux system? as if the system.img is just a ISO? (e.g. mount -o loop system.img /mnt). To rebuild this to become "flashable" is a different story (i believe you need the unayffs2 tools).
Click to expand...
Click to collapse
no luck with this:
debian:/home/darren/gtab/rom/EUR/P7500XWKG9# mount -oloop system.img /mnt
mount: you must specify the filesystem type
But from what I've got from searching xda a lot, maybe it's RFS filesystem?
frankus0512 said:
In terms of flashing the IMG - you need to tar up the *.img files, then do something like md5sum -t #name of tar# >> #name of tar#. Basically, it just appends the hash in md5 format to the tar. rename the file to something like *.tar.md5, and use that to flash as PDA.
Click to expand...
Click to collapse
this tip just really solved my problem.
I've got a tar.md5 file with three files in it: boot.img, system.img, recovery.img, but I don't
want to flash recovery.img coz I've already flashed CWM, yesterday I tried delete recovery.img from the tar ball and then flash it, then ODIN tells me that the files is invalid by
md5sum. I didn't know earlier that it records md5 checksum at the end of the tarball file.
It seems the OP got his answer but I'm having problems figuring out what to do.
I also have a system.img that i unzipped from a tar.md5 package by first editing the file extension to only say tar and then untarring it. When I try to mount the system.img with:
sudo mount -o loop system.img /media/systemimg
I get the filesystem type error:
mount: you must specify the filesystem type
Could someone who knows this please comment on how to mount the system.img to gain access to the files so I can explore system, that would be awesome.
span_01 said:
It seems the OP got his answer but I'm having problems figuring out what to do.
I also have a system.img that i unzipped from a tar.md5 package by first editing the file extension to only say tar and then untarring it. When I try to mount the system.img with:
sudo mount -o loop system.img /media/systemimg
I get the filesystem type error:
mount: you must specify the filesystem type
Could someone who knows this please comment on how to mount the system.img to gain access to the files so I can explore system, that would be awesome.
Click to expand...
Click to collapse
samsung firmwares should have -t rfs but you have to have a linux kernel on your dev machine that has a rfs modules
http://forum.xda-developers.com/showthread.php?t=1081239
darren.hoo said:
I downloaded roms from samfirmware, after I unrar it, these are the file list
boot.img bootloader.bin cache.img hidden.img modem.bin recovery.img system.img
So How can I extract some files from system.img? I've tried unyaffs, but it segfaulted.
another stupid question is , how I can flash these files using odin? just select *.img in
pda and start?[/QUOTE,
........................................
hello,
you can extract system.img by android kitchen but it is long process to setup kitchen.
you make it .tar file to flash as pda in odin.
if you want to extract system.img, contact me by email, [email protected]
I will tell you .
Click to expand...
Click to collapse

Change update.zip to system.img boot.img recovery.img

I am trying to change an update.zip file back to the three components system.img, boot.img, and recovery.img. I have tried creating the system.img but when i do so the permissions are wrong on the files. (update script is not run on it to change permissions)
For boot.img i can repackage it by splitting the blob but when i do it i am not sure what base value to use. when using mkbootimg
i was wondering if there was a way to convert it back to those components in some more automated way....
I am not sure but possible emulating the install of update.zip then harvesting the img files?

[Q] Create system.img from firmware

Can I create system.img from firmware? I see in the firmware zip there is folder system that contain files and folders like the system.img.
How can I create system.img with that folder in firmware zip?
Sorry for my poor Enfglish.

Where is recovery.img located.(on which partition)

I am making a custom rom.for my android.I need to know where recovery.img is located.Like which partition or directory can I try to find it at.I try ed the system partition but obviously it wasn't there because that's the system.I dumped my firmware image so I could modify it,but I can't find recovery.Img.All I found is recovery.fex.Is this my recovery?Thanks for your answer.[emoji2]

How to Flash a ROM with boot.img and System folder only?

HI! Is there any way to flash a custom rom using PC?
SP FLash tool needs a scatter file
but my ROM doesnt have any.
I tried to make my own scatter file but I cant find the system.img
The system.img is a folder
how can i convert the system folder to system.img?
PLS HELP
Ive done this but it was year's ago while making an odin flashable firmware for sgh-t599. Sorry to say I can't remember the procedure but I used guides so the info is out there.
You'll need Linux, and you must know the size of system partition and if it need to be raw img format or sparse img format.
With the right commands these img's can also be extracted straight from a working device.

Categories

Resources