diff --git a/packages/linux-drivers/AF9035/build b/packages/linux-drivers/AF9035/build index 9eb2940283..adedea01d5 100755 --- a/packages/linux-drivers/AF9035/build +++ b/packages/linux-drivers/AF9035/build @@ -24,9 +24,24 @@ cd $PKG_BUILD +[ -z "$OBJDUMP" ] && OBJDUMP=${TARGET_PREFIX}objdump +[ -z "$ECHO" ] && ECHO=/bin/echo + # fix some directives after unpacking sed -i "s|KDIR = .*|KDIR = $(kernel_path)|" Makefile sed -i "s|KSRC = .*|KSRC = \$KDIR|" Makefile sed -i "s|KINS = .*|KINS = \./modules|" Makefile make CC=$CC + +# ultraman: Original build module doesn't depends on dvb-usb module +# How to fix that? For now let's just modify .modinfo section in kernel module +# and depmod will pick up appropriate dependend modules +cp dvb-usb-af9035.ko dvb-usb-af9035.ko_orig +$OBJDUMP -s -j .modinfo dvb-usb-af9035.ko_orig | awk 'BEGIN{v=0;} /Contents/ {v=1; next;} {if (v==1) print $0;}' >new.modinfo1 +cat new.modinfo1 | cut -c7-41 | awk '{printf($0);}' | sed 's/ //g;s/../\\\x&/g;' >new.modinfo2 +$ECHO -ne `cat new.modinfo2` >new.modinfo3 +cat new.modinfo3 | tr '\000' '\n' | awk '/^depends=/ {next;} {print $0;}' | tr '\n' '\000' >new.modinfo4 +$ECHO -ne "depends=dvb-usb\0" >>new.modinfo4 +$OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo4 --set-section-flags .modinfo=contents,alloc,load,readonly,data dvb-usb-af9035.ko_orig dvb-usb-af9035.ko +rm new.modinfo* diff --git a/packages/linux-drivers/a867_drv/build b/packages/linux-drivers/a867_drv/build new file mode 100755 index 0000000000..80cc7aa923 --- /dev/null +++ b/packages/linux-drivers/a867_drv/build @@ -0,0 +1,42 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +cd $PKG_BUILD + +[ -z "$OBJDUMP" ] && OBJDUMP=${TARGET_PREFIX}objdump +[ -z "$ECHO" ] && ECHO=/bin/echo + +make CC=$CC KSRC=$(kernel_path) KOBJ=$(kernel_path) + +# ultraman: Original build module doesn't depends on dvb-usb module +# How to fix that? For now let's just modify .modinfo section in kernel module +# and depmod will pick up appropriate dependend modules +cp a867.ko a867.ko_orig +$OBJDUMP -s -j .modinfo a867.ko_orig | awk 'BEGIN{v=0;} /Contents/ {v=1; next;} {if (v==1) print $0;}' >new.modinfo1 +cat new.modinfo1 | cut -c7-41 | awk '{printf($0);}' | sed 's/ //g;s/../\\\x&/g;' >new.modinfo2 +$ECHO -ne `cat new.modinfo2` >new.modinfo3 +cat new.modinfo3 | tr '\000' '\n' | awk '/^depends=/ {next;} {print $0;}' | tr '\n' '\000' >new.modinfo4 +$ECHO -ne "depends=dvb-usb\0" >>new.modinfo4 +$OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo4 --set-section-flags .modinfo=contents,alloc,load,readonly,data a867.ko_orig a867.ko +rm new.modinfo* diff --git a/packages/linux-drivers/a867_drv/install b/packages/linux-drivers/a867_drv/install new file mode 100755 index 0000000000..238f6a8dc2 --- /dev/null +++ b/packages/linux-drivers/a867_drv/install @@ -0,0 +1,33 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +VER=`ls $BUILD/linux*/modules/lib/modules` + +mkdir -p $INSTALL/lib/modules/$VER/a867 +cp $PKG_BUILD/a867.ko $INSTALL/lib/modules/$VER/a867/ + +$ROOT/$TOOLCHAIN/sbin/depmod -b $INSTALL $VER > /dev/null +for i in `ls $INSTALL/lib/modules/*/modules.* | grep -v modules.dep | grep -v modules.alias | grep -v modules.symbols`; do + rm -f $i +done diff --git a/packages/linux-drivers/a867_drv/meta b/packages/linux-drivers/a867_drv/meta new file mode 100755 index 0000000000..7178a7209e --- /dev/null +++ b/packages/linux-drivers/a867_drv/meta @@ -0,0 +1,35 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="a867_drv" +PKG_VERSION="v1.0.28" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.avermedia.com/Product/ProductDetail.aspx?Id=516&tab=APDriver" +PKG_URL="http://www.avermedia.com/avertv/Upload/Download/${PKG_NAME}_${PKG_VERSION}.tar.bz2" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain linux busybox-hosttools" +PKG_PRIORITY="optional" +PKG_SECTION="driver" +PKG_SHORTDESC="AVerTV Volar HD Nano A867R driver" +PKG_LONGDESC="AVerTV Volar HD Nano A867R driver" +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch b/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch new file mode 100644 index 0000000000..a21f9df225 --- /dev/null +++ b/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch @@ -0,0 +1,75 @@ +diff -Nur a867_drv_v1.0.28/af903x-drv.c a867_drv_v1.0.28_modif//af903x-drv.c +--- a867_drv_v1.0.28/af903x-drv.c 2010-11-10 04:46:22.000000000 +0100 ++++ a867_drv_v1.0.28_modif//af903x-drv.c 2011-07-24 11:41:45.162923006 +0200 +@@ -1103,8 +1103,8 @@ + PDC->StreamType = StreamType_DVBT_DATAGRAM; + PDC->UsbCtrlTimeOut = 1; + +- init_MUTEX(&PDC->powerLock); +- init_MUTEX(&PDC->tunerLock); ++ sema_init(&PDC->powerLock,1); ++ sema_init(&PDC->tunerLock,1); + PDC->power_use_count = 0; + + PDC->idVendor = udev->descriptor.idVendor; +@@ -1116,7 +1116,7 @@ + PDC->fc[0].AVerFlags = 0x00; + PDC->fc[1].AVerFlags = 0x00; + +- init_MUTEX(&PDC->regLock); ++ sema_init(&PDC->regLock,1); + } + else { + PDC->UsbCtrlTimeOut = 5; +diff -Nur a867_drv_v1.0.28/af903x-fe.c a867_drv_v1.0.28_modif//af903x-fe.c +--- a867_drv_v1.0.28/af903x-fe.c 2010-11-10 04:46:22.000000000 +0100 ++++ a867_drv_v1.0.28_modif//af903x-fe.c 2011-07-24 11:43:58.543584444 +0200 +@@ -1,5 +1,5 @@ + #include +-#include ++//#include + #include + #include + #include +@@ -678,7 +678,7 @@ + deb_data("- Enter %s Function -\n",__FUNCTION__); + if( !state ) return -1; + +- lock_kernel(); ++ //lock_kernel(); + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61) + daemonize(); + sigfillset(¤t->blocked); +@@ -689,7 +689,7 @@ + #endif + siginitsetinv(¤t->blocked, sigmask(SIGKILL)|sigmask(SIGINT)|\ + sigmask(SIGTERM)); +- unlock_kernel(); ++ //unlock_kernel(); + + while(!state->thread_should_stop && !signal_pending(current)) { + +diff -Nur a867_drv_v1.0.28/af903x.h a867_drv_v1.0.28_modif//af903x.h +--- a867_drv_v1.0.28/af903x.h 2010-11-10 04:46:22.000000000 +0100 ++++ a867_drv_v1.0.28_modif//af903x.h 2011-07-24 11:42:54.563267143 +0200 +@@ -9,7 +9,7 @@ + #include + #include + #include +-#include ++//#include + #include + #include + #include +diff -Nur a867_drv_v1.0.28/usb2impl.c a867_drv_v1.0.28_modif//usb2impl.c +--- a867_drv_v1.0.28/usb2impl.c 2010-11-10 10:27:27.000000000 +0100 ++++ a867_drv_v1.0.28_modif//usb2impl.c 2011-07-24 11:43:09.915343276 +0200 +@@ -10,7 +10,7 @@ + #include + #include + #include +-#include ++//#include + #include + #include + #include diff --git a/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch.txt b/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch.txt new file mode 100755 index 0000000000..e87806c416 --- /dev/null +++ b/packages/linux-drivers/a867_drv/patches/a867_drv-v1.0.28-100-BKL_removal.patch.txt @@ -0,0 +1,2 @@ +http://www.aviolat-chauffage.ch/~xens/wordpress/?p=229 +http://www.aviolat-chauffage.ch/~xens/files/a867_drv_v1.0.28_BKL_removal.patch.tar.gz \ No newline at end of file diff --git a/projects/ATV/options b/projects/ATV/options old mode 100644 new mode 100755 index dc3774ab8e..9607209c40 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035 bcm_sta" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 bcm_sta a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Fusion/options b/projects/Fusion/options old mode 100644 new mode 100755 index deec81c57a..4d00aba18a --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic/options b/projects/Generic/options old mode 100644 new mode 100755 index a9be35fadf..0dd689633c --- a/projects/Generic/options +++ b/projects/Generic/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options old mode 100644 new mode 100755 index d37b1496eb..ef7a6dc4f9 --- a/projects/Generic_OSS/options +++ b/projects/Generic_OSS/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/ION/options b/projects/ION/options old mode 100644 new mode 100755 index c733229e8b..c3574d6891 --- a/projects/ION/options +++ b/projects/ION/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Intel/options b/projects/Intel/options old mode 100644 new mode 100755 index e38b715bf4..1e40348bb1 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Ultra/options b/projects/Ultra/options old mode 100644 new mode 100755 index b449b026b1..b52768bd65 --- a/projects/Ultra/options +++ b/projects/Ultra/options @@ -150,7 +150,7 @@ # asix-ax887xx: Asix AX887xx USB LAN Driver # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="asix-ax887xx AF9035" - ADDITIONAL_DRIVERS="asix-ax887xx AF9035" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv" # build with network support (yes / no) NETWORK="yes"