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:
Jesse Szwedko 2016-01-12 19:12:57 +00:00 committed by Andrew Garrett
parent bbcb62c4f3
commit 7f9ee9d22c
3 changed files with 8 additions and 4 deletions

View file

@ -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
}

View file

@ -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')

View file

@ -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)