mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
18 lines
698 B
Python
18 lines
698 B
Python
from common.tools import log_check_call
|
|
from base import BasePartition
|
|
|
|
|
|
class GPTPartition(BasePartition):
|
|
|
|
def __init__(self, size, filesystem, format_command, name, previous):
|
|
self.name = name
|
|
super(GPTPartition, self).__init__(size, filesystem, format_command, previous)
|
|
|
|
def _before_create(self, e):
|
|
super(GPTPartition, self)._before_create(e)
|
|
# 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', e.volume.device_path,
|
|
'--', name_command])
|