Commit adf273fc authored by Phil's avatar Phil
Browse files

add kernel26-lts modules

parent 7c5b1cd5
--- 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
--- acerhk.c.orig 2010-10-22 23:33:34.195981177 +0200
+++ acerhk.c 2010-10-22 23:39:16.349277070 +0200
@@ -2793,8 +2793,7 @@ static void acerhk_proc_cleanup(void)
/* {{{ file operations */
-static int acerhk_ioctl( struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg )
+static long acerhk_unlocked_ioctl(struct file *file,unsigned int cmd, unsigned long arg )
{
int retval;
switch( cmd ) {
@@ -2904,7 +2903,7 @@ static int acerhk_resume(struct platform
static struct file_operations acerhk_fops = {
owner: THIS_MODULE,
- ioctl: acerhk_ioctl,
+ unlocked_ioctl: acerhk_unlocked_ioctl,
open: acerhk_open,
#ifdef ACERDEBUG
write: acerhk_write,
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
#
# 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>
# use ../fakeuname -r 2.6.35-CHAKRA-LTS ../makepkg
_kernver=`uname -r`
pkgname=acerhk-lts
pkgver=0.5.35
pkgrel=1
pkgdesc="Acer hotkey driver"
url="http://www.cakey.de/acerhk/"
arch=('i686') # Unavailable for x86_64
license=('GPL')
depends=('kernel26-lts>=2.6.35' 'kernel26-lts<2.6.36')
makedepends=('kernel26-lts-headers>=2.6.35' 'kernel26-lts-headers<2.6.36')
source=(http://www.cakey.de/acerhk/archives/acerhk-${pkgver}.tgz acerhk.rc
2.6.30.patch kernelversion.patch 2.6.36.patch)
install=acerhk.install
build() {
cd "${srcdir}/acerhk-${pkgver}"
sed -i 's/CFLAGS/EXTRA_CFLAGS/' Makefile
patch -Np1 -i "${srcdir}/2.6.30.patch" || return 1
patch -Np0 -i "${srcdir}/2.6.36.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}/acerhk-${pkgver}/acerhk.ko" \
"${pkgdir}/lib/modules/${_kernver}/kernel/drivers/block/acerhk.ko" || return 1
install -Dm755 "${srcdir}/acerhk.rc" "${pkgdir}/etc/rc.d/acerhk-lts" || return 1
sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/acerhk.install
}
# vim:set ts=2 sw=2 et:
md5sums=('05255919f312cb76af473a760c284433'
'935584b3e4bfbb3af8460558e5b98bb5'
'2a0bc99e5b12e25096441df4d53d7df7'
'fd2ef062ecbc9d670e1b42aa5866d32d'
'd257a4e9223ebfde48b9608805df9c99')
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:
#!/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
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
--- cat11.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2011-01-17 15:59:26.000000000 +0100
+++ cat11.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2011-02-01 18:39:08.902218444 +0100
@@ -848,7 +848,12 @@
* happen much less frequent then without this workaround.
*/
if (state == PM_EVENT_SUSPEND)
- acquire_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_lock();
+#else
+ acquire_console_sem();
+#endif
if (firegl_cail_powerdown(privdev, state))
ret = -EIO;
@@ -870,8 +875,13 @@
}
if (state == PM_EVENT_SUSPEND)
- release_console_sem();
-
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_unlock();
+#else
+ release_console_sem();
+#endif
+
KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, ret, NULL);
return ret;
@@ -894,7 +904,12 @@
if (PMSG_EVENT(pdev->dev.power.power_state) == 0) return 0;
if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
- acquire_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_lock();
+#else
+ acquire_console_sem();
+#endif
#ifdef FIREGL_USWC_SUPPORT
// Restore the PAT after resuming from S3 or S4.
@@ -919,7 +934,12 @@
firegl_cail_powerup(privdev);
if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
- release_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_unlock();
+#else
+ release_console_sem();
+#endif
PMSG_EVENT(pdev->dev.power.power_state) = 0;
KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, 0, NULL);
#
# 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>
# use ../fakeuname -r 2.6.35-CHAKRA-LTS ../makepkg
_kernver=`uname -r`
pkgname=catalyst-lts
pkgver=11.2
pkgrel=1
pkgdesc="AMD/ATI Catalyst drivers for kernel26. fglrx kernel module only"
arch=('i686' 'x86_64')
url="http://www.ati.amd.com"
license=('custom')
depends=('kernel26-lts>=2.6.35' 'kernel26-lts<2.6.36' "catalyst-utils=${pkgver}")
makedepends=('gcc-libs' 'gcc>4.0.0' 'make' 'kernel26-headers')
conflicts=('catalyst-test' 'nvidia' 'xf86-video-ati' 'xf86-video-radeonhd' 'ati-dri')
install=catalyst.install
source=(http://www2.ati.com/drivers/linux/ati-driver-installer-${pkgver/./-}-x86.x86_64.run
ati_make.sh
makefile_compat.patch
2.6.38_console.patch)
md5sums=('4db782c2a7924b965918275c39157a28'
'660396540b0ceaff71d6155c986734de'
'3e1b82bd69774ea808da69c983d6a43b'
'dde819cfc936032f98aa04a5d404b3ad')
build() {
msg "Setting compilation variables ..."
## include ati_make.sh and use _ati_check function from it
. ati_make.sh
_ati_check
msg "Unpacking archive ..."
/bin/sh ./ati-driver-installer-${pkgver/./-}-x86.x86_64.run --extract archive_files
if [ "${CARCH}" = "x86_64" ]; then
BUILDARCH=x86_64
_archdir=x86_64
fi
if [ "${CARCH}" = "i686" ]; then
BUILDARCH=i386
_archdir=x86
fi
cd "${srcdir}/archive_files/"
msg "Applying patch(es) ..."
## makefile patch to choose arch_compat_alloc_user_space or older compat_alloc_user_space
## works only in combination with ati_make.sh script
patch -Np1 -i ../makefile_compat.patch || return 1
## 2.6.38 patch made for 2.6.38rc3
patch -Np1 -i ../2.6.38_console.patch || return 1
# if [[ ${_kernver:0:6} == "2.6.37" ]] || [[ ${_kernver:0:6} > "2.6.37" ]]; then
# patch -Np1 -i ../sema_init.patch || return 1
# fi
cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
cp "${srcdir}/archive_files/arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC4" . || return 1
cp 2.6.x/Makefile . || return 1
msg "Compiling fglrx module ..."
## Compile module using _ati_check variables
make -C /lib/modules/${_kernver}/build SUBDIRS="`pwd`" ARCH=${BUILDARCH} \
MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
}
package() {
cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
install -m755 -d "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
install -m644 fglrx.ko "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
## License
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 "${srcdir}/archive_files/ATI_LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/*.install
}
#!/bin/bash
### Vi0L0: it is ati's code from their make.sh file, modified a bit to fit our arch linux system, used inside PKGBUILD
# Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA.
# All Rights Reserved.
#
# Your use and or redistribution of this software in source and \ or
# binary form, with or without modification, is subject to: (i) your
# ongoing acceptance of and compliance with the terms and conditions of
# the ATI Technologies Inc. software End User License Agreement; and (ii)
# your inclusion of this notice in any version of this software that you
# use or redistribute. A copy of the ATI Technologies Inc. software End
# User License Agreement is included with this software and is also
# available by contacting ATI Technologies Inc. at http://www.ati.com
function _ati_check()
{
# ==============================================================
# resolve if we are running a SMP enabled kernel
SMP=0
# 1
# grep in OsVersion string for SMP specific keywords
OsVersion=`uname -v`
if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]; then
SMP=1
echo "OsVersion says: SMP=$SMP"
fi
# 2
# grep in /proc/ksyms for SMP specific kernel symbols
# use triggerlevel of 10 occurences
# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep smp $src_file -c` -gt 10 ]; then
SMP=1
echo "file $src_file says: SMP=$SMP"
fi
fi
# 3
# linux/autoconf.h may contain this: #define CONFIG_SMP 1
# Before 2.6.33 autoconf.h is under linux/.
# For 2.6.33 and later autoconf.h is under generated/.
if [ -f /lib/modules/${_kernver}/build/include/generated/autoconf.h ]; then
autoconf_h=/lib/modules/${_kernver}/build/include/generated/autoconf.h
else
autoconf_h=/lib/modules/${_kernver}/build/include/linux/autoconf.h
fi
src_file=$autoconf_h
if [ ! -e $src_file ]; then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]; then
SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
echo "file $src_file says: SMP=$SMP"
fi
fi
if [ "$SMP" = 0 ]; then
echo "assuming default: SMP=$SMP"
fi
# act on final result
if [ ! "$SMP" = 0 ]; then
smp="-SMP"
def_smp=-D__SMP__
fi
# ==============================================================
# resolve whether we need to set PAGE_ATTR_FIX
PAGE_ATTR_FIX=0
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]; then
PAGE_ATTR_FIX=1
echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX"
fi
fi
# ==============================================================
# resolve if we are running a MODVERSIONS enabled kernel
MODVERSIONS=0
# autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
src_file=$autoconf_h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
then
MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
echo "file $src_file says: MODVERSIONS=$MODVERSIONS"
fi
fi
if [ "$MODVERSIONS" = 0 ]
then
echo "assuming default: MODVERSIONS=$MODVERSIONS"
fi
# act on final result
if [ ! "$MODVERSIONS" = 0 ]
then
def_modversions="-DMODVERSIONS"
fi
# ==============================================================
# resolve if we are building for a kernel with a fix for CVE-2010-3081
# On kernels with the fix, use arch_compat_alloc_user_space instead
# of compat_alloc_user_space since the latter is GPL-only
COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
src_file=/lib/modules/${_kernver}/build/arch/x86/include/asm/compat.h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep -c arch_compat_alloc_user_space` -gt 0 ]
then
COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
fi
echo "file $src_file says: COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE"
fi
}
\ No newline at end of file
KERNEL_VERSION=2.6.35-CHAKRA-LTS
whisperer(){
echo "----------------------------------------------------------------"
echo "Don't forget to add fglrx into MODULES array of /etc/rc.conf"
echo "----------------------------------------------------------------"
echo "For more info and more troubleshooting visit:"
echo "http://wiki.archlinux.org/index.php/ATI_Catalyst"
echo "----------------------------------------------------------------"
echo ""
echo "--------------------------- == * == ----------------------------"
echo "catalyst package has been splited between:"
echo "- catalyst (module for stock kernel)"
echo "- catalyst-utils (libs and stuff)"
echo ""
echo "and optional:"
echo "- catalyst-hook (auto rebuilding script and source files)"
echo "- catalyst-daemon (auto rebuilding script and source files)"
echo "- catalyst-generator (generator of catalyst-{kernver} packages)"
echo "----------------------------------------------------------------"
}
remove_hook(){
##removing hook's entries
# remove hook fglrx
sed '/^HOOKS/s/ *fglrx//' -i /etc/mkinitcpio.conf
# remove heads
sed '/^SyncFirst/s/ *kernel26-headers//' -i /etc/pacman.conf
}
post_install() {
depmod $KERNEL_VERSION
whisperer
}
post_upgrade() {
remove_hook
depmod $KERNEL_VERSION
whisperer
}
post_remove() {
depmod $KERNEL_VERSION