mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Write Jessie growpart workaround script to something other than growpart
In case growpart is installed. Sed this workaround path into the init.d script. Signed-off-by: Andrew Garrett <andrew.garrett@getbraintree.com>
This commit is contained in:
parent
bbcb62c4f3
commit
7f9ee9d22c
3 changed files with 8 additions and 4 deletions
|
@ -13,15 +13,17 @@
|
|||
prog=$(basename $0)
|
||||
logger="logger -t $prog"
|
||||
|
||||
hash growpart 2> /dev/null || {
|
||||
$logger "growpart was not found on PATH. Unable to expand size."
|
||||
growpart="growpart"
|
||||
|
||||
hash $growpart 2> /dev/null || {
|
||||
$logger "$growpart was not found on PATH. Unable to expand size."
|
||||
exit 1
|
||||
}
|
||||
|
||||
root_device_path="/dev/xvda"
|
||||
root_index="0"
|
||||
|
||||
growpart $root_device_path $root_index || {
|
||||
$growpart $root_device_path $root_index || {
|
||||
$logger "growpart failed. Unable to expand size."
|
||||
exit 1
|
||||
}
|
||||
|
|
|
@ -66,3 +66,5 @@ 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)
|
||||
|
||||
sed_i(script, '^growpart="growpart"$', 'growpart-workaround')
|
||||
|
|
|
@ -27,5 +27,5 @@ class AddWorkaroundGrowpart(Task):
|
|||
from shutil import copy
|
||||
from . import assets
|
||||
src = os.path.join(assets, 'bin/growpart')
|
||||
dst = os.path.join(info.root, 'usr/bin/growpart')
|
||||
dst = os.path.join(info.root, 'usr/bin/growpart-workaround')
|
||||
copy(src, dst)
|
||||
|
|
Loading…
Add table
Reference in a new issue