[PATCH] features: added LDM support

Konstantin A. Lepikhov lakostis at altlinux.ru
Wed Jun 13 12:16:42 MSK 2018


Linux Driver Management (aka LDM) allows easy configuration of different
hardware. Currently this hook does GPU configuration on systems with
multiple GPUs (aka Optimus/PRIME).
---
 features.in/ldm/README                        | 10 ++++++++++
 features.in/ldm/config.mk                     | 24 ++++++++++++++++++++++++
 features.in/ldm/rootfs/image-scripts.d/50-ldm | 18 ++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 features.in/ldm/README
 create mode 100644 features.in/ldm/config.mk
 create mode 100755 features.in/ldm/rootfs/image-scripts.d/50-ldm

diff --git a/features.in/ldm/README b/features.in/ldm/README
new file mode 100644
index 0000000..23529ba
--- /dev/null
+++ b/features.in/ldm/README
@@ -0,0 +1,10 @@
+Simple hook to run Linux Driver Management tools to configure hybrid graphics
+(aka Optimus/PRIME) for different DM's.
+
+Currently supported:
++ LightDM
++ GDM
++ SDDM
+
+See https://github.com/solus-project/linux-driver-management
+
diff --git a/features.in/ldm/config.mk b/features.in/ldm/config.mk
new file mode 100644
index 0000000..80de1e1
--- /dev/null
+++ b/features.in/ldm/config.mk
@@ -0,0 +1,24 @@
++ldm: use/ldm/session; @:
+
+# common
+use/ldm: sub/rootfs use/services
+	@$(call add_feature)
+	@$(call add,COMMON_PACKAGES,ldm-tools)
+
+# configure X11 session
+use/ldm/session: use/ldm
+	@$(call add,COMMON_PACKAGES,ldm-session-init)
+	@$(call add,DEFAULT_SERVICES_ENABLE,ldm)
+
+# configure lightdm session
+use/ldm/session/lightdm: use/ldm/session
+	@$(call add,COMMON_PACKAGES,ldm-session-init-lightdm)
+
+# configure sddm session
+use/ldm/session/sddm: use/ldm/session
+	@$(call add,COMMON_PACKAGES,ldm-session-init-sddm)
+
+# configure gdm session
+use/ldm/session/gdm: use/ldm/session
+	@$(call add,COMMON_PACKAGES,ldm-session-init-gdm)
+
diff --git a/features.in/ldm/rootfs/image-scripts.d/50-ldm b/features.in/ldm/rootfs/image-scripts.d/50-ldm
new file mode 100755
index 0000000..5b2545f
--- /dev/null
+++ b/features.in/ldm/rootfs/image-scripts.d/50-ldm
@@ -0,0 +1,18 @@
+#!/bin/sh -efu
+# initiate LDM hook on boot
+
+cat << EOF > /etc/systemd/system/ldm.service
+[Unit]
+Description=Runs LDM configuration hooks
+
+[Service]
+ExecStart=/usr/bin/linux-driver-management configure gpu
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=default.target
+EOF
+
+systemctl enable ldm.service
+
-- 
2.10.5


--/9DWx/yDrRhgMJTb--


More information about the devel-distro mailing list