Distributions

The milkV Pioneer can run a variety of GNU/Linux operating systems.

Debian

The RISC-V architecture is a primary architecture in Debian. This happened in the last few months, so riscv64 isn’t in Debian bookworm (stable/12). It is planned to be in Trixie (testing/13), afaict, but doesn’t have a repo yet.

The main repository at the moment appears to be Debian unstable (sid):

There is still a ports repository, but presumably it is deprecated:

There are occassionally debian-installer made for riscv64. These require netbooting. The most recent I can find are these:

There are no disk images yet.

Install

Debian can be added to the stock Pioneer bootloader, after adding the appropriate partitions on the NVMe, which has plenty of unpartitioned space. A new extended partition gets created on the NVMe, after the Fedora install partition. The extended partition is the max size. Then another partition, number 5, gets created of whatever size for the OS, such as +25G for twenty-five gigabytes. A new Debian disk image is made from Debian unstable repos. This image is written to partition 5 created above. The partition is then re-sized back to it’s full size. Set bootloader and reboot.

Quick and dirty Debian install

##############################################################################
# Log into milkV Pioneer that is running stock Fedora.
# Add a partition to the existing Fedora NVMe drive.
# Can wreck things if partition names are wrong, of course.
[root@fedora-riscv ~]# fdisk /dev/nvme0n1

Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): e

Selected partition 4
First sector (2048-2000409263, default 2048): 30670848
Last sector, +/-sectors or +/-size{K,M,G,T,P} (30670848-2000409263, default 2000409263): 

Created a new partition 4 of type 'Extended' and of size 939.2 GiB.

Command (m for help): n
All primary partitions are in use.
Adding logical partition 5
First sector (30672896-2000409263, default 30672896): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (30672896-2000409263, default 2000409263): +25G

Created a new partition 5 of type 'Linux' and of size 25 GiB.

Command (m for help): p
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: FORESEE XP1000F001T                     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4d3e74a9

Device         Boot    Start        End    Sectors   Size Id Type
/dev/nvme0n1p1          8192     258047     249856   122M  c W95 FAT32 (LBA)
/dev/nvme0n1p2 *      258048    1257471     999424   488M 83 Linux
/dev/nvme0n1p3       1257472   30670847   29413376    14G 83 Linux
/dev/nvme0n1p4      30670848 2000409263 1969738416 939.2G  5 Extended
/dev/nvme0n1p5      30672896   83101695   52428800    25G 83 Linux

Command (m for help): w
The partition table has been altered.
Syncing disks.
##############################################################################
# On your regular amd64 Debian workstation, not the Pioneer, run:
sudo su -
apt install debootstrap qemu-user-static binfmt-support

# Create an empty file, which will become the disk image.
dd if=/dev/zero of=/tmp/debian-pioneer.img bs=1M count=1024
losetup --partscan --find --show /tmp/debian-pioneer.img

mkfs.ext4 /dev/loop0
mount /dev/loop0 /mnt
mkdir /tmp/deb

# Create a Debian root filesystem setup in the new disk image.
debootstrap --cache-dir=/tmp/deb --arch=riscv64 unstable /mnt http://deb.debian.org/debian

# Enter the new riscv64 filesystem.
chroot /mnt

# Set up disk
cat >/etc/fstab <<EOF
/dev/nvme0n1p5  / ext4    defaults 0 0
/dev/nvme0n1p2  /boot ext4    defaults 0 0
EOF

# Set up net
cat >/etc/network/interfaces <<EOF
auto lo
iface lo inet loopback

auto enP3p201s0
iface enP3p201s0 inet dhcp
EOF

# Remove root password (no * asterisk):
vi /etc/shadow

root::19729:0:99999:7:::

# leave chroot
exit

# Detach loopback disk
losetup -d /dev/loop0

# Copy new debian-pioneer.img to the Fedora running milkV, perhaps:
scp -p /tmp/debian-pioneer.img milkv:

##############################################################################
# Log into the milkV running the stock Fedora:
ssh milkv

# Set up disk, writing to stock NVMe using the image created above.
sudo dd if=debian-pioneer.img of=/dev/nvme0n1p5 status=progress bs=4M
e2fsck -f /dev/nvme0n1p5
resize2fs /dev/nvme0n1p5
mount /dev/nvme0n1p5 /mnt/
ls -lh /mnt
umount /mnt

# Add Debian section with new root using fedora kernel and initrd for now.
vim /boot/extlinux/extlinux.conf

label debian
        menu label Debian
        linux /vmlinuz-6.1.31
        initrd /initramfs-6.1.31.img
        fdt  /dtb/sophgo/mango-milkv-pioneer.dtb
        append  console=ttyS0,115200 root=/dev/nvme0n1p5 rootfstype=ext4  rootwait rw earlycon selinux=0 LANG=en_US.UTF-8

# Then reboot, and choose option 04 for Debian when the menu comes up.

##############################################################################
# Login in as root.
# Set date, something like:
date -u --set="20240107 23:55:29"

# Set hostname
vi /etc/hostname
vi /etc/hosts
# Add user
adduser debian
adduser debian sudo
# Install ssh
apt install ntpsec-ntpdate
# Get time from your local time server:
ntpdate -b 192.168.1.1
# Install openssh
apt install openssh-server

Debian Setup

Debian can be set up thusly.

# Install some packages.
sudo apt install sudo git build-essential ccache net-tools libncurses-dev flex bison \
   bc rsync libssl-dev lsb-release initramfs-tools patchelf ninja-build lshw file \
   locales ntpsec-ntpdate rsyslog nvme-cli bash-completion pciutils usbutils \
   lsof git-lfs telnet

# Should probably be documented elsewhere, but set locale, etc.
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen
update-locale
# Set timezone
ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
# Sync the clock!
ntpdate -b 192.168.1.1

# set up ccache, add to ~/.bashrc
PATH=/usr/lib/ccache:$PATH

# More...
sudo apt install libudev-dev libsystemd-dev cmake-curses-gui pkg-config \
  libdrm-dev man-db bind9-host

# pip build flags
MAKEFLAGS="-j48" pip install -r requirements.txt


# Misc
sudo adduser debian render
sudo adduser debian dialout
sudo adduser debian video
sudo adduser debian plugdev
sudo adduser debian kvm

# Disable evbug module
vim /etc/modprobe.d/blacklist.conf
blacklist evbug

Graphical Desktop

An Openbox desktop with autologin can be set up thusly.

sudo apt install \
  openbox lxpanel wmctrl \
  rxvt-unicode gmrun xterm arandr xinit \
  rtkit lxterminal firefox-esr

# See Openbox and lxterminal ~/.config files.

# To autologin at boot:
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d
sudo vim /etc/systemd/system/getty@tty1.service.d/override.conf

[Service]
Type=simple
ExecStart=
# Set debian to username you want to log in as
ExecStart=-/sbin/agetty --autologin debian --noclear %I 38400 linux

# as user add to .profile
vim ~/.profile

# start X
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
. startx
logout
fi

For ~/.config/openbox and ~/.config/lxpanel configuration files see:

Fedora

The milkV Pioneer ships with Fedora version 38.

See Firmware section for information about Fedora proprietary firmware.

Disk Images

There are two Fedora images, the latter more recent one likely the best.

fedora-disk-gnome-workstation_riscv64-f38-20230515-035559-25m.raw.xz

https://drive.google.com/file/d/1IjxeKiwtyDTmc2YGbn7yvpbCx0B1kkBh/view

fedora-disk-gnome-workstation_livecd-f38-20231010-033114.n.0-fix.raw.xz

https://drive.google.com/file/d/1-tYHNXjX6oekNorOGlWb_Az2nVOoey6y/view

Warning

The Fedora image phones home to Microsoft (github) and other cloud services, including 443 TCP (web) and 123 UDP (time), without user prompting.

os-release

Output from os-release running the stock Fedora 38 image.

NAME="Fedora Linux"
VERSION="38 (Workstation Edition)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

uname

Output from uname running the stock Fedora 38 image.

Linux fedora-riscv 6.1.31 #1 SMP Thu Jun 15 01:30:00 CST 2023 riscv64 GNU/Linux

Arch

There is a forum post in Chinese about an Arch port:

Ubuntu

I saw mention there was an Ubuntu image, but I think that is incorrect.

OpenSUSE

There is a forum post in Chinese about an OpenSUSE port:

RevyOS

“RevyOS is a custom Debian distribution optimized for the T-Head chip ecosystem”.

Sites are mostly in Chinese.

Source repository:

RevyOS documentation:

Arch POWER

Arch POWER is a “port of Archlinux base + pickings for powerpc{,64le} with riscv64 in development”.

Source repo: