mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 20:47:13 +08:00
add acerhk
This commit is contained in:
parent
8ebcff0a7f
commit
2ef96fd124
72
acerhk/2.6.30.patch
Normal file
72
acerhk/2.6.30.patch
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
--- a/acerhk.c
|
||||||
|
+++ b/acerhk.c
|
||||||
|
@@ -2668,7 +2668,9 @@ static int acerhk_proc_init(void)
|
||||||
|
printk(KERN_INFO"acerhk: could not create /proc/driver/acerhk\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
proc_acer_dir->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
/* now create several files, first general info ... */
|
||||||
|
entry = create_proc_read_entry("info",
|
||||||
|
0444, proc_acer_dir, acerhk_proc_info, NULL);
|
||||||
|
@@ -2677,7 +2679,9 @@ static int acerhk_proc_init(void)
|
||||||
|
remove_proc_entry("driver/acerhk", NULL);
|
||||||
|
retval = 0;
|
||||||
|
} else {
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
/* ... last pressed key ... */
|
||||||
|
entry = create_proc_read_entry("key",
|
||||||
|
0444, proc_acer_dir, acerhk_proc_key, NULL);
|
||||||
|
@@ -2687,7 +2691,9 @@ static int acerhk_proc_init(void)
|
||||||
|
remove_proc_entry("driver/acerhk", NULL);
|
||||||
|
retval = 0;
|
||||||
|
} else {
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
/* ... and led control file */
|
||||||
|
entry = create_proc_entry("led", 0222, proc_acer_dir);
|
||||||
|
if (entry == NULL) {
|
||||||
|
@@ -2699,7 +2705,9 @@ static int acerhk_proc_init(void)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
entry->write_proc = acerhk_proc_led;
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
/* ... and wireless led controll file */
|
||||||
|
entry = create_proc_entry("wirelessled", 0222, proc_acer_dir);
|
||||||
|
if (entry == NULL) {
|
||||||
|
@@ -2712,7 +2720,9 @@ static int acerhk_proc_init(void)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
entry->write_proc = acerhk_proc_wirelessled;
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
/* ... and bluetooth led controll file */
|
||||||
|
entry = create_proc_entry("blueled", 0222, proc_acer_dir);
|
||||||
|
if (entry == NULL) {
|
||||||
|
@@ -2725,7 +2735,9 @@ static int acerhk_proc_init(void)
|
||||||
|
retval = 0;
|
||||||
|
} else {
|
||||||
|
entry->write_proc = acerhk_proc_blueled;
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
retval = 1;
|
||||||
|
#ifdef ACERDEBUG
|
||||||
|
/* add extra file for debugging purposes */
|
||||||
|
@@ -2742,7 +2754,9 @@ static int acerhk_proc_init(void)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
entry->write_proc = acerhk_proc_debug;
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||||
|
entry->owner = THIS_MODULE;
|
||||||
|
+#endif
|
||||||
|
retval = 1;
|
||||||
|
}
|
||||||
|
#endif
|
68
acerhk/ChangeLog
Normal file
68
acerhk/ChangeLog
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
2010-04-09 Chris Brannon <cmbrannon79@gmail.com>
|
||||||
|
|
||||||
|
* Release bump: 17
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.33 kernel.
|
||||||
|
|
||||||
|
* Added kernelversion.patch, since the location of utsrelease.h
|
||||||
|
changed with the 2.6.33 kernel.
|
||||||
|
|
||||||
|
2010-01-11 Chris Brannon <cmbrannon79@gmail.com>
|
||||||
|
|
||||||
|
* Release bump: 17
|
||||||
|
|
||||||
|
* PKGBUILD: fixed _kernver
|
||||||
|
|
||||||
|
2010-01-09 Chris Brannon <cmbrannon79@gmail.com>
|
||||||
|
|
||||||
|
* Release bump: 16
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.32 kernel
|
||||||
|
|
||||||
|
2009-10-10 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 15
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.31 kernel
|
||||||
|
|
||||||
|
* acerhk.install: changed modprobe.conf path
|
||||||
|
|
||||||
|
2009-06-24 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 14
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.30 kernel, added compilation patch
|
||||||
|
|
||||||
|
* 2.6.30.patch: added
|
||||||
|
|
||||||
|
2009-04-09 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 13
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.29 kernel
|
||||||
|
|
||||||
|
2009-01-16 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 12
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.28 kernel
|
||||||
|
|
||||||
|
2008-10-16 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 11
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.27 kernel
|
||||||
|
|
||||||
|
2008-08-12 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 10
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.26 kernel, moved to $srcdir/$pkgdir
|
||||||
|
|
||||||
|
2008-05-27 Corrado Primier <bardo@aur.archlinux.org>
|
||||||
|
|
||||||
|
* Release bump: 9
|
||||||
|
|
||||||
|
* PKGBUILD: updated for the 2.6.25 kernel
|
||||||
|
|
||||||
|
* ChangeLog: added
|
39
acerhk/PKGBUILD
Normal file
39
acerhk/PKGBUILD
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# Chakra Packages for Chakra, part of chakra-project.org
|
||||||
|
#
|
||||||
|
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||||
|
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||||
|
|
||||||
|
pkgname=acerhk
|
||||||
|
pkgver=0.5.35
|
||||||
|
pkgrel=2
|
||||||
|
pkgdesc="Acer hotkey driver"
|
||||||
|
url="http://www.cakey.de/acerhk/"
|
||||||
|
arch=('i686') # Unavailable for x86_64
|
||||||
|
license=('GPL')
|
||||||
|
depends=('kernel26>=2.6.35' 'kernel26<2.6.36')
|
||||||
|
makedepends=('kernel26-headers>=2.6.35' 'kernel26-headers<2.6.36')
|
||||||
|
source=(http://www.cakey.de/acerhk/archives/${pkgname}-${pkgver}.tgz acerhk.rc
|
||||||
|
2.6.30.patch kernelversion.patch)
|
||||||
|
install=acerhk.install
|
||||||
|
# Find the kernel name inside the chroot
|
||||||
|
_kernver=`pacman -Qf kernel26 | cut -c10-15 | sed 's/kernel26 //g'`-CHAKRA
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
sed -i 's/CFLAGS/EXTRA_CFLAGS/' Makefile
|
||||||
|
patch -Np1 -i "${srcdir}/2.6.30.patch" || return 1
|
||||||
|
patch -N -p1 < "$srcdir/kernelversion.patch" || return 1
|
||||||
|
# Set KERNELSRC. The makefile tries to autodetect it with uname,
|
||||||
|
# but that is unreliable.
|
||||||
|
make KERNELSRC="/lib/modules/${_kernver}/build" acerhk.ko || return 1
|
||||||
|
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/acerhk.ko" \
|
||||||
|
"${pkgdir}/lib/modules/${_kernver}/kernel/drivers/block/acerhk.ko" || return 1
|
||||||
|
install -Dm755 "${srcdir}/acerhk.rc" "${pkgdir}/etc/rc.d/acerhk" || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 et:
|
||||||
|
md5sums=('05255919f312cb76af473a760c284433'
|
||||||
|
'935584b3e4bfbb3af8460558e5b98bb5'
|
||||||
|
'2a0bc99e5b12e25096441df4d53d7df7'
|
||||||
|
'fd2ef062ecbc9d670e1b42aa5866d32d')
|
19
acerhk/acerhk.install
Normal file
19
acerhk/acerhk.install
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
post_install() {
|
||||||
|
cat << EOM
|
||||||
|
>>> PLEASE ADD PROPER OPTIONS IN /etc/modprobe.d/modprobe.conf IF NEEDED
|
||||||
|
>>> e.g. for Series 290:
|
||||||
|
>>> echo "options acerhk force_series=290 usedritek=1 verbose=0" >> /etc/modprobe.conf
|
||||||
|
EOM
|
||||||
|
depmod -a
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
post_upgrade() {
|
||||||
|
depmod -a
|
||||||
|
}
|
||||||
|
|
||||||
|
post_remove() {
|
||||||
|
depmod -a
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 et:
|
32
acerhk/acerhk.rc
Normal file
32
acerhk/acerhk.rc
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /etc/rc.conf
|
||||||
|
. /etc/rc.d/functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
stat_busy "Starting Acer Hotkey Wireless LED"
|
||||||
|
if [ ! -f /proc/driver/acerhk/wirelessled ]; then
|
||||||
|
stat_fail
|
||||||
|
else
|
||||||
|
echo 1 > /proc/driver/acerhk/wirelessled
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stat_busy "Stopping Acer Hotkey Wireless LED"
|
||||||
|
if [ ! -f /proc/driver/acerhk/wirelessled ]; then
|
||||||
|
stat_fail
|
||||||
|
else
|
||||||
|
echo 0 > /proc/driver/acerhk/wirelessled
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "usage: $0 {start|stop|restart}"
|
||||||
|
;;
|
||||||
|
esac
|
12
acerhk/kernelversion.patch
Normal file
12
acerhk/kernelversion.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Naur acerhk-0.5.35/Makefile acerhk-0.5.35-new/Makefile
|
||||||
|
--- acerhk-0.5.35/Makefile 2006-08-16 11:11:08.000000000 -0500
|
||||||
|
+++ acerhk-0.5.35-new/Makefile 2010-04-09 15:59:40.000000000 -0500
|
||||||
|
@@ -3,7 +3,7 @@
|
||||||
|
#KERNELSRC=/usr/src/linux
|
||||||
|
KERNELSRC?=/lib/modules/`uname -r`/build
|
||||||
|
# Starting with 2.6.18, the kernel version is in utsrelease.h instead of version.h, accomodate both cases
|
||||||
|
-KERNELVERSION=$(shell awk -F\" '/REL/ {print $$2}' $(shell grep -s -l REL $(KERNELSRC)/include/linux/version.h $(KERNELSRC)/include/linux/utsrelease.h))
|
||||||
|
+KERNELVERSION=$(shell awk -F\" '/REL/ {print $$2}' $(shell grep -s -l REL $(KERNELSRC)/include/linux/version.h $(KERNELSRC)/include/generated/utsrelease.h))
|
||||||
|
KERNELMAJOR=$(shell echo $(KERNELVERSION)|head -c3)
|
||||||
|
|
||||||
|
# next line is for kernel 2.6, if you integrate the driver in the kernel tree
|
Loading…
Reference in New Issue
Block a user