summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-04-25 11:17:25 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-04-25 11:17:25 +0100
commit77f479b205c8ffcb9f422505fba0b8a04268cbff (patch)
tree74a93e2304691435511436cb32ccbe3d2a0ecbf9
parente322cc124bb1b5a23c3e995335b76e45d5401f97 (diff)
app-laptop/tp_smapi : import from Gentoo, convert to DKMS
-rw-r--r--app-laptop/tp_smapi/files/tp_smapi-0.40-confd20
-rw-r--r--app-laptop/tp_smapi/files/tp_smapi-0.40-initd92
-rw-r--r--app-laptop/tp_smapi/tp_smapi-0.44.ebuild36
-rw-r--r--metadata/md5-cache/app-laptop/tp_smapi-0.4412
-rw-r--r--metadata/md5-cache/sys-kernel/tp_smapi-dkms-0.4414
-rw-r--r--metadata/pkg_desc_index2
-rw-r--r--sys-kernel/tp_smapi-dkms/Manifest1
-rw-r--r--sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf12
-rw-r--r--sys-kernel/tp_smapi-dkms/files/dkms.conf10
-rw-r--r--sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild55
10 files changed, 254 insertions, 0 deletions
diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-confd b/app-laptop/tp_smapi/files/tp_smapi-0.40-confd
new file mode 100644
index 00000000..7c80f35e
--- /dev/null
+++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-confd
@@ -0,0 +1,20 @@
+# /etc/conf.d/smapi: config file for /etc/init.d/smapi
+
+# use '/etc/init.d/smapi info' at any time to check the thresholds
+# currently used by the driver
+# Note that the kernel does some sanity checking on the values and
+# will not accept any combination of values you may try to set up.
+# (i.e. stop value lower than start) So if the output of info does
+# not match what you wanted the driver probably did not like your
+# configuration.
+
+# default thresholds for '/etc/init.d/smapi start'
+SMAPI_THRESH_START="30"
+SMAPI_THRESH_STOP="85"
+# values to be used for '/etc/init.d/smapi low'
+SMAPI_LOW_THRESH_START="${SMAPI_THRESH_START}"
+SMAPI_LOW_THRESH_STOP="${SMAPI_THRESH_STOP}"
+
+# values to be used for '/etc/init.d/smapi high'
+SMAPI_HIGH_THRESH_START="95"
+SMAPI_HIGH_THRESH_STOP="100"
diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-initd b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd
new file mode 100644
index 00000000..3b8c10d9
--- /dev/null
+++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-initd
@@ -0,0 +1,92 @@
+#!/sbin/openrc-run
+# Copyright (C) 2011 Henning Schild <henning@wh9.tu-dresden.de>
+# Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
+#
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="low high info"
+
+SMAPI_SYSFS="/sys/devices/platform/smapi"
+BATS="BAT0 BAT1"
+
+depend() {
+ after modules
+}
+
+start() {
+ local state1
+ local state2
+
+ ebegin "Making sure that module 'tp_smapi' is loaded"
+ modprobe tp_smapi
+ state1=$?
+ eend ${state1}
+
+ ebegin "Checking for \"${SMAPI_SYSFS}\""
+ test -d "${SMAPI_SYSFS}"
+ state2=$?
+ eend ${state2}
+
+ if [ "${state1}" -ne "0" ] || [ "${state2}" -ne "0" ]; then
+ return 1
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ set_all ${SMAPI_THRESH_START} ${SMAPI_THRESH_STOP}
+ eend $?
+}
+
+stop() {
+ einfo "Nothing required to be done to stop ${SVCNAME}"
+}
+
+require_started() {
+ if ! service_started; then
+ "${RC_SERVICE}" start || return $?
+ fi
+}
+
+high() {
+ require_started
+
+ einfo "Switching ${SVCNAME} to high thesholds"
+ set_all ${SMAPI_HIGH_THRESH_START} ${SMAPI_HIGH_THRESH_STOP}
+}
+
+low() {
+ require_started
+
+ einfo "Switching ${SVCNAME} to low thesholds"
+ set_all ${SMAPI_LOW_THRESH_START} ${SMAPI_LOW_THRESH_STOP}
+}
+
+set_all() {
+ local tstart=$1
+ local tstop=$2
+ local bat
+
+ for bat in ${BATS}; do
+ ebegin " setting thresholds for ${bat}: $tstart $tstop"
+ echo ${tstart} > ${SMAPI_SYSFS}/${bat}/start_charge_thresh
+ echo ${tstop} > ${SMAPI_SYSFS}/${bat}/stop_charge_thresh
+ eend $?
+ done
+}
+
+info() {
+ local presence
+ local tstart
+ local tstop
+ local bat
+
+ require_started
+
+ for bat in ${BATS}; do
+ tstart=$(cat ${SMAPI_SYSFS}/${bat}/start_charge_thresh)
+ tstop=$(cat ${SMAPI_SYSFS}/${bat}/stop_charge_thresh)
+ if [ "$(cat ${SMAPI_SYSFS}/${bat}/installed)" -eq "1" ]; then
+ presence=" [installed]"
+ fi
+ einfo "${bat}: ${tstart} ${tstop}${presence}"
+ done
+}
diff --git a/app-laptop/tp_smapi/tp_smapi-0.44.ebuild b/app-laptop/tp_smapi/tp_smapi-0.44.ebuild
new file mode 100644
index 00000000..fee86f3f
--- /dev/null
+++ b/app-laptop/tp_smapi/tp_smapi-0.44.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
+HOMEPAGE="https://github.com/linux-thinkpad/tp_smapi"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+IUSE=""
+
+RDEPEND="
+ ~sys-kernel/${PN}-dkms-${PV}
+ "
+DEPEND="${RDEPEND}"
+
+S=${FILESDIR}
+
+src_prepare() {
+ default
+ :
+}
+
+src_compile() {
+ :
+}
+
+src_install() {
+ newinitd "${FILESDIR}/${PN}-0.40-initd" smapi
+ newconfd "${FILESDIR}/${PN}-0.40-confd" smapi
+}
diff --git a/metadata/md5-cache/app-laptop/tp_smapi-0.44 b/metadata/md5-cache/app-laptop/tp_smapi-0.44
new file mode 100644
index 00000000..cda43713
--- /dev/null
+++ b/metadata/md5-cache/app-laptop/tp_smapi-0.44
@@ -0,0 +1,12 @@
+DEFINED_PHASES=compile install prepare
+DEPEND=~sys-kernel/tp_smapi-dkms-0.44
+DESCRIPTION=IBM ThinkPad SMAPI BIOS driver
+EAPI=6
+HOMEPAGE=https://github.com/linux-thinkpad/tp_smapi
+INHERIT=eutils
+KEYWORDS=amd64 x86
+LICENSE=GPL-2
+RDEPEND=~sys-kernel/tp_smapi-dkms-0.44
+SLOT=0
+_eclasses_=desktop 021728fdc1b03b36357dbc89489e0f0d edos2unix 33e347e171066657f91f8b0c72ec8773 epatch 2b02655f061dfa25067b543539110259 eqawarn c9847c43b3253a276ae2eabddedab3d7 estack c61c368a76fdf3a82fdf8dbaebea3804 eutils 8395a012a2bb768013486b5818f0eb85 ltprune 97143780d341cc8d8f1d4c6187a36d29 multilib c19072c3cd7ac5cb21de013f7e9832e0 preserve-libs 21162ec96c87041004a75348d97342dd strip-linguas ac3ee41ee2d31d8c41a77c0838320cc7 toolchain-funcs e56c7649b804f051623c8bc1a1c44084 vcs-clean d271b7bc7e6a009758d7d4ef749174e3 wrapper 4a1902f969e5718126434fc35f3a0d9c
+_md5_=e0cf3ea99f556f1085f79ee1c8aad14d
diff --git a/metadata/md5-cache/sys-kernel/tp_smapi-dkms-0.44 b/metadata/md5-cache/sys-kernel/tp_smapi-dkms-0.44
new file mode 100644
index 00000000..46790002
--- /dev/null
+++ b/metadata/md5-cache/sys-kernel/tp_smapi-dkms-0.44
@@ -0,0 +1,14 @@
+DEFINED_PHASES=compile install postinst prerm setup
+DEPEND=sys-kernel/dkms
+DESCRIPTION=IBM ThinkPad SMAPI BIOS driver sources
+EAPI=6
+HOMEPAGE=https://github.com/linux-thinkpad/tp_smapi
+INHERIT=eutils
+IUSE=hdaps
+KEYWORDS=amd64 x86
+LICENSE=GPL-2
+RDEPEND=sys-kernel/dkms
+SLOT=0
+SRC_URI=https://github.com/linux-thinkpad/tp_smapi/releases/download/tp-smapi/0.44/tp_smapi-0.44.tgz
+_eclasses_=desktop 021728fdc1b03b36357dbc89489e0f0d edos2unix 33e347e171066657f91f8b0c72ec8773 epatch 2b02655f061dfa25067b543539110259 eqawarn c9847c43b3253a276ae2eabddedab3d7 estack c61c368a76fdf3a82fdf8dbaebea3804 eutils 8395a012a2bb768013486b5818f0eb85 ltprune 97143780d341cc8d8f1d4c6187a36d29 multilib c19072c3cd7ac5cb21de013f7e9832e0 preserve-libs 21162ec96c87041004a75348d97342dd strip-linguas ac3ee41ee2d31d8c41a77c0838320cc7 toolchain-funcs e56c7649b804f051623c8bc1a1c44084 vcs-clean d271b7bc7e6a009758d7d4ef749174e3 wrapper 4a1902f969e5718126434fc35f3a0d9c
+_md5_=c61e4fd3286b7715e9ad6f0c29c73389
diff --git a/metadata/pkg_desc_index b/metadata/pkg_desc_index
index 7f08365b..84f80be6 100644
--- a/metadata/pkg_desc_index
+++ b/metadata/pkg_desc_index
@@ -9,6 +9,7 @@ app-backup/timeshift 22.11.1-r2: A system restore utility for Linux
app-emulation/qemu-guest-agent 8.2.0-r5: QEMU Guest Agent (qemu-ga) for use when running inside a VM
app-emulation/steam 1.0.0.71-r3: Digital distribution client bootstrap package
app-emulation/virtualbox-modules 7.0.16: Kernel Modules for Virtualbox
+app-laptop/tp_smapi 0.44: IBM ThinkPad SMAPI BIOS driver
app-misc/calamares-config-redcore 1.314.1337-r6: Redcore Linux Calamares modules config
app-misc/geoclue 2.7.1-r5: A location information D-Bus service
app-misc/redcore-live 1.314.1337: Redcore Linux live scripts
@@ -70,6 +71,7 @@ sys-kernel/linux-image-redcore-lts 5.15.156 6.1.87 6.6.28: Redcore Linux LTS Ker
sys-kernel/linux-sources-redcore 6.7.12 6.8.7: Redcore Linux Kernel Sources
sys-kernel/linux-sources-redcore-lts 5.15.156 6.1.87 6.6.28: Redcore Linux LTS Kernel Sources
sys-kernel/nvidia-drivers-dkms 390.157-r6 470.239.06 535.171.04: NVIDIA driver sources for linux
+sys-kernel/tp_smapi-dkms 0.44: IBM ThinkPad SMAPI BIOS driver sources
sys-kernel/vhba-dkms 20240202: Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite sources
sys-kernel/virtualbox-modules-dkms 7.0.16-r1: Kernel Modules source for Virtualbox
sys-kernel/zfs-dkms 2.2.3-r1: ZFS sources for linux
diff --git a/sys-kernel/tp_smapi-dkms/Manifest b/sys-kernel/tp_smapi-dkms/Manifest
new file mode 100644
index 00000000..59422510
--- /dev/null
+++ b/sys-kernel/tp_smapi-dkms/Manifest
@@ -0,0 +1 @@
+DIST tp_smapi-0.44.tgz 40724 BLAKE2B 03b765bc5736f514cf2a315dcc6d14bbb7869b98da8c5e016be49bd47bc2d1ec4da7c0c5b5468356df6aa4083b2de4048a078b5498dc7aa0083e3fcfbb64aa41 SHA512 c6b6068941d43505d14dc155441287ba5576f0b1b09861e13853e5360f9b4483d709b823761d39c93bc0c860100d43cc485d2454d66a66ceaaf2d43b5b0c9dc9
diff --git a/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf b/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf
new file mode 100644
index 00000000..9a74ec7a
--- /dev/null
+++ b/sys-kernel/tp_smapi-dkms/files/dkms-hdaps.conf
@@ -0,0 +1,12 @@
+PACKAGE_NAME="tp_smapi-dkms"
+PACKAGE_VERSION="0.44"
+BUILD_EXCLUSIVE_KERNEL="^(5\.[0-9]+\.|6\.[0-8]\.)" # only build for kernels v5.x.x up to and including v6.8.x
+MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build HDAPS=1"
+CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
+BUILT_MODULE_NAME[0]="thinkpad_ec"
+BUILT_MODULE_NAME[1]="tp_smapi"
+BUILT_MODULE_NAME[2]="hdaps"
+DEST_MODULE_LOCATION[0]="/extra/dkms"
+DEST_MODULE_LOCATION[1]="/extra/dkms"
+DEST_MODULE_LOCATION[2]="/extra/dkms"
+AUTOINSTALL="yes"
diff --git a/sys-kernel/tp_smapi-dkms/files/dkms.conf b/sys-kernel/tp_smapi-dkms/files/dkms.conf
new file mode 100644
index 00000000..9dbb68d1
--- /dev/null
+++ b/sys-kernel/tp_smapi-dkms/files/dkms.conf
@@ -0,0 +1,10 @@
+PACKAGE_NAME="tp_smapi-dkms"
+PACKAGE_VERSION="0.44"
+BUILD_EXCLUSIVE_KERNEL="^(5\.[0-9]+\.|6\.[0-8]\.)" # only build for kernels v5.x.x up to and including v6.8.x
+MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
+CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
+BUILT_MODULE_NAME[0]="thinkpad_ec"
+BUILT_MODULE_NAME[1]="tp_smapi"
+DEST_MODULE_LOCATION[0]="/extra/dkms"
+DEST_MODULE_LOCATION[1]="/extra/dkms"
+AUTOINSTALL="yes"
diff --git a/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild b/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild
new file mode 100644
index 00000000..b97ec7e2
--- /dev/null
+++ b/sys-kernel/tp_smapi-dkms/tp_smapi-dkms-0.44.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+MY_PN=tp_smapi
+MY_P=${MY_PN}-${PV}
+DESCRIPTION="IBM ThinkPad SMAPI BIOS driver sources"
+HOMEPAGE="https://github.com/linux-thinkpad/tp_smapi"
+SRC_URI="https://github.com/linux-thinkpad/tp_smapi/releases/download/tp-smapi/${PV}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+IUSE="hdaps"
+
+DEPEND="sys-kernel/dkms"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ if use hdaps; then
+ local CONFIG_CHECK="~INPUT_UINPUT"
+ local WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
+ local CONFIG_CHECK="~!SENSORS_HDAPS"
+ local ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
+ fi
+}
+
+src_compile() {
+ :
+}
+
+src_install() {
+ if use hdaps; then
+ cp "${FILESDIR}"/dkms-hdaps.conf "${S}"/dkms.conf || die
+ else
+ cp "${FILESDIR}"/dkms.conf "${S}" || die
+ fi
+ dodir /usr/src/${P}
+ insinto /usr/src/${P}
+ doins -r "${S}"/*
+}
+
+pkg_postinst() {
+ dkms add ${PN}/${PV}
+}
+
+pkg_prerm() {
+ dkms remove ${PN}/${PV} --all
+}