mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
sed in root_device_path into expand-root
To make it more flexible Signed-off-by: Andrew Garrett <andrew.garrett@getbraintree.com>
This commit is contained in:
parent
4e94880b2a
commit
2ece5a66e1
2 changed files with 7 additions and 2 deletions
|
@ -18,14 +18,15 @@ hash growpart 2> /dev/null || {
|
|||
exit 1
|
||||
}
|
||||
|
||||
root_device_path="/dev/xvda"
|
||||
root_index="0"
|
||||
|
||||
growpart /dev/xvda $root_index || {
|
||||
growpart $root_device_path $root_index || {
|
||||
$logger "growpart failed. Unable to expand size."
|
||||
exit 1
|
||||
}
|
||||
|
||||
device_path="/dev/xvda$root_index"
|
||||
device_path="${root_device_path}${root_index}"
|
||||
filesystem=$(blkid -s TYPE -o value ${device_path})
|
||||
|
||||
case $filesystem in
|
||||
|
|
|
@ -59,6 +59,10 @@ class AdjustExpandRootScript(Task):
|
|||
def run(cls, info):
|
||||
from ..tools import sed_i
|
||||
script = os.path.join(info.root, 'etc/init.d/expand-root')
|
||||
|
||||
root_idx = info.volume.partition_map.root.get_index()
|
||||
root_index_line = 'root_index="{idx}"'.format(idx=root_idx)
|
||||
sed_i(script, '^root_index="0"$', root_index_line)
|
||||
|
||||
root_device_path = 'root_device_path="{device}"'.format(device=info.volume.device_path)
|
||||
sed_i(script, '^root_device_path="/dev/xvda"$', root_device_path)
|
||||
|
|
Loading…
Add table
Reference in a new issue