mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +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.
32 lines
665 B
Python
32 lines
665 B
Python
from base import Task
|
|
from common import phases
|
|
import filesystem
|
|
import volume
|
|
|
|
|
|
class PartitionVolume(Task):
|
|
description = 'Partitioning the volume'
|
|
phase = phases.volume_preparation
|
|
|
|
def run(self, info):
|
|
info.volume.partition()
|
|
|
|
|
|
class MapPartitions(Task):
|
|
description = 'Mapping volume partitions'
|
|
phase = phases.volume_preparation
|
|
before = [filesystem.Format]
|
|
after = [PartitionVolume]
|
|
|
|
def run(self, info):
|
|
info.volume.map()
|
|
|
|
|
|
class UnmapPartitions(Task):
|
|
description = 'Removing volume partitions mapping'
|
|
phase = phases.volume_unmounting
|
|
before = [volume.Detach]
|
|
after = [filesystem.UnmountRoot]
|
|
|
|
def run(self, info):
|
|
info.volume.unmap()
|