-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
modname := asus_fan | ||
DKMS := dkms | ||
modver := $(shell awk -F'"' '/define *ASUS_FAN_VERSION/{print $$2}' < asus-fan.c) | ||
|
||
# directory in which generated files are stored | ||
DKMS_DEST := /usr/src/$(modname)-$(modver) | ||
|
||
all: install | ||
|
||
src_install: | ||
mkdir -p '$(DKMS_DEST)' | ||
cp Makefile asus-fan.c '$(DKMS_DEST)' | ||
sed 's/#MODULE_VERSION#/$(modver)/' dkms/dkms.conf > '$(DKMS_DEST)/dkms.conf' | ||
|
||
build: src_install | ||
$(DKMS) build -m asus-fan -v $(modver) | ||
|
||
install: build | ||
$(DKMS) install -m asus-fan -v $(modver) | ||
|
||
uninstall: | ||
$(DKMS) remove -m asus-fan -v $(modver) --all | ||
|
||
.PHONY: all src_install build install uninstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PACKAGE_NAME="asus-fan" | ||
PACKAGE_VERSION="#MODULE_VERSION#" | ||
MAKE[0]="make KVERSION=$kernelver" | ||
CLEAN="make clean" | ||
BUILT_MODULE_NAME[0]="asus_fan" | ||
DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi" | ||
AUTOINSTALL="yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Maintainer: Markus Meissner <coder@safemailbox.de> | ||
|
||
pkgname=asus-fan-dkms | ||
pkgver=0.9 | ||
pkgrel=1 | ||
_realname=asus-fan | ||
pkgdesc="Kernel module allowing to controll (both) fan inside various asus laptops" | ||
arch=('i686' 'x86_64') | ||
url=("http://github.com/daringer/asus-fan") | ||
license=('GPL') | ||
depends=('dkms') | ||
install=asus-fan-dkms.install | ||
source=("https://github.com/daringer/asus-fan/archive/v${pkgver}.tar.gz") | ||
|
||
build() { | ||
cd ${srcdir}/${_realname}-${pkgver} | ||
|
||
_kernver="$(uname -r)" | ||
|
||
make KDIR=/lib/modules/${_kernver}/build | ||
} | ||
|
||
package() { | ||
cd ${srcdir}/${_realname}-${pkgver} | ||
|
||
make install | ||
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/bbswitch.ko" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
post_install() { | ||
dkms install -m asus-fan -v ${1%%-*} | ||
} | ||
pre_upgrade() { | ||
local curver=${2%%-*} | ||
# $2 is unset due to a bug. Query current version using pacman as fallback | ||
[ -n "$curver" ] || curver=$(pacman -Qi asus-fan-dkms | awk '/^Version/{print $3}') | ||
pre_remove $curver | ||
} | ||
post_upgrade() { | ||
post_install ${1%%-*} | ||
} | ||
pre_remove() { | ||
dkms remove -m asus-fan -v ${1%%-*} --all | ||
} |