mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Merge pull request #301 from zmarano/master
Fix expand-root so it works correctly on GCE and other providers
This commit is contained in:
commit
41597d2700
4 changed files with 12 additions and 17 deletions
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue