2013-07-10 10:49:45 +02:00
|
|
|
from base import Task
|
|
|
|
from common import phases
|
2013-08-10 19:01:54 +02:00
|
|
|
from common.tasks import packages
|
|
|
|
from common.tasks.host import CheckPackages
|
2013-07-10 10:49:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class HostPackages(Task):
|
|
|
|
description = 'Determining required host packages'
|
|
|
|
phase = phases.preparation
|
2013-08-10 19:01:54 +02:00
|
|
|
before = [CheckPackages]
|
|
|
|
after = [packages.HostPackages]
|
2013-07-10 10:49:45 +02:00
|
|
|
|
|
|
|
def run(self, info):
|
2013-09-22 15:43:50 +02:00
|
|
|
info.host_packages.update(['qemu-utils', 'parted', 'kpartx'])
|
2013-09-15 13:19:45 +02:00
|
|
|
if 'xfs' in (p.filesystem for p in info.volume.partition_map.partitions):
|
2013-08-10 19:01:54 +02:00
|
|
|
info.host_packages.add('xfsprogs')
|
2013-07-10 10:49:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ImagePackages(Task):
|
|
|
|
description = 'Determining required image packages'
|
|
|
|
phase = phases.preparation
|
2013-08-10 19:01:54 +02:00
|
|
|
after = [packages.ImagePackages]
|
2013-07-10 10:49:45 +02:00
|
|
|
|
|
|
|
def run(self, info):
|
|
|
|
manifest = info.manifest
|
2013-08-10 19:01:54 +02:00
|
|
|
include, exclude = info.img_packages
|
2013-07-10 10:49:45 +02:00
|
|
|
# Add some basic packages we are going to need
|
2013-09-20 16:08:53 +00:00
|
|
|
include.update(['grub2'])
|
2013-07-10 10:49:45 +02:00
|
|
|
|
|
|
|
# In squeeze, we need a special kernel flavor for xen
|
2013-07-30 14:13:30 +02:00
|
|
|
kernels = {'squeeze': {'amd64': 'linux-image-amd64',
|
|
|
|
'i386': 'linux-image-686', },
|
2013-07-10 10:49:45 +02:00
|
|
|
'wheezy': {'amd64': 'linux-image-amd64',
|
|
|
|
'i386': 'linux-image-686', }, }
|
|
|
|
include.add(kernels.get(manifest.system['release']).get(manifest.system['architecture']))
|