Hi Ricardo,
On Tue, 20 Feb 2018 22:49:19 +0100Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (3 lines)
> So the value “/sys/firmware/non-efi” might as well be> “/does-not-exist”?
Yes.
Toggle quote (8 lines)
> Your patch subject says “Make sure that non-EFI grub doesn't try to use> EFI”, but the problem I had was that GRUB insisted on being passed a> “--target” option.
> That was with a GRUB installation on a system in> legacy mode. Do you mean that this failed because GRUB erroneously> attempted an EFI installation?
Yes, I think so.
There's a default-platform function in grub which determines the defaultplatform to use at runtime if you don't specify one. It one checks forthe existence of /sys/firmware/efi, and if so, returns "i386-efi" or"x86_64-efi" (see ./grub-core/osdep/linux/platform.c).
Grub's "configure" script has the ability to select which platform youwant to compile. For the "grub" package, we choose i386, and for the"grub-efi" package, we choose i386-efi.
The "grub-hybrid" package unions the "grub" and "grub-efi" packages,preferring files from the "grub-efi" package. I think thisconfiguration is what upstream actually tests (only).
In the "grub" package we then had the situation that it was compiledfor i386 (not EFI) but THEIR OWN default-platform function specifiedto use i386-efi which is some seriously strange stuff.
Do you think that this was not the cause?