Unpacking and Repacking problem - Android Q&A, Help & Troubleshooting

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.

Related

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)???

[DIRE NEED] How To Repack System Folder as a Raw Disk Image Ubuntu

Hello,
I was able to unpack the image simply by using the command
Code:
unrar x system.img
Now that I have made my modifications (literally only changing the build.prop to start) I need to repack the system file folder back to an "x-raw-disk-image". Does anybody know how I may do this? Thanks everyone!

Invalid Boot.img when trying to extract kernal and ramdisk.

A very warm Hi! to the XDA community
My phone, the Sony Xperia E4, does not have a recovery - so I am slowly learning how to develop one. It has an MT6582 chip.
In the process I have obtained the stock boot.img (via boot.sin) from the phone's stock .ftf firmaware file.
I wish to use MTK droid tools to create the recovery, however it first gave me the error that the boot.img file is not split. After some research I came to learn that such boot.img files need to be split into the kernal (Zimage i believe) and ramdisk.
After some further research I came across this seemingly helpful guide and tool on how to split the boot.img file on Windows (unfortunately I do not have Linux at my disposal atm).
Now to my issue: (referring to the aforementioned guide & tool) When running the command
Code:
bootimg.exe --unpack-bootimg boot.img
I get this error:
Code:
AssertionError: invald bootimg
Which leads me to believe the boot.img file I have extracted may be corrupt or extracted from the wrong .sin file.
If you are still with me, how can i confirm that the boot.img file from the stock rom is indeed "working" and contains ramdisk and kernal?
Some extra information:
This is the guide I used to initially extract the boot.img file from my phones stock firmware. They highlight that boot.img is extracted from the kernal.sin file. My firmware has no such file. Later in the comments it mentions that newer Sony phones have the boot.img file in the appropriately named "boot.sin" file. This is the file i used to extract my boot.img. Thus from here I cannot see why the boot.img file cannot be split.
The full command line and response is:
Code:
C:\Users\\Downloads\Cofface>bootimg.exe --unpack-bootimg boot.img
arguments: [bootimg file]
bootimg file: boot.img
output: kernel[.gz] ramdisk[.gz] second[.gz]
Traceback (most recent call last):
File "<string>", line 2213, in <module>
File "<string>", line 1424, in unpack_bootimg
File "<string>", line 151, in parse_bootimg
AssertionError: invald bootimg
Thanks very much in advance!

Help on another softbricked H9 (Oreo) !!!

HELP !!!
My H9 was under OREO, using the page: https://forum.xda-developers.com/honor-9/how-to/stf-l09c432-how-to-install-oreo-h9-t3707729
The device is unlocked
Because of SNAPCHAT root detection, i removed completly SuperSU from my phone... very bad idea.... as my phone doesn't start anymore
The blank/green droid page display the following message:
ERROR MODE
Attention please update system again
Error!
Func NO: 10 (boot image)
Error NO: 2 (load failed)
----------------------------------
I can enter fastboot and nothing else !!!
Any suggestions ???
Thanks
Olivier
You must repack from your UPDATE.APP these files:
Recovery.img
Kernel.img
Ramdisk.img
And flash these files via fastboot.
Wysłane z mojego STF-L09 przy użyciu Tapatalka
As i upgraded using OldDroid's steps, i don't have these files. I just have the following ones:
RAMDISK.img
RECOVERY_RAMDISK.img
SR5-2.82-supersu_ramdisk.zip
STF_RECOVERY_NoCheck.img
STF_RECOVERY_OREO_NoCheck.img
twrp-3.1.1-nougat-stf.img
twrp-3.1.1-oreo-stf.img
update_rollback_al10c00b190.zip
and
L09-B321/update_data_full_public.zip
L09-B321/update_full_STF-L09_hw_normal.zip
L09-B321/update.zip
And, as partitions are different in Oreo, i m not sure i can flash the previous files (from L09-B321)...
(my phone is from EU)
Unzip UPDATE.APP contained inside L09-B321/update.zip .
Then open the previously extracted UPDATE.APP with this app:
https://forum.xda-developers.com/showthread.php?t=2433454
Then follow previous post from @kac222
Thanks :good: for all the details... one last (i hope) question regarding extracted files: could you please let me know which *exact* filename i should flash for recovery, kernel and ramdisk among this file list ?
(reminder: my H9 was running Oreo )
Code:
CACHE img
CRC img
CURVER img
DTS img
ERECOVERY_KERNE img
ERECOVERY_RAMDI img
ERECOVERY_VBMET img
ERECOVERY_VENDO img
FASTBOOT img
FW_HIFI img
FW_LPM3 img
HISEE_FS img
HISEE_IMG img
HISIUFS_GPT img
ISP_FIRMWARE img
KERNEL img
MODEM_FW img
MODEMNVM_UPDATE img
ODM img
PACKAGE_TYPE img
PRODUCT img
RAMDISK img
RECOVERY_RAMDIS img
RECOVERY_VBMETA img
RECOVERY_VENDOR img
SENSORHUB img
SHA256RSA img
SYSTEM img
TEEOS img
TRUSTFIRMWARE img
VBMETA img
VECTOR img
VENDOR img
VERLIST img
XLOADER img
fastboot flash recovery_ramdisk RECOVERY_RAMDIS.img
fastboot flash ramdisk RAMDISK.img
fastboot flash kernel KERNEL.img
fastboot reboot
Wysłane z mojego STF-L09 przy użyciu Tapatalka
Guys,
I would like to sincerely THANK YOU for your help and being so responsive !!!
(as you probably guessed: it works ! )

Extract system.img,vendor.img and product.img from super.img

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 ?

Categories

Resources