mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Label GPT partitions
This commit is contained in:
parent
889812b1ad
commit
1e97600013
1 changed files with 10 additions and 5 deletions
|
@ -10,10 +10,15 @@ class GPTPartition(BasePartition):
|
|||
|
||||
def _before_create(self, e):
|
||||
start = self.get_start()
|
||||
# {name} only works for gpt, for msdos that becomes the part-type (primary, extended, logical)
|
||||
parted_command = ('mkpart primary {start}MiB {end}MiB'
|
||||
.format(name=self.name,
|
||||
start=str(start),
|
||||
create_command = ('mkpart primary {start}MiB {end}MiB'
|
||||
.format(start=str(start),
|
||||
end=str(start + self.size)))
|
||||
log_check_call(['/sbin/parted', '--script', '--align', 'none', e.volume.device_path,
|
||||
'--', parted_command])
|
||||
'--', create_command])
|
||||
|
||||
# partition name only works for gpt, for msdos that becomes the part-type (primary, extended, logical)
|
||||
name_command = ('name {idx} {name}'
|
||||
.format(idx=self.get_index(),
|
||||
name=self.name))
|
||||
log_check_call(['/sbin/parted', '--script', '--align', 'none', e.volume.device_path,
|
||||
'--', name_command])
|
||||
|
|
Loading…
Add table
Reference in a new issue