Skip to content

Commit

Permalink
feat: Added LICENSE. Added rpm specs. Renamed module to it87-extras t…
Browse files Browse the repository at this point in the history
…o avoid name collision
  • Loading branch information
grandpares committed Oct 26, 2024
1 parent e1159ef commit a04c93a
Show file tree
Hide file tree
Showing 7 changed files with 441 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Makefile CI

on:
push:
branches: [ "master" ]
branches: [ "master", "akmods" ]
pull_request:
branches: [ "master" ]
branches: [ "master", "akmods" ]
workflow_dispatch:

jobs:
Expand Down
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ else
SYSTEM_MAP = /proc/kallsyms
endif

DRIVER := it87
DRIVER := it87-extras
ifneq ("","$(wildcard .git/*)")
DRIVER_VERSION := $(shell git describe --long).$(shell date -u -d "$$(git show -s --format=%ci HEAD)" +%Y%m%d)
else
Expand All @@ -49,6 +49,7 @@ MODDESTDIR=$(KERNEL_MODULES)/kernel/$(MOD_SUBDIR)

obj-m = $(patsubst %,%.o,$(DRIVER))
obj-ko := $(patsubst %,%.ko,$(DRIVER))
$(patsubst %,%-objs,$(DRIVER)) := it87.o

MAKEFLAGS += --no-print-directory

Expand Down
2 changes: 1 addition & 1 deletion dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ PACKAGE_NAME="it87"
PACKAGE_VERSION=#MODULE_VERSION#
MAKE[0]="make TARGET=${kernelver}"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="it87"
BUILT_MODULE_NAME[0]="it87-extras"
DEST_MODULE_LOCATION[0]="/kernel/drivers/hwmon"
AUTOINSTALL="yes"
1 change: 1 addition & 0 deletions install/modprobe.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blacklist it87
57 changes: 57 additions & 0 deletions it87-extras-kmod.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
%global modname it87-extras
%global srcversion akmods
%global srcname it87
%global pkgname it87-extras
%global maintainer grandpares

%if 0%{?fedora}
%global buildforkernels akmod
%global debug_package %{nil}
%endif

# name should have a -kmod suffix
Name: %{pkgname}-kmod
Version: {{{ git_dir_version }}}
Release: 2%{?dist}
Summary: Linux Driver for ITE LPC chips
License: GPLv2
URL: https://github.com/%{maintainer}/it87
Source0: %{url}/archive/refs/heads/%{srcversion}.zip

BuildRequires: kmodtool

%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }

%description
Linux Driver for ITE LPC chips

%prep
# error out if there was something wrong with kmodtool
%{?kmodtool_check}

# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null

%autosetup -c %{pkgname}
for kernel_version in %{?kernel_versions} ; do
cp -a %{srcname}-%{srcversion} _kmod_build_${kernel_version%%___*}/
done

%build
for kernel_version in %{?kernel_versions} ; do
pushd _kmod_build_${kernel_version%%___*}/
make clean
make KVER=${kernel_version%%___*}
popd
done

%install
for kernel_version in %{?kernel_versions}; do
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
install -D -m 755 _kmod_build_${kernel_version%%___*}/%{modname}.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{modname}.ko
done
%{?akmod_install}


%changelog
39 changes: 39 additions & 0 deletions it87-extras.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%if 0%{?fedora}
%global debug_package %{nil}
%endif

%global srcname it87
%global srcversion akmods

Name: it87-extras
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Linux Driver for ITE LPC chips
License: GPLv2
URL: https://github.com/grandpares/it87


Source: %{url}/archive/refs/heads/%{srcversion}.tar.gz

Provides: %{name}-kmod-common = %{version}
Requires: %{name}-kmod >= %{version}

BuildRequires: systemd-rpm-macros

%description
Linux Driver for ITE LPC chips

%prep
%setup -q -c %{srcname}-%{srcversion}

%install
mkdir -p %{buildroot}%{_prefix}/lib/modprobe.d/
install -p -m 0644 %{srcname}-%{srcversion}/install/modprobe.conf %{buildroot}%{_prefix}/lib/modprobe.d/%{name}.conf

%files
%doc %{srcname}-%{srcversion}/README
%license %{srcname}-%{srcversion}/LICENSE
%attr(0644,root,root) %{_prefix}/lib/modprobe.d/%{name}.conf

%changelog
{{{ git_dir_changelog }}}

0 comments on commit a04c93a

Please sign in to comment.