This commit is contained in:
Disassembler 2018-09-05 19:34:21 +02:00
parent 260c8159c7
commit dd955c5e59
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499

View File

@ -81,9 +81,10 @@ def fix_world():
def run_script(): def run_script():
script_filename = os.path.join(LXC_ROOT, layers[-1], 'run.sh') script_filename = os.path.join(LXC_ROOT, layers[-1], 'run.sh')
with open(script_filename, 'w') as fd: with open(script_filename, 'w') as fd:
fd.write('#!/bin/sh\nset -ev\n')
fd.write(' && '.join([s for s in script])) fd.write(' && '.join([s for s in script]))
os.chmod(script_filename, 0o700) os.chmod(script_filename, 0o700)
subprocess.run(['lxc-execute', '-n', image, '--', '/bin/sh', '-lvc', '/run.sh'], check=True) subprocess.run(['lxc-execute', '-n', image, '--', '/bin/sh', '-lc', '/run.sh'], check=True)
os.unlink(script_filename) os.unlink(script_filename)
def copy_files(src, dst): def copy_files(src, dst):