We cannot use the tool from within the tree unless we chroot (library versions ay be wring etc). If possible we want to always use tools from the build image, in order to avoid forcing the contenst of the target tree, so do that instead. Finally, add a missing include. Signed-off-by: Tom Gundersen <teg@jklm.no>
17 lines
392 B
Python
Executable file
17 lines
392 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def main(tree, options):
|
|
enabled_services = options["enabled_services"]
|
|
|
|
for service in enabled_services:
|
|
subprocess.run([f"systemctl", "--root", tree, "enable", service], check=True)
|
|
|
|
if __name__ == '__main__':
|
|
args = json.load(sys.stdin)
|
|
r = main(args["tree"], args["options"])
|
|
sys.exit(r)
|