-
Notifications
You must be signed in to change notification settings - Fork 74
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
Can't write/wipe persistent partition. #42
Comments
The logs are from @tuxuser fork, but with the code from this repo I have the same issues |
Here is the output of DMESG after running the TRIM command
|
You should have posted the issue on his fork :) You need to specify --cr 2 so: partitions.py --cr 2 --ufs --wipe persistent But that isn't going to work unless you have patched gpt.py to deal with 4096 byte sector size. Again, this doesn't belong here. If you open an issue on his fork, I will be glad to help you. Also, you need to edit partitions.py and and /dev/block/sdX to the body of the OPEN where the X is the block device that your persistent partition is on. -- Brian |
Hi! I meant that the traces that I pasted (command output & dmesg) were after running code from that fork. But the same issue happened with the code from this repo. I think this is the main repo, so I reported the issue here, hoping more people would see it. Sadly I will not have access to the phone for the long weekend, will try the command next Wednesday. When there was an issue with the challenge-response, the phone would return an The persistent partition is somewhere in I did not get the bit about patching the partition tool. The partition seems to be correct: I've verified that it contains the correct data after doing a dump and also reading from |
From your log: [LAF] can not access wp area 117440512 - 125829119(117440512 - 117964287) Yes, the --cr flag should help you. Also, you don't need the --ufs flag because you don't have a UFS NAND. |
@runningnak3d I see. I will try that then. RE: UFS, the same issue happens without the flag, but thanks. I didn't know what the difference between eMMC and UFS was: https://news.samsung.com/global/emmc-to-ufs-how-nand-memory-for-mobile-products-is-evolving It's still unclear why they would be different (other than using a command queue in the UFS operations to make it faster). |
eMMC is exposed as just one block device /dev/block/mmcblk0 with a bunch of partitions /dev/block/mmcblk0p1 to p28 (usually) UFS is exposed as 8 block devices /dev/block/sda to sdh along with a bunch of partitions. With eMMC you only have to issue an OPEN with no body, and it opens mmcblk0. With UFS you have to specify the block device that you want to work with in the body of the OPEN. |
Hi @runningnak3d , thanks for your answer. I tried running the command with the
I did test this in the original repo. Without running the challenge_response, I get
After issuing a
My changes: $ git diff
diff --git a/partitions.py b/partitions.py
index 190512f..4463731 100755
--- a/partitions.py
+++ b/partitions.py
@@ -55,12 +55,14 @@ def find_partition(diskinfo, query):
@contextmanager
def laf_open_disk(comm):
# Open whole disk in read/write mode
+ lglaf.challenge_response(comm, mode=2)
open_cmd = lglaf.make_request(b'OPEN', body=b'\0')
open_header = comm.call(open_cmd)[0]
fd_num = read_uint32(open_header, 4)
try:
yield fd_num
finally:
+ lglaf.challenge_response(comm, mode=4)
close_cmd = lglaf.make_request(b'CLSE', args=[fd_num])
comm.call(close_cmd)
@@ -75,6 +77,7 @@ def laf_read(comm, fd_num, offset, size):
def laf_erase(comm, fd_num, sector_start, sector_count):
"""TRIM some sectors."""
+ lglaf.challenge_response(comm, mode=2)
erase_cmd = lglaf.make_request(b'ERSE',
args=[fd_num, sector_start, sector_count])
header, response = comm.call(erase_cmd) Is there any way to fix this and write to that partition? Thanks! |
You need to send IOCT fd_num,0x1261 -- Brian |
Hi!
I have been trying to wipe the persistent partition in a LG MP450, but every time I do a WRTE or a TRIM command, I get the following:
I have tried issuing manual commands and nothing. Most of the other stuff works without issues (opening FDs, running some basic commands, etc).
Any ideas on what I can do?
The text was updated successfully, but these errors were encountered: