mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 23:36:29 +00:00

MAJOR refactor. The volume is now abstracted into a model along with a partitionmap and partitions. Volumes and partitions are now controlled via an FSM to ensure that commands are called in the proper sequence. GRUB can now be installed properly onto loop devices by using dmsetup to fake a proper harddisk.
30 lines
550 B
Python
30 lines
550 B
Python
from partitions.singlepartition import SinglePartition
|
|
|
|
|
|
class NoPartitions(object):
|
|
|
|
def __init__(self, data):
|
|
root = data['root']
|
|
self.root = SinglePartition(root['size'], root['filesystem'])
|
|
self.mount_points = [('/', self.root)]
|
|
|
|
def get_total_size(self):
|
|
return self.root.size
|
|
|
|
def create(self, volume):
|
|
pass
|
|
|
|
def map(self, volume):
|
|
pass
|
|
|
|
def unmap(self, volume):
|
|
pass
|
|
|
|
def format(self):
|
|
self.root.format()
|
|
|
|
def mount_root(self, destination):
|
|
self.root.mount(destination)
|
|
|
|
def unmount_root(self):
|
|
self.root.unmount()
|