diff --git a/bootstrapvz/common/tasks/initd.py b/bootstrapvz/common/tasks/initd.py index f4537e3..4669b03 100644 --- a/bootstrapvz/common/tasks/initd.py +++ b/bootstrapvz/common/tasks/initd.py @@ -58,7 +58,6 @@ class AdjustExpandRootScript(Task): @classmethod def run(cls, info): from ..tools import sed_i - from bootstrapvz.common.releases import jessie script = os.path.join(info.root, 'etc/init.d/expand-root') root_idx = info.volume.partition_map.root.get_index() @@ -68,5 +67,14 @@ class AdjustExpandRootScript(Task): root_device_path = 'root_device_path="{device}"'.format(device=info.volume.device_path) sed_i(script, '^root_device_path="/dev/xvda"$', root_device_path) - if info.manifest.release >= jessie: - sed_i(script, '^growpart="growpart"$', 'growpart-workaround') + +class AdjustGrowpartWorkaround(Task): + description = 'Adjusting expand-root for growpart-workaround' + phase = phases.system_modification + predecessors = [AdjustExpandRootScript] + + @classmethod + def run(cls, info): + from ..tools import sed_i + script = os.path.join(info.root, 'etc/init.d/expand-root') + sed_i(script, '^growpart="growpart"$', 'growpart-workaround') diff --git a/bootstrapvz/providers/ec2/__init__.py b/bootstrapvz/providers/ec2/__init__.py index 21749c6..5fb2cee 100644 --- a/bootstrapvz/providers/ec2/__init__.py +++ b/bootstrapvz/providers/ec2/__init__.py @@ -83,6 +83,7 @@ def resolve_tasks(taskset, manifest): if manifest.release >= jessie: taskset.add(tasks.packages.AddWorkaroundGrowpart) + taskset.add(initd.AdjustGrowpartWorkaround) if manifest.provider.get('install_init_scripts', True): taskset.add(tasks.initd.AddEC2InitScripts) diff --git a/bootstrapvz/providers/gce/__init__.py b/bootstrapvz/providers/gce/__init__.py index 895a33d..6157bf6 100644 --- a/bootstrapvz/providers/gce/__init__.py +++ b/bootstrapvz/providers/gce/__init__.py @@ -40,7 +40,6 @@ def resolve_tasks(taskset, manifest): tasks.host.InstallHostnameHook, tasks.boot.ConfigureGrub, initd.AddExpandRoot, - tasks.initd.AdjustExpandRootDev, initd.InstallInitScripts, boot.BlackListModules, boot.UpdateInitramfs, diff --git a/bootstrapvz/providers/gce/tasks/initd.py b/bootstrapvz/providers/gce/tasks/initd.py index f2b20bc..1a98fca 100644 --- a/bootstrapvz/providers/gce/tasks/initd.py +++ b/bootstrapvz/providers/gce/tasks/initd.py @@ -1,23 +1,10 @@ from bootstrapvz.base import Task from bootstrapvz.common import phases -from bootstrapvz.common.tasks import initd from bootstrapvz.common.tasks import kernel from . import assets import os.path -class AdjustExpandRootDev(Task): - description = 'Adjusting the expand-root device' - phase = phases.system_modification - predecessors = [initd.AddExpandRoot, initd.AdjustExpandRootScript] - - @classmethod - def run(cls, info): - from bootstrapvz.common.tools import sed_i - script = os.path.join(info.root, 'etc/init.d/expand-root') - sed_i(script, '/dev/xvda', '/dev/sda') - - class AddGrowRootDisable(Task): description = 'Add script to selectively disable growroot' phase = phases.system_modification