Issue with creating/flashing prerooted system.img - Sony Xperia P, U, Sola, Go

Having an issue making the prerooted system.img. Builds just fine only issue is when I flash it.
here is the error from the command prompt when trying to flash it:
sending 'system' (413386 KB)...
(bootloader) USB download speed was 32173kB/s
OKAY [ 13.172s]
writing 'system'...
(bootloader) Flash of partition 'system' requested
(bootloader) S1 partID 0x00000004, block 0x00022000-0x00221fff
(bootloader) Unsupported chunk type: 0x6565
Any ideas?

Try to use doomkernel instead

GR0S said:
Try to use doomkernel instead
Click to expand...
Click to collapse
Dont want a custom kernel.
Sent from my LT26i using Tapatalk 2

Spectre51 said:
Dont want a custom kernel.
Sent from my LT26i using Tapatalk 2
Click to expand...
Click to collapse
You don't have to, it won't help anyway. Might be your image is broken. Have you tried any others?

Did you create it using ext-4 tools in Linux? You can't do it properly with unyaffs for Xperia 2012 devices
Sent from my LT26i using XDA

krabappel2548 said:
Did you create it using ext-4 tools in Linux? You can't do it properly with unyaffs for Xperia 2012 devices
Sent from my LT26i using XDA
Click to expand...
Click to collapse
Yes I did. Followed the guide in the firmwares and root compilation thread.

Spectre51 said:
Yes I did. Followed the guide in the firmwares and root compilation thread.
Click to expand...
Click to collapse
Ok, I looked at the guide but I don't think it's a really good guide. Maybe I'll write a guide in general about it when I have some time
Sent from my LT26i using XDA

krabappel2548 said:
Ok, I looked at the guide but I don't think it's a really good guide. Maybe I'll write a guide in general about it when I have some time
Sent from my LT26i using XDA
Click to expand...
Click to collapse
yeh its not really complete. I had to find some help in other posts but its a starting point. Just gotta figure out if its something I am doing or if sony put something in .75 to make it harder to root this way.

Spectre51 said:
yeh its not really complete. I had to find some help in other posts but its a starting point. Just gotta figure out if its something I am doing or if sony put something in .75 to make it harder to root this way.
Click to expand...
Click to collapse
I prerooted .76 without issues by using that guide.
Could you give us some more details about the steps you followed, and eventually post all the commands you ran and their output?

crimilde said:
I prerooted .76 without issues by using that guide.
Could you give us some more details about the steps you followed, and eventually post all the commands you ran and their output?
Click to expand...
Click to collapse
Agree with this post. I created my own shell script following that guide to pre-root image for .73 and .75 and never found any issue.
Would be great if you could provide us the steps and commands you used

I'll paste the commands exactly and their output when I get back to my computer.

This is what I get when making the img:
[email protected]:/home/jtking/Desktop/android# ./sin2img.py system.sin system.img
[email protected]:/home/jtking/Desktop/android# mkdir system; mount -o loop system.img system
[email protected]:/home/jtking/Desktop/android# cp Superuser.apk system/app/
[email protected]:/home/jtking/Desktop/android# cp su system/b
bin/ build.prop
[email protected]:/home/jtking/Desktop/android# cp su system/bin/
[email protected]:/home/jtking/Desktop/android# chmod 644 system/app/Superuser.apk
[email protected]:/home/jtking/Desktop/android# chmod 06755 system/bin/su
[email protected]:/home/jtking/Desktop/android# ./mkuserimg.sh -s system ./system2.img ext4 ./temp 1024M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
./make_ext4fs -s -l 1024M -a ./temp ./system2.img system
Creating filesystem with parameters:
Size: 1073741824
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 4096
Label:
Blocks: 262144
Block groups: 8
Reserved block group size: 63
Created filesystem with 1224/65536 inodes and 107179/262144 blocks
[email protected]:/home/jtking/Desktop/android#
And again this is what I got when trying to flash that img
writing 'system'...
(bootloader) Flash of partition 'system' requested
(bootloader) S1 partID 0x00000004, block 0x00022000-0x00221fff
(bootloader) Unsupported chunk type: 0x656c
I was able to unlock the bootloader just fine with this system multiple times and had flashed the .73 system image previously so I don't think its an issue with the computer.

Thank you for posting commands you used here. Those are the same ones as I use so this problem seems too difficult for my knowledge.
There is a possible cause I'm thinking of now. That guideline creates 2 img file: system.img and system2.img. system2.img is the prerooted one and it is the file to be flashed via fastboot. Their names are confusing. The question is which file you used to flashed?
If your answer is system2.img, I think you did everything correctly. We need to find someone else who has better knowledge than me to help.

Spectre51 said:
[email protected]:/home/jtking/Desktop/android# cp su system/b
bin/ build.prop
Click to expand...
Click to collapse
Well, this line seems strange to me, what did you try to do here?
Spectre51 said:
Creating filesystem with parameters:
Size: 1073741824
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 4096
Label:
Blocks: 262144
Block groups: 8
Reserved block group size: 63
Created filesystem with 1224/65536 inodes and 107179/262144 blocks
Click to expand...
Click to collapse
I also tried to preroot and make the system img using the system.sin from 6.0.A.3.75_CE1 just to compare the output and I got:
Code:
[[email protected] ext4_utils]# ./mkuserimg.sh -s ../system ../system2.img ext4 ./temp 1024M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
./make_ext4fs -s -l 1024M -a ./temp ../system2.img ../system
Creating filesystem with parameters:
Size: 1073741824
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 4096
Label:
Blocks: 262144
Block groups: 8
Reserved block group size: 63
Created filesystem with 1230/65536 inodes and 108440/262144 blocks
So the inodes and block numbers clearly differ from yours. I didn't try to flash it though, to see if it works or not, as I already got .76, but I'd suggest you try a different FTF if you didn't use the one I mentioned already.
Also, maybe it's unrelated, but when you ran make on the ext4_utils, was the result ok?

crimilde said:
Well, this line seems strange to me, what did you try to do here?
I also tried to preroot and make the system img using the system.sin from 6.0.A.3.75_CE1 just to compare the output and I got:
Code:
[[email protected] ext4_utils]# ./mkuserimg.sh -s ../system ../system2.img ext4 ./temp 1024M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
./make_ext4fs -s -l 1024M -a ./temp ../system2.img ../system
Creating filesystem with parameters:
Size: 1073741824
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 4096
Label:
Blocks: 262144
Block groups: 8
Reserved block group size: 63
Created filesystem with 1230/65536 inodes and 108440/262144 blocks
So the inodes and block numbers clearly differ from yours. I didn't try to flash it though, to see if it works or not, as I already got .76, but I'd suggest you try a different FTF if you didn't use the one I mentioned already.
Also, maybe it's unrelated, but when you ran make on the ext4_utils, was the result ok?
Click to expand...
Click to collapse
1) bash completion
2) it's different sizes

Haha, I must be going bad in the eyes, what with the bash completion fail I just did right there. Thanks.
Sent from my Sony Tablet S using xda premium

tot_anusak said:
There is a possible cause I'm thinking of now. That guideline creates 2 img file: system.img and system2.img. system2.img is the prerooted one and it is the file to be flashed via fastboot. Their names are confusing. The question is which file you used to flashed?
If your answer is system2.img
Click to expand...
Click to collapse
I used system2.img to flash
crimilde said:
Also, maybe it's unrelated, but when you ran make on the ext4_utils, was the result ok?
Click to expand...
Click to collapse
ext4_utils make went fine with no errors or anything.

Just to make sure I got the system.sin the right way. From the SEUS blob_fs folder I took the two biggest files from the .75 update download and and in flashtool did the decrypt files option. Took the system.sin file from there to use for this process.

Spectre51 said:
Just to make sure I got the system.sin the right way. From the SEUS blob_fs folder I took the two biggest files from the .75 update download and and in flashtool did the decrypt files option. Took the system.sin file from there to use for this process.
Click to expand...
Click to collapse
Yes, you did it right way.

Okay not sure what the deal is then with making this pre-rooted system image. Now for the Superuser.apk and su files I got them from http://androidsu.com/superuser/ Downloaded and extracted the Superuser.apk and su from the system/app and system/bin folders and thats what I was using to put into the prerooted system.img
Is that also the correct way to do it?
Not sure why I am having so much trouble getting this to work. If I upload the system.sin can someone else try making it to see if maybe something with my system is messing it up?

Related

[Q] Unpacking and repacking stock rom .img files

hello,
Question on this post, I have no access to answer
http://forum.xda-developers.com/showthread.php?t=1081239
Thanks, good work to unpack the .img file.
I have a problem
repacking factoryfs_custom.img only 10,2*Mio (10678552 octets)
Code:
[email protected]:/home/max/ext4_utils# mkdir tempdir; mount -o loop output.img tempdir
[email protected]:/home/max/ext4_utils# ./mkuserimg.sh -s /some/directory/with/files ./factoryfs_custom.img ext4 ./temp 512M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
./make_ext4fs -s -l 512M -a ./temp ./factoryfs_custom.img /some/directory/with/files
Creating filesystem with parameters:
Size: 536870912
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 2048
Label:
Blocks: 131072
Block groups: 4
Reserved block group size: 31
Created filesystem with 10/32768 inodes and 4205/131072 blocks
[email protected]:/home/max/ext4_utils# ls -l factoryfs_custom.img
-rw-r--r-- 1 root root 10678552 2011-05-28 09:57 factoryfs_custom.img
[email protected]:/home/max/ext4_utils#
what is the problem?
sorry for my bad English
Thanks
Can we move my question in the original post?
http://forum.xda-developers.com/showthread.php?t=1081239
Thank
max30 said:
Can we move my question in the original post?
http://forum.xda-developers.com/showthread.php?t=1081239
Thank
Click to expand...
Click to collapse
It remains for me to write the six missing messages to be able to ask my question in the right place
max30 said:
It remains for me to write the six missing messages to be able to ask my question in the right place
Click to expand...
Click to collapse
I can go post in the right place now

How to make Odin package for ex4 devices

Hey fellow guys!!!
I have been trying to make ODIN roms for my device (Galaxy NOTE).
I have tried making system.img using adb using this command:
Code:
dd if=/dev/block/mmcblk0p9 of=/sdcard/system.img bs=4096
And got system.img in my sdcard.When I made tar ball of the img and tried to flash with ODIN it said failed!!
So I continued searching and found this thread.
what I made was:
extract my previously created system.img into a folder called system and used this command in terminal:
Code:
[email protected]:~/ext4_utils$ ./mkuserimg.sh -s ~/system/ ./factoryfs_custom.img ext4 ./temp 512M
But I get this error:
Code:
in mkuserimg.sh PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
./make_ext4fs -s -l 512M -a ./temp ./factoryfs_custom.img /home/vijai/system/
./mkuserimg.sh: line 52: ./make_ext4fs: No such file or directory
Where am I going wrong??Or someone could guide me in right direction??
Thanks.
You need the make_ext4fs tool, get it by googling and place it in the directory the script is.
Sent from my GT-P1000
cdesai said:
You need the make_ext4fs tool, get it by googling and place it in the directory the script is.
Sent from my GT-P1000
Click to expand...
Click to collapse
thanks Will report after trying
Now I get this error:
Code:
./mkuserimg.sh: line 52: ./make_ext4fs: cannot execute binary file
vijai2011 said:
Now I get this error:
Code:
./mkuserimg.sh: line 52: ./make_ext4fs: cannot execute binary file
Click to expand...
Click to collapse
chmod +x ./make_ext4fs
Sent from my GT-P1000
cdesai said:
chmod +x ./make_ext4fs
Sent from my GT-P1000
Click to expand...
Click to collapse
Sorry the file was a wrong one .
I put in the correct file and type the command and I got this error:
[email protected]:~/ext4_utils$ ./mkuserimg.sh -s ~/system/ ./factoryfs_custom.img ext4 ./temp 512M
in mkuserimg.sh PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
./make_ext4fs -s -l 512M -a ./temp ./factoryfs_custom.img /home/vijai/system/
Creating filesystem with parameters:
Size: 536870912
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 2048
Label:
Blocks: 131072
Block groups: 4
Reserved block group size: 31
error: do_inode_allocate_extents: Failed to allocate 134 blocks
Click to expand...
Click to collapse
vijai2011 said:
Sorry the file was a wrong one .
I put in the correct file and type the command and I got this error:
Click to expand...
Click to collapse
hello
i have the same error, have you solved?

Error while restorting CWM backup

Hi there.
I'm trying to do port CWM for Xperia J for a locked bootloader.
Everything works except restoring backup /system:
Code:
Checking MD5 sums...
boot.img: OK
cache.ext4.dup: OK
data.ext4.dup: OK
system.ext4.dup: OK
couldn't find default
Found new backup image: /sdcard/clockworkmod/backup/2012-12-29.00.19.49//system.ext4.dup
Restoring system...
Creating filesystem with parameters:
Size: 681574400
Block size: 4096
Blocks per group: 32768
Inodes per group: 6944
Inode size: 256
Journal blocks: 2600
Label:
Blocks: 166400
Block groups: 6
Reserved block group size: 47
Created filesystem with 11/41664 inodes and 5415/166400 blocks
Unable to copy file ./app/AccessoryKeyDispatcher.apk
system
app
AccessoryKeyDispatcher.apk
Error while restoring /system!
Then the phone will not start. I need reflash fw (recovery doesn't work then because it is on /system partition - locked bl)

[HELP] Can't restore /system and /data from CWM

Hi guys, I Have a Xperia P LT22i Black and I'm here because I can't restore my backups that I always used, but now is useless. I'm on same kernel (Sony stock), same FW (6.2.A.1.100) and can't backup anymore, always give me error while restoring those 2. Here is last_log from /cache/recovery.
Backing up .android_secure...
.
com.trust5.odp-1.asec
com.quoord.tapatalkxda.activity-1.a
com.loudtalks-1.asec
com.whatsapp.wallpaper-1.asec
com.music.download-1.asec
com.facebook.orca-1.asec
me.pou.app-2.asec
com.kiloo.subwaysurf-2.asec
com.davidamado.MetalGearOuterHeaven
Backing up cache...
.
lost+found
dalvik-cache
recovery
last_log
log
No sd-ext found. Skipping backup of sd-ext.
Generating md5 sum...
chmod: /sdcard/clockworkmod/blobs/02c/§☻‼/♀~|♫: No such file or directory
chmod: /sdcard/clockworkmod/blobs/235/∟/☺>☼>♣~: No such file or directory
Backup complete!
Checking MD5 sums...
boot.img: OK
cache.ext4.dup: OK
data.ext4.dup: OK
system.ext4.dup: OK
.android_secure.vfat.dup: OK
couldn't find default
Found new backup image: /sdcard/clockworkmod/backup/2013-06-30.03.16.22//data.ex
t4.dup
Restoring data...
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label:
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 11/131072 inodes and 17193/524288 blocks
warning: wipe_block_device: Discard failed
Unable to copy file ./backup/processed
data
user
0
idd
etc
bluetooth_bdaddr
wlan_macaddr
light_themes
GNB_DEBUG.txt
backup
processed
Error while restoring /data!
Click to expand...
Click to collapse
Can someone answer that? Thank you!!
I had a similar problem with twrp recently. I had to completely reflash my rom. I ended up totally deleting the whole twrp folder
And after re trying making and restoring a new backup all worked.
I could only assume corrupted data in that folder caused the issue
Sent from my 4.2.2 Xperia S via Tapatalk
Reflashing d entire rom is d only way ............
so as i did so
Yeah, I had to start all over, some told me to change the format of the backup, but when I press to change the format, it stuck and i have to force reboot the phone. Can't change the format, anyone know how to reinstall CWM or delete CWM? So I can install it fresh again?

Can't edit cache.img file using simg2img and img2simg

I tried on both windows and ubuntu.
First I try to flash the original cache.img
Code:
heimdall flash --CACHE cache.img
Works, no errors and everything goes fine. Now when I do...
Code:
>file cache.img
cache.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
>simg2img cache.img cache.raw
>img2simg cache.raw cache2.img
>file cache2.img
cache2.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 74 input chunks.
Without changing (or even mounting) the raw file at all! I just converted it to raw and back.
Then I tried to flash the new file again, fails. And as you can see they are obviously very different, even though I did absolutely no changes!
I verified the block size, the default one (4096) is the correct one.
Also, the original cache.img is 49.4 MB, the cache2.img file is 39.6 MB
The output when trying to flash the new cache.img file:
Code:
Uploading CACHE
100%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: CACHE upload failed!
It should be the same file, but isn't. What am I doing wrong?
Edit:
Instead of using img2simg, I used mkuserimg.sh which created a file that's NEARLY identical to my original file:
Code:
>sudo ./mkuserimg.sh -s ./cache ./cache2.img ext4 cache 64M
in mkuserimg.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
make_ext4fs -s -l 64M -a cache ./cache2.img ./cache
Creating filesystem with parameters:
Size: 67108864
Block size: 4096
Blocks per group: 32768
Inodes per group: 4096
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16384
Block groups: 1
Reserved block group size: 7
Created filesystem with 15/4096 inodes and 12062/16384 blocks
>file *.img
cache2.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
cache.img: Android sparse image, version: 1.0, Total of 16384 4096-byte output blocks in 14 input chunks.
>ls -l *.img
-rw-r--r-- 1 root root 49406148 Aug 20 13:19 cache2.img
-rwxrw-rw- 1 ae ae 49406208 May 19 09:24 cache.img
As you see they slightly differ now, but flashing still fails. Adding --verbose to heimdall adds this:
Code:
ERROR: Failed to unpack received packet.
Edit 2:
I'm using a Samsung device (Galaxy S7)
Fixed it in the end using manually compiled and modified binaries of the sim2img and img2sim. The original source is obtained from
github .com/ASdev/android_img_repack_tools/tree/android-6.0.1
and then apply this patch
gist. github .com/jedld/4f388496bda03b349f5744f367749a67
(had to add spaces because i'm a new user, but wanted to put this here in case someone else has this problem)
then build it, and it flashes now properly. (using simg2img and img2simg)

Categories

Resources