mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Add 1 sector gap between partitions on GPT
This commit is contained in:
parent
4d74c72d99
commit
9a50cea204
1 changed files with 8 additions and 0 deletions
|
@ -45,13 +45,21 @@ class GPTPartitionMap(AbstractPartitionMap):
|
||||||
self.boot = GPTPartition(Sectors(data['boot']['size'], sector_size),
|
self.boot = GPTPartition(Sectors(data['boot']['size'], sector_size),
|
||||||
data['boot']['filesystem'], data['boot'].get('format_command', None),
|
data['boot']['filesystem'], data['boot'].get('format_command', None),
|
||||||
'boot', last_partition())
|
'boot', last_partition())
|
||||||
|
# Offset all partitions by 1 sector.
|
||||||
|
# parted in jessie has changed and no longer allows partitions to be right next to each other.
|
||||||
|
self.boot.offset = Sectors(1, sector_size)
|
||||||
|
self.boot.size -= self.boot.offset
|
||||||
self.partitions.append(self.boot)
|
self.partitions.append(self.boot)
|
||||||
if 'swap' in data:
|
if 'swap' in data:
|
||||||
self.swap = GPTSwapPartition(Sectors(data['swap']['size'], sector_size), last_partition())
|
self.swap = GPTSwapPartition(Sectors(data['swap']['size'], sector_size), last_partition())
|
||||||
|
self.swap.offset = Sectors(1, sector_size)
|
||||||
|
self.swap.size -= self.swap.offset
|
||||||
self.partitions.append(self.swap)
|
self.partitions.append(self.swap)
|
||||||
self.root = GPTPartition(Sectors(data['root']['size'], sector_size),
|
self.root = GPTPartition(Sectors(data['root']['size'], sector_size),
|
||||||
data['root']['filesystem'], data['root'].get('format_command', None),
|
data['root']['filesystem'], data['root'].get('format_command', None),
|
||||||
'root', last_partition())
|
'root', last_partition())
|
||||||
|
self.root.offset = Sectors(1, sector_size)
|
||||||
|
self.root.size -= self.root.offset
|
||||||
self.partitions.append(self.root)
|
self.partitions.append(self.root)
|
||||||
|
|
||||||
# The last 34 sectors are reserved for the secondary GPT
|
# The last 34 sectors are reserved for the secondary GPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue