DevHeads.net

Wiki page correction: GRUB2

Hello,

I'd like to propose tiny correction for the Fedora wiki page about GRUB2 [1].

However I'm not confident enought to edit it prior to any discussions,
so that's why I'm writing here.

In the chapter "Updating GRUB 2 configuration on UEFI systems"
In the section "Install the bootloader files"
I believe, there should be an information added, that the 'grub2-efi'
package *must* match your architecture. So e.g. for x86_64, you want
the 'grub2-efi-x64' package.

By default the 'dnf install grub2-efi' will find 'grub2-efi-ia32'
package which doesn't contain the files you need for boot on x86_64
system, nor pulls the correct package as a dependency.

Also, on once of my old F28 Cinnamon system, I can see, that there are packages:
$ dnf list installed | grep grub2-efi | awk '{ print $1 }'
grub2-efi-ia32.x86_64
grub2-efi-ia32-cdboot.x86_64
grub2-efi-x64.x86_64
grub2-efi-x64-cdboot.x86_64

but I believe I only need the 'grub2-efi-x64.x86_64'.
Given that, maybe the anaconda installation should be checked to not
pull uneeded packages?

Correct me, if I'm wrong, thanks.

[1] <a href="https://fedoraproject.org/wiki/GRUB_2" title="https://fedoraproject.org/wiki/GRUB_2">https://fedoraproject.org/wiki/GRUB_2</a>

Comments

Re: Wiki page correction: GRUB2

By Chris Murphy at 05/29/2019 - 19:43

On Wed, May 29, 2019 at 5:52 AM Michal Schorm < ... at redhat dot com> wrote:
No. You can have x86_64 CPU but the firmware is 32-bit, hence ia32
which is why there is:

grub2-efi-ia32-1:2.02-81.fc30.x86_64.rpm

The user space will still be 64-bit but the EFI binaries will be
32-bit for the rare firmware floating out there that require it. There
isn't a problem with 32-bit and 64-bit EFI binaries being located on
the same EFI system volume in EFI/fedora, the firmware figures it out
(I think by filenaming convention which is mentioned in the UEFI
spec).

My suggested change for this section:

Re: Wiki page correction: GRUB2

By Adam Williamson at 05/30/2019 - 11:25

On Wed, 2019-05-29 at 17:43 -0600, Chris Murphy wrote:

Re: Wiki page correction: GRUB2

By Chris Murphy at 05/30/2019 - 12:29

On Thu, May 30, 2019 at 9:26 AM Adam Williamson
< ... at fedoraproject dot org> wrote:
Right. And the original command works there.

I think we have a packaging problem on x86_64. On a cleanly installed
Fedora 31 Workstation, I have

shim-x64-15-8.x86_64
shim-ia32-15-8.x86_64
grub2-pc-2.02-84.fc31.x86_64
grub2-efi-ia32-cdboot-2.02-84.fc31.x86_64
grub2-tools-extra-2.02-84.fc31.x86_64
grub2-tools-efi-2.02-84.fc31.x86_64
grub2-tools-minimal-2.02-84.fc31.x86_64
grub2-pc-modules-2.02-84.fc31.noarch
grub2-tools-2.02-84.fc31.x86_64
grub2-efi-x64-2.02-84.fc31.x86_64
grub2-common-2.02-84.fc31.noarch
grub2-efi-x64-cdboot-2.02-84.fc31.x86_64
grub2-efi-ia32-2.02-84.fc31.x86_64

If I remove:
shim-x64-15-8.x86_64
shim-ia32-15-8.x86_64
grub2-efi-x64-2.02-84.fc31.x86_64
grub2-efi-x64-cdboot-2.02-84.fc31.x86_64
grub2-efi-ia32-2.02-84.fc31.x86_64
grub2-efi-ia32-cdboot-2.02-84.fc31.x86_64

And then:
# dnf install grub2-efi shim

I get the following (edited for legibility)

Installing:
grub2-efi-ia32
shim-x64

That is obviously wrong, it could never work. On x86_64 the original
command should install 32-bit and 64-bit shim and GRUB EFI binaries.

Re: Wiki page correction: GRUB2

By Adam Williamson at 05/30/2019 - 12:39

On Thu, 2019-05-30 at 10:29 -0600, Chris Murphy wrote:
But...your suggestion is to remove both of the original commands...you
put '-' next to both those lines.

Re: Wiki page correction: GRUB2

By Chris Murphy at 05/30/2019 - 13:29

On Thu, May 30, 2019 at 10:40 AM Adam Williamson
< ... at fedoraproject dot org> wrote:
Yes, the suggestion is flawed.

Re: Wiki page correction: GRUB2

By Adam Williamson at 05/30/2019 - 12:39

On Thu, 2019-05-30 at 10:29 -0600, Chris Murphy wrote:
Well, it's sort of a problem, because both the packages provide 'grub2-
efi' and dnf's behaviour in this case is to pick one, not install both.

The only way to get both installed when you call 'dnf install grub2-
efi' would be to have some sort of dependency relationship between
them, I guess.

Re: Wiki page correction: GRUB2

By Chris Murphy at 05/30/2019 - 13:26

On Thu, May 30, 2019 at 10:39 AM Adam Williamson
< ... at fedoraproject dot org> wrote:
How does netinstall handle this? I'm guessing it must be true anaconda
checks sysfs for firmware bitness, and is explicitly installing only
the correct shim and grub2 EFI packages for that bitness.

Sounds good.

But, what is the use case we're trying to solve with this wiki? The
case where the user intentionally removed GRUB, perhaps in favor of
some other bootloader, changed their mind, and they now want to
install GRUB again? Why is it missing in the first place? I don't
really care about that use case, and would demote it to the end of the
wiki. And really, those users don't need install instructions. What
they need is a decoder ring so they know the minimum GRUB packages by
name they need to install per arch and firmware type, and maybe
firmware bitness. They just need a chart.

The use case I care about, are those who have had GRUB inadvertently
stepped on through no (or only a little) fault of their own. This
helps folks on #fedora and users@ who keep having to repeat themselves
for this use case, where they could just say "here read this simple
wiki". When the wiki is not concise, and instead is a giant text wall
of idiosyncratic workarounds for obscure problems almost no one else
is bound to have, it isn't nearly as useful.

Looking at the GRUB2 wiki, I'd like to chop out 3/4ths of it. Much of
it is obsolete, without even considering Fedora 30's bootloaderspec
changes.

Re: Wiki page correction: GRUB2

By Adam Williamson at 05/29/2019 - 15:28

On Wed, 2019-05-29 at 13:50 +0200, Michal Schorm wrote:
That sounds correct, yes. For background, IIRC this split was done to
allow the special case of Baytrail-like systems (which have 64-bit CPUs
and on which you can install an x86_64 OS, but whose firmwares are 32-
bit and so require a 32-bit EFI bootloader) to work. I *think* on such
systems both grub2-efi-x64 and grub2-efi-ia32 is needed, but IMBW.

Current anaconda is designed to do this - it has a check to only
install grub2-efi-ia32 on systems with a 32-bit firmware. I'm not sure
if this wasn't in place when you installed, or if it went wrong
somehow...

Re: Wiki page correction: GRUB2

By Jared K. Smith at 05/29/2019 - 14:50

Be bold and just update the page... it's a wiki, so it keeps a change
history, and if someone else has a problem with what you wrote, they can
either update it or roll back the changes. You shouldn't ever feel like
you have to ask permission or have the details 100% correct before updating
something on the wiki.

Re: Wiki page correction: GRUB2

By Michal Schorm at 05/29/2019 - 15:20

I'm not looking for a permission.
I'm looking for a sanity check.

I personaly take care of several wiki pages. If that would be a
subject I understand well and I'm confident in, I'd edit right away.
I also take it as a chance, that someone may spot it's not right and
uncover some packaging issue by it.

The fact It's a wiki IMHO doesn't imply anyone *should* edit it
without being confident about it.

Re: Wiki page correction: GRUB2

By Michal Schorm at 05/29/2019 - 11:37

Also, it's IMHO worth mentioning, a package 'grub2-pc-modules' is
needed on BIOS systems in order to 'grub2-install' utility to work