diff --git a/bootstrapvz/providers/gce/__init__.py b/bootstrapvz/providers/gce/__init__.py index 6157bf6..895a33d 100644 --- a/bootstrapvz/providers/gce/__init__.py +++ b/bootstrapvz/providers/gce/__init__.py @@ -40,6 +40,7 @@ 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 1a98fca..57d305c 100644 --- a/bootstrapvz/providers/gce/tasks/initd.py +++ b/bootstrapvz/providers/gce/tasks/initd.py @@ -23,3 +23,15 @@ class AddGrowRootDisable(Task): 'etc/initramfs-tools/scripts/local-premount/gce-disable-growroot') copy(script_src, script_dst) os.chmod(script_dst, rwxr_xr_x) + + +class AdjustExpandRootDev(Task): + description = 'Adjusting the expand-root device' + phase = phases.system_modificatio + 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/loop0', '/dev/sda')