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 1749583 - bootloader --leavebootorder does not work on UEFI systems
Summary: bootloader --leavebootorder does not work on UEFI systems
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: Documentation
Version: 8.1
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.2
Assignee: Sagar Dubewar
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-05 22:55 UTC by Jeff Bastian
Modified: 2024-12-20 18:53 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-12 07:59:01 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeff Bastian 2019-09-05 22:55:34 UTC
Description of problem:
I tried using 'bootloader --leavebootorder' in a RHEL8 kickstart on a UEFI aarch64 (64-bit ARM) server, but the --leavebootorder option did not work as intended.  Instead, it created a duplicate boot entry for "Red Hat Enterprise Linux" and put the new duplicate first in the UEFI BootOrder (which means it did _not_ leave the boot order alone).

The program.log from Anaconda shows the issue.  Note how the newly created 000F entry is first in the BootOrder, and it's a duplicate of the older 000E entry.


22:42:44,988 INF program: Running in chroot '/mnt/sysimage'... efibootmgr -c -w -L Red Hat Enterprise Linux -d /dev/sda -p 1 -l \EFI\redhat\shimaa64.efi
22:42:46,659 INF program: efibootmgr: ** Warning ** : Boot000E has same label Red Hat Enterprise Linux
22:42:46,659 INF program: BootCurrent: 0008
22:42:46,660 INF program: Timeout: 0 seconds
22:42:46,660 INF program: BootOrder: 000F,0006,0007,0008,0009,000A,000B,000C,000D,0005,000E,0000,0002,0003,0004,0001
22:42:46,661 INF program: Boot0000* System Utilities
22:42:46,661 INF program: Boot0001  Embedded UEFI Shell
22:42:46,662 INF program: Boot0002  Diagnose Error
22:42:46,662 INF program: Boot0003  Network Boot
22:42:46,663 INF program: Boot0004  HTTP Boot
22:42:46,663 INF program: Boot0005* Embedded SATA Port 1 HDD : XR0120GEBLT
22:42:46,664 INF program: Boot0006* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (HTTP IPv4)
22:42:46,664 INF program: Boot0007* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (HTTP IPv6)
22:42:46,664 INF program: Boot0008* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (PXE IPv4)
22:42:46,665 INF program: Boot0009* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (PXE IPv6)
22:42:46,665 INF program: Boot000A* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (HTTP IPv4) 2
22:42:46,666 INF program: Boot000B* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (HTTP IPv6) 2
22:42:46,666 INF program: Boot000C* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (PXE IPv4) 2
22:42:46,667 INF program: Boot000D* Embedded LOM 1 Port 1 : Port 1 - Mellanox Network Adapter - NIC (PXE IPv6) 2
22:42:46,667 INF program: Boot000E* Red Hat Enterprise Linux
22:42:46,668 INF program: Boot000F* Red Hat Enterprise Linux
22:42:46,668 DBG program: Return code: 0


Version-Release number of selected component (if applicable):
RHEL-8.1.0
anaconda 29.19.1.11-1.el8

How reproducible:
always

Steps to Reproduce:
1. kickstart a UEFI aarch64 system with 'bootloader --leavebootorder'
2.
3.

Actual results:
a duplicate boot entry is created and placed first in the BootOrder list

Expected results:
no duplicates are created and the BootOrder remains unchanged

Additional info:

Comment 6 Jeff Bastian 2019-09-05 23:06:06 UTC
The current code for --leavebootorder is fairly simple for UEFI systems:

    def install(self, args=None):
        if not flags.leavebootorder:
            self.remove_efi_boot_target()
        self.add_efi_boot_target()

https://github.com/rhinstaller/anaconda/blob/rhel-8/pyanaconda/bootloader.py#L1842


I'm guessing this code assumes that adding a target with the same label will replace the existing target with the same label.  Obviously that's not the case here, so it must be dependent on the firmware implementation.

Instead, I think the code will need to make a note of the current BootOrder, then remove the old target and add the new target, and finally restore the BootOrder originally noted. Although it's possible the new target will have a different Boot00xx number, so it could get a bit more complicated.

Comment 7 Jiri Konecny 2019-09-12 08:41:30 UTC
Could bootloader developers please look on this and tell us what they think could be the problem here?

Comment 9 Jeff Bastian 2019-09-12 17:28:20 UTC
The documentation is different upstream; it does not say the new OS will be at the top of the list.

    --leavebootorder
    On EFI or ISeries/PSeries machines, this option prevents the installer from making changes to the existing list of bootable images.
    New in version Fedora18.

https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#bootloader

It seems there is some confusion or ambiguity on what exactly this option should do.

Comment 14 Samantha N. Bueno 2020-04-21 00:12:31 UTC
Flipping this bz over to documentation. This should get routed over to the installation docs team.

As for what exactly needs to be corrected, I am now confused as well. As Jeff noted, the upstream and RHEL docs differ. Our own internal notes about this differ. And looking at the code, the behavior seems to differ based on a few factors as well.

Let me talk to someone on the team to try and sort this out properly.

I'll set needinfo on myself in the meantime.

Comment 16 Daniel Juarez 2020-09-09 15:17:52 UTC
I would not say this is a matter of documentation. The clear deviation from upstream while using the same parameter and behaving differently seems like a clear bug that should be addressed. For RHEL7 it might be too late but not for RHEL8.

Think about https://github.com/rhinstaller/anaconda/blame/master/docs/boot-options.rst#L680:


Boot the drives in their existing order, to override the default of booting into
the newly installed drive on Power Systems servers and EFI systems. This is
useful for systems that, for example, should network boot first before falling
back to a local boot.

This is the usual workflow for some datacenters, and on UEFI a fresh install alters bootorder due to this, making consecutive network installations impossible without altering back the order. Dirty workarounds are needed to address this change of behaviour.

Comment 18 Pavel Holica 2021-03-11 07:23:19 UTC
Note there's also Fedora bug 1456353 I've filed some time ago, but unfortunately didn't get any attention :/

Comment 19 Pavel Holica 2021-03-11 07:36:10 UTC
There's also other related bug 1456404

Comment 30 Red Hat Bugzilla 2023-09-15 00:18:34 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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