From e5dd68acc74ffcd62819a6b8d14e44d5d6d1deb0 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Mon, 19 Jan 2015 17:19:27 +0100 Subject: [PATCH] Extlinux booting on gpt now working --- bootstrapvz/base/fs/partitionmaps/gpt.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bootstrapvz/base/fs/partitionmaps/gpt.py b/bootstrapvz/base/fs/partitionmaps/gpt.py index 0a402ad..afae06a 100644 --- a/bootstrapvz/base/fs/partitionmaps/gpt.py +++ b/bootstrapvz/base/fs/partitionmaps/gpt.py @@ -36,8 +36,6 @@ class GPTPartitionMap(AbstractPartitionMap): from ..partitions.unformatted import UnformattedPartition grub_size = Sectors('1MiB', sector_size) - primary_gpt.size 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) # The boot and swap partitions are optional @@ -71,6 +69,14 @@ class GPTPartitionMap(AbstractPartitionMap): if hasattr(self, 'grub_boot'): 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) def _before_create(self, event):