Enable riscv64 build

Bug #1876620 reported by Ryan Finnie
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Wishlist
Heinrich Schuchardt

Bug Description

RISC-V EFI support is not yet in the Linux kernel (ca. 5.8: https://lkml.org/lkml/2020/4/20/1800), and while GRUB2 EFI Loader support needs to happen with the kernel (https://lists.gnu.org/archive/html/grub-devel/2020-04/msg00203.html), GRUB2 already has RISC-V EFI support. It can't currently boot anything, but it is a valid UEFI application and displays a pretty menu.

Please see the attached debdiff. Of note:

* grub2 requires efibootmgr and efivar. I've filed Debian bugs to enable riscv64 for them (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959498 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959499 respectively), but if this is actioned before those end up happening, it's a simple Architecture: update on each.

* riscv-default-platform.patch: Upstreamed, allows `grub-install` to work without --platform.

* riscv-relocation-offset.patch: Upstreamed, fixes "unaligned pointer" failure.

* riscv-ubuntu-linuxefi.patch: Patches ubuntu-linuxefi.patch for riscv support; not sure if this should be integrated into ubuntu-linuxefi.patch.

* Tested on qemu-system-riscv64 focal.

Revision history for this message
Ryan Finnie (fo0bar) wrote :
description: updated
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "grub2-riscv64.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Given there is no secureboot support with lockdown for the platform as far as I know, it is premature to sign the grub2 for riscv64.

Also I think we'd want these patches from upstream. By taking 2.06 or like master for the riscv64 build.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

To enable RISC-V you need GRUB 2.06 plus this series:

[PATCH v2 0/7] Add LoadFile2 and riscv Linux loader
https://lists.gnu.org/archive/html/grub-devel/2021-06/msg00006.html

tags: added: riscv64
removed: patch
tags: added: fr-1681
Revision history for this message
Julian Andres Klode (juliank) wrote :

There is nothing to sponsor here; RISC-V support will land with 2.06

Changed in grub2 (Ubuntu):
assignee: nobody → Heinrich Schuchardt (xypron)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Julian Andres Klode (juliank) wrote :

Setting block-proposed to give this more testing

tags: added: block-proposed
Revision history for this message
Julian Andres Klode (juliank) wrote :

😬 we did not have a bug task for grub2-unsigned and signed, so the most important bits already migrated, so removing the block here too

tags: removed: block-proposed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu5

---------------
grub2 (2.06-2ubuntu5) jammy; urgency=medium

  [ Julian Andres Klode ]
  * Free correct size when freeing params, rather than 16 Ki (LP: #1958623)
  * Build with FUSE3 (LP: #1935659)
  * Only run os-prober on first run and if it previously found other OS
    (LP: #1955109)

  [ Heinrich Schuchardt ]
  * Rename grub-core/loader/efi/linux.c
  * Add patches for GRUB on RISC-V
  * fat: fix listing the root directory
  * Enable building for RISC-V (LP: #1876620)

  [ Julian Andres Klode ]
  * Re-enable peimage code on other archs outside secure boot; this
    fixes LP: #1947046 when not booting in secure boot mode (secure
    boot pending security review of the code)

 -- Julian Andres Klode <email address hidden> Fri, 18 Feb 2022 17:21:16 +0100

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers