Re: Booting CLFS with qemu-system-riscv64

"Xi Ruoyao" ([email protected] via lfs-support Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.support
Message-ID <[email protected]>
On Tue, 2024-10-15 at 14:17 +0800, NakanoMiku wrote:

/* snip */

> error: cannot load image.

I can see two possibilities here:

1. The grub.cfg file is not correctly written.  I cannot verify because
you didn't send the content of the file and the partitioning scheme of
your virtual disk.

[Personally I don't like a separate /boot and I don't use it in the
recent years, but it's still how the book's grub.cfg is assuming.  If
you don't have a separate /boot you'll need to use "linux /boot/vmlinuz-
..." instead of "linux /vmlinuz-...".]

2. You've copied a wrong kernel file.  On UEFI grub needs a kernel with
EFI stub, i.e. the bootable image should be a PE executable:

$ file /boot/vmlinuz-6.10.2 
/boot/vmlinuz-6.10.2: PE32+ executable (EFI application) Aarch64
(stripped to external PDB), for MS Windows, 2 sections 

[This is a kernel for AArch64 instead of RISC-V, as I (or maybe the
world) don't have an RISC-V UEFI board and I hate developing things
solely depending on an emulator.]

Instead of:

$ file ~/git-repos/linux/vmlinux
/home/xry111/git-repos/linux/vmlinux: ELF 64-bit LSB pie executable, ARM
aarch64, version 1 (SYSV), statically linked,
BuildID[sha1]=597d3d1ed221ac095c5a1539c19242fd537ddbf3, not stripped

-- 
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-support
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.