about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ov511
diff options
context:
space:
mode:
authorArmijn Hemel <armijn@gpl-violations.org>2006-01-03 15:49:54 +0000
committerArmijn Hemel <armijn@gpl-violations.org>2006-01-03 15:49:54 +0000
commitf6e4235c6b75135221df7600b3f5419a4a85eb1f (patch)
treec06f3139b8b982b8f09cb9f5a574454507d1d607 /pkgs/os-specific/linux/ov511
parentc476c825cbcb7adabe5a2e3f707e2ec45a9ae0cb (diff)
downloadnixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar.gz
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar.bz2
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar.lz
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar.xz
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.tar.zst
nixlib-f6e4235c6b75135221df7600b3f5419a4a85eb1f.zip
add ov511 kernel driver. This is for testing purposes. What we do is we build
the module and install it under $out/lib/modules/$kernelversion/ ...

Eventually we will make tons of symlinks from /lib/modules/$kernelversion
to this location, so we can safely run tools like depmod and friends.
I believe this is the least ugly hack to make it work.

svn path=/nixpkgs/trunk/; revision=4486
Diffstat (limited to 'pkgs/os-specific/linux/ov511')
-rw-r--r--pkgs/os-specific/linux/ov511/builder.sh18
-rw-r--r--pkgs/os-specific/linux/ov511/default.nix12
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-kernel.patch40
3 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/ov511/builder.sh b/pkgs/os-specific/linux/ov511/builder.sh
new file mode 100644
index 000000000000..8bb282cacf75
--- /dev/null
+++ b/pkgs/os-specific/linux/ov511/builder.sh
@@ -0,0 +1,18 @@
+source $stdenv/setup
+
+hashname=$(basename $kernel)
+echo $hashname
+if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
+  hashname=$(echo "$hashname" | cut -c -32)
+fi
+
+stripHash $kernel
+version=$(echo $strippedName | cut -c 7-)-$hashname
+
+echo "version $version"
+
+export version
+
+ensureDir $out/lib/modules/$version/kernel/drivers/usb/media/
+
+genericBuild
diff --git a/pkgs/os-specific/linux/ov511/default.nix b/pkgs/os-specific/linux/ov511/default.nix
new file mode 100644
index 000000000000..79f954b04117
--- /dev/null
+++ b/pkgs/os-specific/linux/ov511/default.nix
@@ -0,0 +1,12 @@
+{stdenv, fetchurl, kernel}:
+
+stdenv.mkDerivation {
+  name = "ov511-2.30";
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = http://alpha.dyndns.org/ov511/download/2.xx/distros/ov511-2.30.tar.bz2;
+    md5 = "9eacf9e54f2f54a59ddbf14221a53f2a";
+  };
+  patches = [./ov511-kernel.patch];
+  inherit kernel;
+}
diff --git a/pkgs/os-specific/linux/ov511/ov511-kernel.patch b/pkgs/os-specific/linux/ov511/ov511-kernel.patch
new file mode 100644
index 000000000000..98b1ec35e79e
--- /dev/null
+++ b/pkgs/os-specific/linux/ov511/ov511-kernel.patch
@@ -0,0 +1,40 @@
+diff -ruN ov511-2.30/do_install.sh ov511-2.30.new/do_install.sh
+--- ov511-2.30/do_install.sh	2003-11-12 09:24:29.000000000 +0100
++++ ov511-2.30.new/do_install.sh	2006-01-03 16:34:44.000000000 +0100
+@@ -6,10 +6,10 @@
+ 	exit 1
+ fi
+ 
+-UNAME=`uname -r`
++UNAME=$version
+ 
+-INSTALL_PATH_2_4=/lib/modules/$UNAME/kernel/drivers/usb/
+-INSTALL_PATH_2_6=/lib/modules/$UNAME/kernel/drivers/usb/media/
++INSTALL_PATH_2_4=$out/lib/modules/$UNAME/kernel/drivers/usb/
++INSTALL_PATH_2_6=$out/lib/modules/$UNAME/kernel/drivers/usb/media/
+ 
+ MAJMIN=`echo $UNAME | cut -d . -f 1-2`
+ 
+@@ -35,7 +35,7 @@
+ 	install $MODULE $INSTALL_PATH
+ done
+ 
+-echo Finding module dependencies
+-/sbin/depmod -ae
++#echo Finding module dependencies
++#/sbin/depmod -ae
+ 
+ echo All done!
+diff -ruN ov511-2.30/Makefile ov511-2.30.new/Makefile
+--- ov511-2.30/Makefile	2005-10-12 11:19:27.000000000 +0200
++++ ov511-2.30.new/Makefile	2006-01-03 16:02:41.000000000 +0100
+@@ -112,7 +112,8 @@
+ 
+ else  # We were called from command line
+ 
+-KDIR := /lib/modules/$(shell uname -r)/build
++#KDIR := /lib/modules/$(shell uname -r)/build
++KDIR := $(kernel)/lib/modules/$(version)/build
+ PWD  := $(shell pwd)
+ 
+ default: