2023 Unmatched Rev B boot from NVME

Recently purchased an Unmatched Rev B (2023) and have been trying to get ubuntu installed on the system.

I downloaded the image from the ubuntu-based link. Will the address post below in the reply section.

Specifically under “Preinstalled server image” option

  • " [RISC-V for SiFive HiFive Unmatched preinstalled server image]"

The image was downloaded to the microSD card provided with the unmatched system. I burned the image to the NVME device using the sifive instructions provided here (boot from NVME section).

The instructions say that you need to mount the boot partition and modify extlinux/extlinux.conf - I’ve mounted that drive and there is no file at the path extlinux/extlinux.conf. In fact, the only partition with the path is the /root partition. The instructions claim that u-boot checks for this file when the system starts to find out where it needs to look for a kernel.

So, I doubled back to the instructions from the ubuntu team. They claim all you need to do is modify extlinux/extlinux.conf on the /root partition and run the u-boot-update command and all is good. A link is provided here.

I’m unsure of this claim and it gives me the impression that the instructions from sifive are for folks that want to boot from NVME and the instructions from ubuntu are for folks that are ok with a microSD boot that switches over to NVME.

My first question is the above impression correct? Next question, if this is correct, then is the lack of the correct path on the boot partition mean the 22.04.3 version of ubuntu broken? If that is the case, should I move up to ubuntu 23?

Thanks in advance.

The ubuntu image address → Ubuntu 22.04.3 LTS (Jammy Jellyfish)

Different linux distros can put things in different places. So the fact that the extlinux.conf path is different doesn’t matter. The SiFive instructions are correct for the OpenEmbedded images that they produce. The Ubuntu instructions are correct for Ubuntu.

You can’t boot without the SDcard. The board will run u-boot from the SDcard, and then u-boot can optionally use either an SDcard root or a NVMe root depending on the extlinux.conf contents. In theory, the only thing you need on the SDcard is the u-boot partition if you have an NVMe root.

Either you’re not looking in the correct partition, or you didn’t transfer the image to the nvme drive correctly. Here’s some tips.

You can mount the .img file on your x86 Linux box and see what’s on it. First, show the partitions.

$ fdisk -l ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img
Disk ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img: 4.51 GiB, 4831838208 bytes, 9437184 sectors
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: gpt
Disk identifier: 1FFAD53A-DA06-4DAA-96B2-7D6029A8F4E0

Device                                                      Start     End Sectors  Size Type
ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img1  235520 9437150 9201631  4.4G Linu
ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img12 227328  235519    8192    4M Linu
ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img13     34    2081    2048    1M HiFi
ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img14   2082   10239    8158    4M HiFi
ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img15  10240  227327  217088  106M EFI 

Partition table entries are not in disk order.

Then mount the first partition using the correct offset.

$ sudo mount -t ext4 -o loop,offset=$((235520 * 512)) ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img /mnt

Then you can look at the contents.

$ cd /mnt
$ ls
bin   dev  home  lost+found  mnt  proc  run   snap  sys  usr
boot  etc  lib   media       opt  root  sbin  srv   tmp  var
$ cd boot
$ ls
config-5.19.0-1021-generic      initrd.img.old
efi                             System.map-5.19.0-1021-generic
extlinux                        vmlinuz
initrd.img                      vmlinuz-5.19.0-1021-generic
initrd.img-5.19.0-1021-generic  vmlinuz.old
$ cd extlinux/
$ ls
extlinux.conf

Hope this helps.

Also, if you transferred the image correctly, you should have 5 partitions on your nvme drive. It should look like this (except you won’t have mtdblock0 and the mountpoints will be on mmcblk0). Then you would want to mount partition nvme0n1p1.

$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mtdblock0     31:0    0    32M  0 disk 
mmcblk0      179:0    0  29.7G  0 disk 
├─mmcblk0p1  179:1    0  29.6G  0 part 
├─mmcblk0p12 259:0    0     4M  0 part 
├─mmcblk0p13 259:1    0     1M  0 part 
├─mmcblk0p14 259:2    0     4M  0 part 
└─mmcblk0p15 259:3    0   106M  0 part 
nvme0n1      259:4    0 465.8G  0 disk 
├─nvme0n1p1  259:5    0 465.6G  0 part /
├─nvme0n1p12 259:6    0     4M  0 part 
├─nvme0n1p13 259:7    0     1M  0 part 
├─nvme0n1p14 259:8    0     4M  0 part 
└─nvme0n1p15 259:9    0   106M  0 part /boot/efi

point taken, just noticed references to openembedded. thanks

thank you, I’ll be walking through this process tomorrow. will report back hopefully with a success story soon!

After some delay, I’ve noticed the following situation when booting ubuntu from the following image: ubuntu-23.04-preinstalled-server-riscv64+unmatched.img.xz

This is an attempt at booting from /dev/nvme0p1

It looks like the device tree file name is corrupted. Note the string <NULL>- is being placed as a subdirectory when the system expects to see sifive/.

Scanning nvme 0:1…
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
793 bytes read in 1 ms (774.4 KiB/s)
U-Boot menu
1: Ubuntu 23.04 6.2.0-19-generic
2: Ubuntu 23.04 6.2.0-19-generic (rescue target)
Enter choice: 1
1: Ubuntu 23.04 6.2.0-19-generic
Retrieving file: /boot/initrd.img-6.2.0-19-generic
119701050 bytes read in 126 ms (906 MiB/s)
Retrieving file: /boot/vmlinuz-6.2.0-19-generic
42211840 bytes read in 46 ms (875.1 MiB/s)
append: root=/dev/nvme0n1p1 ro efi=debug earlycon sysctl.kernel.watchdog_thresh=60
Retrieving file: /lib/firmware/6.2.0-19-generic/device-tree/<NULL>-hifive_unmatched_fu7
Failed to load ‘/lib/firmware/6.2.0-19-generic/device-tree/<NULL>-hifive_unmatched_fu7’
Skipping l0 for failure retrieving fdt

Looks like a u-boot problem. I’m going to guess you’re still using the SD card that came with the board. I would try burning the Ubuntu 23.04 image onto another SD card and use that instead. Then you’ll have a more up to date u-boot.

The board is sensitive to SD cards. Another SanDisk 32 GB would be ideal.

Yep, I’m using the sifive provided microSD card and am following the nvme bring up instructions provided in the user manuals for the unmatched from the sifive site.

The sifive documentation for nvme bring up refences a version of ubuntu that isnt available on the ubuntu servers any more (~ubuntu-21). This maybe an indication the version sifive provides had some issue (maybe this one?) which resulted in that version being taken down (ubuntu 20, 22, 23 are still on their servers…so they skipped a version that has documentation?).

So the sifive card boots but cant be used to bring up other distros.

Alright, looks like I’ll have to snag another microSD card and work this process from scratch.

Thanks for the assistance and recommendations!

Just FYI, the installation instructions for NVME is the same for all versions of Ubuntu except for the very latest, 23.10. With 23.10, they’ve switched from extlinux to EFI boot.

You can switch back to extlinux on 23.10 with a little trickery.

thanks, I decided to go with this image off the ubuntu site: ubuntu-22.04.3-preinstalled-server-riscv64+unmatched.img.xz

ended up flashing the microSD with the new image and am in the process of getting the image flashed to nvme. will have updates soonish.

good news. everything worked! flashed the microSD with that specific image, downloaded the image again, dumped the image to nvme, modified extlinux.conf as per the instructions and the system and it everything seems like it’s in order.

The device hits microSD and redirects to nvme to load the kernel.

@drmpeg Are the instructions under “Use NVME as root filesystem” at this link how you get rid of the microSD card boot dependency?

No, that’s about creating your own rootfs. If you want to get rid of the SD card, you have to burn u-boot into the the SPI flash. The instructions are here:

thanks!