stages/systemd: minor fixes

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>
This commit is contained in:
Tom Gundersen 2019-06-18 23:54:23 +02:00
parent b38506a702
commit 4b69d02dc8

View file

@ -3,12 +3,13 @@
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"{tree}/usr/bin/systemctl", "--root", tree, "enable", service], check=True)
subprocess.run([f"systemctl", "--root", tree, "enable", service], check=True)
if __name__ == '__main__':
args = json.load(sys.stdin)