Kernel Sauce and Build

What is the best Linux kernel source code repo for the Pioneer?

I got this repo working with my Pioneer computer. It is the latest/greatest I’ve found:

This repo, which seems the most logical, hasn’t been updated since last May, so is much older than the latest images. So I thought this would be best, but it appears unmaintained:

Other options would be the main riscv repo from Linux, linux-stable, Linus’ latest, etc. I also checked the /usr/src/kernels/6.1.31 directory in the stock Fedora 38 image, which perhaps corresponds to the running binary, but it is missing files in a “regular” Linux kernel.

Anyway, with the Sophgo linux-riscv repo, I built a fresh kernel for my Pioneer running Debian thusly:

mkdir -p sophgo
cd sophgo/
git clone https://github.com/sophgo/linux-riscv
cd linux-riscv/
make ARCH=riscv sophgo_mango_ubuntu_defconfig
scripts/config --disable DEBUG_INFO
make menuconfig
# For Debian:
make -j$(nproc) deb-pkg
# Others, perhaps
# make -j$(nproc)
cd ../
sudo dpkg -i linux-headers-*_riscv64.deb linux-image-*_riscv64.deb linux-libc-dev_*_riscv64.deb 
mkdir -p /boot/dtb/debian/
sudo cp -p /usr/lib/linux-image-6.1.61-0fyi+/sophgo/mango-milkv-pioneer.dtb /boot/dtb/debian/

Then add it to the bootloader:

vim /boot/extlinux/extlinux.conf

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

Happy hacking,

-Jeff

6 Likes

Worked great. Thanks for the writeup Jeff!

3 Likes

I’ve had much better luck with the milkv-community/linux tree and running the 6.8.0 branch:

linux-sophgo was just unstable for me (frequent core lockups, segfaults etc) and the official milk-v tree was even more outdated.

3 Likes

Hi, thanks for pointing out this kernel!

I haven’t had any luck running this kernel, although I got around to compiling it. Currently, every time I boot this kernel I get some weird serial output, and the system fails to boot.
Could you maybe share the way you build there kernel, and the bootloader configuration for it?

2 Likes

I guess you are booting the system with the firmware comes with the Fedora image dated 2023xxxx. For some reason that firmware doesn’t work with newer kernels. The problem would gone if you use newer firmware.

1 Like