diff --git a/config/functions b/config/functions old mode 100644 new mode 100755 index 2fe22d986d..65c788030b --- a/config/functions +++ b/config/functions @@ -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* +} + diff --git a/config/path b/config/path old mode 100644 new mode 100755 index f60f280fa5..d4b2024426 --- a/config/path +++ b/config/path @@ -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 diff --git a/packages/linux-drivers/aver_h826d/build b/packages/linux-drivers/aver_h826d/build new file mode 100755 index 0000000000..60a261766a --- /dev/null +++ b/packages/linux-drivers/aver_h826d/build @@ -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" diff --git a/packages/linux-drivers/aver_h826d/install b/packages/linux-drivers/aver_h826d/install new file mode 100755 index 0000000000..bdcf91d47c --- /dev/null +++ b/packages/linux-drivers/aver_h826d/install @@ -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 diff --git a/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/_prebuild.o_shipped b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/_prebuild.o_shipped new file mode 100644 index 0000000000..f167884b53 Binary files /dev/null and b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/_prebuild.o_shipped differ diff --git a/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/aver/osdep_dvb.o_shipped b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/aver/osdep_dvb.o_shipped new file mode 100644 index 0000000000..9c98ea8137 Binary files /dev/null and b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-4GREG/aver/osdep_dvb.o_shipped differ diff --git a/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/_prebuild.o_shipped b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/_prebuild.o_shipped new file mode 100644 index 0000000000..9a49dc8a22 Binary files /dev/null and b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/_prebuild.o_shipped differ diff --git a/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/aver/osdep_dvb.o_shipped b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/aver/osdep_dvb.o_shipped new file mode 100644 index 0000000000..38ab6ef008 Binary files /dev/null and b/packages/linux-drivers/aver_h826d/kdep_2.6.30/OBJ-x64/aver/osdep_dvb.o_shipped differ diff --git a/packages/linux-drivers/aver_h826d/meta b/packages/linux-drivers/aver_h826d/meta new file mode 100644 index 0000000000..e390a0a659 --- /dev/null +++ b/packages/linux-drivers/aver_h826d/meta @@ -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" diff --git a/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch b/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch new file mode 100644 index 0000000000..43d8659c47 --- /dev/null +++ b/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch @@ -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 +@@ -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 +@@ -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 +@@ -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 diff --git a/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch.txt b/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch.txt new file mode 100644 index 0000000000..181f84035f --- /dev/null +++ b/packages/linux-drivers/aver_h826d/patches-manual/aver_h826d-0.10-100-latest_kernel.patch.txt @@ -0,0 +1 @@ +http://linuxtv.org/wiki/index.php/AVerMedia_AverTV_Hybrid_Volar_HX_(A827) \ No newline at end of file diff --git a/packages/linux-drivers/aver_h826d/unpack b/packages/linux-drivers/aver_h826d/unpack new file mode 100755 index 0000000000..de62af18dc --- /dev/null +++ b/packages/linux-drivers/aver_h826d/unpack @@ -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 diff --git a/projects/Fusion/options b/projects/Fusion/options index 866fd589b8..9f50fdb787 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic/options b/projects/Generic/options index 98d89832a1..d1bfa313be 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options index 9903a82c34..57887cf8ff 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/ION/options b/projects/ION/options index 9162623451..737a6d1b8c 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Intel/options b/projects/Intel/options index f6c24db492..329a066a5a 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Ultra/options b/projects/Ultra/options index 24f4c4467b..d9f110b8f9 100755 --- 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 a867_drv" + ADDITIONAL_DRIVERS="asix-ax887xx AF9035 a867_drv aver_h826d" # build with network support (yes / no) NETWORK="yes"