RISC-V (PineTab V etc.) via JH7110; I would like to build a rootfs!

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. :slight_smile:

Thanks in advance and kind regards,
Ingwie

4 Likes

Surely you can’t get a complete Sailfish OS running on that as things stand now. Some key components are only distributed in binary form - i.e. for the 3 supported architectures. I think Nemo Mobile moved off Sailfish OS as a base, so i’m not sure there are fully open versions that could serve as a PoC.

So i don’t really see adding another architecture without some involvement from Jolla. Maybe ask at a community meeting?

1 Like

Dont want to build up useless hope here;
but isnt MER at least (the platform “foundation” of SailfishOS) open sourced?
That should be usable here, right? And a first step towards SFOS /Nemo?
So something like buildng MER for RISCV (yadda yadda here be dragons),
and getting the kernel to boot in MER, should provide a good start…

EDIT : see here Mer Wiki
EDIT #2 : second hint, Sailfish-devices channels / topics on this forum provide a good reference as well

Back in the days, if my memory doesnt fail me, there was a way to get MER separately (from SFOS) ;
Id assume that “adding support” for RISC-V would translate into “supporting RISC-V” in the platform SDK.

So something like:
https://wiki.merproject.org/wiki/Platform_SDK_and_SB2
https://wiki.merproject.org/wiki/Platform_SDK#Building_an_image

could be a starting point…

EDIT #3 dang it seems all the links to the images from the mer wiki are dead :frowning: @lbt hyialp!

2 Likes

I’m afraid Mer “ceased to be”, as they say, quite some time ago : https://merproject.org/

My opinion: Getting RISC builds would involve a complete architecture bootstrap and that’s just not going to happen on the SFOS community infra. Could you do it yourself. Of course. Would I take that bet? No - it’s exceedingly complex and the know-how has pretty much evaporated. Sorry.

3 Likes

Thanks @lbt; that sounds a bit like the last nail in a coffin…
considering the open source nature of the project; is there really no chance to get some of the info back?
If not for bootstrapping efforts, for preservation? Also, i’d imagine since the tools are necessary for new device bootstrappings, they would be in the sfos repos?

EDIT : it seems some of the links are on web archive

https://web.archive.org/web/20210327104432/http://img.merproject.org/images/mer-sdk/

however, most of them refer to older meego repo’s which are not available anymore :confused:
In fact, they redirect to the Tizen(?) website…
But some seem in fact to be in the SFOS repos too:

EDIT: There’s obs on sailfishos of course:
https://repo.sailfishos.org/obs/

it’s a pity, such an excellent effort wasted in the sands of time…
Reminds me of Eidos loosing the source code of FFVII for PS…