2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.common.tools import log_check_call
|
2013-09-18 00:46:58 +02:00
|
|
|
from gpt import GPTPartition
|
2013-09-15 13:19:45 +02:00
|
|
|
|
|
|
|
|
2013-09-18 00:46:58 +02:00
|
|
|
class GPTSwapPartition(GPTPartition):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""Represents a GPT swap partition
|
|
|
|
"""
|
2013-09-15 13:19:45 +02:00
|
|
|
|
|
|
|
def __init__(self, size, previous):
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-05-04 19:31:53 +02:00
|
|
|
:param Bytes size: Size of the partition
|
|
|
|
:param BasePartition previous: The partition that preceeds this one
|
2014-03-23 16:04:03 +01:00
|
|
|
"""
|
2014-02-23 17:52:05 +01:00
|
|
|
super(GPTSwapPartition, self).__init__(size, 'swap', None, 'swap', previous)
|
2013-09-15 13:19:45 +02:00
|
|
|
|
2013-09-22 21:20:09 +02:00
|
|
|
def _before_format(self, e):
|
2014-02-23 22:16:10 +01:00
|
|
|
log_check_call(['mkswap', self.device_path])
|