Daily Ubuntu Kernel Builds - Now With 100% More APT Repo!

I’m on the latest release fw from Starfive (Release VisionFive2 Software v2.11.5 · starfive-tech/VisionFive2 · GitHub)

1 Like

Please ensure your sdcard is unmounted before doing any of the wiping/imaging to the sdcard.

lsblk
umount /run/media/davidm/rootpart
umount /run/media/davidm/root
umount /run/media/davidm/305E-3140
lsblk

Wipe your sdcard, then image it with ubuntu image.

wipefs --all /dev/sdb
xz -dk ubuntu-23.04-preinstalled-server-riscv64+visionfive2.img.xz
dd if=./ubuntu-23.04-preinstalled-server-riscv64+visionfive2.img of=/dev/sdb bs=4M status=progress conv=fdatasync

Unless you are giving the SDcard away and worried about leaking data, the wipe command only adds wear to your SDcard and is entirely unnecessary. Also, you can just decompress directly to the SDcard. This is Linux, not SysV: xzcat ubuntu-23.04-preinstalled-server-riscv64+visionfive2.img.xz > /dev/sdb

2 Likes

Reboot is inconsistent for me. Sometimes it hangs after a few lines of output, other times it’s fine. Not sure if I’m on the latest firmware but can check tomorrow.

:frowning: Indeed, even with the latest firmware my board just failed to reboot. It hung after printing the below on the serial console:

...
[ESC[0;32m  OK  ESC[0m] Stopped ESC[0;1;39mmotd-news.timerESC[0m - Message of the Day.
[ESC[0;32m  OK  ESC[0m] Stopped ESC[0;1;39msystemd-tmpfiles-c_ Cleanup of Temporary Directories.
[ESC[0;32m  OK  ESC[0m] Stopped ESC[0;1;39mua-timer.timerESC[0m_e Timer for running re

On latest firmware v2.11.5 u-boot and payload, booting Ubuntu 23.04 with Kernel #72.

a. does anyone else get anything from the video out over hdmi?
b. anyone had it booting with an nvme connected?
c. does the second led go green for anyone else (ubuntu 6.2 kernel and 6.4.0 #72)
d. is iperf3 performance much lower (with more collisions) on ubuntu vs debian 5.15?

Sorry still new, so feeling like it could all be me causing the issues still.

Having some trouble installing newer kernels. I’m downloading from the release section manually and then running a dpkg -i *.deb. after rebooting the board won’t come back up. After following the guide posted here, https://agreenbhm.github.io/linux/repo/riscv64 12 / results in a repo that cannot be found. Any help would be greatly appreciated.

Not sure where the “12” before the “/” in the repo URL is coming from, but remove it. It should read:

https://agreenbhm.github.io/linux/repo/riscv64 /

Edit, I see. Stupid formatting from this forum software is adding that “12” . When you copy it it gets copied too. Remove that and try running apt update.

1 Like

Thank you very much! Yeah I figured it was a formatting error as well, and it isnt present in my file. I’ll give it another go tonight and report back asap. Thank you for the help! Greatly appreciate the work you have been doing.

Please report back the exact error you get from apt if it still gives you issues when you test again. Hopefully it’ll work but if not it shouldn’t be too difficult to diagnose.

2 Likes

Sorry for the delayed response. I removed my /custom_kernel.list file, and then recreated it to make sure there wasn’t any issues. After recreating the file, and running linux-image-rolling linux-headers-rolling it worked as intended. Kernel was updated successfully. Thank you again @agreenbhm! Greatly appreciate the help!

Excellent, glad it’s working now!

2 Likes

Thank you again for your help!

2 Likes

Your Linux kernel “6.4.0-rc3+ #90” is behaving correctly for me. Thank you. I got wired ethernet and have been successfully building some existing projects with rust like salvo web server.
Linux vf2-UbuSrv-YOW 6.4.0-rc3+ #90 SMP Thu May 25 00:40:09 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux

I would like to start playing with the gpu driver, what is the best way to consider tweaking this to simply run it in ubuntu server?

Has anybody attempted this? I wish there was more visibility as to the progress of this work and whether they wanted individuals to run and report their tests.

3 Likes

This is indeed very exiting development to have Ubuntu support on VisionFive2. I followed your instructions and everything worked flawlessly. I noticed that while original image from Canonical had no support for NVME, the one from latest rolling kernel does. You can see NVME drive and mount it. Encouraged by this I’ve been trying to boot from NVME drive or at least mount it as root. So far I have failed. The kernel sees the drive and its partitons, there are entries quite early in the boot log to that affect. However it fails to mount root and it drops into initramfs prompt after claiming that NVME partition that I prepared for it does not exist. I wander if NVME module is missing in initrd but I can’t find it in the file system. It listed as built into the kernel. I’m not sure what else to try.

Now I’m just mounting SSD as my home folder (from /etc/fstab) and I noticed that it takes a while, probably on the order of 15-20 seconds. I wander if the boot process just times out very quickly when it’s trying to mount SSD. In fact it outputs a message which say exactly that as a possible problem. Does anyone knows how to increase this delay?

2 Likes

Update: I managed to boot into SSD. That is it boots from EFI/grub config on SD card, but it mounts both root and boot/efi from the SSD. For some reason it can’t boot directly from SSD. There are couple of problems with my approach. First it requires copying several folders from the SD card to the SSD. Second the boot is slow, it pauses in couple of places along the way for reasons that are not clear to me. But I guess it still progress.

Update: I figured out a way to install on SSD without copying anything manually. However slow boot remains a problem, it takes anywhere from 3 to 5 minutes. For anyone interested the steps are as follows:

  1. Setup SD card with standard Ubuntu image.

  2. Update to latest kernel as described at the top of this post. Reboot.

  3. Copy standard Ubuntu image to SSD. Reboot.

  4. You will be running with latest kernel but root file system will be from standard image. Update to latest kernel again and reboot.

  5. Done.

2 Likes

The install did not go up to the end for me:

sudo apt install linux-image-rolling linux-headers-rolling
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libefivar1 net-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-libc-dev
The following NEW packages will be installed:
  linux-headers-rolling linux-image-rolling
The following packages will be upgraded:
  linux-libc-dev
1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.2 MB of archives.
After this operation, 72.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://agreenbhm.github.io/linux/repo/riscv64  linux-headers-rolling 6.5.0-rc4+-232 [8222 kB]
Get:2 https://agreenbhm.github.io/linux/repo/riscv64  linux-image-rolling 6.5.0-rc4+-232 [11.7 MB]
Get:3 https://agreenbhm.github.io/linux/repo/riscv64  linux-libc-dev 6.5.0-rc4+-232 [1281 kB]
Fetched 21.2 MB in 6s (3343 kB/s)
Selecting previously unselected package linux-headers-rolling.
(Reading database ... 97754 files and directories currently installed.)
Preparing to unpack .../linux-headers-rolling_6.5.0-rc4+-232_riscv64.deb ...
Unpacking linux-headers-rolling (6.5.0-rc4+-232) ...
Selecting previously unselected package linux-image-rolling.
Preparing to unpack .../linux-image-rolling_6.5.0-rc4+-232_riscv64.deb ...
Unpacking linux-image-rolling (6.5.0-rc4+-232) ...
Preparing to unpack .../linux-libc-dev_6.5.0-rc4+-232_riscv64.deb ...
Unpacking linux-libc-dev:riscv64 (6.5.0-rc4+-232) over (6.0.12-1) ...
Setting up linux-libc-dev:riscv64 (6.5.0-rc4+-232) ...
Setting up linux-headers-rolling (6.5.0-rc4+-232) ...
Setting up linux-image-rolling (6.5.0-rc4+-232) ...
dkms: running auto installation service for kernel 6.5.0-rc4+:Sign command: /lib/modules/6.5.0-rc4+/build/scripts/sign-file
Binary /lib/modules/6.5.0-rc4+/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 6.5.0-rc4+ cannot be found at /lib/modules/6.5.0-rc4+/build or /lib/modules/6.5.0-rc4+/source.
Please install the linux-headers-6.5.0-rc4+ package or use the --kernelsourcedir option to tell DKMS where it's located.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
update-initramfs: Generating /boot/initrd.img-6.5.0-rc4+
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8107e-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168h-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168g-3.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168g-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8106e-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8106e-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8411-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8411-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8402-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-3.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for built-in driver r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for built-in driver r8169
Copying rgx firmware to initrd...
41573 blocks
42569 blocks
/
Done.
P: Checking for EXTLINUX directory... found.
P: Writing config for vmlinuz-6.5.0-rc4+...
P: Writing config for vmlinuz-5.15.0-starfive...
P: Updating /boot/extlinux/extlinux.conf...
dpkg: error processing package linux-image-rolling (--configure):
 installed linux-image-rolling package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-rolling
E: Sub-process /usr/bin/dpkg returned an error code (1)
user@starfive:~$

I uninstalled it before rebooting, and all went fine.
As a new kernel was available today, I tried again and rebooted.
Now the board won’t start.
Let me find my UART2USB, and hope it will talk to me. :person_shrugging:

She talked to me, and we’re now using the default kernel. :partying_face:

1 Like

Is there any way to install older kernel from daily builds? I just tried 6.6-rc2 but I am not able to boot. (I am able to boot with the default one coming with Ubuntu but the lack of nvme is unfortunate)

I used fw v2. Maybe I should try new one with latest kernel?