[master/f21] Ignore partition start if there is a biosboot partition (#1044849)
Vratislav Podzimek
vpodzime at redhat.com
Wed Oct 8 06:51:19 UTC 2014
On Tue, 2014-10-07 at 17:39 -0700, Brian C. Lane wrote:
> A biosboot partition can be anywhere on the disk, it doesn't need to be
> the first. When there is one the first partition can start lower than
> without one.
> ---
> pyanaconda/bootloader.py | 27 +++++++++++++++++----------
> 1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> index b3492ee..1bc10c9 100644
> --- a/pyanaconda/bootloader.py
> +++ b/pyanaconda/bootloader.py
> @@ -1626,20 +1626,27 @@ class GRUB2(GRUB):
> if not self.stage1_disk:
> return False
>
> - # If the first partition starts too low show an error.
> + # If the first partition starts too low and there is no biosboot partition show an error.
> + error_msg = None
> + biosboot = False
> parts = self.stage1_disk.format.partedDisk.partitions
> for p in parts:
> - start = p.geometry.start * p.disk.device.sectorSize
> - if not p.getFlag(PARTITION_BIOS_GRUB) and start < min_start:
> - msg = _("%(deviceName)s may not have enough space for grub2 to embed "
> - "core.img when using the %(fsType)s file system on %(deviceType)s") \
> - % {"deviceName": self.stage1_device.name, "fsType": self.stage2_device.format.type,
> - "deviceType": self.stage2_device.type}
> - log.error(msg)
> - self.errors.append(msg)
> - ret = False
> + if p.getFlag(PARTITION_BIOS_GRUB):
> + biosboot = True
> break
>
> + start = p.geometry.start * p.disk.device.sectorSize
> + if start < min_start:
> + error_msg = _("%(deviceName)s may not have enough space for grub2 to embed "
> + "core.img when using the %(fsType)s file system on %(deviceType)s") \
> + % {"deviceName": self.stage1_device.name, "fsType": self.stage2_device.format.type,
> + "deviceType": self.stage2_device.type}
> +
> + if error_msg and not biosboot:
> + log.error(error_msg)
> + self.errors.append(error_msg)
> + ret = False
> +
> return ret
>
> class EFIGRUB(GRUB2):
Looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list