RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1418609 - 30_os-prober generates incorrect menuentry definitions
Summary: 30_os-prober generates incorrect menuentry definitions
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grub2
Version: 7.3
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Peter Jones
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-02 10:31 UTC by Vit Ry
Modified: 2021-01-15 07:31 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1108296
Environment:
Last Closed: 2021-01-15 07:31:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vit Ry 2017-02-02 10:31:23 UTC
+++ This bug was initially created as a clone of Bug #1108296 +++

Description of problem:
Sometimes (most of the time) I believe that os-prober and associated code should be abandon.  There has got to be a better way to support customization and multi-boot.  Peasonally, I use 40_custom with hand-crafted files to chainload configfiles.

Anyway, the code currently in rawhide is broken.  I have identified two problems:

1. Bother linux and initrd rather than linux16 and initrd16 are used.  Instead of just forcing linux16/initrd16, 30_os-prober should look at the secondary system and use linux/initrd or linux16/initrd16 that the system uses.

2. The operands for linux are missing.  The result is that sometimes you can boot and sometimes not.

Version-Release number of selected component (if applicable):
grub2-2.02-0.44, os-prober-1.58-9

How reproducible:
everytime

--- Additional comment from Gene Czarcinski on 2014-06-11 14:51:55 EDT ---

A related but different problem is that os-prober's linux-boot-prober cannot handle linux16/initrd16 and produces no output for those menuentries.  Sigh!

--- Additional comment from Gene Czarcinski on 2014-06-12 11:39:37 EDT ---

To function properly, this patch needs the patch sumitted for bug #1108344.

--- Additional comment from Gene Czarcinski on 2014-06-12 15:40:34 EDT ---

Test the updates.  Updates grub2-2.02 and os-prober rpms are available here:
   http://czarc.org/fedora/repo/21/

--- Additional comment from Gene Czarcinski on 2014-06-12 15:43:04 EDT ---

Test the updates.  Updates grub2-2.02 and os-prober rpms are available here:
   http://czarc.org/fedora/repo/21/

--- Additional comment from Hedayat Vatankhah on 2014-06-13 01:18:14 EDT ---

I will fix os-prober soon. Will grub2 be fixed soon too?

--- Additional comment from Gene Czarcinski on 2014-06-13 08:14:16 EDT ---

Since 30_prober and os-prober flat do not work currently without the grub2 & os-prober patches, I consider that this problem is a Fedora 21 alpha blocker.  This should be fixed sooner ratrher than later.  But that is just my opinion ;)

--- Additional comment from Gene Czarcinski on 2014-06-17 15:34:34 EDT ---

Includes bugfix to limit kernel options to parameter 6 returned by linux-boot-prober.

--- Additional comment from Gene Czarcinski on 2014-10-24 07:46:32 EDT ---

The patch is still valid for grub2-2.02-0.8 and is a problem in Fedora 21.

See the other half of the solution in bz#1108344 where there is a p[atch for os-prober.

Either patch can be applied first as it takes both to implement the fix and currently, broken is broken.

To see the problem:

1. install Fedora21 on a system (real of virtura).

2. Install a second installation of Fedora 21 in different partitions.

3. Upon bootup of installation 2 (last installed gets the mbr) and note that the grub2 menu does NOT have the other system entries.

--- Additional comment from Peter Jones on 2014-10-27 09:30:37 EDT ---

Well, since Hedayat didn't accept the part of the os-prober patch that actually tells us what stanzas it found in the foreign config file, I had to implement this a different way.

I think with this patch we should generally be right, but the case where the running OS is booted via EFI and the foreign OS is booted via the CSM will be wrong on x86 platforms.

--- Additional comment from Gene Czarcinski on 2014-10-27 09:44:13 EDT ---

Yes, Hedayat believes that os-prober should not be telling grub2 what to do and the grub2 developers will not take ownership of os-prober.

To be honest, I believe that os-prober is a bad idea and chaining configfile is far better.  I do not use os-prober any more.

--- Additional comment from Fedora Update System on 2014-10-27 10:46:26 EDT ---

grub2-2.02-0.10.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/grub2-2.02-0.10.fc21

--- Additional comment from Fedora Update System on 2014-10-28 06:06:35 EDT ---

Package grub2-2.02-0.10.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub2-2.02-0.10.fc21'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-13799/grub2-2.02-0.10.fc21
then log in and leave karma (feedback).

--- Additional comment from Hedayat Vatankhah on 2014-10-29 12:36:49 EDT ---

Actually, I wonder what is the correct entry for the case when one OS is installed in EFI mode and the other in BIOS mode. When the grub is loaded in former mode, should it try to load both kernels in EFI mode using linuxefi (was it?), or should it try to boot the BIOS mode kernel using linux/linux16? I guessed that the latter wouldn't work, and both of them should be loaded using linuxefi.

If not, so it would be beneficial to provide such info by os-prober. However, the output format should be general enough (e.g. a boot mode field which contains something like this: EFI, BIOS_16, BIOS_32) so that it can be provided for other OSes too. So, if the info is really relevant, I'll add it in one way or the other.

--- Additional comment from Fedora Update System on 2014-11-02 02:27:45 EST ---

grub2-2.02-0.10.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from Adam Williamson on 2014-11-07 17:48:35 EST ---

Note the fix for this had a small bug and doesn't work in -10. In grub2-2.02-0.11.fc21 (in Koji currently, should be in updates-testing soon) it should work correctly. See https://bugzilla.redhat.com/show_bug.cgi?id=964828#c23 .

--- Additional comment from Adam Williamson on 2014-11-07 18:54:23 EST ---

Couple of notes here:

1) I'm curious as to what Gene meant by "2. The operands for linux are missing.  The result is that sometimes you can boot and sometimes not.". It seems like he's suggesting that Fedora's grub2 (non-UEFI) can't/couldn't boot entries of the form 'linux (somekernel)' (as opposed to 'linux16 (somekernel)'), but from my look at the source that doesn't seem like it can be right. The introduction of 'linux16' happened years ago upstream (2009), the only thing we changed in Fedora/RHEL recently was to start using 'linux16' rather than 'linux' *by default*, but I don't see that Peter ever patched grub to not work with plain 'linux', which would be a pretty weird thing to do. There are implications both here and in https://bugzilla.redhat.com/show_bug.cgi?id=964828#c12 that somehow plain 'linux' didn't work, but I *think* they must be mistaken. Perhaps they got confused by UEFI reports (the 'linux' command really doesn't exist in our grub2-efi).

2) Peter - when you say "I think with this patch we should generally be right, but the case where the running OS is booted via EFI and the foreign OS is booted via the CSM will be wrong on x86 platforms." - is there actually anything *right* we can do there? I thought it's not possible to do a BIOS boot from a UEFI bootloader. Theoretically I suppose we could possibly do a UEFI native boot of an OS that was intended to be a BIOS native install - it seems like that might work to at least some extent - but it'd probably get very confused when it tried to update its kernel, and I'm not sure we actually want to do that.

Is the right thing to do there just to try as hard as possible not to generate entries for the other type of install at all?

--- Additional comment from Gene Czarcinski on 2014-11-08 11:35:40 EST ---

OK, what I meant is that /etc/grub.d/30_os-prober does not have sufficient information to determine if the other installation used linux/initrd (32 bit) or linux16/initrd16.

It could be that it does not matter and linux16/initrd16 will work for any "recent" Fedora release.  If that is the case, then just go with Peter's solution of forceing linux16/initrd16 because it will work.

If there is some really weird corner case the a user can disable os-prober and create a simple /etc/grub.d/40_custom menuentry which chains grub2/grub.cfg files.

--- Additional comment from Adam Williamson on 2014-11-08 11:42:49 EST ---

Gene: my reading is that 99% of the time a system that boots with 'linux' will boot with 'linux16', and vice versa. The things the 16-bit loader has that the 32-bit loader doesn't are at least (briefly) documented - support for some 'BIOS features' (APM and EDD are mentioned specifically), and for the vga= parameter (32-bit loader requires gfxmode= and can translate some common vga= parameters into gfxmode= ). It's systems that need the 'BIOS features' that need linux16 rather than linux, AIUI - the bug report that caused the switch in Fedora/RHEL was from a RHEL customer who had hardware whose storage did not work with the 32-bit loader because it needed EDD.

I think it would be 'most correct' to preserve the original directive - as explained in https://bugzilla.redhat.com/show_bug.cgi?id=1108344#c15 - but 99% of the time it's not actually going to cause *problems* to 'translate' 'linux' into 'linux16' or vice versa.

--- Additional comment from D. Hugh Redelmeier on 2015-04-03 15:23:34 EDT ---

I seem to have this problem on Fedora 20.  I mistakenly wrote it up in https://bugzilla.redhat.com/show_bug.cgi?id=1108344 (see #17 through #21).  Hedayat Vatankhah says that this bz is the correct one.

Recap: 

On Fedora 20, on a UEFI system, grub2-mkconfig builds grub entries for CentOS 7 that use initrd and kernel commands where the initrdefi and kernelefi are required.

Fedora 20 (with all current updates) uses
os-prober-1.58-8,
grub2-efi-2.00-27
grub2-tools-2.00-27
grubby-8.28-1

Could someone fix this?  My guess: by back-porting grub2-2.02-0.10 or better and perhaps os-prober-1.58-11 or better to Fedora 20.

Comment 3 RHEL Program Management 2021-01-15 07:31:16 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.