Bug 1088761 - rhts_partitions snippet should create /boot/efi for UEFI-based system
Summary: rhts_partitions snippet should create /boot/efi for UEFI-based system
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: lab controller
Version: 0.16
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: 0.17.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-17 07:01 UTC by Jun'ichi NOMURA
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-18 08:17:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Jun'ichi NOMURA 2014-04-17 07:01:26 UTC
Description of problem:
rhts_partitions snippet should create /boot/efi for UEFI-based system. The partition is needed by UEFI firmware to boot OS. Without the partition, either anaconda detects the problem and abort, or the system fails to boot after the installation.

Version-Release number of selected component (if applicable):
  beaker-0.16.1-1.el6eng

How reproducible:
  Always, depends on hardware

Steps to Reproduce:
1. Provision a system with RHEL6.5, adding "ondisk=sda" to Kickstart Metadata
2.
3.

Actual results:
Installation fails

Expected results:
Installation succeeds

Additional info:

When a recipe requires non-default partitioning (e.g. if ksmeta like partitions, ondisk, rootfstype and fstype are used), beaker sets up kickstart file to specifically create partitions.
However, it misses /boot/efi, which is required for UEFI-based system.

This is an excerpt from rhts_partitions:

  {% if distro_tree is arch('ia64') %}
  part /boot/efi --fstype vfat --size 200 --recommended
  {%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
  {% elif distro_tree is arch('ppc', 'ppc64') %}
  part None --fstype 'PPC PReP Boot' --size 8
  part /boot --size 200 --recommended --asprimary
  {%- if fstype %} --fstype {{ fstype }}{% endif %}
  {%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
  {% else %}
  part /boot --size 200 --recommended --asprimary
  {%- if fstype %} --fstype {{ fstype }}{% endif %}
  {%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
  {% endif %}

It should somehow detect whether the system is UEFI-based or not and then create /boot/efi instead of /boot, in the similar way as arch('ia64') case above.

If /boot/efi is not created for UEFI-based system, the installation will fail like this: (tested on RHEL6.5)

  ...
  Examining storage devices
  In progress
  
  The following errors occurred with your partitioning: 
  
  You have not created a /boot/efi partition.
  
  This can happen if there is not enough space on your hard drive(s) for the installation.

Comment 2 Dan Callaghan 2014-06-24 00:50:37 UTC
I filed bug 1112439 for recording the firmware type in Beaker. In the meantime we can examine the NETBOOT_METHOD key (NETBOOT_METHOD=efigrub means it booted in EFI mode).

Comment 3 Dan Callaghan 2014-06-24 01:47:37 UTC
On Gerrit: http://gerrit.beaker-project.org/3168

Comment 4 Jun'ichi NOMURA 2014-06-25 23:11:38 UTC
"ondisk" line is needed inside "if system.has_efi" block, too.

Quoted from Gerrit:
+{% if system and system.has_efi %}
+{# x86 EFI #}
+part /boot/efi --fstype vfat --size 200 --recommended
+{% else %}
+{# x86 BIOS #}
+part /boot --size 200 --recommended --asprimary
+{%- if fstype %} --fstype {{ fstype }}{% endif %}
+{%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
+{% endif %}

Expected:
+{% if system and system.has_efi %}
+{# x86 EFI #}
+part /boot/efi --fstype vfat --size 200 --recommended
+{%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
+{% else %}
+{# x86 BIOS #}
+part /boot --size 200 --recommended --asprimary
+{%- if fstype %} --fstype {{ fstype }}{% endif %}
+{%- if ondisk %} --ondisk={{ ondisk }}{% endif %}
+{% endif %}

Comment 5 Dan Callaghan 2014-06-25 23:23:41 UTC
(In reply to Jun'ichi NOMURA from comment #4)

Well spotted!

Comment 6 Dan Callaghan 2014-06-26 01:05:48 UTC
http://gerrit.beaker-project.org/3174

Comment 7 Jun'ichi NOMURA 2014-06-26 04:48:51 UTC
(In reply to Dan Callaghan from comment #2)
> In the
> meantime we can examine the NETBOOT_METHOD key (NETBOOT_METHOD=efigrub means
> it booted in EFI mode).

Do we have to set NETBOOT_METHOD=efigrub key/value pair manually in the inventory system?

Comment 8 Dan Callaghan 2014-06-26 04:54:27 UTC
(In reply to Jun'ichi NOMURA from comment #7)
> Do we have to set NETBOOT_METHOD=efigrub key/value pair manually in the
> inventory system?

It is populated automatically by /distribution/inventory, or you can set it manually.

Comment 9 Jun'ichi NOMURA 2014-06-26 05:04:21 UTC
beaker-distribution-inventory-1.2-3 is used in our lab currently
but NETBOOT_METDHO=efigrub was not set for EFI system.
Does the automatic registration need newer /distribution/inventory?

Comment 10 Dan Callaghan 2014-06-26 05:38:37 UTC
It could be because the NETBOOT_METHOD key is not defined in your Beaker installation.

The key was added in 2012, it is created automatically for new Beaker installations, but existing installations would need to add it manually as a non-numeric key type using Admin -> Key Types. Unfortunately we didn't have proper release notes back then, so this step was never noted anywhere.

Comment 11 Raymond Mancy 2014-06-26 05:57:31 UTC
I've added this for you Jun'ichi.

Comment 13 Dan Callaghan 2014-06-26 06:21:54 UTC
Notes for verification:

* This bug only affects recipes which use custom partitioning. When no custom partitions are defined, Beaker uses 'autopart' in the kickstart which tells Anaconda to figure out the right partitions itself. To trigger custom partitioning, you can just add a small custom partition with any mount point, for example <partition fs="ext4" name="mnt" size="1" />.

* You can search on the NETBOOT_METHOD key-value to find BIOS or EFI systems. NETBOOT_METHOD=pxe is x86 BIOS, NETBOOT_METHOD=efigrub is x86 EFI. IBM x3250 m4 systems have EFI firmware, KVM guests have BIOS firmware.

* x86 EFI is only supported on RHEL6+ and Fedora.

Suggested test cases:

* Check that Beaker recipes using custom partitioning run successfully on an x86 EFI system using RHEL6, RHEL7, and Fedora. Verify that /boot/efi partition is defined in the kickstart, and exists after installation.

* Check that Beaker recipes using custom partitioning still run successfully on x86 BIOS systems.

Comment 14 Jun'ichi NOMURA 2014-06-26 11:22:08 UTC
(In reply to Dan Callaghan from comment #10)
> It could be because the NETBOOT_METHOD key is not defined in your Beaker
> installation.
> 
> The key was added in 2012, it is created automatically for new Beaker
> installations, but existing installations would need to add it manually as a
> non-numeric key type using Admin -> Key Types. Unfortunately we didn't have
> proper release notes back then, so this step was never noted anywhere.

After NETBOOT_METHOD key is added and re-running /distribution/inventory, NETBOOT_METHOD=efigrub is added to the EFI system.
Thank you.

Comment 16 Dan Callaghan 2014-07-18 08:17:37 UTC
Beaker 0.17.1 has been released.


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