help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to get the architecture of the machine just booted up


From: Albretch Mueller
Subject: Re: Is there a way to get the architecture of the machine just booted up by GRUB2: [32|64]-[amd|arm]? ...
Date: Sun, 17 Dec 2023 16:24:16 +0000

On 12/17/23, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> Now explain, how grub compiled for rsic-v is going to run on amd64 to
> decide anything.

 This is not what I have in mind. What I mean is that as part of the
sequence the boot process goes through, GRUB2 should be able to decide
which compiled option to use and all kinds of UEFI/BIOS can certainly
read a CD/DVD as part of the boot process.

> It is up to the firmware to select the correct boot image that this
> firmware expects.

 What kind of firmware are we talking about here? What I am talking
about is exploiting that selection strategy you mentioned at its
critical moment during boot up to then choose the path to get into.

On 12/17/23, Pascal HamboOn 12/17/23, Andrei Borzenkov
<arvidjaar@gmail.com> wrote:
> Debian does not provide any such multi-arch ISO image. Until bookworm it
> provided a amd64+i386 multi-arch image which was able to boot with PC
> BIOS (with ISOLinux, 32-bit x86 UEFI and 64-bit x86 UEFI (with GRUB).
>
>> will GRUB2 automatically
>> detect the architecture and pick the file?
>
> Let's assume you you create such an ISO image for UEFI boot only. It
> must contain an EFI partition with EFI images for each firmware
> architecture : bootarm64.efi (built for ARM64), bootx64.efi (built for
> AMD64/x86_64) and bootriscv64.efi (built for RISC-V64). The UEFI
> firmware will seek the matching EFI image, and the GRUB image will
> report the architecture in $grub_cpu and $grub_platform.
>
> Note: bootxxx.efi may be a GRUB image or a shim image which loads
> grubxxx.efi in turn (for secure boot).

 Well, in a sense you are confirming that to be technically possible
at least as part of UEFI boots. All that DVD would need is an EFI
partition with the EFI images for each firmware architecture.

 I will not be messing with GRUB itself, just exploiting the moment in
which it kisses the UEFI to strategize a multi-boot, multi-arch boot
loading process and yes, "secure boot" would be the way to go.

 I could imagine you use a virtual machine for development and initial
testing (of course, at some point you will have to use the actual
hardware). Any tutorials, literature you would suggest for advanced
users and developers? (googling, searching for it doesn’t make any
sense these days, they are selling your attention to whatever they
dangle in your field of view, making you waste time, ...)

 lbrtchx



reply via email to

[Prev in Thread] Current Thread [Next in Thread]