Ruka-CFW / rk3128-cfw

*** DEPRECATED - DON'T USE *** Rockchip RK3128 Custom Firmware for Powkiddy A12/A13 & AIWO retro-consoles
Other
44 stars 13 forks source link

PS5000 controls don't work after flashing CFW #53

Closed acmeplus closed 2 years ago

acmeplus commented 2 years ago

Describe the bug There seems to be at least two different board revisions of the PS5000. Initial custom firmware released () fails to properly flash the userdata partition in some cases, resulting in a broken system (controls don't work)

Custom Firmware version: [e.g. v3.0 Alpha 1]

Console (please complete the following information):

To Reproduce

  1. Follow installation guide to get internal firmware into the MMC and external content into the SD
  2. Restart device
  3. CFW logo shows up
  4. CFW starts (retroarch theme loaded)
  5. Controls don't respond

Expected behavior Controls should respond as expected.

Additional context The partition table of the PS5000 seems to have at least two variations. We are going to call them Rev A & B.

Rev.A Partition Table: Partition Info(gpt): NO LBA Size Name 01 0x00002000 0x00000800 uboot 02 0x00002800 0x00001000 trust 03 0x00003800 0x00004800 boot 04 0x00008000 0x00020800 rootfs 05 0x00028800 0x0000d5df userdata

Rev.B Partition Table Partition Info(gpt): NO LBA Size Name 01 0x00002000 0x00000800 uboot 02 0x00002800 0x00001000 trust 03 0x00003800 0x00004800 boot 04 0x00008000 0x00023000 rootfs 05 0x0002b000 0x0000addf userdata

As we can see, the rootfs and userdata partitions length are different, and therefore the userdata partition starts at a different offset. Once the user flashes the Rev.A CFW into a Rev.B, the userdata partition actually overwrites the end of the rootfs partition.

acmeplus commented 2 years ago

Some additional information about this issue.

It looks like some of the users exhibit a corrupted userdata partition after flashing at the incorrect offset. Re-flashing a proper partition should typically fix that but that's not seem to be the case at least for one user.

[    2.573273] FAT-fs (mmcblk0p1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[    2.577116] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    3.621013] EXT4-fs (rkflash0p5): couldn't mount as ext3 due to feature incompatibilities
[    3.621700] EXT4-fs (rkflash0p5): mounting ext2 file system using the ext4 subsystem
[    3.621728] EXT4-fs (rkflash0p5): bad geometry: block count 27372 exceeds size of device (22255 blocks)
[    3.622353] EXT4-fs (rkflash0p5): bad geometry: block count 27372 exceeds size of device (22255 blocks)
[    3.623118] FAT-fs (rkflash0p5): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[    3.623787] [EXFAT] trying to mount...

After that happens, the system is unable to properly mount /userdata and therefore the links required for /run and config are not properly set. udev cannot properly be reinitialized after switching to the chroot and controls don't respond.

acmeplus commented 2 years ago

Issue was related to different partition tables in different PS5000 models. Issue has been already corrected in the latest release since the partition table is rewritten during cfw flashing.