mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
parent
22760c76db
commit
3131558691
1 changed files with 12 additions and 3 deletions
|
@ -97,9 +97,18 @@ class BasePartition(AbstractPartition):
|
||||||
"""Creates the partition
|
"""Creates the partition
|
||||||
"""
|
"""
|
||||||
from bootstrapvz.common.tools import log_check_call
|
from bootstrapvz.common.tools import log_check_call
|
||||||
# The create command is failry simple, start and end are just Bytes objects coerced into strings
|
# The create command is fairly simple:
|
||||||
create_command = ('mkpart primary {start} {end}'
|
# - fs_type is the partition filesystem, as defined by parted:
|
||||||
.format(start=str(self.get_start() + self.pad_start),
|
# fs-type can be one of "fat16", "fat32", "ext2", "HFS", "linux-swap",
|
||||||
|
# "NTFS", "reiserfs", or "ufs".
|
||||||
|
# - start and end are just Bytes objects coerced into strings
|
||||||
|
if self.filesystem == 'swap':
|
||||||
|
fs_type = 'linux-swap'
|
||||||
|
else:
|
||||||
|
fs_type = 'ext2'
|
||||||
|
create_command = ('mkpart primary {fs_type} {start} {end}'
|
||||||
|
.format(fs_type=fs_type,
|
||||||
|
start=str(self.get_start() + self.pad_start),
|
||||||
end=str(self.get_end() - self.pad_end)))
|
end=str(self.get_end() - self.pad_end)))
|
||||||
# Create the partition
|
# Create the partition
|
||||||
log_check_call(['parted', '--script', '--align', 'none', e.volume.device_path,
|
log_check_call(['parted', '--script', '--align', 'none', e.volume.device_path,
|
||||||
|
|
Loading…
Add table
Reference in a new issue