2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from bootstrapvz.common import phases
|
2014-01-30 11:44:26 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
class VirtIO(Task):
|
|
|
|
description = 'Install virtio modules'
|
|
|
|
phase = phases.system_modification
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2014-02-18 00:07:26 +01:00
|
|
|
modules = os.path.join(info.root, '/etc/initramfs-tools/modules')
|
2014-01-30 11:44:26 +01:00
|
|
|
with open(modules, "a") as modules_file:
|
2014-02-18 00:07:26 +01:00
|
|
|
modules_file.write("\n")
|
2014-02-23 20:48:42 +01:00
|
|
|
for module in info.manifest.system.get('virtio', []):
|
2014-02-23 20:27:41 +01:00
|
|
|
modules_file.write(module + "\n")
|