Extlinux booting on gpt now working

This commit is contained in:
Anders Ingemann 2015-01-19 17:19:27 +01:00
parent 0e19b4c1ed
commit e5dd68acc7

View file

@ -36,8 +36,6 @@ class GPTPartitionMap(AbstractPartitionMap):
from ..partitions.unformatted import UnformattedPartition from ..partitions.unformatted import UnformattedPartition
grub_size = Sectors('1MiB', sector_size) - primary_gpt.size grub_size = Sectors('1MiB', sector_size) - primary_gpt.size
self.grub_boot = UnformattedPartition(grub_size, last_partition()) self.grub_boot = UnformattedPartition(grub_size, last_partition())
# Mark the partition as a bios_grub partition
self.grub_boot.flags.append('bios_grub')
self.partitions.append(self.grub_boot) self.partitions.append(self.grub_boot)
# The boot and swap partitions are optional # The boot and swap partitions are optional
@ -71,6 +69,14 @@ class GPTPartitionMap(AbstractPartitionMap):
if hasattr(self, 'grub_boot'): if hasattr(self, 'grub_boot'):
self.root.size -= self.grub_boot.size self.root.size -= self.grub_boot.size
# Set the boot flag on the right partition
if hasattr(self, 'grub_boot'):
# Mark the partition as a bios_grub partition
self.grub_boot.flags.append('bios_grub')
else:
# Mark the boot partition, or root, if boot does not exist
getattr(self, 'boot', self.root).flags.append('legacy_boot')
super(GPTPartitionMap, self).__init__(bootloader) super(GPTPartitionMap, self).__init__(bootloader)
def _before_create(self, event): def _before_create(self, event):