FS#69125 - [grub] Package not reproducible on EFI systems

Attached to Project: Arch Linux
Opened by Fergus Dall (sidereal) - Sunday, 27 December 2020, 07:19 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:14 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: The grub-install man page includes the following line for the "--target" option:
"install GRUB for TARGET platform [default=%s]; available targets: %s"
where the first %s is replaced with the default value, and the second by the list of available values.

The default value of this parameter depends on both build-time and run-time checks, defined in the function "get_default_platform" in util/grub-install.c

In particular, when built for x86 systems, it delegates to grub_install_get_default_x86_platform in grub-core/osdep/linux/platform.c , which checks if the system it's running on is EFI based or not and returns different results on this basis. This is pulled into the help output, which is pulled into the man page by help2man, which means the man page will have different contents depending on the system used to build it. Additionally, if grub is then installed on a system with different configuration, the man page will actually be incorrect about the defaults for grub-install.

Steps to reproduce:
1) Acquire an EFI based system (or possibly one using ieee-1275 Open Firmware
2) Install package "archlinux-repro" via pacman
3) Download grub-2:2.04-8-x86_64.pkg.tar.zst from an archive or mirror
4) Run "repro /path/to/downloaded/grub-2:2.04-8-x86_64.pkg.tar.zst"
5) (Optional) Run "diffoscope ./build/grub-2:2.04-8-x86_64.pkg.tar.zst /path/to/downloaded/grub-2:2.04-8-x86_64.pkg.tar.zst" to see differences
6) (Optional) Run "grub-install --help" and "man grub-install" and observe that they list different defaults for "--target", the first will show "default=x86_64-efi" and the second will show "default=i386-pc"
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:14 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/grub/issues/3
Comment by Toolybird (Toolybird) - Sunday, 11 June 2023, 03:37 GMT
Interesting. It also shows up on the Arch repro status page [1]. Do you have any thoughts on how best to fix this?

[1] https://reproducible.archlinux.org/
Comment by Christian Hesse (eworm) - Monday, 12 June 2023, 05:22 GMT
We would have to patch the source, to always have the same default target. Does "default=x86_64-efi" make sense here?
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...