Add required packages in the right places

This commit is contained in:
Anders Ingemann 2013-10-27 09:10:37 +01:00
parent 0fdcc2e27b
commit a07e02cfcc
2 changed files with 11 additions and 9 deletions

View file

@ -7,8 +7,12 @@ class HostPackages(Task):
phase = phases.preparation phase = phases.preparation
def run(self, info): def run(self, info):
packages = set(['debootstrap']) info.host_packages = set()
info.host_packages = packages info.host_packages.add('debootstrap')
from base.fs.partitionmaps.none import NoPartitions
if not isinstance(info.volume.partition_map, NoPartitions):
info.host_packages.update(['parted', 'kpartx'])
class ImagePackages(Task): class ImagePackages(Task):
@ -16,9 +20,7 @@ class ImagePackages(Task):
phase = phases.preparation phase = phases.preparation
def run(self, info): def run(self, info):
# Add some basic packages we are going to need info.img_packages = set(), set()
include, exclude = info.img_packages
# We could bootstrap without locales, but things just suck without them, error messages etc. # We could bootstrap without locales, but things just suck without them, error messages etc.
include = set(['locales']) include.add('locales')
exclude = set()
info.img_packages = include, exclude

View file

@ -11,7 +11,7 @@ class HostPackages(Task):
after = [packages.HostPackages] after = [packages.HostPackages]
def run(self, info): def run(self, info):
info.host_packages.update(['qemu-utils', 'parted', 'kpartx']) info.host_packages.add('qemu-utils')
if 'xfs' in (p.filesystem for p in info.volume.partition_map.partitions): if 'xfs' in (p.filesystem for p in info.volume.partition_map.partitions):
info.host_packages.add('xfsprogs') info.host_packages.add('xfsprogs')
@ -25,7 +25,7 @@ class ImagePackages(Task):
manifest = info.manifest manifest = info.manifest
include, exclude = info.img_packages include, exclude = info.img_packages
# Add some basic packages we are going to need # Add some basic packages we are going to need
include.update(['grub2']) include.add('grub2')
# In squeeze, we need a special kernel flavor for xen # In squeeze, we need a special kernel flavor for xen
kernels = {'squeeze': {'amd64': 'linux-image-amd64', kernels = {'squeeze': {'amd64': 'linux-image-amd64',