7Ji / ampart

A partition tool for Amlogic's proprietary emmc partition format
GNU General Public License v3.0
64 stars 26 forks source link

[Official/Progress] Phicomm devices' support is incomplete #2

Closed 7Ji closed 2 years ago

7Ji commented 2 years ago

I currently do not have such a device to further debug and develop

A proprietary dtb format starts with DA04 is used in Phicomm devices, mainly N1 as I've only seen reports from a user with this device

Since u-boot would compare the partition table stored at the beginning of the reserved partition, and in the on-emmc dtb stored at the middle of the reserved partition, and 'friendly fix' it if these two are different, the new partition table will be reverted as soon as you reboot. ampart avoids this by removing the partitions node in the on-emmc dtb, and it supports standard dtb (magic D00DFEED), Amlogic multi-dtb (magic 414D4C5F) and gzipped versions of both (magic 1F8B), but does not support such proprietary format found on Phicomm N1.

ampart will refuse to modify the partition table if such a format is found. However, if you believe your u-boot won't 'fix' the partition table, or you have modified the dtb to avoid this, or you'll never poweroff the box after you re-partition it, you can force ampart to run with --no-node/-N

If anyone knows how this proprietary dtb format is decrpted and encrpted, please leave a comment below. I'll be appreciated.

7Ji commented 2 years ago

A workaround of this is to write dtb from other source (e.g. from mainline Linux kernel) into emmc, and if the box still boots, ampart will work on these normal dtb formats

7Ji commented 2 years ago

When forced a Phicomm N1 dtb onto my BesTV R3300L with DD, the dtb can't be processed, which suggests it is definitely in a proprietary format

[mmc_init] mmc init success
dtb magic 71b104da
      Amlogic multi-dtb tool
      Cannot find legal dtb!
start dts,buffer=0000000033eb8200,dt_addr=0000000033eb8200
check_valid_dts: FDT_ERR_BADMAGIC
7Ji commented 2 years ago

I'll close this and never support "a powerful hardware" Phicomm N1 due to my limited time and lack of support from owners of corresponding hardware. Some Mr.programmer buddy got lots of time to play with games but no time to actually help with actual development even he claims "I want to explore its full potential"