Skip to content

fix: add riscv64 to this_arch_root#2125

Open
woltere wants to merge 1 commit intobootc-dev:mainfrom
woltere:fix-this_arch_root-for-riscv64
Open

fix: add riscv64 to this_arch_root#2125
woltere wants to merge 1 commit intobootc-dev:mainfrom
woltere:fix-this_arch_root-for-riscv64

Conversation

@woltere
Copy link
Copy Markdown

@woltere woltere commented Apr 3, 2026

I'm trying to use bootc on a riscv64 machine, this_arch_root returns "Unsupported architecture" error
The root partition GUID is known: ROOT_RISCV64

@bootc-bot bootc-bot bot requested a review from jmarrero April 3, 2026 21:19
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the riscv64 architecture in the discoverable partition specification. The reviewer pointed out that for full support, the riscv64 architecture must also be added to the ARCH_USES_EFI constant in crates/lib/src/install.rs to ensure proper EFI-related installation steps are performed.

Comment on lines +524 to +525
} else if #[cfg(target_arch = "riscv64")] {
ROOT_RISCV64
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While adding riscv64 support here is correct, it appears that riscv64 also needs to be added to the ARCH_USES_EFI constant in crates/lib/src/install.rs to ensure full support for this architecture.

On RISC-V 64-bit systems, UEFI is the standard boot environment for modern Linux distributions. Without updating ARCH_USES_EFI, the installation process (specifically clean_boot_directories) will skip essential EFI-related steps like mounting and cleaning the ESP, which will likely lead to a broken installation on RISC-V hardware.

Please consider updating crates/lib/src/install.rs as well:

pub(crate) const ARCH_USES_EFI: bool = cfg!(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "riscv64"));

Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane, hmm....I wonder if we could change this whole thing to a table instead of list-of-const, then we wouldn't need this lookaside function.

(We'd need a mapping between rust arch const and the DPS names though)

@jmarrero
Copy link
Copy Markdown
Contributor

jmarrero commented Apr 6, 2026

@woltere thank you for your contribution, we need a DCO

You can do this by:
git commit --amend --signoff

and pushing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants