mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
Subtract gpt_offset from first real partition
... and not from grub_boot
This commit is contained in:
parent
d85ad7f598
commit
01208c61b5
1 changed files with 7 additions and 5 deletions
|
@ -18,6 +18,7 @@ class GPTPartitionMap(AbstractPartitionMap):
|
|||
if bootloader == 'grub':
|
||||
from ..partitions.unformatted import UnformattedPartition
|
||||
self.grub_boot = UnformattedPartition(Bytes('1007KiB'), last_partition())
|
||||
self.grub_boot.offset = gpt_offset
|
||||
self.grub_boot.flags.append('bios_grub')
|
||||
self.partitions.append(self.grub_boot)
|
||||
|
||||
|
@ -28,15 +29,16 @@ class GPTPartitionMap(AbstractPartitionMap):
|
|||
if 'swap' in data:
|
||||
self.swap = GPTSwapPartition(Bytes(data['swap']['size']), last_partition())
|
||||
self.partitions.append(self.swap)
|
||||
self.root = GPTPartition(Bytes(data['root']['size']), data['root']['filesystem'], 'root', last_partition())
|
||||
self.root = GPTPartition(Bytes(data['root']['size']), data['root']['filesystem'],
|
||||
'root', last_partition())
|
||||
self.partitions.append(self.root)
|
||||
|
||||
if hasattr(self, 'grub_boot'):
|
||||
self.partitions[1].size -= gpt_offset
|
||||
self.partitions[1].size -= self.grub_boot.size
|
||||
|
||||
# Offset for GPT partitioning table
|
||||
self.partitions[0].offset = gpt_offset
|
||||
self.partitions[0].size -= self.partitions[0].offset
|
||||
else:
|
||||
self.partitions[0].offset = gpt_offset
|
||||
self.partitions[0].size -= gpt_offset
|
||||
|
||||
super(GPTPartitionMap, self).__init__(bootloader)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue