Entry created
2025-05-28

Translation(s): none

DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware.

The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware.

If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware.

Models covered
?DeepComputing RISC-V Mainboard
also known as: DC-ROMA RISC-V Mainboard
also known as: ?DeepComputing FML13V01

Overall Status

Core Components

[ATTACH]

Boot Standard Kernel:

[?]

Detect hard drives (SD/MMC):

{OK}

Extra Features

CPU Frequency Scaling

[?]

Hibernation

[?]

Sleep / Suspend

[?]

Xorg

[?]

- OpenGL

X-(

- Resize-and-Rotate(randr)

[?]

Switch to External Screen

{OK}

Mouse

- Built-in (Touchpad)

{OK}

Wireless/Wifi

X-(

Keyboard's Hotkeys

{OK}

Camera

[?]

Microphone

[?]

Legend :
{OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable
{i} = Configuration Required; X-( = Only works with a non-free driver and or firmware

Important Note

This mainboard is very similar to the SBC Starfive ?VisionFive 2 and shares the same SBC.

Unofficial prebuilt images are provided here https://el-puerro.gitlab.io/homepage/blog/fml13v01_debian_download.html.

Setting up Rootfs

Preparing the build environment

export VF2_WORK_DIR=$HOME/work
mkdir -p $VF2_WORK_DIR

install the build dependencies

sudo apt install libncurses-dev libssl-dev bc flex bison make gcc-13 gcc-13-riscv64-linux-gnu git qemu-user-static binfmt-support debootstrap debian-ports-archive-keyring systemd-container rsync wget

Build the kernel

cd $VF2_WORK_DIR
git clone https://github.com/DC-DeepComputing/fml13v01-linux.git linux
pushd linux/
cp arch/riscv/configs/fml13v01_defconfig .config
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- olddefconfig
nice make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- -j$(nproc) bindeb-pkg KDEB_COMPRESS=xz LOCALVERSION=-debian
popd

Build the VPU driver

cd $VF2_WORK_DIR
mkdir extra
git clone https://github.com/starfive-tech/soft_3rdpart.git
cd soft_3rdpart
git checkout -B fm7110-6.6 JH7110_VF2_6.6_v5.12.0
pushd wave511/code
make -C $VF2_WORK_DIR/linux/ M=$(pwd)/vdi/linux/driver LDDINCDIR=$(pwd)/vdi/linux/driver/../include CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv modules
cp ./vdi/linux/driver/vdec.ko $VF2_WORK_DIR/extra
popd
pushd wave420l/code
make -C $VF2_WORK_DIR/linux/ M=$(pwd)/vdi/linux/driver/ LDDINCDIR=$(pwd)/vdi/linux/driver/../include CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv modules
cp ./vdi/linux/driver/venc.ko $VF2_WORK_DIR/extra
popd
pushd codaj12/jdi/linux/driver
make -C $VF2_WORK_DIR/linux/ M=$(pwd) LDDINCDIR=$(pwd)/../include CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv modules
cp ./jpu.ko $VF2_WORK_DIR/extra
popd

Build SPL Tool

cd $VF2_WORK_DIR
mkdir spl_tool
pushd soft_3rdpart/spl_tool
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv
cp spl_tool $VF2_WORK_DIR/spl_tool

Download Keyring for Debian chroot

Download the ?DebianArchiveKeyring https://packages.debian.org/sid/all/debian-archive-keyring/download and save it to $VF2_WORK_DIR.

Create the Debian bootstrap filesystem

sudo debootstrap --arch=riscv64 --no-check-gpg --no-merged-usr --exclude=usr-is-merged unstable riscv-chroot-snapshots http://deb.debian.org/debian

After finishing, copy the linux-kernel and debian keyring deb-packages into the bootstrap filesystem and install them:

sudo cp $VF2_WORK_DIR/linux-image-6.6.20-*.deb ./riscv-chroot-snapshots/root
sudo cp $VF2_WORK_DIR/debian-archive-keyring_*.deb ./riscv-chroot-snapshots/root
sudo chroot $VF2_WORK_DIR/riscv-chroot-snapshots
dpkg -i /root/*.deb
mkdir /lib/firmware
sync
exit

Copy VPU driver, GPU driver, applications

Copy the VPU driver and mesa packages:

sudo cp -r $VF2_WORK_DIR/extra/ $VF2_WORK_DIR/riscv-chroot-snapshots/lib/modules/6.6.20-debian/
cd $VF2_WORK_DIR
mkdir mesa-pkgs && pushd mesa-pkgs
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/mesa-debs.tar.gz
tar -zxvf mesa-debs.tar.gz
sudo cp -r debs/ $VF2_WORK_DIR/riscv-chroot-snapshots/opt
popd

Copy and install the GPU driver:

cp $VF2_WORK_DIR/soft_3rdpart/IMG_GPU/out/img-gpu-powervr-bin-1.19.6345021.tar.gz .
tar -zxvf img-gpu-powervr-bin-1.19.6345021.tar.gz
sudo cp -r img-gpu-powervr-bin-1.19.6345021/target/etc/* $VF2_WORK_DIR/riscv-chroot-snapshots/etc/
sudo cp -r img-gpu-powervr-bin-1.19.6345021/target/lib/* $VF2_WORK_DIR/riscv-chroot-snapshots/lib/
sudo cp -r img-gpu-powervr-bin-1.19.6345021/target/usr/* $VF2_WORK_DIR/riscv-chroot-snapshots/usr/

Copy additional applications (not strictly required, but built for this SoC):

cd $VF2_WORK_DIR
mkdir app-pkgs && pushd app-pkgs
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/firefox_105.0_202305_riscv64.deb
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/codec.tar.gz
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/ffmpeg-deb.tar.gz
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/gst-omx-deb.tar.gz
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/vlc-deb.tar.gz
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/libsdl2-2.0-0_2.26.1+dfsg-1_riscv64.deb
sudo cp * $VF2_WORK_DIR/riscv-chroot-snapshots/opt
popd

Configuring Debian

Chroot into Debian, make sure everything is up-to-date:

sudo chroot $VF2_WORK_DIR/riscv-chroot-snapshots
echo "Acquire::Check-Valid-Until no;" > /etc/apt/apt.conf.d/99-no-check-valid-until
apt update -y
apt upgrade -y

Install some basic tools and the GNOME desktop (known to work):

apt install initramfs-tools systemd-timesyncd rsync bash-completion u-boot-menu wget binutils alsa-utils sudo network-manager network-manager-gnome openssh-server net-tools -y
DEBIAN_FRONTEND=noninteractive apt-get install gnome-shell gnome-terminal gnome-tweaks gnome-shell-extensions -y

Configure superuser and regular user:

echo "root:framework" | chpasswd
echo framework > /etc/hostname
echo "export LD_LIBRARY_PATH=/usr/lib/riscv64-linux-gnu" >> /root/.bashrc
echo "export GST_PLUGIN_PATH=/usr/lib/riscv64-linux-gnu/gstreamer-1.0" >> /root/.bashrc
useradd user -s /bin/bash -m
echo "user:framework" | chpasswd
echo "export LD_LIBRARY_PATH=/usr/lib/riscv64-linux-gnu" >> /home/user/.bashrc
echo "export GST_PLUGIN_PATH=/usr/lib/riscv64-linux-gnu/gstreamer-1.0" >> /home/user/.bashrc
usermod -aG sudo user

Install mesa packages:

cd /opt/debs
dpkg -i *.deb

Configure the GPU:

cat << EOF > /etc/udev/rules.d/61-mutter-primary-gpu.rules
ENV{DEVNAME}=="/dev/dri/card1", TAG+="mutter-device-preferred-primary"
EOF

cat << EOF > /usr/share/X11/xorg.conf.d/10-starfive.conf
Section "OutputClass"
Identifier "Starfive Display"
MatchDriver "starfive"
Driver "modesetting"
Option "PrimaryGPU" "true"
#Option "AccelMethod" "no"
Option "SWcursor" "false"
Option "NoCursor" "true"
Option "ShadowFB" "true"
Option "Atomic" "true"
Option "DoubleShadow" "true"
Option "PageFlip" "true"
Option "VariableRefresh" "true"
Option "AsyncFlipSecondaries" "true"
EndSection
#Section "Extensions"
#Option "glx" "Disable"
#Option "Composite" "Disable"
#EndSection
EOF

cat << EOF >> /etc/gdm3/daemon.conf
WaylandEnable=true
EOF

cat << EOF > /etc/environment
COGL_DRIVER=gles2
GST_GL_API=gles2
CLUTTER_PAINT="disable-clipped-redraws"
XWAYLAND_NO_GLAMOR=1
SDL_VIDEODRIVER=wayland
MESA_LOADER_DRIVER_OVERRIDE=pvr
EOF

Check wether the VPU driver can be loaded by the kernel:

depmod -a 6.6.20-debian

Create and configure the VPU init script:

cd /etc/init.d/

cat << EOF >> /etc/init.d/vpudev
#!/bin/sh
case "\$1" in
start)
echo "make vpu dev accesible to non root"
chmod 666 /dev/jpu
chmod 666 /dev/venc
chmod 666 /dev/vdec
chmod 666 /dev/i2c-*
;;
*)
echo "Usage: /etc/init.d/vpudev {start}"
exit 1
;;
esac
exit 0
EOF

chmod +x vpudev
update-rc.d vpudev defaults

The original configuration made by ?DeepComputing for the Ubuntu image is incompatible with recent versions of wireplumber. Configure the Audio with the following config instead:

cat << EOF >> /usr/share/wireplumber/wireplumber.conf.d/51-alsa-rename.conf
monitor.alsa.rules = [
{
matches = [
{ api.alsa.card.name = "Starfive-ES8326-Sound-Card" }
]
actions = {
update-props = {
node.description = "Audio ES8326"
device.profile = "pro-audio"
}
}
}
]
monitor.alsa.rules = [
{
matches = [
{ api.alsa.card.name = "Starfive-HDMI-Sound-Card" }
]
actions = {
update-props = {
node.description = "HDMI Audio"
device.profile = "output:multichannel-output"
}
}
}
]
EOF

Configure SSH-Keygen:

rm -f /etc/ssh/ssh_host_*

cat << EOF >> /etc/systemd/system/sshd-keygen.service
[Unit]
Description=SSH Key Generation
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key.pub
ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key
ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key.pub
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key.pub
[Service]
ExecStart=/usr/bin/ssh-keygen -A
Type=oneshot
RemainAfterExit=yes
EOF

sed -i 's/\"After=network.target\ auditd.service\"/\"After=network.target\ sshd-keygen.service\ auditd. service\\nWants=sshd-keygen.service\"/g' /lib/systemd/system/ssh.service
ssh-keygen -A

Mask hibernate:

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Blacklist certain kernel modules:

cat << EOF >> /etc/modprobe.d/blacklist.conf
blacklist starfive_mailbox_test
blacklist e24
blacklist xrp
blacklist starfive_mailbox
blacklist wave5
blacklist evbug
EOF

OPTIONAL: Installing some applications:

NOTE: If you run into any packages that can't be found during apt install, or missing dependencies during dpkg -i, wget the missing packages from the 20220616T194833Z snapshot.

cd /opt
wget https://snapshot.debian.org/archive/debian-ports/20220616T194833Z/pool-riscv64/main/i/icu/libicu71_71.1-3_riscv64.deb
dpkg -i libicu71_71.1-3_riscv64.deb
DEBIAN_FRONTEND=noninteractive apt-get install nautilus -y
DEBIAN_FRONTEND=noninteractive apt-get install libevent-dev libdbus-glib-1-dev -y

DEBIAN_FRONTEND=noninteractive apt-get install libopenal-dev libcdio-paranoia-dev libdc1394-dev libcaca-dev libv4l-dev libpocketsphinx-dev libbs2b-dev liblilv-0-0 librubberband-dev libmysofa-dev libflite1 libass-dev libvidstab-dev libzmq3-dev libzimg-dev libgme-dev libopenmpt-dev libchromaprint-dev librabbitmq-dev libssh-dev libsrt-openssl-dev liba52-0.7.4-dev libhwy1 libjxl0.7 -y

DEBIAN_FRONTEND=noninteractive apt-get install fonts-freefont-ttf libaribb24-0 libcddb2 libdvbpsi10 libebml5 libixml10 liblirc-client0 liblua5.2-0 libmad0 libmatroska7 libprotobuf-lite32 libqt5x11extras5 libresid-builder0c2a libsdl-image1.2 libsdl1.2debian libsidplay2 libspatialaudio0 libupnp13 libva-wayland2 libvncclient1 libopenmpt-modplug1 libxcb-composite0 -y

DEBIAN_FRONTEND=noninteractive apt-get install bluez-tools blueman -y
dpkg -i firefox_105.0_202305_riscv64.deb
dpkg -i libsdl2-2.0-0_2.26.1+dfsg-1_riscv64.deb
tar -xvzf codec.tar.gz
cd $PWD/codec
dpkg --force-all -i *.deb
cd ../
tar -xvzf ffmpeg-deb.tar.gz
cd $PWD/ffmpeg-deb
dpkg --force-all -i *.deb
cd ../
tar -xvzf gst-omx-deb.tar.gz
cd $PWD/gst-omx-deb
dpkg --force-all -i *.deb
cd ../
tar -xvzf vlc-deb.tar.gz
cd $PWD/vlc-deb
dpkg --force-all -i *.deb
cd ..
mkdir -p /home/user/.config/vlc/
cd /home/user/.config/vlc/
wget https://github.com/starfive-tech/Debian/releases/download/v0.13.0-engineering-release-wayland/vlcrc
chown -R user:user /home/user/.config
cd /opt
rm -rf *

The custom packages need to be held like so:

apt-mark hold ffmpeg libavcodec59 libavdevice59 libavfilter8 libavformat59 libavutil57 libpostproc56 libsdl2-2.0-0 libswresample4 libswscale6 vlc-plugin-base vlc-plugin-samba vlc-plugin-svg

Clean up the Debian system:

rm -rf /etc/unsupported-skip-usrmerge-conversion
rm -rf /usr/local/bin/openssl
apt clean
history -c
sync
exit

Building the SDK

You need to download and build the SDK from ?DeepComputing, in order to obtain the u-boot-spl, firmware, and boot partition that you need to boot the debian we just created.

Install prerequisites

sudo apt update

sudo apt-get install build-essential automake libtool texinfo bison flex gawk g++ git xxd curl wget gdisk gperf cpio bc screen texinfo unzip libgmp-dev libmpfr-dev libmpc-dev libssl-dev libncurses-dev libglib2.0-dev libpixman-1-dev libyaml-dev patchutils python3-pip zlib1g-dev device-tree-compiler dosfstools mtools kpartx rsync

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs

Prepare the git repository

Change into some other folder and prepare the git repo:

git clone https://github.com/DC-DeepComputing/fml13v01.git fml13v01-sdk
cd fml13v01-sdk
git submodule update --init --recursive
cd buildroot && git checkout -B fm7110-6.6 origin/fm7110-6.6 && cd ..
cd u-boot && git checkout -B fm7110-6.6 origin/fm7110-6.6 && cd ..
cd linux && git checkout -B fm7110-6.6 origin/fm7110-6.6 && cd ..
cd opensbi && git checkout -B fm7110-6.6 origin/fm7110-6.6 && cd ..
cd soft_3rdpart && git checkout -B fm7110-6.6 JH7110_VF2_6.6_v5.12.0 && cd ..

prepare conf/visionfive2-fit-image.its

/dts-v1/;

/ {
description = "U-boot FIT image for visionfive2";
#address-cells = <2>;

images {
vmlinux {
description = "vmlinux";
data = /incbin/("/home/YOURUSERNAME/work/riscv-chroot-snapshots/boot/vmlinuz-6.6.20-debian");
type = "kernel";
arch = "riscv";
os = "linux";
load = <0x0 0x40200000>;
entry = <0x0 0x40200000>;
compression = "gzip";
};

ramdisk {
description = "buildroot initramfs";
data = /incbin/("../work/initramfs.cpio.gz");
type = "ramdisk";
arch = "riscv";
os = "linux";
load = <0x0 0x46100000>;
compression = "none";
hash-1 {
algo = "sha256";
};
};

fdt {
data = /incbin/("/home/YOURUSERNAME/work/riscv-chroot-snapshots/usr/lib/linux-image-6.6.20-debian/starfive/jh7110-deepcomputing-fml13v01.dtb");
type = "flat_dt";
arch = "riscv";
load = <0x0 0x46000000>;
compression = "none";
hash-1 {
algo = "sha256";
};
};
};

configurations {
default = "config-1";

config-1 {
description = "visionfive2 with opensbi";
kernel = "vmlinux";
fdt = "fdt";
loadables = "ramdisk";
};
};
};

This is the configuration file for the FIT-Image. The resulting image will contain the kernel, the initramfs, and the dtb (device tree blob), that the system needs to properly boot up. Make sure you replace "YOURUSERNAME" with your username on your machine, so the kernel and dtb can be found in during building.

Build the SDK

You're ready for building now. Run make -j$(nproc). If, after successful building, you can't find a file beginning with "u-boot-spl" in the "work" folder, rerun the command.

If your build fails because some tar archives couldn't be downloaded, perform the following patch in the "buildroot" directory:

diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index ddf7e96f..fff25aa1 100755
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -7,7 +7,8 @@
# When updating the version, please also update mesa3d-headers
MESA3D_VERSION = 22.1.3
MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
-MESA3D_SITE = https://archive.mesa3d.org
+#MESA3D_SITE =https://archive.mesa3d.org
+MESA3D_SITE = https://archive.mesa3d.org/older-versions/22.x
MESA3D_LICENSE = MIT, SGI, Khronos
MESA3D_LICENSE_FILES = docs/license.rst
MESA3D_CPE_ID_VENDOR = mesa3d
diff --git a/package/ramsmp/ramsmp.mk b/package/ramsmp/ramsmp.mk
index 6098376d..43b834e9 100644
--- a/package/ramsmp/ramsmp.mk
+++ b/package/ramsmp/ramsmp.mk
@@ -5,7 +5,8 @@
################################################################################

RAMSMP_VERSION = 3.5.0
-RAMSMP_SITE = http://www.alasir.com/software/ramspeed
+#RAMSMP_SITE = http://www.alasir.com/software/ramspeed
+RAMSMP_SITE = https://github.com/cruvolo/ramspeed-smp/archive/refs/heads/upstream
RAMSMP_ARCH = $(if $(BR2_i386),i386)$(if $(BR2_x86_64),x86_64)
RAMSMP_LICENSE = Alasir License
RAMSMP_LICENSE_FILES = LICENCE
diff --git a/package/ramspeed/ramspeed.mk b/package/ramspeed/ramspeed.mk
index 7dc4faae..f1207a04 100644
--- a/package/ramspeed/ramspeed.mk
+++ b/package/ramspeed/ramspeed.mk
@@ -5,7 +5,8 @@
################################################################################

RAMSPEED_VERSION = 2.6.0
-RAMSPEED_SITE = http://www.alasir.com/software/ramspeed
+#RAMSPEED_SITE = http://www.alasir.com/software/ramspeed
+RAMSPEED_SITE = https://github.com/cruvolo/ramspeed/archive/refs/heads/upstream
RAMSPEED_ARCH = $(if $(BR2_i386),i386)$(if $(BR2_x86_64),x86_64)
RAMSPEED_LICENSE = Alasir License
RAMSPEED_LICENSE_FILES = LICENCE

If "starfive-visionfive2-vfat.part" is still missing, run make buildroot_rootfs -j$(nproc) as well.

Copying wifi firmware

Copy work/buildroot_initramfs_sysroot/lib/firmware/iwlwifi* to riscv-chroot-snapshots/lib/firmware, if you want to have wifi. Depending on the wifi card you have chosen for your computer, other files might be better suited. Also you can try to use instead the regular Debian packages from the non-free-firmware section. For instance, the firmware-mediatek package can be installed if you use the AMD RZ616 Wi-Fi 6E card, no further file needs to be copied.

Create SD-Card image

cd $VF2_WORK_DIR
mkdir create_sd_image
cd create_sd_image
sudo dd if=/dev/zero of=fml13v01-debian.img bs=1M count=10000
sudo sgdisk -g --clear --new=1:4096:8191: --typecode=1:2e54b353-1271-4842-806f-e436d6af6985 --change-name=1:'spl' --new=2:8192:16383: --typecode=2:5b193300-fc78-40cd-8002-e86c45580b47 --change-name=2:'uboot' --new=3:16384:+300M: -t 3:EF00 --change-name=3:'image' --new=4:0:-1M: --change-name=4:'root' --attributes 4:set:2 fml13v01-debian.img
sudo losetup --partscan --show --find fml13v01-debian.img

You'll get /dev/loopXY as output. Take note of this, and substitute any following loopXY with the output you just got.

mkdir boot rootfs
sudo mkfs.vfat /dev/loopXYp3
sudo mkfs.ext4 -m 0 -L root /dev/loopXYp4
sudo mount /dev/loopXYp4 $VF2_WORK_DIR/create_sd_image/rootfs
sudo dd if=/PATH/TO/work/u-boot-spl.bin.normal.out of=/dev/loopXYp1 bs=4096
sudo dd if=/PATH/TO/work/visionfive2_fw_payload.img of=/dev/loopXYp2 bs=4096
sudo dd if=/PATH/TO/work/starfive-visionfive2-vfat.part of=/dev/loopXYp3 bs=4096
sudo cp -a $VF2_WORK_DIR/riscv-chroot-snapshots/* $VF2_WORK_DIR/create_sd_image/rootfs
sudo rm -rf $VF2_WORK_DIR/create_sd_image/rootfs/boot
sync
sudo umount /dev/loopXYp4
sudo losetup -D /dev/loopXY

Then you may copy the fml13v01-debian.img file to the SD card. If you wish to extend the fourth partition (hosting the filesystem), you may then type

sudo growpart /dev/mmcblk0 4  # extend partition 4
sudo e2fsck -f /dev/mmcblk0p4
sudo resize2fs /dev/mmcblk0p4  # extend filesystem
sudo fsck.ext4 /dev/mmcblk0p4

Resources

Attachments

Some configuration files and sample outputs.

Other reports

# * Debian installation report

# * Installing Linux distro foo on computer bar

#== Useful Links ==

Credits