Permalink
Browse files

ebuild for avermedia-a828 usb adapter kernel driver

  • Loading branch information...
1 parent ca72929 commit c8c8999fc9db6ac3d7590eb50f83479528499ee0 @wired committed Apr 5, 2011
@@ -0,0 +1,73 @@
+
+AVerMedia TECHNOLOGIES, Inc.
+AVerMedia Linux Driver License Agreement
+
+
+
+IMPORTANT: This AVerMeida Linux Driver is supplied to you by
+AVerMedia TECHNOLOGIES, Inc. ("AVerMedia") in consideration
+of your agreement to the following terms, and your use, installation,
+modification or redistribution of this AVerMedia Linux Driver
+constitutes acceptance of these terms. If you do not agree with
+these terms, please do not use, install, modify or redistribute
+this AVerMedia Linux Driver.
+
+1. License. Any driver sources, binaries, utilities, documentation
+and other materials accompanying this License, whether on disk,
+print or electronic documentation, in read only memory, or any
+other media, (collectively, the "AVerMedia Linux Driver") are
+licensed, not sold, to you by AVerMedia for use only under the terms
+of this License, and AVerMedia reserves all rights not expressly
+granted to you. The rights granted herein are limited to AVerMedia's
+intellectual property rights in the AVerMedia Linux Driver and do not
+include any other patents or intellectual property rights. You own
+the media on which the AVerMedia Linux Driver is recorded but AVerMedia
+retains ownership of the AVerMedia Linux Driver itself and its
+derivative works. The AVerMedia Linux Driver in this package and
+any copies, modifications and derivative works which this License
+authorizes you to make are subject to this License. The binaries
+part of AVerMedia Linux Driver is ported from Windows driver and
+is under some other NDA, so the original source code will not be
+released.
+
+2. Permitted Uses and Restrictions. You may use, copy, redistribute
+or install the original AVerMedia Linux Driver to test or demonstrate
+the AVerMedia Linux Driver with AVerMedia's products. You may also
+modify the released source code in order to improve the compatibilities,
+operability and functionalities with AVerMedia's products as long as
+this License in whole are remained and subsequently use, copy,
+redistribute or install the derivative works. You have no right to
+reverse engineer, decompile, disassemble the accompanying object files
+through the released source code, nor to modify, incorporate into or
+compile in combination with your own programs to operate with any
+product other than from AVerMedia. Your rights under this License
+will terminate automatically without notice from AVerMedia if you
+fail to comply with any term(s) of this License.
+
+3. Disclaimer of Warranty. The AVerMedia Linux Driver may be "alpha",
+"beta", "development", pre-release, untested, and/or not fully tested
+and may contain errors that could cause failures or loss of data, be
+incomplete or contain inaccuracies. YOU EXPRESSLY ACKNOWLEDGE AND AGREE
+THAT USE OF THE AVERMEDIA LINUX DRIVER IS AT YOUR SOLE RISK AND THAT THE
+ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT
+IS WITH YOU. THE AVERMEDIA LINUX DRIVER IS PROVIDED "AS IS" WITH ALL
+FAULTS. THE USER ASSUMES TOTAL RESPONSIBILITY AND ALL RISKS ASSOCIATED
+WITH USE OF THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, RISKS OF ANY
+DEFECTS, INACCURACIES, PROGRAM ERRORS, DAMAGE TO OR LOSS OF DATA,
+PROGRAMS OR EQUIPMENT, UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
+AVERMEDIA DOES NOT MAKE, AND EXPRESSLY DISCLAIM, ANY EXPRESS OR IMPLIED
+WARRANTIES OF ANY KIND WHATSOEVER, INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES
+OF TITLE OR NON-INFRINGEMENT. AVERMEDIA DOES NOT WARRANT THAT THE USE
+OR OPERATION OF THE SOFTWARE WILL BE UNITERRUPTED OR ERROR FREE.
+
+4. Complete Agreement. This License constitutes the entire agreement
+between the parties with respect to the use of the AVerMedia Linux
+Driver licensed hereunder and supersedes all prior or contemporaneous
+understandings regarding such subject matter. No amendment to or
+modification of this License will be binding unless in writing and
+signed by AVerMedia. Any translation of this License is done for
+local requirements and in the event of a dispute between the English
+and any non-English versions, the English version of this License
+shall govern.
+
@@ -0,0 +1,5 @@
+AUX avermedia-a828-2.6.37.patch 1900 RMD160 f920b0c8e46222b16eebb04a94f8837506f999eb SHA1 a2440fb11ff8fb096cc3317f719f4aa3b52cec54 SHA256 fe9a1c1e0245d34fcddec5b545b04209ba4d6d808843f36646352c13cfcc6861
+AUX avermedia-a828.installer.patch 1305 RMD160 ff72693396d5f40d187acc84165edacd94c58d5d SHA1 6466404695b4ae99903d20031895c9f1d1957d8c SHA256 7fda60f68e210f7c7ebefc68c110408b33c01f3b339a6272856513c742977652
+AUX install_prebuilt.sh 4276 RMD160 3aec631e52a7baf3a4e48933a9d116688d12a887 SHA1 07cb0c46d386b6785464ca7e25300a878b1df833 SHA256 e695882775d4ae1ffb43f49285ea8d0a38072165c1bc3c222ec56f3bf2bd5e74
+DIST A828_Installer_x64_0.28-Beta_091125.zip 1617723 RMD160 12953528fdb9739a5e0a4c58b564ac88b36f0ff8 SHA1 8ab6b7fb37f549147ac060a19d591dff7d346430 SHA256 0c51f73347451c6a12c5973a7f76df496e79ce21a1daacd676ca5f117581a856
+EBUILD avermedia-a828-0.28_beta.ebuild 1227 RMD160 d52a6adfe94a3e6b78f3325cde26b614aaaf21bf SHA1 2431c444381b27764a9314978659f001bbcf529d SHA256 24b2eb921276731cfef36f90406364217146d9ac8e0588de29f4da8f7ae96610
@@ -0,0 +1,54 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit linux-mod
+
+DESCRIPTION="Kernel module for the Avermedia A828 USB Adapter"
+HOMEPAGE="http://www.avermedia.com/"
+SRC_URI="
+ amd64? (
+ http://www.avermedia.com/avertv/Support/DownloadCount.aspx?FDFId=3204 ->
+ A828_Installer_x64_0.28-Beta_091125.zip
+ )
+ "
+
+LICENSE="AVerMediaLinuxDriver"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RESTRICT="mirror strip"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/"A828_Installer_x64_0.28-Beta"
+
+pkg_setup() {
+ MODULE_NAMES="
+ averusba828(video:${S}/drv/installer/src:${S}/drv/installer/src)
+ a828(video:${S}/drv/installer/src:${S}/drv/installer/src)
+ "
+ BUILD_TARGETS="default"
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ # fix the installer
+ epatch "${FILESDIR}"/"${PN}".installer.patch
+
+ # extract the thing
+ ./AVERMEDIA-Linux-x64-A828-0.28-beta.sh "${S}"/drv
+
+ cd drv/installer
+ # fix driver
+ # http://www.linuxtv.org/wiki/index.php/AVerMedia_A828
+ kernel_is ge 2 6 37 && epatch "${FILESDIR}"/"${PN}"-2.6.37.patch
+
+ cp "${FILESDIR}"/install_prebuilt.sh .
+ # moving prebuilt stuff to place
+ ./install_prebuilt.sh "${S}"/drv/installer $KV_DIR $KV_OUT_DIR
+}
@@ -0,0 +1,75 @@
+diff -u -ur src-orig//aver/osdep.c src/aver/osdep.c
+--- src-orig//aver/osdep.c 2011-04-05 12:25:38.705956015 +0300
++++ src/aver/osdep.c 2011-04-05 12:28:14.779956016 +0300
+@@ -432,11 +432,11 @@
+ if( !tmp ) return -ENOMEM;
+
+ if(st_Mutex == type) {
+- init_MUTEX(tmp);
++ sema_init(tmp, 1);
+ *sem = (pSemaphore) tmp;
+ }
+ else if(st_MutexLocked == type) {
+- init_MUTEX_LOCKED(tmp);
++ sema_init(tmp, 0);
+ *sem = (pSemaphore) tmp;
+ }
+ else {
+@@ -1067,14 +1067,15 @@
+ kfree(kref);
+ }
+
++static DEFINE_MUTEX(dvbdev_mutex);
+ void SysLockKernel()
+ {
+- lock_kernel();
++ mutex_lock(&dvbdev_mutex);
+ }
+
+ void SysUnlockKernel()
+ {
+- unlock_kernel();
++ mutex_unlock(&dvbdev_mutex);
+ }
+
+ unsigned long SysCopyToUser(void *to, const void *from, unsigned long n)
+diff -u -ur src-orig//aver/osdep_th2.c src/aver/osdep_th2.c
+--- src-orig//aver/osdep_th2.c 2011-04-05 12:25:38.705956015 +0300
++++ src/aver/osdep_th2.c 2011-04-05 12:28:14.785956016 +0300
+@@ -78,6 +78,7 @@
+ #include <linux/smp_lock.h>
+ #include <linux/sched.h>
+ #include "osdep_th2.h"
++#include "osdep.h"
+
+
+ int SysKernelThread(void (*func)(void *),void *thObj)
+@@ -87,7 +88,7 @@
+
+ int SysSetThreadName(const char *name)
+ {
+- lock_kernel();
++ SysLockKernel();
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61)
+ daemonize();
+ sigfillset(&current->blocked);
+@@ -97,7 +98,7 @@
+ allow_signal(SIGTERM);
+ #endif
+ siginitsetinv(&current->blocked, sigmask(SIGKILL)|sigmask(SIGINT)| sigmask(SIGTERM));
+- unlock_kernel();
++ SysUnlockKernel();
+
+ return 0;
+ }
+diff -u -ur src-orig//aver/osdep_v4l2.c src/aver/osdep_v4l2.c
+--- src-orig//aver/osdep_v4l2.c 2011-04-05 12:25:38.705956015 +0300
++++ src/aver/osdep_v4l2.c 2011-04-05 12:28:14.790956016 +0300
+@@ -98,6 +98,7 @@
+ #include "osdep_v4l2.h"
+
+ #include "debug.h"
++#define VFL_TYPE_VTX 3
+
+ struct videodev_context
+ {
@@ -0,0 +1,53 @@
+--- AVERMEDIA-Linux-x64-A828-0.28-beta.sh.old 2011-04-05 12:19:38.794956016 +0300
++++ AVERMEDIA-Linux-x64-A828-0.28-beta.sh 2011-04-05 12:24:07.952956016 +0300
+@@ -2,8 +2,8 @@
+ BASE=`(cd \`dirname $0\`; pwd)`
+ THIS=`basename $0`
+ END_OF_SCRIPT=115
+-MD5SUM=17ef6d18d6dae4332807c192b25c9589
+ TMPDIR=/tmp/avm-install
++[[ -n $1 ]] && TMPDIR=$1
+
+ install_package()
+ {
+@@ -84,12 +84,12 @@
+ cd $TMPDIR
+
+ # verify MD5 checksum
+-CHECKSUM=`tail -n +${END_OF_SCRIPT} $BASE/$THIS | md5sum /dev/stdin | awk '{print $1}'`
+-echo "Verifying archive integrity..."
+-if [[ "$CHECKSUM" != "$MD5SUM" ]]; then
+- echo "Archive integrity check failed. This installer is corrupted."
+- exit
+-fi
++#CHECKSUM=`tail -n +${END_OF_SCRIPT} $BASE/$THIS | md5sum /dev/stdin | awk '{print $1}'`
++#echo "Verifying archive integrity..."
++#if [[ "$CHECKSUM" != "$MD5SUM" ]]; then
++# echo "Archive integrity check failed. This installer is corrupted."
++# exit
++#fi
+
+ # extract archive and invoke installer
+ echo "Extracting archive..."
+@@ -100,15 +100,15 @@
+ exit
+ fi
+
+-echo "Running installer..."
+-cd installer
+-bash -i ./installer.sh
++#echo "Running installer..."
++#cd installer
++#bash -i ./installer.sh
+
+ # clean up
+-cd $BASE
+-rm -rf $TMPDIR
++#cd $BASE
++#rm -rf $TMPDIR
++echo "installed dir: $(pwd)"
+
+-clear
+ exit
+
+ ==END_OF_SCRIPT==
Oops, something went wrong.

0 comments on commit c8c8999

Please sign in to comment.