mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Move hack for growpart to its own task.
This commit is contained in:
parent
6c03860eac
commit
3f208b985f
2 changed files with 12 additions and 1 deletions
|
@ -58,7 +58,6 @@ class AdjustExpandRootScript(Task):
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
from ..tools import sed_i
|
from ..tools import sed_i
|
||||||
from bootstrapvz.common.releases import jessie
|
|
||||||
script = os.path.join(info.root, 'etc/init.d/expand-root')
|
script = os.path.join(info.root, 'etc/init.d/expand-root')
|
||||||
|
|
||||||
root_idx = info.volume.partition_map.root.get_index()
|
root_idx = info.volume.partition_map.root.get_index()
|
||||||
|
@ -68,5 +67,16 @@ class AdjustExpandRootScript(Task):
|
||||||
root_device_path = 'root_device_path="{device}"'.format(device=info.volume.device_path)
|
root_device_path = 'root_device_path="{device}"'.format(device=info.volume.device_path)
|
||||||
sed_i(script, '^root_device_path="/dev/xvda"$', root_device_path)
|
sed_i(script, '^root_device_path="/dev/xvda"$', root_device_path)
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
from bootstrapvz.common.releases import jessie
|
||||||
|
|
||||||
if info.manifest.release >= jessie:
|
if info.manifest.release >= jessie:
|
||||||
sed_i(script, '^growpart="growpart"$', 'growpart-workaround')
|
sed_i(script, '^growpart="growpart"$', 'growpart-workaround')
|
||||||
|
|
|
@ -89,6 +89,7 @@ def resolve_tasks(taskset, manifest):
|
||||||
|
|
||||||
if manifest.volume['partitions']['type'] != 'none':
|
if manifest.volume['partitions']['type'] != 'none':
|
||||||
taskset.add(initd.AdjustExpandRootScript)
|
taskset.add(initd.AdjustExpandRootScript)
|
||||||
|
taskset.add(initd.AdjustGrowpartWorkaround)
|
||||||
|
|
||||||
if manifest.system['bootloader'] == 'pvgrub':
|
if manifest.system['bootloader'] == 'pvgrub':
|
||||||
taskset.add(grub.AddGrubPackage)
|
taskset.add(grub.AddGrubPackage)
|
||||||
|
|
Loading…
Add table
Reference in a new issue