Extract system.img,vendor.img and product.img from super.img - Redmi 9 / Poco M2 Guides, News, & Discussion

After lots of search i found a way to extract those img file from super.img
What is need?
1.Computer with linux os.
extract zip file from this post and place your super.img in same location where you extract..
then run below cmd...
simg2img super.img super.img.raw
To extract system.img run below cmd
./lpunpack --partition=system super.img.raw
To extract vendor.img run below cmd
./lpunpack --partition=vendor super.img.raw
To extract product.img run below cmd
./lpunpack --partition=product super.img.raw

Shas45558 said:
After lots of search i found a way to extract those img file from super.img
Click to expand...
Click to collapse
It is better to let other also know where you have found this. https://github.com/AndroidDumps/Fir...20a9a111b44f79da89b8/tools/Linux/bin/lpunpack from https://github.com/AndroidDumps/Firmware_extractor

HemanthJabalpuri said:
It is better to let other also know where you have found this. https://github.com/AndroidDumps/Fir...20a9a111b44f79da89b8/tools/Linux/bin/lpunpack from https://github.com/AndroidDumps/Firmware_extractor
Click to expand...
Click to collapse
Tnx for suggestions....and right i found it from those source.i want to simplify the hole process....

Shas45558 said:
After lots of search i found a way to extract those img file from super.img
What is need?
1.Computer with linux os.
extract zip file from this post and place your super.img in same location where you extract..
then run below cmd...
simg2img super.img super.img.raw
To extract system.img run below cmd
./lpunpack --partition=system super.img.raw
To extract vendor.img run below cmd
./lpunpack --partition=vendor super.img.raw
To extract product.img run below cmd
./lpunpack --partition=product super.img.raw
Click to expand...
Click to collapse
how to repack after modeficatiom

mohacraft8 said:
how to repack after modeficatiom
Click to expand...
Click to collapse
Sorry i do not know...
But you can flash then via fastbootd mood..
Remember do not use fastbootd if you are custom recovery...it must brick your device...
So flash stock recovery..go fastbootd mood and flash system, vendor and product..
Tnx for understanding.

mohacraft8 said:
how to repack after modeficatiom
Click to expand...
Click to collapse
You have to use lpmake for it.
See https://forum.xda-developers.com/t/gsis-on-a51-5g.4114349/ and https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-r-w.4247311/ for more info.

.......

Bro can we get modem.img by this

So let say if we flashing super.img , does it automatically flashed product.img ? or need to manually flash the product.img ?

Related

[Q] Unpack system.img GPad G10

Hi all,
I have a question about the GPad G10 firmware files.
I have unpack the rom of the G10, and i have now 3 files, boot.img, recover.img en system.img.
I can unpack the boot.img and the recover.img with split_bootimg, but when i try to unpack the system.img with unyaffs it fails.
I think its because the system.img is an ext3 format?
Can anyone tell me how i can extract this system.img with another way.
You can find the system.img here: tinyurl.com/6kqvoot
Jelmer.
Sorry for my bad english, i am dutch.
In CentOS when i type:
Code:
file system.img
it says:
Code:
system.img: VMS Alpha executable
Can someone tell me how i can extract that sort of files?
Jelmer.
Sorry for bad english, i'm Dutch.

What are data.img system.img boot.img files

Someone please tell me some basic of data.img system.img boot.img files
their use
and how to edit them ?
Or post some links explaining these.
ip2op01 said:
Someone please tell me some basic of data.img system.img boot.img files
their use
and how to edit them ?
Or post some links explaining these.
Click to expand...
Click to collapse
http://stackoverflow.com/questions/3879717/what-is-purpose-of-using-system-img-in-android
http://en.wikipedia.org/wiki/Disk_image
http://en.wikipedia.org/wiki/Boot_image
these may help, or may not. But hopefully so, if not try looking around stackoverflow a bit more.
ip2op01 said:
Someone please tell me some basic of data.img system.img boot.img files
their use
and how to edit them ?
Or post some links explaining these.
Click to expand...
Click to collapse
1.
boot.img : be similar with bootstrap in the PC's BIOS,aim to boot the android OS;
data.img : this file includes some user data and system data;
system.img : this file includes some packages and some lib file.
ramdisk.img : emulator's FS(file system)
2.
when the android OS start, emulator loads those image file to ramdisk FS, create "system" file directory and "data" file directory.so you should think that those are android OS component.
3.
(1)unpack:
a. tool-------"unyaffs" download link : http://code.google.com/p/unyaffs/downloads/list
b. command------./unyaffs system.img
(2)pack:
a. tool-------"mkyaffs2image" location:android/out/host/linux-x86/bin or search internet
b. make this tool
c. command------ ./mkyaffs2image <directory> <out_file>
I know this, try myself
Thanks guys
ip2op01 said:
Thanks guys
Click to expand...
Click to collapse
My English is poor,it's my pleasure,you can understand it.
enyblock said:
1.
boot.img : be similar with bootstrap in the PC's BIOS,aim to boot the android OS;
data.img : this file includes some user data and system data;
system.img : this file includes some packages and some lib file.
ramdisk.img : emulator's FS(file system)
2.
when the android OS start, emulator loads those image file to ramdisk FS, create "system" file directory and "data" file directory.so you should think that those are android OS component.
3.
(1)unpack:
a. tool-------"unyaffs" download link : http://code.google.com/p/unyaffs/downloads/list
b. command------./unyaffs system.img
(2)pack:
a. tool-------"mkyaffs2image" location:android/out/host/linux-x86/bin or search internet
b. make this tool
c. command------ ./mkyaffs2image <directory> <out_file>
I know this, try myself
Click to expand...
Click to collapse
So, if I have a ROM with the .img file extension I should flash it as "System" (In TWRP)???

[help]how to unpack and repack ramdisk.cpio and ramdisk-recovery.cpio from cm12.1

I have unpack boot.img use android kitchen and other boot.img tools ,but ramdisk.cpio and ramdisk-recovery.cpio are always there and can't unpack these two files, who can help ?
Very thanks
i want to unpack boot.img to patch some third roms.
who can unpack and repack ramdisk.cpio and ramdisk-recovery.cpio from cm12.1,can help with this problems
?

Unpacking and Repacking problem

Hoping someone can help me. Using the stock OS for a motorola moto G(3rd gen) and the windows command prompt, I can flash install system.img_sparsechunk.# files succesfully and the phone works great. However, I want to slim down this OS and remove some of the bloatware.
So, I unpacked system.img_sparsechunk.#'s into a system.img file using 'sparse converter.exe'. Then further decompressed it into folders and files using 'img extractor.exe'. Removed a few unimportant apps from the app folder and then made it back into a system.img file using 'make_ext4fs.exe & cygwin1.dll' which I got from the MTK Thai Developers Tool Unpack Repack package. Finally, I convert system.img into system.img_sparsechunk# files with 'sparse converter.exe' and I flashed to the moto G. This is unsuccessful. The phone is never gets past the bootloader unlocked screen and eventually goes to recovery. Is there something I'm doing wrong along the way in my unpack and repack?
These are the files from the stock OS:
boot.img
bootloader.img
flashfile.xml
fsg.mbn
gpt.bin
logo.bin
NON-HLOS.bin
OSPREY_RETUS_6.0_MPI24.65-25.1_cid9_subsidy-DEFAULT_CFC.info.txt
recovery.img
servicefile.xml
slcf_rev_b_default_v1.0.nvm
system.img
system.img_sparsechunk.0
system.img_sparsechunk.1
system.img_sparsechunk.2
system.img_sparsechunk.3
system.img_sparsechunk.4
system.img_sparsechunk.5
system.img_sparsechunk.6
Here are my steps more detailed:
1. sparseConverter_1.0.1 /decompress system.img_sparsechunk.0 system.img
A. This creates system.img
2. imgExtractor.exe system.img systemUnpack
A. This unpacks to files and folders
3. Modify files within 'systemUnpack' folder
4. make_ext4fs.exe -l 1200M system.img g:\rootAndroidMotoG3\osModXT1540\systemUnpack
A. Determine the size of the 'systemUnpack' folder. Round up to the nearest 100 Mb and substitute this
number for 1200.
B. This makes system.img
5. sparseConverter_1.0.1 /compress system.img . 256MB
A. This makes system.img_sparsechunk files
6. Enter bootloader mode on the MotoG.
7. Type: 'c:\adb\fastboot flash system system.img_sparsechunk1'. Type this for all of the system.img_sparsechunk#'s
Thanks
ACFH said:
I think you need put "-a system" in make_ext4fs command. Read this:
https://forum.xda-developers.com/ge...packing-editing-packing-roms-img-dat-t3350261
Click to expand...
Click to collapse
Thanks, it worked.

How to Unpack and Recompile system.img.ext4.lz4?

As the title suggests, is it possible to unpack and recompile the System.img.ext4.lz4 found within the stock system image? I'd like to poke around with stuff and see what happens. I know it probably won't accomplish anything but let a boy dream I can't fine any guides out there that work for this but hopefully a dev will bless me with his magic.
If you go to android software and hacking forum here on xda you might see what you're looking for. It's a devs section.
Nathamio said:
As the title suggests, is it possible to unpack and recompile the System.img.ext4.lz4 found within the stock system image? I'd like to poke around with stuff and see what happens. I know it probably won't accomplish anything but let a boy dream I can't fine any guides out there that work for this but hopefully a dev will bless me with his magic.
Click to expand...
Click to collapse
Use 7zip lz4 to extract img then mount img in Linux and then you can access raw system. I can extract and upload it for you if you want to give me the file name for the firmware.
VICosPhi said:
Use 7zip lz4 to extract img then mount img in Linux and then you can access raw system. I can extract and upload it for you if you want to give me the file name for the firmware.
Click to expand...
Click to collapse
If I mount it in linux can I modify it without having to write it to a new img? I tried mounting it and it won't work. Is there some special tool I need to install?
You extracted the xxx.ext4.lz4 to xxx.ext4 then again extracted xxx.ext4 to xxx.img using 7zip LZ4 before mounting to Linux, correct?
VICosPhi said:
You extracted the xxx.ext4.lz4 to xxx.ext4 then again extracted xxx.ext4 to xxx.img using 7zip LZ4 before mounting to Linux, correct?
Click to expand...
Click to collapse
I am also having an issue repacking the image as odin says invalid lz4.
I'm trying to but I get this error:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I haven't tried modifying and repacking the file yet, but what I did was extracted the lz4 to ext4 and then ext4 to img using 7zip LZ4. Then I mounted the img in CentOS and copied the /system folder over to get it Deodexed. Someone posted the other day that you can repack an IMG file and just flash it as IMG without having to convert to EXT4 or LZ4 on an S8 with v2 bootloader. I don't think this has been tested on a newer or v3 bootloader like S9.
Micro-instruction for unpack lz4 formats
-Download lz4 programm in attach. Extract in any folder.
-Put in lz4 folder system.img.ext4.lz4
-Open CMD line for lz4 folder and write:
lz4.exe -d system.img.ext4.lz4 system.img.ext4
-wait
-Done. We have system.img.ext4.
Now we can unpack this with SVAImgUnpack or any tool
mahotlov said:
Micro-instruction for unpack lz4 formats
-Download lz4 programm in attach. Extract in any folder.
-Put in lz4 folder system.img.ext4.lz4
-Open CMD line for lz4 folder and write:
lz4.exe -d system.img.ext4.lz4 system.img.ext4
-wait
-Done. We have system.img.ext4.
Now we can unpack this with SVAImgUnpack or any tool
Click to expand...
Click to collapse
nope decoded but linux reader not work, svaimg not work is oreo
bleros said:
nope decoded but linux reader not work, svaimg not work is oreo
Click to expand...
Click to collapse
I just converted the S7 Oreo Image (BTU-G930FXXU2ERD5) on my debian linux machine. To convert the android sparse file to the raw ext4 image, both worked simg2img and SVAImgUnpack.exe.
Which step does not work? The lz4 decompression? Or the conversion of the android sparse file to an raw ext4 image? Or the reading of the raw ext4 image?
By the way, I'm wondering if the S9 image is using ext4 or f2fs. Maybe that is the problem.
wernerwa said:
I just converted the S7 Oreo Image (BTU-G930FXXU2ERD5) on my debian linux machine. To convert the android sparse file to the raw ext4 image, both worked simg2img and SVAImgUnpack.exe.
Which step does not work? The lz4 decompression? Or the conversion of the android sparse file to an raw ext4 image? Or the reading of the raw ext4 image?
By the way, I'm wondering if the S9 image is using ext4 or f2fs. Maybe that is the problem.
Click to expand...
Click to collapse
i treid on windows , s7 oreo , no worry i have tried on vmware machine with debian and superr kitchen work fine
End of day you will find out that once you modify the stock image, it's no longer "stock" and probably fail when you try to flash it. Integrity verification wont let you. Unless you OEM unlock and flash a custom recovery, which WILL certainly trip your knox. There is no way back. For now. (I hope.)
wernerwa said:
I just converted the S7 Oreo Image (BTU-G930FXXU2ERD5) on my debian linux machine. To convert the android sparse file to the raw ext4 image, both worked simg2img and SVAImgUnpack.exe.
Which step does not work? The lz4 decompression? Or the conversion of the android sparse file to an raw ext4 image? Or the reading of the raw ext4 image?
By the way, I'm wondering if the S9 image is using ext4 or f2fs. Maybe that is the problem.
Click to expand...
Click to collapse
i tried again work fine was my mistake first lz4 used then droped into svaimgunpack then ext4explorer :highfive:
mahotlov said:
Micro-instruction for unpack lz4 formats
-Download lz4 programm in attach. Extract in any folder.
-Put in lz4 folder system.img.ext4.lz4
-Open CMD line for lz4 folder and write:
lz4.exe -d system.img.ext4.lz4 system.img.ext4
-wait
-Done. We have system.img.ext4.
Now we can unpack this with SVAImgUnpack or any tool
Click to expand...
Click to collapse
Hi,
I used 7zip to decompress firmware downloaded from sammobile (s7 edge). But the boot and recovery img I got were boot.img.lz4 and recovery.img.lz4.
I used your tool to get the .img directly without going into .ext4. Did I miss something in the steps I took? Thanks
dknight178
Hi. This instruction I wrote for s8/s9 (+)
Their images in firmware have ext4 extension.
You're doing everything right.
dknight178 said:
Hi,
I used 7zip to decompress firmware downloaded from sammobile (s7 edge). But the boot and recovery img I got were boot.img.lz4 and recovery.img.lz4.
I used your tool to get the .img directly without going into .ext4. Did I miss something in the steps I took? Thanks
Click to expand...
Click to collapse
Only certain partitions , like system and userdata, will have images that include the ext4 extension. Possibly cache, as well. Basically just the main partitions that are always mounted and regularly interacted with when the system is booted up and running.
Nathamio said:
I am also having an issue repacking the image as odin says invalid lz4.
I'm trying to but I get this error:
Click to expand...
Click to collapse
The tar archives used by odin aren't the basic version that 7zip is capable of making,. You need to use an actual tar excutable, and include certain argument. On windows, your tar command should look something like this:
Code:
tar.exe --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644 -f yourFW.tar boot.img.lz4 recovery.img.lz4 system.img.ext4.lz4 userdata.img.ext4.lz4
That would make a basic AP odin-ready tar package. Then just use md5sum to finish it off, though I don't believe its necessary Something like this:
Code:
md5sum.exe -t yourFW.tar >> yourFW.tar
move yourFW.tar yourFW.tar.md5
I attached d a zip with windows version of tar, md5sum, mv, and ls.
I f I want to make a flashable zip, what steps would I take to extract stock firmware to do so?
up
mahotlov said:
Micro-instruction for unpack lz4 formats
-Download lz4 programm in attach. Extract in any folder.
-Put in lz4 folder system.img.ext4.lz4
-Open CMD line for lz4 folder and write:
lz4.exe -d system.img.ext4.lz4 system.img.ext4
-wait
-Done. We have system.img.ext4.
Now we can unpack this with SVAImgUnpack or any tool
Click to expand...
Click to collapse
i had error
lz4.exe : The term 'lz4.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ lz4.exe
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (lz4.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
hochocnua said:
i had error
lz4.exe : The term 'lz4.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ lz4.exe
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (lz4.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Click to expand...
Click to collapse
wrong path and dont use powershell use cmd as admin

Categories

Resources