Arch Linux Image for VisionFive 2

If you dd directly to NVMe and start doing a lot of things on it, it will no longer be “minimal,” which causes some conflicts in my mind. Perhaps my subconscious always thinks about that, so I always make my subvolume on NVMe just “arch” without “minimal” from the beginning.

Yeah, you’re right, dd directly to NVMe is easier. I’ll change my approach accordingly.

Or perhaps I’ll drop “minimal” from the subvolume name in the next version, since we’re going to do a lot of things after booting it anyway.

2 Likes

@danboid Ah! I remember now, I didn’t dd directly to NVMe because it would destroy everything that was already on it. Before obtaining the working image, I had other distros in their separate subvolumes such as Debian69 and Fedora. That’s why I had to do it my way.

1 Like

I just release my first kernel package for Arch Linux cwt image here:

2 Likes
(6/6) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: '5.15.2-cwt-3.0.4-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> ERROR: module not found: 'jpu'
==> ERROR: module not found: 'vdec'
==> ERROR: module not found: 'venc'
==> Generating module dependencies
==> Creating lz4-compressed initcpio image: '/boot/initramfs-linux.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
error: command failed to execute correctly

Install the soft_3rd package and it will be fine. Next image will use the packaged kernel by default, and this error message will not appear again.

For now use command

sudo pacman -U --overwrite “*” *. zst

Thanks

1 Like

And I’d much prefer the changed packages rather than having to manually extract stuff from an image onto my SSD.

1 Like

Will provide both easy way (but it will destroy any previous data on SSD) and the hard way.

Again, thanks for all the work. Now booted into the new packaged kernel.

1 Like

Ah… forgot to tell you that you need to edit the /boot/extlinux/extlinux.conf to use the new kernel

Guess what, I worked that out myself.

1 Like

I got mesa working! :smiley:

Most of the credit goes to @cordlandwehr’s yocto setup, I just ported it to a PKGBUILD.
I’ll release this on aur shortly once I clean it up a bit, in the meantime, here’s a .pkg.tar.zst (install with pacman -U)

[user@ArchVF2 mesa-pvr]$ weston
Date: 2023-06-13 UTC
[04:38:46.746] weston 11.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 11.0.1
[04:38:46.746] Command line: weston
[04:38:46.746] OS: Linux, 5.15.2-cwt13, #2 SMP PREEMPT Thu Jun 1 14:42:43 +07 2023, riscv64
[04:38:46.746] Flight recorder: enabled
[04:38:46.746] Starting with no config file.
[04:38:46.747] Output repaint window is 7 ms maximum.
[04:38:46.747] Loading module '/usr/lib/libweston-11/drm-backend.so'
[04:38:46.755] initializing drm backend
[04:38:46.755] Trying libseat launcher...
00:00:24.591  [seatd/server.c:145] New client connected (pid: 89377, uid: 1000, gid: 1000)
00:00:24.591  [seatd/seat.c:170] Added client 1 to seat0
00:00:24.591  [seatd/seat.c:480] Opened client 1 on seat0
[04:38:46.755] [libseat/libseat.c:73] Seat opened with backend 'seatd'
[04:38:46.755] [libseat/backend/seatd.c:212] Enabling seat
[04:38:46.755] libseat: session control granted
[04:38:46.762] using /dev/dri/card1
[04:38:46.762] DRM: supports atomic modesetting
[04:38:46.762] DRM: supports GBM modifiers
[04:38:46.762] DRM: supports picture aspect ratio
[04:38:46.762] Loading module '/usr/lib/libweston-11/gl-renderer.so'
[04:38:46.802] Using rendering device: /dev/dri/card1
[04:38:46.802] EGL version: 1.5
[04:38:46.802] EGL vendor: Mesa Project
[04:38:46.802] EGL client APIs: OpenGL_ES
[04:38:46.803] EGL features:
               EGL Wayland extension: yes
               context priority: yes
               buffer age: yes
               partial update: yes
               swap buffers with damage: no
               configless context: yes
               surfaceless context: yes
               dmabuf support: modifiers
[04:38:46.817] GL version: OpenGL ES 3.2 build 1.17@6210866
[04:38:46.817] GLSL version: OpenGL ES GLSL ES 3.20 build 1.17@6210866
[04:38:46.817] GL vendor: Imagination Technologies
[04:38:46.817] GL renderer: PowerVR B-Series BXE-4-32
[04:38:46.840] GL ES 3.2 - renderer features:
               read-back format: ARGB8888
               wl_shm 10 bpc formats: yes
               wl_shm 16 bpc formats: no
               wl_shm half-float formats: no
               internal R and RG formats: yes
               OES_EGL_image_external: yes
5 Likes

3 Likes

Thanks for the effort. Unfortunately, it crashes here with a fully updated system, including the latest cwt kernel. Any hints as to where I should start looking ?
Is there a source repo?

Jun 13 07:51:54 jagular kernel: weston[2245]: unhandled signal 11 code 0x1 at 0x
0000000000000000 in libLLVM-15.so[3fa33d7000+5cb6000]

Attached is the weston log, which looks great up to the moment it dies.
weston-crash.log (13.1 KB)

Maybe a mismatch between your llvm version and mine - I’ll have a pkgbuild ready soon just trying to write patch files for my last few changes. Also maybe install visionfive2-img-gpu , I forgot to add that as a dep I think in the first pass.

I have the visionfive2-img-gpu package installed.

There is also the following in dmesg :

[Tue Jun 13 07:41:50 2023] PVR_K:  1: --------------------------------
[Tue Jun 13 07:41:50 2023] PVR_K:(Error):     1: PVRSRVDeviceFinalise: Failed to set device (____ptrval____) power state to 'on' (PVRSRV_ERROR_TIMEOUT) [2466]
[Tue Jun 13 07:41:50 2023] PVR_K:(Error):     1: PVRSRVDeviceFinalise() failed (PVRSRV_ERROR_TIMEOUT) in PVRSRVCommonDeviceInitialise() [2170]
[Tue Jun 13 07:41:50 2023] [drm:pvr_drm_load] *ERROR* device (____ptrval____) initialisation failed (err=-19)

I’m running the later kernel, so that could also be a factor.

Booting into the old (cwt-12) kernel mitigates the PVR_K dmesg errors and I can run weston. So it appears to be a kernel issue.

That’s weird because @sajattack use cwt-13 kernel, and the diff between cwt-13 and the packaged kernel is almost nothing as below:

# diff -u /boot/config-5.15.2-cwt13 /tmp/config
--- /boot/config-5.15.2-cwt13   2023-06-01 15:33:18.000000000 +0700
+++ /tmp/config 2023-06-13 23:51:13.043233748 +0700
@@ -28,11 +28,11 @@
 CONFIG_INIT_ENV_ARG_LIMIT=32
 # CONFIG_COMPILE_TEST is not set
 # CONFIG_WERROR is not set
-CONFIG_LOCALVERSION="-cwt13"
+CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_BUILD_SALT=""
 CONFIG_DEFAULT_INIT=""
-CONFIG_DEFAULT_HOSTNAME="StarFive"
+CONFIG_DEFAULT_HOSTNAME="ArchVF2"
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y

Weird indeed. I have working weston with * cwt12 * and non-working with cwt-3.0.4 (and 3.0.4 firmware in both cases; at least I didn’t revert /dev/mtdN).

Let me find cwt13 and confuse myself even more.

But I see more significant differences between the cwt13 and 3.0.4 kernels:

-rwxr-xr-x 1 root root  7539875 Jun  7 12:15 initramfs-linux.img
-rwxr-xr-x 1 root root  9529238 Jun 13 19:15 initrd.img-5.15.2-cwt12
-rwxr-xr-x 1 root root  9810596 Jun 13 19:15 initrd.img-5.15.2-cwt13
-rwxr-xr-x 1 root root      406 Mar  1 23:34 uEnv.txt
-rwxr-xr-x 1 root root  9894368 Jun  7 10:46 vmlinuz
-rwxr-xr-x 1 root root 10564653 Jun 13 19:15 vmlinuz-5.15.2-cwt12
-rwxr-xr-x 1 root root 10553965 Jun 13 19:15 vmlinuz-5.15.2-cwt13