From 2b629d784c5306d6b8955fb6b94e5300688048d8 Mon Sep 17 00:00:00 2001 From: Zach Marano Date: Thu, 3 Mar 2016 13:59:01 -0800 Subject: [PATCH] Again fix the expand-root script for GCE. The volume is not /dev/loop0 but it should be /dev/sda. --- bootstrapvz/providers/gce/__init__.py | 1 + bootstrapvz/providers/gce/tasks/initd.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) 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')