Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with SM-G361F system.img #24

Closed
Max1Truc opened this issue Jan 19, 2020 · 1 comment
Closed

Error with SM-G361F system.img #24

Max1Truc opened this issue Jan 19, 2020 · 1 comment

Comments

@Max1Truc
Copy link

Max1Truc commented Jan 19, 2020

Hello @anestisb ,

I've got a system.img from the official ROM G361FXXU1APB1 of Samsung Galaxy SM-G361F.

(Download here)

The problem is, if I "repack" this image, the newly-created image (packed in a tarfile) is accepted by Odin but rejected by the device.

EDIT:
It seems that the size of the input chunks is 2562 in the original system.img, but,
because 2562 % 4 != 0, img2simg is rejecting my command to force the use of
2562-sized blocks `img2simg system.raw.img system.img 2562`

I am showing a case were I didn't modify the filesystem from simg2img before converting it back with img2simg for clarification.

I am "repacking" this way:

root@pc:~/Desktop# simg2img system.img system.raw.img
root@pc:~/Desktop# mv system.img system.original.img
root@pc:~/Desktop# img2simg system.raw.img system.img
root@pc:~/Desktop# tar cvf G361FXXU1APB1.tar system.img
root@pc:~/Desktop# md5sum -t G361FXXU1APB1.tar >> G361FXXU1APB1.tar
root@pc:~/Desktop# mv G361FXXU1APB1.tar G361FXXU1APB1.tar.md5

Additional information :

  • Repacking with neither simg2img nor img2simg works with Odin and is accepted by the device:
root@pc:~/Desktop# tar cvf G361FXXU1APB1.tar system.img
root@pc:~/Desktop# md5sum -t G361FXXU1APB1.tar >> G361FXXU1APB1.tar
root@pc:~/Desktop# mv G361FXXU1APB1.tar G361FXXU1APB1.tar.md5
  • I'm using a Linux VM inside of Windows 10
  • About the base image :
root@pc:~/Desktop# file system.img 
system.img: Android sparse image, version: 1.0, Total of 471808 4096-byte output blocks in 2562 input chunks. 

root@pc:~/Desktop# python2 ./android-simg2img/simg_dump.py system.img
simg_dump.py: system.img: The file header size was expected to be 28, but is 32.
  • About the generated image :
root@pc:~/Desktop# file system.img
system.img: Android sparse image, version: 1.0, Total of 471808 4096-byte output blocks in 1692 input chunks.

root@pc:~/Desktop# python2 ./android-simg2img/simg_dump.py system.img 
system.img: Total of 471808 4096-byte output blocks in 1692 input chunks.
  • About the raw image :
root@pc:~/Desktop# file system.raw.img
system.raw.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (extents) (large files)
@Max1Truc Max1Truc changed the title Support 2562 input chunks Error with Samsung Galaxy SM-G361F firmware Jan 19, 2020
@Max1Truc Max1Truc changed the title Error with Samsung Galaxy SM-G361F firmware Error with SM-G361F system.img Jan 19, 2020
@Max1Truc
Copy link
Author

Self-answer for guys looking at the solution... You have to post-process the "repacked" system.img with this tool from chainfire, before flashing it on the phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant