From 93e46baa4a2fef67a0f2c824599e8a4db8807530 Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 23 Jan 2017 16:16:22 +0100 Subject: [PATCH] [services] adopt Marcus' modifications for Manjaro --- src/modules/services/main.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/services/main.py b/src/modules/services/main.py index e195faff4..55c720c3f 100644 --- a/src/modules/services/main.py +++ b/src/modules/services/main.py @@ -3,8 +3,9 @@ # # === This file is part of Calamares - === # -# Copyright 2014, Philip Müller +# Copyright 2014-2016, Philip Müller # Copyright 2014, Teo Mrnjavac +# Copyright 2016, Artoo # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,6 +21,7 @@ # along with Calamares. If not, see . import libcalamares +from os.path import join, exists def run(): @@ -27,6 +29,7 @@ def run(): services = libcalamares.job.configuration['services'] targets = libcalamares.job.configuration['targets'] disable = libcalamares.job.configuration['disable'] + rootmnt = libcalamares.globalstorage.value("rootMountPoint") # note that the "systemctl enable" and "systemctl disable" commands used # here will work in a chroot; in fact, they are the only systemctl commands @@ -67,5 +70,17 @@ def run(): else: libcalamares.utils.debug("Cannot disable systemd service {}".format(dbl['name'])) libcalamares.utils.debug("systemctl disable call in chroot returned error code {}".format(ec)) + + if libcalamares.globalstorage.contains("displayManagers"): + for dm in libcalamares.globalstorage.value("displayManagers"): + if not exists(join(rootmnt, "etc/systemd/system/display-manager.service")): + ec = libcalamares.utils.target_env_call(['systemctl', 'enable', '{}.service'.format(dm)]) + + if ec != 0: + return "Cannot enable systemd service {}".format(dm), \ + "systemctl enable call in chroot returned error code {}".format(ec) + else: + libcalamares.utils.debug("Cannot enable systemd service {}".format(dm)) + libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec)) return None