Booting Ubuntu Linux on a LicheeRV

Sipeed made a microSD card image to boot Ubuntu on RISC-V based Allwinner D1 SoC. with their LicheeRV SoM.

Boot sequence on ASCIInema (local copy)

I made a copy of the image in my own repository, that’s faster/easier to download.
* SHA256sum: 4a414a36ba5ae8000bd2f8ee088ea399b502527e1868662427bc00676d65ca79

Just download the archive, untar and follow the instruction in the README. There is an error, the primary partition should start at 80MB (163840), not 40MB (81920). The is limited to 4Go, so it should be grown with resize2fs to have more place to work.

The whole process so:

You must first set the SDCARD device name. For me it was /dev/sdd warning if you are wrong you can delete your system ^^. You can have it’s value by using dmesg just after plugging it:

sudo dmesg | tail

or by using fdisk -l. You need a microSD card with 16GB or more space.

export SDCARD=/dev/sdd

Then follow the following script:

tar xf licheerv_d1_1.14lcd_ub2004.tgz
cd licheerv_d1_ub2004_20220104a
sudo wipefs -a "${SDCARD}"
sudo fdisk "${SDCARD}"

In fdisk:


then continue the process:

sudo dd if=boot0_sdcard_sun20iw1p1.bin of="${SDCARD}" bs=512 seek=16
sudo dd if=d1-kernel.toc1 of="${SDCARD}" bs=512 seek=32800 status=progress

Then depending on the name of the device on your system, if its of kind /dev/mmcblk0 then you should use /dev/mmcblk0p1 for partition 1, if it’s a /dev/sdd then, it’s /dev/sdd1.

if you use a /dev/mmcblkX type of device (typically internal SDcard reader) use this:

sudo dd if=ub2004_rootfs.img of="${SDCARD}p1" bs=1M status=progress
sudo resize2fs "${SDCARD}p1"

if you use a /dev/sdX type of device (typically an USB SDcard reader) use this:

sudo dd if=ub2004_rootfs.img of="${SDCARD}1" bs=1M status=progress
sudo resize2fs "${SDCARD}1"

After the sync, you can unplug the microSD card, plug it in your Lichee RV turn on the SoM, wait few seconds, after OpenSBI have booted it will open the kernel and you will see the Ubuntu boot sequence on screen.

Here is the boot with the LicheeRV dock, allowing to plug USB keyboard or other device, and HDMI, still need to manage it. There are some Debian image with HDMI working, but need proprietary Windows tools to make the microSD card :(.

Update: Another interesting image with more features Debian Bulleseye 11 from RVBoards, but with very strange FS (Android ?) and only 4GB partition (the /opt could be hacked). On their mirror (can be slow), local copy
* Sha256sum: e4a042d3a7c0658ffa009185488164eb18bd49fd92928cdec190a80f15b0c86b
* Just need to unzip and dd to the microSDcard.
* ASCIInema record of the boot sequence (local copy). This image is for Allwinner Nezha, so lot of things will not work and throw error message. But on the other side, most peripherals are detected, could be interesting for tuning. Linux condig.gz of the kernel