Installing Ubuntu 21.04 on the HiFive Unmatched

@neilwhitlow Yes, they are still current.

1 Like

Installation on SD card work fine but fail on NVMe drive

The DD command work OK: the nvme hold all partitions and files\folders

But the installation on nvme fail at:

sudo chroot /mnt

The output error is:

chroot: failed to run command ‘/bin/bash’: Accessing a corrupted shared library

Retry with new SD card and new NMVE M2
Flash the SD card with:

wget http://cdimage.ubuntu.com/ubuntu/releases/21.04/release/ubuntu-21.04-preinstalled-server-riscv64+unmatched.img.xz 
unxz ubuntu-21.04-preinstalled-server-riscv64+unmatched.img.xz
sudo dd if=ubuntu-21.04-preinstalled-server-riscv64+unmatched.img of=/dev/mmcblk0 bs=1M status=progress

Boot SD card without problem but again the installation on nvme fail at “sudo chroot /mnt” with the same error message

Any help will be greatly appreciate.

I’d recommend you try re-downloading the image and redoing the dd command with the re-downloaded image. That error message implies that something didn’t get copied properly, either while downloading the image, decompressing it, or writing it to the NVMe.

Also just to be sure, the NVMe is plugged into the Unmatched while you’re doing the chroot, correct? You can only chroot into a RISC-V root using a RISC-V system. There are ways to work-around the chroot, but if /bin/bash can’t be loaded your system won’t be usable either way.

And since is this the most recent ubuntu thread and the topic is somewhat generic:
is there any active development on this right now? Where/by whom? i.e. patching in latest changes of the Freedom Unleashed SDK (including 1.2 [or more] GHz) ?

Yes we are still actively developing Ubuntu on RISC-V and for the Unmatched specifically. @xypron is leading that effort, and changes to packages can be observed on Launchpad: OpenSBI, U-Boot.

I know we’ve discussed the CPU speed issue but I’m not 100% sure where it stands in development. Other developments we’re working on are booting with grub, and toolchain improvements (such as in golang and javascript).

1 Like

I have unofficial Ubuntu u-boot and kernel builds here.

https://forums.sifive.com/t/latest-ubuntu-u-boot-and-kernel-images/

Thanks for the reply and in particular your efforts!
It would be great to stay posted somewhere here about the status/news.

Hello Martin,

I assume that you relate to the patches in

Unfortuntately these are not in sync with the patches that have been sent upstream. Take for instance 0002-riscv-sifive-unmatched-update-for-16GB-rev3.patch. Some of the changes are in an accepted upstream patch d09560435cb7 (“riscv: dts: fix memory size for the SiFive HiFive Unmatched”).

If you think patches are missing in the Ubuntu kernel, please, open an issue on launchpad.net indicating the upstream patches either by commit ID or by the URL on lore.kernel.org.

Best regards

Heinrich

Just FYI, there’s a new patch set for the 5.13.x kernel.

The 0002-riscv-sifive-unmatched-update-for-16GB-rev3.patch file is still out of sync though.

Yes

I did it: downloaded from 2 differents sources, use 2 different USB SD card reader, use SD card not the same size and brand. I always get the same “chroot: failed” message.

I also try “sudo chroot /mnt” on the SD card from SiFive (Xfce4) and I get also the message:
chroot: failed to run command ‘/bin/bash’: Accessing a corrupted shared library

The default shell on Xfce4 is bash (and work fine). How can the library be corrupted ?

Probability that error come from OS on the SD is then very low


Is my firmware corrupted ?

@JawnSmith I see that there is now a 20.04.03 image up:

https://wiki.ubuntu.com/RISC-V

Is there any benefit to running this? Outside of general LTS/non-LTS considerations. E.g. more packages built, fixes or later bootloader etc.

@AndrewBack The general LTS/non-LTS considerations hold true here. There are more packages built, bugfixes, and recent bootloader on the development version, 21.10 that will be releasing on October 14. The beta is already available at https://cdimage.ubuntu.com/ubuntu/releases/21.10/beta/ubuntu-21.10-beta-preinstalled-server-riscv64+unmatched.img.xz

Oh, that is great news! Assuming that 21.10 will have general updates (like 1.2 or more Ghz) as well.

Clock speed is purely firmware on the Unmatched, so the only reason newer Ubuntu images clock the core faster is because they have newer firmware baked into the pre-built images (and that Linux distributions continue to go down the route of providing an SD card image, rather than leaving firmware completely separate and shipping a generic USB stick image so they’re completely decoupled like FreeBSD (and, now, Haiku) does). It has nothing to do with the actual OS (beyond the usual improvements that can come from kernel updates on any hardware).

1 Like

We set the clock speed during the boot process with u-boot. The version in impish sets it to 1.2 GHz.

That’s what I said. It’s just the version that Ubuntu happens to ship with on the different versions differing in their clock speed configurations.

Yes that’s correct. I wasn’t disagreeing, just adding some detail and confirming that 21.10 is set to 1.2GHz.

1 Like

Hi all,
I am just trying to set up Ubuntu 21.10 from here:
https://cdimage.ubuntu.com/ubuntu/releases/21.10/release/
I dd’d the image to SD via:
sudo dd if=ubuntu-21.10-preinstalled-server-riscv64+unmatched.img of=/dev/mmcblk0 bs=1M status=progress
And before I booted with the new SD, I renamed the /boot/extlinux/extlinux.conf on the nvme to avoid launching the freedom OS from former nvme install.
However I receive (via console usb connection) some of those during boot:
“A start job is running for /dev/mmcblk0p3 (15s / 1min 30s)”
then after a while among other messages these fails:
“[DEPEND] Dependency failed for Local File Systems.”


“[FAILED] Failed to start Console System Startup Logging.”


"You are in emergency mode. After logging in, type “journGive root password for maintenance”.

There I’m stuck. CTRL+D loops back to this request and I wouldnt even know the ubuntu root pass

Is this behavior somehow known or what went wrong here?
Any help is highly appreciated.
Thanks in advance!

It’s hard to tell exactly what’s going on without full logs, but it looks to me like the freedom OS is still attempting to boot. The Ubuntu images shouldn’t even have a /dev/mmcblk0p3, so that’s likely the freedom OS trying to boot and not finding a partition that it’s expecting to find.

You can force boot from mmc0 by hitting any key when you see the “Hit any key to stop autoboot” message on the serial console, and then type “run bootcmd_mmc0”. Renaming the nvme extlinux.conf file should work for freedom-u-sdk, but maybe there is something different about the boot flow for Ubuntu that prevents that from working.