Looks right so far. I’m not sure about the mmc bootpart command as i always did this from uboot. You did this after booting initrd from nand? You cannot access emmc after booting from sdcard because both share the emmc controller,but it looks like emmc itself is available. It would be interesting how far boot process goes,so please show bootlog (debug uart).
After running this build from SD card, another problem occurred.
The build damaged the NAND bootloader. I understand that this is a result of using a UBI device.
So until I restore the bootloader, I have no way to make changes to the EMMC sector.
Have not tried ubi yet,only added the options. Also do nothing with nand (no write access). Normal bl2 should load fip from fip gpt partition. Wonder about the gpt error. Maybe you have to use the sgdisk workaround to update the backup gpt.
Backup table is never written by image because it is at the end of disk and image build process does not know how big the later disk is. It can only write the main gpt. The sgdisk uses the main gpt and writes the backup.
Perhaps it would be better to remove the ubi.mtd= from the kernel command line and use the userspace tool `ubiattach’ to attach the ubi-device, only when needed.
But perhapse attaching ubi is still safe, but the corruption is started when the ubifs is mounted on a ubi-volume on the ubi-device…
This is clear. I did not build the kernel, I used the ready one from your BPI-Router-Linux repository.
In this case, the question is, how to disable the use of UBI? Rebuild the kernel myself by disabling the options related to UBI?
If i would find time i would change nand to ubi too like openwrt does. Was not aware that linux recreates ubi and so breaks nand.
Basicly ubi only starts after bl2,so fip gets overridden as it should be inside ubi. So you have to flash bl2 with ubi support and (somehow) get fip into the ubifs.
Need to look how this can be done and then change my image creation code.
Disabling ubi in kernel can be done by either disabling ubi options or changing devicetree dropping the ubi partition.
You mean inside uboot? Maybe creating from linux (sdcard) and only loading in uboot is easier.
Would be great if you post such thread. Also looked for a way to load fit and initrd from spi nand/nor. Ubi would be a generic way without fixed offsets.