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 1469821 - Update to RHEL 7 kickstart documentation option --leavebootorder
Summary: Update to RHEL 7 kickstart documentation option --leavebootorder
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-Installation_Guide
Version: 7.4
Hardware: Unspecified
OS: Linux
high
unspecified
Target Milestone: rc
: ---
Assignee: Lenka Kimlickova
QA Contact: ecs-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1470091
TreeView+ depends on / blocked
 
Reported: 2017-07-11 22:03 UTC by Devon
Modified: 2019-03-06 02:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-20 14:44:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Devon 2017-07-11 22:03:16 UTC
Document URL: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html

Section Number and Name: 24.3.2 Kickstart Commands and Options

Describe the issue: A customer was requesting that the --leavebootorder be more clear that it does not leave the boot order exactly as is.

Suggestions for improvement: 

The customer would just like the docs to clearly state that the boot order is not left completely unchanged as they had expected. In the words of the customer:
"Suggestion:  The documentation about --leavebootorder is missing notes about how it interacts, or can be superseded by --driveorder.  The concept of what "leavebootorder" actually is intended to do should be clarified as well.  The fact that Anaconda always changes the bootorder (efi mode) and puts linux at the top should be clear too."

Additional information: 


From the findings on how --leavebootorder actually works

We were able to confirm that this is the default and expected behavior.

    # man efibootmgr

     An  OS  installer  would call efibootmgr -c.  This assumes that /boot/efi is your EFI System Partition, and is mounted at /dev/sda1.  This creates a new boot option, called "Linux", and puts it at the top of the boot order list.

I have noted that our internal documentation is misleading and as such I will open a bug to get the description of what the --leavebootorder option does.

##################################################

class EFIBase(object):

...

    def efibootmgr(self, *args, **kwargs):
        if flags.imageInstall or flags.dirInstall:
            log.info("Skipping efibootmgr for image/directory install.")
            return ""

        if "noefi" in flags.cmdline:
            log.info("Skipping efibootmgr for noefi")
            return ""

        if kwargs.pop("capture", False):
            exec_func = iutil.execWithCapture
        else:
            exec_func = iutil.execWithRedirect
        if "root" not in kwargs:
            kwargs["root"] = iutil.getSysroot()

        return exec_func("efibootmgr", list(args), **kwargs)

...

    def _add_single_efi_boot_target(self, partition):
        boot_disk = partition.disk
        boot_part_num = str(partition.parted_partition.number)

        rc = self.efibootmgr(
            "-c", "-w", "-L", productName.split("-")[0],  # pylint: disable=no-member
            "-d", boot_disk.path, "-p", boot_part_num,
            "-l", self.efi_dir_as_efifs_dir + self._efi_binary,  # pylint: disable=no-member
            root=iutil.getSysroot()
        )
        if rc:
            raise BootLoaderError("failed to set new efi boot target. This is most likely a kernel or firmware bug.")


...

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

##############################################

The --leavebootorder only prevents the installation from running the remove_efi_boot_target() which would have otherwise gone through all of the entries and used a command such as efibootmgr("-b", slot_id, "-B") to remove the other installed products such as old rhel installations. 

From the logs, we can see that the following command is run by the installer. 

    21:59:43,329 INFO program: Running... efibootmgr -c -w -L Red Hat Enterprise Linux -d /dev/nvme0n1 -p 1 -l \EFI\redhat\shim.efi

And this has the effect of adding the entry to the list and making it first in the boot order.

21:59:43,406 INFO program: BootOrder: 0009,000C,000C,000C,000C,000A,000B,000E,0000,0001,0002,0003,0004,0005,0006,0007,0008,000D
21:59:43,406 INFO program: Boot0000  Startup Menu
21:59:43,406 INFO program: Boot0001  System Information
21:59:43,406 INFO program: Boot0002  Bios Setup
21:59:43,406 INFO program: Boot0003  3rd Party Option ROM Management
21:59:43,406 INFO program: Boot0004  System Diagnostics
21:59:43,406 INFO program: Boot0005  System Diagnostics
21:59:43,407 INFO program: Boot0006  System Diagnostics
21:59:43,407 INFO program: Boot0007  System Diagnostics
21:59:43,407 INFO program: Boot0008  Boot Menu
21:59:43,407 INFO program: Boot000A* Red Hat Enterprise Linux
21:59:43,407 INFO program: Boot000B* IPV6 Network - Intel(R) Ethernet Connection (2) I218-LM
21:59:43,407 INFO program: Boot000C* IPV4 Network - Intel(R) Ethernet Connection (2) I218-LM
21:59:43,407 INFO program: Boot000D  Network Boot
21:59:43,407 INFO program: Boot000E* hp PLDS DVDROM DU8RESH
21:59:43,408 INFO program: Boot000F  USB:
21:59:43,408 INFO program: Boot0010* hp PLDS DVDROM DU8RESH
21:59:43,408 INFO program: Boot0011* hp PLDS DVDROM DU8RESH
21:59:43,408 INFO program: Boot0013* NVMe Drive
21:59:43,408 INFO program: Boot0009* Red Hat Enterprise Linux

This is caused by the _add_single_efi_boot_target() which will always be run to add the new install:

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

Thus, the --leavebootorder option is intended to leave previous OS installation's EFI boot entries. The installer will always add rhel as the first entry based on the above findings.


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