public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: sys-firmware/lenovolegionlinux/files/, sys-firmware/lenovolegionlinux/
@ 2024-03-17 15:12 Julien Roy
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Roy @ 2024-03-17 15:12 UTC (permalink / raw
  To: gentoo-commits

commit:     92e292680eb33e306848bb17f3c60919078f6488
Author:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
AuthorDate: Sun Mar 17 13:38:49 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Sun Mar 17 13:41:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=92e29268

sys-firmware/lenovolegionlinux: add openrc support and improve ebuild
* thanks to @st0nie

Closes: https://github.com/johnfanv2/LenovoLegionLinux/issues/181
Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail.com>

 .../lenovolegionlinux/files/legiond-onresume.sh    |  6 ++++++
 sys-firmware/lenovolegionlinux/files/legiond.initd |  7 +++++++
 .../lenovolegionlinux-9999.ebuild                  | 23 ++++++++++++++--------
 sys-firmware/lenovolegionlinux/metadata.xml        |  7 ++++---
 4 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh b/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
new file mode 100644
index 0000000000..2c311aabb5
--- /dev/null
+++ b/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
@@ -0,0 +1,6 @@
+#!/BIN/bash
+case $1/$2 in
+post/*)
+       /usr/bin/legiond-cli fanset 3
+       ;;
+esac

diff --git a/sys-firmware/lenovolegionlinux/files/legiond.initd b/sys-firmware/lenovolegionlinux/files/legiond.initd
new file mode 100644
index 0000000000..a95e50bd92
--- /dev/null
+++ b/sys-firmware/lenovolegionlinux/files/legiond.initd
@@ -0,0 +1,7 @@
+#!/sbin/openrc-run
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/legiond"
+command_background=true
+pidfile="/run/legiond.pid"

diff --git a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
index a98d9f643f..58270c5e48 100644
--- a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
+++ b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -8,7 +8,7 @@ M_PN=LenovoLegionLinux
 DISTUTILS_USE_PEP517=setuptools
 PYTHON_COMPAT=(python3_{9..12})
 
-inherit linux-mod-r1 distutils-r1 systemd
+inherit linux-mod-r1 distutils-r1 systemd optfeature
 
 if [[ ${PV} == "9999" ]]; then
 	EGIT_REPO_URI="https://github.com/johnfanv2/${M_PN}.git"
@@ -37,18 +37,13 @@ RDEPEND="
 		sys-power/acpid
 	)
 	downgrade-nvidia? ( <=x11-drivers/nvidia-drivers-525 )
-	radeon-dgpu? ( dev-util/rocm-smi )
-	ryzenadj? ( sys-power/RyzenAdj )
-	undervolt-intel? ( dev-python/undervolt )
 "
 
 DEPEND="${RDEPEND}"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="+gui radeon-dgpu downgrade-nvidia ryzenadj undervolt-intel"
-REQUIRED_USE="|| ( radeon-dgpu downgrade-nvidia ryzenadj gui undervolt-intel ) radeon-dgpu? ( !downgrade-nvidia gui ) downgrade-nvidia? ( !radeon-dgpu gui ) undervolt-intel? ( !ryzenadj gui ) ryzenadj? ( !undervolt-intel gui )"
-
+IUSE="+gui downgrade-nvidia elogin"
 MODULES_KERNEL_MIN=5.10
 
 src_compile() {
@@ -83,6 +78,14 @@ src_install() {
 		cd "${WORKDIR}/${P}/extra" || die
 
 		systemd_dounit service/legiond.service service/legiond-onresume.service
+
+        newinitd "${FILESDIR}/legiond.initd" legiond
+
+        if use elogind; then
+            exeinto /lib64/elogind/system-sleep/
+            doexe "${FILESDIR}/legiond-onresume.sh"
+        fi
+
 		insinto /etc/acpi/events
 		doins acpi/events/{legion_ppd,legion_ac}
 		dobin service/legiond/legiond
@@ -105,4 +108,8 @@ pkg_postinst() {
 	ewarn "Note for 2023-2023 Legion user: It need help for testing the features"
 	ewarn "Pls test the feature how is decribe in the README of the project!"
 	ewarn "and also go to this issue in github: https://github.com/johnfanv2/LenovoLegionLinux/issues/46"
+
+    optfeature "radeon dgpu power management" dev-util/rocm-smi
+    optfeature "ryzen CPU tweaks" sys-power/RyzenAdj
+    optfeature "intel CPU tweaks" dev-python/undervolt
 }

diff --git a/sys-firmware/lenovolegionlinux/metadata.xml b/sys-firmware/lenovolegionlinux/metadata.xml
index bd4ddf3020..a98adf9979 100644
--- a/sys-firmware/lenovolegionlinux/metadata.xml
+++ b/sys-firmware/lenovolegionlinux/metadata.xml
@@ -3,14 +3,15 @@
 <pkgmetadata>
 	<use>
 		<flag name="gui">Build and install legion_gui and legion_cli</flag>
-		<flag name="radeon-dgpu">Enable AMD GPU TDP control (systemd-service)</flag>
 		<flag name="downgrade-nvidia">Downgrade nvidia for 525 to enable TDP control (systemd-service)</flag>
-		<flag name="ryzenadj">[AMD] CPU and APU control using ryzenadj (systemd-service)</flag>
-		<flag name="undervolt-intel">[INTEL] CPU and APU control using undervolt (systemd-service)</flag>
+		<flag name="elogind">Enable legiond-onresume openrc support</flag>
 	</use>
 	<maintainer type="person">
 		<email>gonegrier.duarte@gmail.com</email>
 		<name>Gonçalo Negrier Duarte</name>
+	<maintainer type="person">
+		<email>ston.jia@outlook.com</email>
+		<name>ston</name>
 	</maintainer>
 	<upstream>
 		<remote-id type="github">johnfanv2/LenovoLegionLinux</remote-id>


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

* [gentoo-commits] repo/proj/guru:master commit in: sys-firmware/lenovolegionlinux/files/, sys-firmware/lenovolegionlinux/
@ 2024-03-17 18:02 Julien Roy
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Roy @ 2024-03-17 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     639414a7aac99acebe8bb0d96b390075303e7e5f
Author:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
AuthorDate: Sun Mar 17 16:40:49 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Sun Mar 17 16:42:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=639414a7

sys-firmware/lenovolegionlinux: fix typos

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail.com>

 sys-firmware/lenovolegionlinux/files/legiond-onresume.sh     | 2 +-
 sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh b/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
index 2c311aabb5..cd6b7c4a5c 100644
--- a/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
+++ b/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
@@ -1,4 +1,4 @@
-#!/BIN/bash
+#!/bin/bash
 case $1/$2 in
 post/*)
        /usr/bin/legiond-cli fanset 3

diff --git a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
index 58270c5e48..f90d2e5553 100644
--- a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
+++ b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
@@ -43,7 +43,7 @@ DEPEND="${RDEPEND}"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="+gui downgrade-nvidia elogin"
+IUSE="+gui downgrade-nvidia elogind"
 MODULES_KERNEL_MIN=5.10
 
 src_compile() {


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

* [gentoo-commits] repo/proj/guru:master commit in: sys-firmware/lenovolegionlinux/files/, sys-firmware/lenovolegionlinux/
@ 2024-04-05 15:22 Arthur Zamarin
  0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2024-04-05 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     8cd75708ad3546d396f09194fdd510a68ba260ab
Author:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
AuthorDate: Fri Apr  5 15:17:58 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Apr  5 15:19:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8cd75708

sys-firmware/lenovolegionlinux: apply changes upstream
* https://github.com/johnfanv2/LenovoLegionLinux/pull/195

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail.com>

 sys-firmware/lenovolegionlinux/files/legiond-onresume.sh     |  6 ------
 sys-firmware/lenovolegionlinux/files/legiond.initd           |  7 -------
 sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild | 11 +++++++----
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh b/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
deleted file mode 100644
index cd6b7c4a5c..0000000000
--- a/sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-case $1/$2 in
-post/*)
-       /usr/bin/legiond-cli fanset 3
-       ;;
-esac

diff --git a/sys-firmware/lenovolegionlinux/files/legiond.initd b/sys-firmware/lenovolegionlinux/files/legiond.initd
deleted file mode 100644
index a95e50bd92..0000000000
--- a/sys-firmware/lenovolegionlinux/files/legiond.initd
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-command="/usr/bin/legiond"
-command_background=true
-pidfile="/run/legiond.pid"

diff --git a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
index debc32bf51..551ab1a727 100644
--- a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
+++ b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild
@@ -26,6 +26,7 @@ BDEPEND="
 	sys-apps/lm-sensors
 	sys-apps/dmidecode
 	sys-apps/sed
+	dev-libs/inih
 "
 
 RDEPEND="
@@ -79,17 +80,19 @@ src_install() {
 
 		systemd_dounit service/legiond.service service/legiond-onresume.service service/legiond-cpuset.service service/legiond-cpuset.timer
 
-        newinitd "${FILESDIR}/legiond.initd" legiond
+        newinitd service/legiond.initd legiond
+		newinitd service/legiond-cpuset.initd legiond
+		newsbin service/legiond-cpuset.sh legiond-cpuset
 
         if use elogind; then
             exeinto /lib64/elogind/system-sleep/
-            doexe "${FILESDIR}/legiond-onresume.sh"
+            doexe service/legiond-onresume.sh
         fi
 
 		insinto /etc/acpi/events
 		doins acpi/events/{legion_ppd,legion_ac}
 		dobin service/legiond/legiond
-		dobin service/legiond/legiond-cli
+		dobin service/legiond/legiond-ctl
 	fi
 }
 
@@ -97,7 +100,7 @@ pkg_postinst() {
 	ewarn "Default config files are present in /usr/share/legion_linux"
 	ewarn "Copy folder /usr/share/legion_linux to /etc/legion_linux"
 	ewarn "Note: Fancurve can be edit using the gui app"
-	ewarn "Dont forget to edit /etc/legion_linux/.env to enable and disable extra features"
+	ewarn "Dont forget to edit /etc/legion_linux/legiond.ini (previous .env) to enable and disable extra features"
 	ewarn "Note the CPU and APU control command both for undervolt an ryzenadj are edit in /etc/legion_linux/.env"
 	if !use downgrade-nvidia; then
 		ewarn "Note: use flag downgrade-nvidia if you need for nvidia TDP control (requires driver 525 to work)\n"


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

end of thread, other threads:[~2024-04-05 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-17 15:12 [gentoo-commits] repo/proj/guru:master commit in: sys-firmware/lenovolegionlinux/files/, sys-firmware/lenovolegionlinux/ Julien Roy
  -- strict thread matches above, loose matches on Subject: below --
2024-03-17 18:02 Julien Roy
2024-04-05 15:22 Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox