summaryrefslogtreecommitdiffstats
path: root/core/modules/lightdm
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/lightdm')
-rw-r--r--core/modules/lightdm/data/etc/X11/default-display-manager1
l---------core/modules/lightdm/data/etc/systemd/system/display-manager.service1
-rw-r--r--core/modules/lightdm/module.build26
-rw-r--r--core/modules/lightdm/templates/lightdm.service (renamed from core/modules/lightdm/data/etc/systemd/system/lightdm.service)2
4 files changed, 25 insertions, 5 deletions
diff --git a/core/modules/lightdm/data/etc/X11/default-display-manager b/core/modules/lightdm/data/etc/X11/default-display-manager
new file mode 100644
index 00000000..7d4e29bb
--- /dev/null
+++ b/core/modules/lightdm/data/etc/X11/default-display-manager
@@ -0,0 +1 @@
+/usr/sbin/lightdm
diff --git a/core/modules/lightdm/data/etc/systemd/system/display-manager.service b/core/modules/lightdm/data/etc/systemd/system/display-manager.service
deleted file mode 120000
index 4fcfbb14..00000000
--- a/core/modules/lightdm/data/etc/systemd/system/display-manager.service
+++ /dev/null
@@ -1 +0,0 @@
-lightdm.service \ No newline at end of file
diff --git a/core/modules/lightdm/module.build b/core/modules/lightdm/module.build
index 656d71a9..a86d0baa 100644
--- a/core/modules/lightdm/module.build
+++ b/core/modules/lightdm/module.build
@@ -12,9 +12,29 @@ build() {
post_copy() {
mkdir -p "${TARGET_BUILD_DIR}/var/lib/lightdm"{,-data}
- local LDMUID=$(add_user "lightdm")
- local LDMGID=$(add_group "lightdm")
+ local LDMUID=$(add_system_user "lightdm")
+ local LDMGID=$(add_system_group "lightdm")
pinfo "lightdm user and group is $LDMUID $LDMGID"
- chown -R "${LDMUID}:${LDMGID}" "${TARGET_BUILD_DIR}/var/lib/lightdm/" || perror "chowning '${TARGET_BUILD_DIR}/var/lib/lightdm/' failed."
+ chown -R "${LDMUID}:${LDMGID}" "${TARGET_BUILD_DIR}/var/lib/lightdm/" || \
+ perror "chowning '${TARGET_BUILD_DIR}/var/lib/lightdm/' failed."
+
+ # NOTE this might cause problems on systemd-based systems where use our
+ # own systemd module instead of using the distro's module, which we shouldn't
+ # in the first place! First, check if service file is present on system:
+ local LIGHTDM_SERVICE_PATH="$(systemctl show -p FragmentPath lightdm.service | cut -c 14-)"
+ if [ -z "${LIGHTDM_SERVICE_PATH}" ]; then
+ # Not found, so use our template
+ local LIGHTDM_SERVICE_TPL="${MODULE_DIR}/templates/lightdm.service"
+ [ -s "${LIGHTDM_SERVICE_TPL}" ] || perror "Unable to find template at ${LIGHTDM_SERVICE_TPL}."
+ local LIGHTDM_SERVICE_DEST="${TARGET_BUILD_DIR}/etc/systemd/system/lightdm.service"
+ mkdir -p "${LIGHTDM_SERVICE_DEST%/*}" || perror "Could not create '${LIGHTDM_SERVICE_DEST%/*}'."
+ cp "${MODULE_DIR}/templates/lightdm.service" "${LIGHTDM_SERVICE_DEST}" || \
+ perror "Could not cp lightdm.service template to '${LIGHTDM_SERVICE_DEST}'."
+ LIGHTDM_SERVICE_PATH="${LIGHTDM_SERVICE_DEST//${TARGET_BUILD_DIR}/}"
+ fi
+ # either way link display-manager to LIGHTDM_SERVICE_PATH
+ ln -sf "${LIGHTDM_SERVICE_PATH}" \
+ "${TARGET_BUILD_DIR}/etc/systemd/system/display-manager.service" || \
+ perror "Could not set lightdm as display-manager!"
}
diff --git a/core/modules/lightdm/data/etc/systemd/system/lightdm.service b/core/modules/lightdm/templates/lightdm.service
index baa93f2f..d9002404 100644
--- a/core/modules/lightdm/data/etc/systemd/system/lightdm.service
+++ b/core/modules/lightdm/templates/lightdm.service
@@ -1,7 +1,7 @@
[Unit]
Description=LightDM Display Manager
Conflicts=getty@tty7.service
-After=dev-tty7.device systemd-user-sessions.service load-gfx-driver.service setup-slx-addon@vmware.service setup-slx-addon@virtualbox.service
+After=systemd-user-sessions.service load-gfx-driver.service
[Service]
ExecStart=/usr/sbin/lightdm