I think the cause of this is the resize of partitions.
I changed the emmc using the empty space and then did a run of resize2fs. All space was available to / and I was able to work with it. That is the moment I started the sysupgrade and there I suspect it went wrong.
So the trick might be how to reset the emmc, this is what I see in cfdisk:
Disk: /dev/mmcblk0
Size: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Label: gpt, identifier: 5452574F-2211-4433-5566-778899AABB00
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 8191 8158 4M BIOS boot
/dev/mmcblk0p2 8192 9215 1024 512K Linux filesystem
/dev/mmcblk0p3 9216 13311 4096 2M Linux filesystem
/dev/mmcblk0p4 13312 24575 11264 5.5M EFI System
>> /dev/mmcblk0p5 24576 131054 106479 52M EFI System
/dev/mmcblk0p6 131072 15269256 15138185 7.2G unknown
If I understood it correctly, p5 and p6 are joined and that's where the procedure fails in upgrading.
So I deleted these two and now it is like this:
Disk: /dev/mmcblk0
Size: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Label: gpt, identifier: 5452574F-2211-4433-5566-778899AABB00
Device Start End Sectors Size Type
>> /dev/mmcblk0p1 34 8191 8158 4M Linux filesystem
/dev/mmcblk0p2 8192 9215 1024 512K Linux filesystem
/dev/mmcblk0p3 9216 13311 4096 2M Linux filesystem
/dev/mmcblk0p4 13312 21503 8192 4M EFI System
Free space 22528 15269854 15247327 7.3G
I expected booting from nand and issuing the following would recreate in a default state what I deleted, but I must do something more I guess:
fw_setenv bootcmd "env default bootcmd ; saveenv ; saveenv ; run emmc_init ; bootmenu 0"
I also tried dd for replacing the data, but it is not bootable anymore from emmc, also no recovery in tmpfs.
I also noticed my partitions are a little different with lsblk:
START SIZE FSTYPE NAME PARTLABEL
122.5M ubi mtdblock0
2M mtdblock1
3M mtdblock2
512K mtdblock3
7.3G mmcblk0
34 4M ├─mmcblk0p1 bl2
8192 512K ├─mmcblk0p2 ubootenv
9216 2M ├─mmcblk0p3 factory
13312 4M └─mmcblk0p4 fip
The bl2 partition is new for me, not visible in other examples (may this be a cause of things go wrong?)
So how to continue effectively wiping emmc to get restarted on the emmc?