So, long story short: I have been playing around a lot with a VisionFive2 and familiarized myself with kernel building and device trees for quite a while now (still have to connect the remaining dots of going from PCB to device tree entries in detail; which pin resolves to what addr and alike). But I have compiled a working 6.6.0 kernel, successfuly, while it was still “unsupported” and I am on the verge of adding GPU drivers into that build too by fast-tracking a 6.6.0-rc1 branch that has the OSS version of those in it. So, long story short, I have a kernel, device tree and even some drivers. I have yet to buy a PineTab or Sipeed Lichee Console for additional HW though, but the process should be very similiar.
Now, the easiest way that I could put together a runnable SailfishOS on RISC-V would be if I could split bootloader (OpenSBI, U-Boot), Kernel (+ linux-firmware, initrd) and OS (= rootfs) into three build steps and merge them together into one flashable image.
For instance, here is an example of my current live system:
# parted /dev/mmcblk1
GNU Parted 3.6
Using /dev/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: SD SD (sd/mmc)
Disk /dev/mmcblk1: 31.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2097kB 4194kB 2097kB spl
2 4194kB 8389kB 4194kB uboot
3 8389kB 300MB 292MB fat16 image boot, esp
4 301MB 31.0GB 30.7GB ext4
As you can see, the entire microSD acts as the entire boot chain; dip-switches on the board just tell the bootROM where to look for the bootloader and then run it unconditionally.
So my question is: How do I bootstrap the build system to build me but a plain rootfs that I can then work together with the rest of my partitions? Kernel and initrd live on p3, p1 is OpenSBI and p2 is u-boot, which loads config from p3 and is thus instructed to run the kernel which will mount p4 and execute init.
As for the GPU drivers, they support Vulkan and some OGL and apparently work well with Wayland - so that should be pretty neat. They even submitted code to Mesa and friends. So there is a kernel driver, firmware blob and API impl in Mesa.
Thanks in advance and kind regards,
Ingwie