mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Fix AdjustExpandRootScript
Also, only add it when it is required
This commit is contained in:
parent
a9558a729a
commit
40f208c151
2 changed files with 9 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
from bootstrapvz.base import Task
|
from bootstrapvz.base import Task
|
||||||
from .. import phases
|
from .. import phases
|
||||||
from ..exceptions import TaskError
|
|
||||||
from ..tools import log_check_call
|
from ..tools import log_check_call
|
||||||
from . import assets
|
from . import assets
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -57,14 +56,9 @@ class AdjustExpandRootScript(Task):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
if 'expand-root' not in info.initd['install']:
|
|
||||||
raise TaskError('The expand-root script was not installed')
|
|
||||||
|
|
||||||
from bootstrapvz.base.fs.partitionmaps.none import NoPartitions
|
|
||||||
if not isinstance(info.volume.partition_map, NoPartitions):
|
|
||||||
import os.path
|
import os.path
|
||||||
from ..tools import sed_i
|
from ..tools import sed_i
|
||||||
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()
|
||||||
device_path = 'device_path="/dev/xvda{idx}"'.format(idx=root_idx)
|
device_path = 'device_path="/dev/xvda{idx}"'.format(idx=root_idx)
|
||||||
sed_i(script, '^device_path="/dev/xvda$', device_path)
|
sed_i(script, '^device_path="/dev/xvda$', device_path)
|
||||||
|
|
|
@ -60,11 +60,13 @@ def resolve_tasks(taskset, manifest):
|
||||||
initd.RemoveHWClock,
|
initd.RemoveHWClock,
|
||||||
tasks.initd.AddEC2InitScripts,
|
tasks.initd.AddEC2InitScripts,
|
||||||
initd.InstallInitScripts,
|
initd.InstallInitScripts,
|
||||||
initd.AdjustExpandRootScript,
|
|
||||||
|
|
||||||
tasks.ami.RegisterAMI,
|
tasks.ami.RegisterAMI,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if manifest.volume['partitions']['type'] != 'none':
|
||||||
|
taskset.add(initd.AdjustExpandRootScript)
|
||||||
|
|
||||||
if manifest.system['bootloader'] == 'pvgrub':
|
if manifest.system['bootloader'] == 'pvgrub':
|
||||||
taskset.add(boot.AddGrubPackage)
|
taskset.add(boot.AddGrubPackage)
|
||||||
taskset.add(tasks.boot.ConfigurePVGrub)
|
taskset.add(tasks.boot.ConfigurePVGrub)
|
||||||
|
|
Loading…
Add table
Reference in a new issue