Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #440 from octivi/expand_root_path
Browse files Browse the repository at this point in the history
Change location of expand-root script and drop .sh extension
  • Loading branch information
andsens authored Jan 20, 2018
2 parents fe4782b + 44c5c17 commit a449d35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/expand_root/assets/expand-root.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ After=local-fs.target
Wants=local-fs.target

[Service]
ExecStart=/usr/bin/expand-root.sh DEVICE PARTITION FILESYSTEM
ExecStart=/usr/local/sbin/expand-root DEVICE PARTITION FILESYSTEM
Type=oneshot

[Install]
Expand Down
10 changes: 5 additions & 5 deletions bootstrapvz/plugins/expand_root/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class InstallExpandRootScripts(Task):

@classmethod
def run(cls, info):
expand_root_script = os.path.join(ASSETS_DIR, 'expand-root.sh')
expand_root_script = os.path.join(ASSETS_DIR, 'expand-root')
expand_root_service = os.path.join(ASSETS_DIR, 'expand-root.service')

expand_root_script_dest = os.path.join(info.root, 'usr/bin/expand-root.sh')
expand_root_script_dest = os.path.join(info.root, 'usr/local/sbin/expand-root')
expand_root_service_dest = os.path.join(info.root, 'etc/systemd/system/expand-root.service')

filesystem_type = info.manifest.plugins['expand_root'].get('filesystem_type')
Expand All @@ -49,10 +49,10 @@ def run(cls, info):
os.chmod(expand_root_script_dest, 0750)
shutil.copy(expand_root_service, expand_root_service_dest)

# Expand out options into expand-root.sh script.
# Expand out options into expand-root script.
opts = '%s %s %s' % (root_device, root_partition, filesystem_type)
sed_i(expand_root_service_dest, r'^ExecStart=/usr/bin/expand-root.sh.*$',
'ExecStart=/usr/bin/expand-root.sh %s' % opts)
sed_i(expand_root_service_dest, r'^ExecStart=/usr/local/sbin/expand-root.*$',
'ExecStart=/usr/local/sbin/expand-root %s' % opts)

# Enable systemd service
log_check_call(['chroot', info.root, 'systemctl', 'enable', 'expand-root.service'])

0 comments on commit a449d35

Please sign in to comment.