litew / sfos-ham

Projects and Issues for Sailfish OS port on ZUK Z1
4 stars 0 forks source link

Assumptions for critical partitions are not fit with Z1s which used to run the latest ZUI rom. #11

Open persmule opened 6 years ago

persmule commented 6 years ago

The current build of sfos for ZUK Z1 assumes that system partition is /dev/mmcblk0p22 and userdata is /dev/mmcblk0p23, but I found on my phone, which used to run the latest ZUI rom, had system on /dev/mmcblk0p21 and userdata on /dev/mmcblk0p22. Such partition scheme allows most android distributions to run properly, since they usually locate partitions via their partlabel, but prevent the current build of sfos for ZUK Z1 running.

In order to make sfos boot properly, I had to invoke sfos' fdisk (TWRP's fdisk seems too poor to accomplish it)with

# LD_LIBRARY_PATH=/data/.stowaway/sailfish/usr/lib:/data/.stowaway/sailfish/lib /data/.stowaway/sailfish/lib/ld-2.19.so /data/.stowaway/sailfish/sbin/fdisk /dev/mmcblk0

from the environment on initrd (since it is unable to find the partition containing rootfs on /dev/mmcblk0p23) via telnet, after installation, in order to repartition system and userdata to /dev/mmcblk0p22 and /dev/mmcblk0p23 accordingly, with all flag intact.

Is it the only and best solution to deal with the partition scheme introduced by latest ZUI rom, or is it possible to locate partitions by partlabel during init, just as android distributions do?