Merge pull request #344 from vorlock/master

Finishing touches for Stretch
This commit is contained in:
Anders Ingemann 2016-09-25 01:53:09 +02:00 committed by GitHub
commit 4fbfd795a9
4 changed files with 19 additions and 7 deletions

View file

@ -12,6 +12,7 @@ class InstallInitScripts(Task):
@classmethod @classmethod
def run(cls, info): def run(cls, info):
import stat import stat
from bootstrapvz.common.releases import jessie
rwxr_xr_x = (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | rwxr_xr_x = (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
stat.S_IRGRP | stat.S_IXGRP | stat.S_IRGRP | stat.S_IXGRP |
stat.S_IROTH | stat.S_IXOTH) stat.S_IROTH | stat.S_IXOTH)
@ -20,10 +21,16 @@ class InstallInitScripts(Task):
dst = os.path.join(info.root, 'etc/init.d', name) dst = os.path.join(info.root, 'etc/init.d', name)
copy(src, dst) copy(src, dst)
os.chmod(dst, rwxr_xr_x) os.chmod(dst, rwxr_xr_x)
log_check_call(['chroot', info.root, 'insserv', '--default', name]) if info.manifest.release > jessie:
log_check_call(['chroot', info.root, 'systemctl', 'enable', name])
else:
log_check_call(['chroot', info.root, 'insserv', '--default', name])
for name in info.initd['disable']: for name in info.initd['disable']:
log_check_call(['chroot', info.root, 'insserv', '--remove', name]) if info.manifest.release > jessie:
log_check_call(['chroot', info.root, 'systemctl', 'mask', name])
else:
log_check_call(['chroot', info.root, 'insserv', '--remove', name])
class AddExpandRoot(Task): class AddExpandRoot(Task):

View file

@ -101,6 +101,7 @@ class ShredHostkeys(Task):
def run(cls, info): def run(cls, info):
ssh_hostkeys = ['ssh_host_dsa_key', ssh_hostkeys = ['ssh_host_dsa_key',
'ssh_host_rsa_key'] 'ssh_host_rsa_key']
from bootstrapvz.common.releases import wheezy from bootstrapvz.common.releases import wheezy
if info.manifest.release >= wheezy: if info.manifest.release >= wheezy:
ssh_hostkeys.append('ssh_host_ecdsa_key') ssh_hostkeys.append('ssh_host_ecdsa_key')
@ -109,4 +110,5 @@ class ShredHostkeys(Task):
public = [path + '.pub' for path in private] public = [path + '.pub' for path in private]
from ..tools import log_check_call from ..tools import log_check_call
log_check_call(['shred', '--remove'] + private + public) log_check_call(['shred', '--remove'] + [key for key in private + public
if os.path.isfile(key)])

View file

@ -10,8 +10,10 @@ properties:
type: string type: string
enum: enum:
- wheezy - wheezy
- stable - oldstable
- jessie - jessie
- stable
- stretch
- testing - testing
- sid - sid
- unstable - unstable
@ -38,7 +40,7 @@ properties:
type: array type: array
properties: properties:
module: {type: string} module: {type: string}
position: { type: number} position: {type: number}
additionalProperties: false additionalProperties: false
required: [username] required: [username]
additionalProperties: false additionalProperties: false

View file

@ -49,7 +49,7 @@ def validate_manifest(data, validator, error):
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
from bootstrapvz.common.releases import wheezy, jessie from bootstrapvz.common.releases import wheezy, jessie, stable
taskset.update(task_groups.get_standard_groups(manifest)) taskset.update(task_groups.get_standard_groups(manifest))
taskset.update(task_groups.ssh_group) taskset.update(task_groups.ssh_group)
@ -80,12 +80,13 @@ def resolve_tasks(taskset, manifest):
taskset.add(tasks.network.EnableDHCPCDDNS) taskset.add(tasks.network.EnableDHCPCDDNS)
if manifest.release >= jessie: if manifest.release >= jessie:
taskset.add(apt.AddBackports)
taskset.add(tasks.tuning.SetCloudInitMountOptions) taskset.add(tasks.tuning.SetCloudInitMountOptions)
taskset.add(tasks.packages.AddWorkaroundGrowpart) taskset.add(tasks.packages.AddWorkaroundGrowpart)
taskset.add(initd.AdjustGrowpartWorkaround) taskset.add(initd.AdjustGrowpartWorkaround)
if manifest.system['bootloader'] == 'grub': if manifest.system['bootloader'] == 'grub':
taskset.add(grub.EnableSystemd) taskset.add(grub.EnableSystemd)
if manifest.release <= stable:
taskset.add(apt.AddBackports)
if manifest.provider.get('install_init_scripts', True): if manifest.provider.get('install_init_scripts', True):
taskset.add(tasks.initd.AddEC2InitScripts) taskset.add(tasks.initd.AddEC2InitScripts)