Merge "Editing follow-up for UEFI Software RAID support"

This commit is contained in:
Zuul 2020-04-07 13:18:44 +00:00 committed by Gerrit Code Review
commit bdc5e9448d
3 changed files with 17 additions and 14 deletions

View File

@ -360,12 +360,12 @@ def _prepare_boot_partitions_for_softraid(device, holders, efi_part,
:param device: the softraid device path :param device: the softraid device path
:param holders: the softraid drive members :param holders: the softraid drive members
:param efi_part: when relevant the efi partition coming from the image :param efi_part: when relevant the efi partition coming from the image
deployed on softraid device, can be/is often None deployed on softraid device, can be/is often None
:param target_boot_mode: target boot mode can be bios/uefi/None :param target_boot_mode: target boot mode can be bios/uefi/None
or anything else for unspecified or anything else for unspecified
:returns: the efi partition paths on softraid disk holders when target :returns: the efi partition paths on softraid disk holders when target
boot mode is uefi, empty list otherwise. boot mode is uefi, empty list otherwise.
""" """
efi_partitions = [] efi_partitions = []
@ -387,6 +387,7 @@ def _prepare_boot_partitions_for_softraid(device, holders, efi_part,
if efi_part: if efi_part:
efi_part = '{}p{}'.format(device, efi_part) efi_part = '{}p{}'.format(device, efi_part)
LOG.info("Creating EFI partitions on software RAID holder disks")
# We know that we kept this space when configuring raid,see # We know that we kept this space when configuring raid,see
# hardware.GenericHardwareManager.create_configuration. # hardware.GenericHardwareManager.create_configuration.
# We could also directly get the EFI partition size. # We could also directly get the EFI partition size.
@ -414,11 +415,11 @@ def _prepare_boot_partitions_for_softraid(device, holders, efi_part,
target_part = target_part.splitlines()[-1].split(':', 1)[0] target_part = target_part.splitlines()[-1].split(':', 1)[0]
LOG.debug("Efi partition %s created on disk holder %s", LOG.debug("EFI partition %s created on holder disk %s",
target_part, holder) target_part, holder)
if efi_part: if efi_part:
LOG.debug("Relocating efi %s to holder part %s", efi_part, LOG.debug("Relocating EFI %s to holder part %s", efi_part,
target_part) target_part)
# Blockdev copy # Blockdev copy
utils.execute("cp", efi_part, target_part) utils.execute("cp", efi_part, target_part)
@ -710,6 +711,7 @@ class ImageExtension(base.BaseAgentExtension):
device = hardware.dispatch_to_managers('get_os_install_device') device = hardware.dispatch_to_managers('get_os_install_device')
iscsi.clean_up(device) iscsi.clean_up(device)
boot = hardware.dispatch_to_managers('get_boot_info') boot = hardware.dispatch_to_managers('get_boot_info')
# FIXME(arne_wiebalck): make software RAID work with efibootmgr
if (boot.current_boot_mode == 'uefi' if (boot.current_boot_mode == 'uefi'
and not hardware.is_md_device(device)): and not hardware.is_md_device(device)):
has_efibootmgr = True has_efibootmgr = True

View File

@ -1570,10 +1570,11 @@ class GenericHardwareManager(HardwareManager):
# 1. Create boot partitions in prevision # 1. Create boot partitions in prevision
# 2. Just leave space # 2. Just leave space
# 3. Do nothing: rely on the caller to specify target_raid_config # 3. Do nothing: rely on the caller to specify target_raid_config
# correctly according to what they intend to do (eg not set MAX if # correctly according to what they intend to do (e.g. not set MAX
# they know they will need some space for bios boot or efi parts. # if they know they will need some space for bios boot or efi
# (Best option imo, if we accept that the target volume granularity # parts). Best option imo, if we accept that the target volume
# is GiB, so you lose up to 1GiB just for a bios boot partition...) # granularity is GiB, so you lose up to 1GiB just for a bios boot
# partition...
if target_boot_mode == 'uefi': if target_boot_mode == 'uefi':
# Leave 129MiB - start_sector s for the esp (approx 128MiB) # Leave 129MiB - start_sector s for the esp (approx 128MiB)
# NOTE: any image efi partition is expected to be less # NOTE: any image efi partition is expected to be less

View File

@ -1,12 +1,12 @@
--- ---
features: features:
| - |
- Adds UEFI boot support for Software RAID, and for partition table Adds UEFI boot support for Software RAID, and for partition table
creation based upon boot mode in use. creation based upon boot mode in use.
upgrade: upgrade:
| - |
- The type of the partition table created for Software RAID is now based The type of the partition table created for Software RAID is now based
upon the boot mode in use (GPT for UEFI or if explicitly passed via the upon the boot mode in use (GPT for UEFI or if explicitly passed via the
instance's capabilities or the node's properties, otherwise MSDOS). instance's capabilities or the node's properties, otherwise MSDOS).
- The amount of reserved space on the drives now also depends on the boot The amount of reserved space on the drives now also depends on the boot
mode (128MiB for UEFI/GPT, 8MiB for BIOS/GPT, and one sector otherwise). mode (128MiB for UEFI/GPT, 8MiB for BIOS/GPT, and one sector otherwise).