linux: driver for DVB-T AVerMedia AverTV Hybrid Volar HX (A827)

This commit is contained in:
peter 2011-11-08 20:29:34 +01:00
parent 9169369bc2
commit fc5e7061c6
18 changed files with 233 additions and 6 deletions

15
config/functions Normal file → Executable file
View File

@ -15,6 +15,7 @@ setup_toolchain() {
export NM=$TARGET_NM
export RANLIB=$TARGET_RANLIB
export OBJCOPY=$TARGET_OBJCOPY
export OBJDUMP=$TARGET_OBJDUMP
export STRIP=$TARGET_STRIP
export CPPFLAGS="$TARGET_CPPFLAGS"
export CFLAGS="$TARGET_CFLAGS"
@ -174,3 +175,17 @@ strip_gold() {
LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||g"`
}
fix_module_depends() {
# modify .modinfo section in kernel module to depends on other required modules
local MODULE="$1"
local DEPENDS="$2"
cp ${MODULE} ${MODULE}_orig
$OBJDUMP -s -j .modinfo ${MODULE}_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
/bin/echo -ne `cat new.modinfo2` >new.modinfo3
cat new.modinfo3 | tr '\000' '\n' | awk '/^depends=/ {next;} {print $0;}' | tr '\n' '\000' >new.modinfo4
/bin/echo -ne "depends=$DEPENDS\0" >>new.modinfo4
$OBJCOPY --remove-section=.modinfo --add-section=.modinfo=new.modinfo4 --set-section-flags .modinfo=contents,alloc,load,readonly,data ${MODULE}_orig ${MODULE}
rm new.modinfo*
}

1
config/path Normal file → Executable file
View File

@ -82,6 +82,7 @@ TARGET_AR=${TARGET_PREFIX}ar
TARGET_NM=${TARGET_PREFIX}nm
TARGET_RANLIB=${TARGET_PREFIX}ranlib
TARGET_OBJCOPY=${TARGET_PREFIX}objcopy
TARGET_OBJDUMP=${TARGET_PREFIX}objdump
TARGET_STRIP=${TARGET_PREFIX}strip
. config/optimize

View File

@ -0,0 +1,29 @@
#!/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/installer/src
make KERNELDIR=$(kernel_path)
fix_module_depends "h826d.ko" "averusbh826d,videodev"

View File

@ -0,0 +1,28 @@
#!/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/aver_h826d
cp $PKG_BUILD/installer/src/*.ko $INSTALL/lib/modules/$VER/aver_h826d

View File

@ -0,0 +1,36 @@
################################################################################
# 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="aver_h826d"
PKG_VERSION="0.10"
PKG_REV="1"
PKG_ARCH="i386 x86_64"
PKG_LICENSE="GPL"
PKG_SITE="http://www.avermedia-usa.com/avertv/product/ProductDetail.aspx?Id=431&tab=APDriver"
[ "$TARGET_ARCH" = "i386" ] && PKG_URL="http://www.avermedia-usa.com/AVerTV/Upload/Download/C038A827H826_Installer_x86_0.10-Beta_091126.zip"
[ "$TARGET_ARCH" = "x86_64" ] && PKG_URL="http://www.avermedia-usa.com/AVerTV/Upload/Download/C038A827H826_Installer_x64_0.10-Beta_091126.zip"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain linux busybox-hosttools"
PKG_PRIORITY="optional"
PKG_SECTION="driver"
PKG_SHORTDESC="AVerTV Hybrid Volar MAX H826 driver"
PKG_LONGDESC="AVerTV Hybrid Volar MAX H826 driver"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"

View File

@ -0,0 +1,65 @@
diff -Nr -u0 original/installer/installer.sh modified/installer/installer.sh
--- original/installer/installer.sh 2009-11-13 11:47:33.000000000 +0100
+++ modified/installer/installer.sh 2011-08-28 20:58:38.000000000 +0200
@@ -177,13 +176,0 @@
- if [[ "$kversion" != "2" || "$kpatchlevel" != "6" ]]; then
- dialog --backtitle "$BACKTITLE" \
- --title "Kernel version error" \
- --msgbox "Installer cannot determine kernel version or the running kernel is not 2.6.x kernel. \n\
-Installer will abort now.
-" \
- 10 $WIDTH
- log "generate_kdep_string: wrong kernel version ${kversion}.${kpatchlevel}.${ksublevel}. Abort."
- log_from_file $ksrc/Makefile #s016
- log_from_file $kobj/Makefile #s016
- exit
- fi
-
diff -Nr -u0 original/installer/src/aver/osdep.c modified/installer/src/aver/osdep.c
--- original/installer/src/aver/osdep.c 2009-11-13 11:54:56.000000000 +0100
+++ modified/installer/src/aver/osdep.c 2011-08-28 20:19:19.000000000 +0200
@@ -89 +88,0 @@
-#include <linux/smp_lock.h>
@@ -435 +434 @@
- init_MUTEX(tmp);
+ sema_init(tmp, 1);
@@ -439 +438 @@
- init_MUTEX_LOCKED(tmp);
+ sema_init(tmp, 0);
@@ -1069,0 +1069 @@
+static DEFINE_MUTEX(dvbdev_mutex);
@@ -1072 +1072 @@
- lock_kernel();
+ mutex_lock(&dvbdev_mutex);
@@ -1077 +1077 @@
- unlock_kernel();
+ mutex_unlock(&dvbdev_mutex);
diff -Nr -u0 original/installer/src/aver/osdep_dvb.c modified/installer/src/aver/osdep_dvb.c
--- original/installer/src/aver/osdep_dvb.c 2009-11-13 11:54:57.000000000 +0100
+++ modified/installer/src/aver/osdep_dvb.c 2011-08-28 20:19:36.000000000 +0200
@@ -79 +78,0 @@
-#include <linux/smp_lock.h>
@@ -233 +232 @@
- init_MUTEX(&p->feedlock);
+ sema_init(&p->feedlock, 1);
diff -Nr -u0 original/installer/src/aver/osdep_th2.c modified/installer/src/aver/osdep_th2.c
--- original/installer/src/aver/osdep_th2.c 2009-11-13 11:54:57.000000000 +0100
+++ modified/installer/src/aver/osdep_th2.c 2011-08-28 20:20:00.000000000 +0200
@@ -78 +77,0 @@
-#include <linux/smp_lock.h>
@@ -80,0 +80 @@
+#include "osdep.h"
@@ -90 +90 @@
- lock_kernel();
+ SysLockKernel();
@@ -100 +100 @@
- unlock_kernel();
+ SysUnlockKernel();
diff -Nr -u0 original/installer/src/aver/osdep_v4l2.c modified/installer/src/aver/osdep_v4l2.c
--- original/installer/src/aver/osdep_v4l2.c 2009-11-13 11:54:58.000000000 +0100
+++ modified/installer/src/aver/osdep_v4l2.c 2011-08-28 20:20:19.000000000 +0200
@@ -75,0 +76,2 @@
+#define VFL_TYPE_VTX 3
+
@@ -84 +85,0 @@
-#include <linux/smp_lock.h>

View File

@ -0,0 +1 @@
http://linuxtv.org/wiki/index.php/AVerMedia_AverTV_Hybrid_Volar_HX_(A827)

View File

@ -0,0 +1,52 @@
#!/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
ZIP_PKG="`echo $PKG_URL | sed 's%.*/\(.*\)$%\1%'`"
mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION}
unzip $SOURCES/$1/$ZIP_PKG -d $BUILD/${PKG_NAME}-${PKG_VERSION} >/dev/null 2>&1
tail -n +115 $BUILD/${PKG_NAME}-${PKG_VERSION}/H826D_Installer_*/AVERMEDIA-Linux-*-H826D-0.10-beta.sh | bzip2 -d | tar xf - -C $BUILD/${PKG_NAME}-${PKG_VERSION}
# this code is copied from scripts/unpack
PKG_BUILD=`ls -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION}`
for i in $PKG_DIR/patches-manual/$PKG_NAME-$PKG_VERSION*.patch ; do
if [ -f "$i" ]; then
PATCH=`basename $i`
PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
printf "%${INDENT}c SKIP PATCH: $i\n" >&$SILENT_OUT
continue;
else
printf "%${INDENT}c APPLY PATCH: $i\n" >&$SILENT_OUT
cat $i | patch -p1 -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
fi
fi
done
# prebuild objects were hex edited for kernel 3.1
[ "$TARGET_ARCH" = "x86_64" ] && KVSTR=x64
[ "$TARGET_ARCH" = "i386" ] && KVSTR=4GREG
cp -rf $PKG_DIR/kdep_2.6.30/OBJ-$KVSTR/* $BUILD/${PKG_NAME}-${PKG_VERSION}/installer/src

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"

View File

@ -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 a867_drv"
ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d"
# build with network support (yes / no)
NETWORK="yes"