# gddr7_temp Akmod RPM Spec - NVIDIA-style approach %global _debugsource_packages 0 %global _debuginfo_packages 0 %global debug_package %{nil} %global _dracut_conf_d /usr/lib/dracut/dracut.conf.d %global gddr7_temp_version 4.1 Name: gddr7_temp Version: %{gddr7_temp_version} Release: 1%{?dist} Summary: Kernel module to read NVIDIA GPU GDDR7 DQR and THERM temperature sensors License: GPL-2.0-only URL: https://github.com/sunnyyangyangyang/gddr7-temp Source0: gddr7_temp.rs Source1: Makefile Source2: gddr7_temp-kmod.spec.in Source3: LICENSE Source4: gddr7_temp-load.service Source5: offsets.yaml Source6: gen_offsets.py # Akmod BuildRequires BuildRequires: kmodtool BuildRequires: akmods BuildRequires: gcc make rpm-build python3 python3-pyyaml BuildRequires: kernel-devel BuildRequires: systemd-rpm-macros # Rust for Linux module: rustc must match the kernel's CONFIG_RUSTC_VERSION_TEXT BuildRequires: rust # Runtime Requirements Requires: systemd Requires: %{name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} Requires: %{name}-kmod-common = %{?epoch:%{epoch}:}%{version}-%{release} # Generate akmod metadata %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} --akmod 2>/dev/null) } %description gddr7_temp is a kernel module, written in Rust for Linux, that reads NVIDIA GPU GDDR7 DQR and THERM internal hotspot temperature sensors directly via ioremap and exposes them through the Linux hwmon subsystem. Supported GPUs are defined in offsets.yaml (RTX 5090 / 5080 / 5070 Ti / 5070). Requires a kernel built with CONFIG_RUST=y (Rust for Linux 7.x+). This module is reverse-engineered and unofficial. It performs read-only access to GPU MMIO registers that are not privilege-locked, without defeating any hardware protection. The kernel module will be compiled automatically after installation via akmods. # Akmod package definition and scripts are generated by kmodtool (line 32). # No manual %package -n akmod-gddr7_temp needed here. %package kmod-common Summary: Common files for %{name} kernel module Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: %{name}-kmod-common = %{?epoch:%{epoch}:}%{version}-%{release} %description kmod-common This package provides the common dependency anchor for the %{name} kernel module. %prep %setup -q -c -T -n gddr7_temp-%{version} cp %{SOURCE0} . cp %{SOURCE1} . cp %{SOURCE3} . cp %{SOURCE4} . cp %{SOURCE5} . cp %{SOURCE6} . %install # --- Create and install the kmod SRPM for akmods --- install -d %{buildroot}%{_usrsrc}/akmods/ SRPM_TOPDIR=$(mktemp -d) mkdir -p "$SRPM_TOPDIR"/{SOURCES,SPECS} sed -e 's|@GDDR7_TEMP_VERSION@|%{gddr7_temp_version}|g' \ -e 's|@RELEASE@|%{release}|g' \ %{SOURCE2} > "$SRPM_TOPDIR"/SPECS/gddr7_temp-kmod.spec tar -czf "$SRPM_TOPDIR"/SOURCES/gddr7_temp-kmod-%{version}.tar.gz \ --transform "s|^gddr7_temp-%{version}|gddr7_temp-kmod-%{version}|" \ -C %{_builddir} \ gddr7_temp-%{version} rpmbuild -bs \ --define "_topdir $SRPM_TOPDIR" \ "$SRPM_TOPDIR"/SPECS/gddr7_temp-kmod.spec install -m 0644 "$SRPM_TOPDIR"/SRPMS/*.src.rpm %{buildroot}%{_usrsrc}/akmods/ SRPM_NAME=$(basename "$SRPM_TOPDIR"/SRPMS/*.src.rpm) ln -s "$SRPM_NAME" %{buildroot}%{_usrsrc}/akmods/%{name}-kmod.latest rm -rf "$SRPM_TOPDIR" # --- Dracut configuration --- install -d -m 0755 %{buildroot}%{_dracut_conf_d} cat > %{buildroot}%{_dracut_conf_d}/99-gddr7_temp.conf << EOF # Do not include the gddr7_temp module in the initramfs. omit_drivers+=" gddr7_temp " EOF # --- Systemd service --- install -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/gddr7_temp-load.service %post %systemd_post gddr7_temp-load.service systemctl enable gddr7_temp-load.service >/dev/null 2>&1 || true %preun %systemd_preun gddr7_temp-load.service if [ $1 -eq 0 ]; then # Complete uninstall: try to remove the kernel module /sbin/modprobe -r gddr7_temp >/dev/null 2>&1 || true fi %postun %systemd_postun gddr7_temp-load.service %files %license LICENSE %{_unitdir}/gddr7_temp-load.service %{_dracut_conf_d}/99-gddr7_temp.conf # Akmod files are handled by kmodtool (line 32). %files kmod-common # Empty dependency anchor package %changelog * Sun Sep 6 2026 Sunny Yang - 4.1-1 - Version hygiene: drop the stale "v0.2" suffix from the module description (leftover from the pre-Rust-rewrite era; the release is identified by the hand-written .modinfo entry instead) - Replace the stale "Remove before merge" comment on the .modinfo version entry; it is the release identifier now * Fri Aug 14 2026 Sunny Yang - 4.0-1 - Rewrite the module in Rust for Linux (issue #14); same hwmon interface, drop-in replacement under the gddr7_temp module name - gen_offsets.py now emits a single gpu_tables.rs table consumed via include!() (RA VFS only indexes .rs) - Fix PCI candidate reference leak on probe of unsupported NVIDIA devices * Thu Jul 24 2026 Sunny Yang - 3.0-3 - Refactor: replace hardcoded offsets with YAML-driven lookup table - Add multi-GPU support via offsets.yaml configuration - Build artifacts now isolated in build/ directory - Add LSP clangd support and GitHub Actions Copr auto-rebuild * Tue Jul 21 2026 Sunny Yang - 3.0-2 - Fix spec description: /proc/gddr7_temp -> hwmon subsystem - Update MODULE_AUTHOR to "Sunny Yang" * Mon Jul 20 2026 Sunny Yang - 2.5-1 - Update kernel module to version 2.5 * Sun Jul 19 2026 Sunny Yang - 2-2 - Remove kmodgenca from %post (akmods handles signing keys) - Add explicit systemctl enable after %%systemd_post * Sun Jul 19 2026 Sunny Yang - 2-1 - Add gddr7_temp-load.service: oneshot systemd service for auto-loading at boot - Service runs after akmods to ensure module is compiled before loading - Use systemd-rpm-macros (%%systemd_post/preun/postun) + explicit systemctl enable * Sun Jul 19 2026 Sunny Yang - 1.0-3 - Add gddr7_temp-load.service: oneshot systemd service for auto-loading at boot - Service runs after akmods to ensure module is compiled before loading - Use systemd-rpm-macros for proper service lifecycle management * Sun Jul 19 2026 Sunny Yang - 1.0-2 - Remove unsupported --pattern flag from kmodtool call - Fix: kmodtool expand now generates posttrans to trigger akmods on install * Sun Jul 19 2026 Sunny Yang - 1.0-1 - Initial NVIDIA-style akmod spec: generate kmod SRPM at build time - Add Secure Boot MOK enrollment detection in post script - Add dracut config to omit module from initramfs