Arch Linux Image for VisionFive 2 cwt23 Release
This release introduces the cwt23 image, which includes significant updates and components to enhance functionality and compatibility. The major changes are as follows:
Major Components:
- Arch RISC-V rootfs-2024-09-22 from https://riscv.mirror.pkgbuild.com/
- Kernel based on StarFive’s JH7110_VF2_6.6_v5.13.1
- with patches and configuration from GitHub - cwt-vf2/linux-cwt-starfive-vf2: PKGBUILD for Linux kernel (-cwt) Image on StarFive VisionFive 2
- GPU driver from GitHub - cwt-vf2/img-gpu-vf2: IMG_GPU driver for VisionFive2
- Mesa for PowerVR GPU from GitHub - cwt-vf2/mesa-pvr-vf2: Used to be a clone of https://aur.archlinux.org/mesa-pvr-vf2.git to host the binary package
- Inclusion of all WiFi and Bluetooth firmwares from StarFive
Major changes:
- Enabled most of
SATA
drivers for M.2 PCIe to SATA adapter - Mainline U-Boot v2024.07 built with StarFive’s OpenSBI for Linux 6.6 v5.13.1
Here the links to download:
- GitHub Release: Releases · cwt-vf2/archlinux-image-vf2 · GitHub
Login and password:
root
password isarchriscv
user
password isuser
user
is sudoer, and it can run sudo without password.
Maximize the partition:
After flashing the image to an SD card of at least 4 GB, please edit partition 4 and expand it to the rest of the available space. Then use the following command to maximize the partition.
$ sudo btrfs filesystem resize max /
Packages and sources:
- The kernel and GPU driver packages are included in the
/root/pkgs/
directory. - Sources are on GitHub:
- Build script: GitHub - cwt-vf2/archlinux-image-vf2: Build script to create Arch Linux image for VisionFive 2
- Kernel, headers, and StarFive’s soft_3rdpart: GitHub - cwt-vf2/linux-cwt-starfive-vf2: PKGBUILD for Linux kernel (-cwt) Image on StarFive VisionFive 2
- GPU driver: GitHub - cwt-vf2/img-gpu-vf2: IMG_GPU driver for VisionFive2
- Mesa for PowerVR GPU: GitHub - cwt-vf2/mesa-pvr-vf2: Used to be a clone of https://aur.archlinux.org/mesa-pvr-vf2.git to host the binary package
- OpenSBI: GitHub - cwt-vf2/opensbi-starfive-vf2: OpenSBI for Linux 6.6.x (-cwt) for StarFive RISC-V VisionFive 2 Board
- U-Boot: GitHub - cwt-vf2/u-boot-starfive-vf2: U-Boot for StarFive RISC-V VisionFive 2 Board
How to boot directly from NVMe SSD:
Warning: Following these steps will destroy any data on your NVMe SSD.
In theory, you could just
dd
your micro SD to the NVMe SSD, but I would not recommend doing so while the mounted storage is in use.
- Ensure that
SPL
andU-Boot
on your board are up to date. - Copy or download the cwt23 image to
/tmp
or any directory of your choice. - Discard all data on your NVMe SSD (whole disk trimming):
$ sudo blkdiscard /dev/nvme0n1
- Use
dd
to copy the image to the NVMe SSD:$ zstd -c -T0 -d ArchLinux-VF2_6.6_v5.13.1-cwt23.img.zst \ | sudo dd of=/dev/nvme0n1 bs=32M \ iflag=fullblock oflag=direct \ status=progress
- Shutdown your device, set the DIP switch to flash mode (0-0), remove the SD card, and then power it on.
- Maximize the partition.
How to update the previous image without rewrite the SD card:
You should upgrade the onboard firmware (SPL and U-boot) to the latest version first.
Make sure you are going to write the firmware to the right MTD partition.
$ cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00001000 "spl"
mtd1: 00010000 00001000 "uboot-env"
mtd2: 00300000 00001000 "uboot"
mtd3: 00100000 00001000 "data"
In this case, spl
is mtd0
, and uboot
is mtd2
.
Please note that the MTD partitions have been rearranged and resized in the past, and now
uboot
is located onmtd2
. Therefore, it is important to always check withcat /proc/mtd
before performing the firmware upgrade.
$ sudo pacman -U /root/pkgs/u-boot-starfive-vf2-2024.07-3-riscv64.pkg.tar.zst
$ sudo flashcp -v /usr/share/u-boot-starfive-vf2/u-boot-spl.bin.normal.out /dev/mtd0
$ sudo flashcp -v /usr/share/u-boot-starfive-vf2/u-boot.itb /dev/mtd2
You can download the Kernel and GPU packages and then update the previous cwt
image efortlessly.
$ wget https://raw.githubusercontent.com/cwt-vf2/linux-cwt-starfive-vf2/6.6/kernel-update.sh
$ chmod 755 kernel-update.sh
$ ./kernel-update.sh
The img-gpu
binary hasn’t changed since the last build, so just use the old one. If you are running on an image older than cwt19, please execute the following commands.
$ wget https://github.com/cwt-vf2/img-gpu-vf2/releases/download/cwt19-1.19.6345021-6/img-gpu-vf2-1.19.6345021-6-riscv64.pkg.tar.zst
$ sudo pacman -U *.tar.zst
$ sudo reboot