-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Asus Nexus 7 (2012) (grouper) #79
Comments
hi, thanks! this is an old device, and as such it might work, its GPT might not be locked. please read: #55 thanks again! |
I'll take the risk |
btw, I ran
So I don't think the gpt is locked down |
good work there! i'll try to do this port soon. might take a bit cause i'm travelling in europe at the moment. |
wtf!!! this comes from your dump, there seems to be no partition table there...
but regardless, the partitions are found by linux, dont know how/why
so this device, i dont know why it's working, but it's not compatible with REPIT. sorry! |
rip, but seriously though. How did linux even find the partitions. (I suspect dark magic) I'm going to flash the stock kernel and try again tomorrow. |
no, don't do that. what you can do is dmsg and try to figure out how the kernel found the partitions. in THEORY, they could even be compiled into the kernel, but sooooo improbable... who would even do that? in any case, REPIT only supports GPT, which is not there. so further experimentation is valuable in terms of knowledge, but expectation is that REPIT wont ever work on that device. |
I'm looking to resize partitions on my 2012 N7, and found this issue. Not sure if this is useful information at this point, but it looks like for some reason the primary GPT doesn't exist, but the backup/alternate GPT does. At boot time:
And if we look at |
hey thanks for this info... interesting. the secondary GPT is kinda swapped in format, i mean header and content: in the GPT headers you can find:
it'd be interesting to see whats on your disk. the idea would be fixing the main GPT (if possible), then porting REPIT. we need a dump of the start and end of the disk. unfortunately 32-bit so the easiest way for you to get the disk segments would be:
you can later cut the start and end (in a documented position) of the pulled file and post. we can probably edit the backup GPT to create a good main GPT. and if partitions are not there, and if data is not there, we can try writing the main GPT and see if the device still boots. alternatively we can use a GPT recovery tool and point to the pulled file as if it were a device, and have it recover the main GPT instead of doing it manually. we still need to take a look at everything though. if the start of the disk is used somehow (if not, why is the GPT not there?) then a kernel could be modded to fail reading the first blocks of the device and discard data written to them. i'd like to provide a block device in userland solution (similar to FUSE) or filtering lookback device that could do this trick without a custom kernel but i know little of linux to know if it is possible. |
Nexus 7 2012 isn't only t30 device. All devices, based on this soc have same partitions handle system. Some of them have workarounds for repartition, and some, like N7 doesn't. At least yet. |
ok, and which are the workarounds? do you plan to pull and follow this up? |
@Lanchon It is not that simple. I have Asus Transformer device on t30 and N7. They both have partition table in PT partition (pretty obvious). I observed images of this partitions and used hex editing in both devices to change partition sizes. Additionally PT image can be flashed only in APX mode. Currently only experiments with Transformer were successful. I've managed to increase system volume, decrease cache volume and change partition lable (made vendor partition). Same time changes to some partition cause device to brick, even permanent. P. S. Transformer has a proprietary flashing system that alloved me to create a binaries which I can flash via recovery and fastboot. |
the exynos 4 devices (i9100 etc) have a custom partitioning system called PIT involving a partition where the PT info is stored, a custom binary format for this PT called PIT, a custom flashing tool, etc original attempts to repit had tweaked the PIT and flashed it using the proprietary tool and download mode. that is necessary if you want to change partitions used by the bootloader. but most partitions arent, and i realized that you could simply mod the GPT mirror for those (system, data, cache...), which is what repit does. many thousands of decives have used repit and never had issues. |
so the custom TegraPT shit is placed at the beginning of the devices, so we cant fix the GPT. more info about the custom PT: |
if i were you, id create a GPT through a manual process and flashed that to the backup GPT. manual process could be: pull the mmc file, operste on the file as a device (maybe loop mounted), fix the missing GPT copy with standard tools, mod the GPT with standard tools, write back only the backup GPT to the device. or you could mod a kernel to change the userland view of the mmc so that standard gpt tools in repit work. possible if enough motivation is there, but too much work IMO. |
Sorry for the delayed response. I pulled the last 33 sectors off and have dropped it here. I tried to make a dummy disk image with a valid primary GPT on my laptop like so: truncate -s 31272730624 n7-mmc.img # make sparse file same size as N7 storage
dd if=n7-alt-gpt.img of=n7-mmc.img conv=notrunc bs=512 seek=1 skip=32 # copy alt GPT header to sector 1
dd if=n7-alt-gpt.img of=n7-mmc.img conv=notrunc bs=512 seek=2 count=32 # copy alt GPT entries to sectors 2-33 I tried leaving sector 0 as all zeroes, but that just gave me:
I also tried cheating and copying the protective MBR off my laptop's NVMe drive. But that just gave me:
A hexdump makes it seem like it looks like a normal GPT just from a cursory visual inspection, and not the proprietary TegraPT, but I can't be sure. Although, hmm, if I try sgdisk:
So even though it superficially looks like GPT, maybe it is TegraPT since the version field is wrong? Also the reserved field is not all zeroes like it should be. However, a quick look through the kernel source that I'm running on the N7 doesn't reveal any Tegra-specific GPT parsing code. And it looks like the stock kernel GPT parsing code doesn't validate the GPT version field like sgdisk does. Hmm... |
now you should be able to alter the table with usual tools. later you can copy those altered 32 sectors back into the device. WARNING:
|
@kelnos Did you resize your partitions in the end? I'm currently looking to do the same |
@alanplatt I haven't. My interest in messing with the hardware has faded a bit. I put PostmarketOS on it (which doesn't require the system partition; you can install it on the user-data partition), so my need to resize has also mostly gone away. |
@kelnos Thanks for the tip, I think I will also try PostmarketOS. Looks interesting! |
Device: Asus Nexus 7 (2012 WIFI)
Device Codename: grouper
Recovery: TWRP official 3.1.0
Kernel: 3.1.10-krassermench-g1cb11d3
Rom: Resurrection Remix Unofficial (RR-N-v5.8.4-20170810-grouper-Unofficial): https://forum.xda-developers.com/nexus-7/development/rom-resurrection-remix-5-8-0-nexus-7-t3537968)
Partition Layout: Unmodified
repit-dump.txt
The text was updated successfully, but these errors were encountered: