summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-03-23 07:21:17 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2019-03-23 07:21:17 -0400
commit4e8f4c2f06d980ce53cf937a1bd16a37cb4a2c6f (patch)
tree8bc727b13b00b9ad348eb968b86436ec7045b300
parent89611c7111cdb8b970ac15da089f5ddc64b3b2b1 (diff)
adapt for openrc/systemd option
-rw-r--r--src/modules/services-openrc/main.py23
-rw-r--r--src/modules/services-openrc/services-openrc.conf24
-rw-r--r--src/modules/services-systemd/main.py29
-rw-r--r--src/modules/services-systemd/services-systemd.conf20
4 files changed, 59 insertions, 37 deletions
diff --git a/src/modules/services-openrc/main.py b/src/modules/services-openrc/main.py
index c3e14b481..9506c44a2 100644
--- a/src/modules/services-openrc/main.py
+++ b/src/modules/services-openrc/main.py
@@ -35,15 +35,22 @@ class OpenrcController:
"""
def __init__(self):
+ #desktop_key = libcalamares.globalstorage.value(GS::DESKTOP_KEY)
+ desktop_key = libcalamares.globalstorage.value('default-desktop') # TODO:
+ cfg = libcalamares.job.configuration
+ cfg['services'] += cfg.get('services' , []) + cfg.get(desktop_key + '-services' , [])
+
self.root = libcalamares.globalstorage.value('rootMountPoint')
# Translate the entries in the config to the actions passed to rc-config
- self.services = dict()
- self.services["add"] = libcalamares.job.configuration.get('services', [])
- self.services["del"] = libcalamares.job.configuration.get('disable', [])
- self.initdDir = libcalamares.job.configuration['initdDir']
- self.runlevelsDir = libcalamares.job.configuration['runlevelsDir']
+ self.services = dict()
+
+ self.services["add"] = cfg.get('services', [])
+ self.services["del"] = cfg.get('disable', [])
+
+ self.initdDir = cfg['initdDir']
+ self.runlevelsDir = cfg['runlevelsDir']
def update(self, state):
"""
@@ -99,6 +106,12 @@ class OpenrcController:
return r
def run():
+ #init_key = libcalamares.globalstorage.value(GS::INITSYSTEM_KEY)
+ init_key = libcalamares.globalstorage.value('default-initsystem') # TODO:
+
+ if init_key != 'openrc': return None
+
+
"""
Setup services
"""
diff --git a/src/modules/services-openrc/services-openrc.conf b/src/modules/services-openrc/services-openrc.conf
index b8255b21a..e631b8c99 100644
--- a/src/modules/services-openrc/services-openrc.conf
+++ b/src/modules/services-openrc/services-openrc.conf
@@ -41,6 +41,26 @@ runlevelsDir: /etc/runlevels
# - name: foo3
# runlevel: default
# - foo4
-services: []
-disable: []
+services:
+ - name: "alsasound"
+ mandatory: false
+ - name: "dbus"
+ mandatory: true
+ - name: "elogind"
+ mandatory: false
+ - name: "haveged"
+ mandatory: false
+ - name: "NetworkManager"
+ mandatory: false
+lxde-services:
+ - name: "lxdm"
+ mandatory: true
+
+mate-services:
+ - name: "lightdm"
+ mandatory: true
+
+disable:
+ - name: "pacman-init"
+ mandatory: false
diff --git a/src/modules/services-systemd/main.py b/src/modules/services-systemd/main.py
index 7488f0a18..67488ffd9 100644
--- a/src/modules/services-systemd/main.py
+++ b/src/modules/services-systemd/main.py
@@ -62,15 +62,19 @@ def systemctl(targets, command, suffix):
def run():
+ #init_key = libcalamares.globalstorage.value(GS::INITSYSTEM_KEY)
+ #desktop_key = libcalamares.globalstorage.value(GS::DESKTOP_KEY )
+ init_key = libcalamares.globalstorage.value('default-initsystem') # TODO:
+ desktop_key = libcalamares.globalstorage.value('default-desktop' ) # TODO:
+
+ if init_key != 'systemd': return None
+
+
"""
Setup systemd services
"""
- setServices()
-
- cfg = libcalamares.job.configuration
- services = cfg['services']
- targets = cfg['targets']
- disable = cfg['disable']
+ cfg = libcalamares.job.configuration
+ cfg['services'] += cfg.get('services' , []) + cfg.get(desktop_key + '-services' , [])
# note that the "systemctl enable" and "systemctl disable" commands used
# here will work in a chroot; in fact, they are the only systemctl commands
@@ -97,18 +101,5 @@ def run():
if r is not None:
return r
-
# This could have just been return r
return None
-
-
-def setServices():
- #init_key = libcalamares.globalstorage.value(GS::INITSYSTEM_KEY)
- #desktop_key = libcalamares.globalstorage.value(GS::DESKTOP_KEY )
- init_key = libcalamares.globalstorage.value('default-initsystem') # TODO:
- desktop_key = libcalamares.globalstorage.value('default-desktop' ) # TODO:
- config = libcalamares.job.configuration
- config['services'] = config[init_key + '-services'] + \
- config[desktop_key + '-services']
- config['targets' ] = config[init_key + '-targets' ]
- config['disable' ] = config[init_key + '-disable' ]
diff --git a/src/modules/services-systemd/services-systemd.conf b/src/modules/services-systemd/services-systemd.conf
index c4afc6efc..6b1066f2d 100644
--- a/src/modules/services-systemd/services-systemd.conf
+++ b/src/modules/services-systemd/services-systemd.conf
@@ -63,17 +63,11 @@
# - mandatory: true
# By default, no changes are made.
-services: [] # deferred
-targets: [] # deferred
-disable: [] # deferred
-disable-targets: []
-mask: []
-
-systemd-services:
- - name: "NetworkManager"
- mandatory: false
+services:
- name: "cups"
mandatory: false
+ - name: "NetworkManager"
+ mandatory: false
lxde-services:
- name: "lxdm"
@@ -83,10 +77,14 @@ mate-services:
- name: "lightdm"
mandatory: true
-systemd-targets:
+targets:
- name: "graphical"
mandatory: true
-systemd-disable:
+disable:
- name: "pacman-init"
mandatory: false
+
+disable-targets: []
+
+mask: []