mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +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 .. import phases
|
||||
from ..exceptions import TaskError
|
||||
from ..tools import log_check_call
|
||||
from . import assets
|
||||
import os.path
|
||||
|
@ -57,14 +56,9 @@ class AdjustExpandRootScript(Task):
|
|||
|
||||
@classmethod
|
||||
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
|
||||
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()
|
||||
device_path = 'device_path="/dev/xvda{idx}"'.format(idx=root_idx)
|
||||
sed_i(script, '^device_path="/dev/xvda$', device_path)
|
||||
|
|
|
@ -60,11 +60,13 @@ def resolve_tasks(taskset, manifest):
|
|||
initd.RemoveHWClock,
|
||||
tasks.initd.AddEC2InitScripts,
|
||||
initd.InstallInitScripts,
|
||||
initd.AdjustExpandRootScript,
|
||||
|
||||
tasks.ami.RegisterAMI,
|
||||
])
|
||||
|
||||
if manifest.volume['partitions']['type'] != 'none':
|
||||
taskset.add(initd.AdjustExpandRootScript)
|
||||
|
||||
if manifest.system['bootloader'] == 'pvgrub':
|
||||
taskset.add(boot.AddGrubPackage)
|
||||
taskset.add(tasks.boot.ConfigurePVGrub)
|
||||
|
|
Loading…
Add table
Reference in a new issue