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

Bug#1033737: flash-kernel: Unable to run flash-kernel on EFI-based systems



On 2023-04-16, Johannes Schauer Marin Rodrigues wrote:
> On Fri, 31 Mar 2023 13:52:45 +0000 Isaac True <isaac@is.having.coffee> wrote:
>> As part of our CI/CD system, we are building images for target devices.  The
>> images are set up in virtual machines which boot using EFI, but flash-kernel
>> installation always fails as it detects that the system is running in EFI by
>> checking for the existence of /sys/firmware/efi.
>
> we have the same problem when building bootable images for the MNT Reform
> laptop:
>
> https://source.mnt.re/reform/reform-system-image/
>
> The CI system is a machine that boots with EFI but the final system uses uboot
> to boot and not EFI.
>
>> Being able to setup the image on these VMs is an important part of our
>> testing and validation workflow, so it would be very helpful to have an
>> option to skip this check and proceed regardless of whether the system is
>> currently running in EFI mode or not.
>
> This used to work in the past but was broken by this commit:
>
> https://salsa.debian.org/installer-team/flash-kernel/-/commit/8a81a537995a2b98386aea883729ce9960a825bf
>
>> I've added a debdiff for a proposal for a new parameter --force-efi which can
>> be set to skip this check.
>
> The problem with implementing this using a command line flag or an environment
> variable is, that then you will have to run flash-kernel again manually after
> initially installing it.

Why would you have to run flash-kernel again?
In the EFI VM environment, you are overriding the detected default, as
the image is created for another system type. Once you have booted into
that image, it should pick the correct defaults (e.g. EFI or not EFI).

For better or worse, something similar is already done with the
FK_MACHINE environment variable, so at least another environment
variable would not be inconsistent.

The name FK_FORCE_EFI=yes seems a bit backwards; it is ignoring the
presence of EFI, not forcing it to behave like EFI. FK_FORCE_NO_EFI?
FK_IGNORE_EFI? Names are hard.

I definitely like the simiplicity of the environment variable approach,
although it feels a bit wrong to have the package postinst affected by
it (although there is already precedent with FK_MACHINE).

Not sure about a commandline flag, though I can't quite place my finger
on why...

 
> What do you think about instead using an option in /etc/default/flash-kernel
> which allows ignoring /sys/firmware/efi if inside a chroot as I implemented
> here:
>
> https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/33

I overall like this approach, although the main drawback is having to
write to /etc/default/flash-kernel and then potentially having to handle
changes merged into it on flash-kernel upgrades...


I very much appreciate new energy on this issue; it seemed stuck on two
somewhat incompatible needs and also broke previous working
configurations.

It seems like there are a few options forwards now, at least! Thanks!


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature


Reply to: