[services-openrc] Follow services-systemd configuration example

- Based on comments from #974, follow the configuration
   scheme from services-systemd, so with separate lists
   "services" and "disable". This ties it **slightly**
   less closely to the commands passed to rc-config.
main
Adriaan de Groot 7 years ago
parent dbcc419218
commit b02ee3cd8d

@ -36,7 +36,12 @@ class OpenrcController:
def __init__(self): def __init__(self):
self.root = libcalamares.globalstorage.value('rootMountPoint') self.root = libcalamares.globalstorage.value('rootMountPoint')
self.services = libcalamares.job.configuration.get('services', [])
# 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.initdDir = libcalamares.job.configuration['initdDir']
self.runlevelsDir = libcalamares.job.configuration['runlevelsDir'] self.runlevelsDir = libcalamares.job.configuration['runlevelsDir']

@ -13,25 +13,25 @@ initdDir: /etc/init.d
# runlevelsDir: holds the runlevels directory location # runlevelsDir: holds the runlevels directory location
runlevelsDir: /etc/runlevels runlevelsDir: /etc/runlevels
# services: each subkey of *services* is an action to take; # services: a list of entries to **enable**
# supported actions are "add" and "del". The each subkey # disable: a list of entries to **disable**
# has a list of entries as value, and each entry has two #
# fields: # Each entry has two fields:
# - name: the service name # - name: the service name
# - runlevel: can hold any runlevel present on the target system; # - runlevel: can hold any runlevel present on the target system;
# if no runlevel is provided, "default" is assumed. # if no runlevel is provided, "default" is assumed.
# #
# # Example services: # # Example services and disable settings:
# # - add foo1 to default # # - add foo1 to default
# # - add foo2 to nonetwork # # - add foo2 to nonetwork
# # - remove foo3 from default # # - remove foo3 from default
# services: # services:
# add:
# - name: foo1 # - name: foo1
# - name: foo2 # - name: foo2
# runlevel: nonetwork # runlevel: nonetwork
# del: # disable:
# - name: foo3 # - name: foo3
# runlevel: default # runlevel: default
services: [] services: []
disable: []

Loading…
Cancel
Save