uefi-riscv64: add cloud kernel target#9862
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesUEFI RISC-V64 Board Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
x86 and arm64 UEFI both have a cloud kernel variant; riscv64 didn't.
This adds the missing pair so a riscv64 cloud image (qcow2 / vhdx
for QEMU + KVM hosts running riscv64 VMs) builds out of the box.
Two changes:
- config/boards/uefi-riscv64.csc: append `cloud` to KERNEL_TARGET
so the framework knows to expose it.
- config/kernel/linux-uefi-riscv64-cloud.config: seed from the
current riscv64 UEFI config. Same kernel version (6.18, per
uefi_common.inc's cloud branch) so the seed is appropriate.
The cloud-specific leanness comes from uefi_common.inc's cloud arm
(INSTALL_ARMBIAN_FIRMWARE=no, EXTRAWIFI=no, UEFI_GRUB_TIMEOUT=0,
qemu-guest-agent + spice-vdagent in the image). Stripping kernel
modules to match x86-cloud's lean shape (~400 lines vs current's
3148) can come as a follow-up once we have field data on what's
actually needed for riscv64 VMs.
eef855a to
1272e78
Compare
The DTB-to-ESP copy assumed /boot/dtb/* always exists. True for SBC riscv64 kernels (StarFive, SiFive, etc.) which ship per-board DTBs; false for cloud/VM kernels where the firmware (QEMU/EDK2/OpenSBI) generates the device tree at boot. Result on uefi-riscv64 BRANCH=cloud: cp: cannot stat '/.../boot/dtb/*': No such file or directory Error 1 in pre_umount_final_image__install_grub Guard the copy with compgen -G so the directory-but-no-files case is also skipped (some kernels create the dir but install no .dtb). On the no-DTB path, emit an info-level alert instead of failing. Existing SBC riscv64 builds (kernels that ship DTBs) hit the same old path and continue to work unchanged. Also added a brief comment explaining the sed -i 's,devicetree,echo,g' /etc/grub.d/10_linux line two below: it rewrites GRUB's `devicetree` stanza emitter to 'echo' so update-grub doesn't bake in a hardcoded DTB path that fails at boot when the file isn't present (cloud) or when an SBC swaps storage between models (SBC).
Cloud images output to serial only by default (SERIALCON=ttyS0 gets
appended by the grub-${LINUXFAMILY} extension), so users viewing the
VM through Cockpit-machines / virt-manager / a hosting-panel VNC
viewer see "Display output is not active" forever — even though the
guest is happily booting and serving SSH.
Add console=tty1 to the cloud-branch base cmdline. Linux writes
boot messages to BOTH declared consoles; /dev/console (where
systemd-getty-generator spawns the unattended login) maps to the
LAST console=, which after the SERIALCON append is still ttyS0 —
so cloud-init / serial workflows stay untouched. The framebuffer
console just becomes a read-only window for operators glancing at
VNC.
Universal across x86 / arm64 / riscv64 UEFI cloud (riscv64 cloud
landed two commits ago). Safe on hosts without a virtio-gpu device
attached: kernel silently drops the tty1 console, falls back to
serial-only — no regression.
Kernel config requirements (CONFIG_VT + CONFIG_FRAMEBUFFER_CONSOLE)
are already pulled in transitively by the existing CONFIG_FB +
CONFIG_DRM_SIMPLEDRM + CONFIG_DRM_VIRTIO_GPU set in all three
*-cloud configs.
Summary
x86 and arm64 UEFI both have a cloud kernel variant; riscv64 didn't. Adds the missing pair so a riscv64 cloud image (qcow2 / vhdx for QEMU + KVM hosts running riscv64 VMs) builds out of the box.
Changes
Why arm64-cloud as the template
arm64-cloud is the closer arch peer (no x86-specific microcode, ACPI variants, Intel ME, etc.). Three arm64-only options removed:
Two riscv64-only options added (the same two `linux-uefi-riscv64-current.config` declares):
The rest of the cloud config is arch-agnostic — virtio drivers, BPF, IP stack, cgroups, KVM-guest essentials, virtio-gpu / simpledrm for graphics. Same shape as the other two cloud variants.
Existing wiring already covers the rest
The cloud-specific build-framework behavior already lives in `uefi_common.inc`:
```bash
cloud)
declare -g KERNEL_MAJOR_MINOR="6.18"
declare -g LINUXCONFIG="linux-uefi-${LINUXFAMILY}-cloud"
declare -g INSTALL_ARMBIAN_FIRMWARE="no"
declare -g EXTRAWIFI="no"
declare -g UEFI_GRUB_TIMEOUT=0
declare -g QCOW2_RESIZE_AMOUNT="16G"
add_packages_to_image qemu-guest-agent spice-vdagent
```
No changes needed there — LINUXFAMILY=riscv64 + BRANCH=cloud now resolves to a real config.
Test plan
Summary by CodeRabbit
New Features
Bug Fixes