mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-09 15:13:31 -04:00
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@gmail.com>
This commit is contained in:
6
sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
Normal file
6
sys-firmware/lenovolegionlinux/files/legiond-onresume.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/BIN/bash
|
||||
case $1/$2 in
|
||||
post/*)
|
||||
/usr/bin/legiond-cli fanset 3
|
||||
;;
|
||||
esac
|
||||
7
sys-firmware/lenovolegionlinux/files/legiond.initd
Normal file
7
sys-firmware/lenovolegionlinux/files/legiond.initd
Normal file
@@ -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"
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user