RISC-V

Differences between revisions 11 and 58 (spanning 47 versions)
Revision 11 as of 2021-02-01 11:42:30
Size: 3408
Editor: xnox
Comment:
Revision 58 as of 2024-04-21 06:55:43
Size: 2922
Editor: xypron
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Ubuntu provides riscv64 architecture for the RISC-V platform since Focal release. Ubuntu provides the riscv64 architecture for the RISC-V platform since the release of Ubuntu 20.04 LTS.
Line 5: Line 5:
 * Ubuntu 20.04.2 LTS Release Image https://cdimage.ubuntu.com/releases/20.04.2/release/ === Preinstalled Server Images ===
Line 7: Line 7:
 * Ubuntu Focal (20.04) Dailies https://cdimage.ubuntu.com/ubuntu-server/focal/daily-preinstalled/current/  * Ubuntu 24.04 (Noble Numbat) preinstalled images for
Line 9: Line 9:
 * Ubuntu Hirsute (21.04) Dailies https://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/    * [[RISC-V/Nezha D1 | Allwinner Nezha D1]]
   * [[RISC-V/LicheeRV | LicheeRV Dock]]
   * [[RISC-V/PolarFire SoC FPGA Icicle Kit | Microchip Polarfire Icicle]]
   * [[RISC-V/QEMU | QEMU]]
   * [[RISC-V/SiFive HiFive Unmatched | SiFive HiFive Unmatched]]
   * [[RISC-V/StarFive VisionFive | StarFive VisionFive]]
   * [[RISC-V/StarFive VisionFive 2 | StarFive VisionFive 2]]
Line 11: Line 17:
One can boot it on any system with qemu-system, or on bare-metal board such as those built by SiFive.  are available at https://cdimage.ubuntu.com/releases/24.04/release/.
Line 13: Line 19:
== Booting with qemu ==  * Ubuntu 22.04.4 (Jammy Jellyfish) preinstalled SD-card images for
Line 15: Line 21:
Prerequisites:    * [[RISC-V/Nezha D1 | Allwinner Nezha D1]]
   * [[RISC-V/LicheeRV | LicheeRV Dock]]
   * [[RISC-V/PolarFire SoC FPGA Icicle Kit | Microchip PolarFire Icicle Kit]]
   * [[RISC-V/SiFive HiFive Unmatched | SiFive HiFive Unmatched]] (also supports [[RISC-V/QEMU | QEMU]])
   * [[RISC-V/StarFive VisionFive | StarFive VisionFive]]
Line 17: Line 27:
 * apt install qemu-system-misc opensbi u-boot-qemu qemu-utils  are available at https://cdimage.ubuntu.com/releases/22.04.4/release/.
Line 19: Line 29:
After installing the above prerequisites, one can use any of the above images to boot virtua>  * Ubuntu 20.04.5 (Focal Fossa) preinstalled SD-card images for the
Line 21: Line 31:
First unpack the image    * SiFive HiFive Unleashed
   * [[RISC-V/SiFive HiFive Unmatched | SiFive HiFive Unmatched]] (also supports [[RISC-V/QEMU | QEMU]])
Line 23: Line 34:
{{{
xz -dk focal-preinstalled-server-riscv64.img.xz
}}}
 are available at https://cdimage.ubuntu.com/releases/20.04.5/release/.
Line 27: Line 36:
Optionally, if you want larger disk, you can expand the disk (filesystem will be automatical> === Server Install Image ===
Line 29: Line 38:
{{{
qemu-img resize focal-preinstalled-server-riscv64.img +5G
}}}
If you want to install Ubuntu on a disk drive, use the server install image.
Line 33: Line 40:
Next use OpenSBI bootloader & u-boot-qemu to boot the virtual machine  * An Ubuntu 23.10 (Mantic Minotaur) [[https://cdimage.ubuntu.com/releases/23.10/release/ubuntu-23.10-live-server-riscv64.img.gz|server install image]] is available at https://cdimage.ubuntu.com/releases/23.10/release/
Line 35: Line 42:
Working example with all the options is:  * A Ubuntu 23.04 (Lunar Lobster) server install image supporting the [[RISC-V/SiFive HiFive Unmatched | SiFive HiFive Unmatched]] board and [[RISC-V/QEMU | QEMU]] is available at https://cdimage.ubuntu.com/releases/23.04/release/.
Line 37: Line 44:
{{{
qemu-system-riscv64 \
-machine virt -m 2048 -smp 4 \
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
-device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \
}}}
Line 45: Line 45:
The important options to use are:  * A Ubuntu 22.04.3 (Jammy Jellyfish) server install image supporting the [[RISC-V/SiFive HiFive Unmatched | SiFive HiFive Unmatched]] board and [[RISC-V/QEMU | QEMU]] is available at https://cdimage.ubuntu.com/releases/22.04.3/release/.
Line 47: Line 47:
 * Machine type `virt` aka `-machine virt`
 * Bios is OpenSBI `-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf`
 * "kernel" is qemu smode uboot `-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf`
A tutorial is available at https://ubuntu.com/tutorials/install-ubuntu-server.
Line 51: Line 49:
One can use pass through networking, adjust memory (`-m`) & cpu counts (`-smp`) as needed. A description of the installation process is also available at https://discourse.ubuntu.com/t/ubuntu-installation-on-the-sifive-hifive-unmatched-board-using-a-server-install-image/27804.
Line 53: Line 51:
Switch to the serial console, wait for cloud-init to complete, then login using `ubuntu:ubuntu`. See the cloud-init section below to further customise the first boot behaviour with cloud-init. === Desktop ===
Line 55: Line 53:
== Booting on SiFive HiFive Unleashed board == We currently don't provide a desktop image for RISC-V. But you can install package ubuntu-desktop to get a GNOME desktop. As of 2022 due to performance restrictions the only hardware usable for a desktop is the SiFive HiFive Unmatched board.
Line 57: Line 55:
The above image has U-Boot SPL loader as well as SiFive U-Boot to boot on the board. == Forums ==
Line 59: Line 57:
Set jumpers to boot from the microSD by setting `MSEL=1011` (MSEL2 to the outside of the board, the rest to the inside).

You can then use "Gnome Disks" app to restore `img.xz` image onto the microSD card, plug it into the board and boot.

You can also use cmdline to extract the image and dd it.

{{{
xz -dk focal-preinstalled-server-riscv64.img.xz
dd if=focal-preinstalled-server-riscv64.img of=/dev/disk/by-id/<TAB><TAB>complete-to-sdcard-device
}}}

Monitor serial console, wait for cloud-init to complete, then login using `ubuntu:ubuntu`. See the cloud-init section below to further customise the first boot behaviour with cloud-init.

== cloud-init integration ==

The image has a fallback cloud-init datasource that configures sudo user `ubuntu` with password `ubuntu` and DHCP networking. You will be asked to change the password on first login.

The image has `CIDATA` partition which can be used as a valid datasource to adjust cloud-config metadata. If you wish to customize user password, networking information, add ssh keys, etc. Please mount `CIDATA` partition rename `meta-data` and `user-data` files and adjust them to taste. You can use network-info to configure networking if something more sophisticated than just DHCP is desired.

For example ssh keys, disabling interactive login, and so on. See https://cloudinit.readthedocs.io/en/latest
You can discuss Ubuntu on RISC-V over at the [[https://discourse.ubuntu.com/c/server/17|Ubuntu Server forums]].

Ubuntu provides the riscv64 architecture for the RISC-V platform since the release of Ubuntu 20.04 LTS.

Images

Preinstalled Server Images

Server Install Image

If you want to install Ubuntu on a disk drive, use the server install image.

A tutorial is available at https://ubuntu.com/tutorials/install-ubuntu-server.

A description of the installation process is also available at https://discourse.ubuntu.com/t/ubuntu-installation-on-the-sifive-hifive-unmatched-board-using-a-server-install-image/27804.

Desktop

We currently don't provide a desktop image for RISC-V. But you can install package ubuntu-desktop to get a GNOME desktop. As of 2022 due to performance restrictions the only hardware usable for a desktop is the SiFive HiFive Unmatched board.

Forums

You can discuss Ubuntu on RISC-V over at the Ubuntu Server forums.

RISC-V (last edited 2024-04-21 06:55:43 by xypron)