ALT Linux Distributions development
 help / color / mirror / Atom feed
* [devel-distro] [PATCH]: feature: add LDM support
@ 2018-06-13  9:24 Konstantin Lepikhov
  2018-06-25 18:07 ` Michael Shigorin
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Lepikhov @ 2018-06-13  9:24 UTC (permalink / raw)
  To: devel-distro

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

В аттаче патч который добавляет поддержку LDM вместо хуков имени ALTLinux
(x11drv*). Linux Driver Management это библиотека и набор утилит из
проекта Solus (https://solus-project.com/). Данный хук добавляет поддержку
конфигурации железа с несколькими GPU (Optimus/PRIME) + умеет детектить
что мы не запущены из-под virtualbox и удаляет ненужные VBoxOGL/EGL
библиотеки.

Пример работы -
http://www.unsafe.ru/lakostis/RPMS/ALTLinux/livecd/gnome3/lakostis-gnome3-20180612-x86_64.iso

Сами скрипты ldm я добавлю позже, поскольку пока нужно придумать как
конвертить наши modalias из hwdatabase в формат для ldm.

-- 
WBR et al.

[-- Attachment #2: 0001-features-added-LDM-support.patch --]
[-- Type: text/x-patch, Size: 2589 bytes --]

>From 87cade8b679a62cce2d17d4eede9f9793593a56e Mon Sep 17 00:00:00 2001
From: "Konstantin A. Lepikhov" <lakostis@altlinux.ru>
Date: Wed, 13 Jun 2018 11:16:42 +0200
Subject: [PATCH] features: added LDM support

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel-distro] [PATCH]: feature: add LDM support
  2018-06-13  9:24 [devel-distro] [PATCH]: feature: add LDM support Konstantin Lepikhov
@ 2018-06-25 18:07 ` Michael Shigorin
  2018-06-26 11:09   ` Konstantin Lepikhov
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Shigorin @ 2018-06-25 18:07 UTC (permalink / raw)
  To: devel-distro

On Wed, Jun 13, 2018 at 11:24:57AM +0200, Konstantin Lepikhov wrote:
> В аттаче патч который добавляет поддержку LDM вместо хуков
> имени ALTLinux (x11drv*). Linux Driver Management это
> библиотека и набор утилит из проекта Solus
> (https://solus-project.com/). Данный хук добавляет поддержку
> конфигурации железа с несколькими GPU (Optimus/PRIME) + умеет
> детектить что мы не запущены из-под virtualbox и удаляет
> ненужные VBoxOGL/EGL библиотеки.

Не сталкивался, но давай заберу, только...

> 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

Это хорошо бы заменить файликом в самом пакете ldm,

> +systemctl enable ldm.service

а это можно (но не обязательно) сделать через фичу service --
она умеет позаботиться и про livecd, и про install2.

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel-distro] [PATCH]: feature: add LDM support
  2018-06-25 18:07 ` Michael Shigorin
@ 2018-06-26 11:09   ` Konstantin Lepikhov
  2018-07-08 17:45     ` Michael Shigorin
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Lepikhov @ 2018-06-26 11:09 UTC (permalink / raw)
  To: devel-distro

Hi Michael!

On 06/25/2018, at 09:07:00 PM you wrote:

<skip>
> Это хорошо бы заменить файликом в самом пакете ldm,
>
Как считают авторы LDM, это должны делать мантейнеры соответствующего
функционала в дистрибутиве, т.е. данный скрипт и программа это просто
proof of concept. Если будет интерес, то тогда будет и отдельный пакет с
сервисом.

> > +systemctl enable ldm.service
> 
> а это можно (но не обязательно) сделать через фичу service --
> она умеет позаботиться и про livecd, и про install2.
Окей, посмотрю. Спасибо!

-- 
WBR et al.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel-distro] [PATCH]: feature: add LDM support
  2018-06-26 11:09   ` Konstantin Lepikhov
@ 2018-07-08 17:45     ` Michael Shigorin
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Shigorin @ 2018-07-08 17:45 UTC (permalink / raw)
  To: devel-distro

On Tue, Jun 26, 2018 at 01:09:05PM +0200, Konstantin Lepikhov wrote:
> > > +systemctl enable ldm.service
> > а это можно (но не обязательно) сделать через фичу service --
> > она умеет позаботиться и про livecd, и про install2.
> Окей, посмотрю. Спасибо!

Тем временем забрал для 1.2.18, только поправил три
whitespace error, по мнению git (пустые строки в конце
каждого файла).

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-08 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13  9:24 [devel-distro] [PATCH]: feature: add LDM support Konstantin Lepikhov
2018-06-25 18:07 ` Michael Shigorin
2018-06-26 11:09   ` Konstantin Lepikhov
2018-07-08 17:45     ` Michael Shigorin

ALT Linux Distributions development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-distro/0 devel-distro/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-distro devel-distro/ http://lore.altlinux.org/devel-distro \
		devel-distro@lists.altlinux.org devel-distro@lists.altlinux.ru devel-distro@lists.altlinux.com
	public-inbox-index devel-distro

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-distro


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git