Package: isdnutils / 1:3.25+dfsg1-3.5

capiinit-fwpath.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- a/capiinit/capiinit.c	2005-02-21 18:52:00.000000000 +0100
+++ b/capiinit/capiinit.c	2005-07-14 15:38:23.592997400 +0200
@@ -87,6 +87,7 @@
 #include <linux/capi.h>
 #include <linux/kernelcapi.h>
 #include <getopt.h>
+#include <sys/utsname.h>
 
 #define MODPROBE	"/sbin/modprobe"
 static char capidevnameold[] = "/dev/capi20";
@@ -94,6 +95,7 @@
 static char *capidevname = capidevnameold;
 
 static char *firmwarepath[] = {
+	"/usr/share/isdn/release", /* replaced by kernel release */
 	"/lib/firmware/isdn",
 	"/usr/share/isdn",
 	"/usr/lib/isdn",
@@ -136,6 +138,19 @@
    return s;
 }
 
+static int init_firmware_path(void)
+{
+   struct utsname uts;
+   char *path;
+
+   if (uname(&uts))
+      return 1;
+   path = (char *) malloc(strlen(firmwarepath[0]) + strlen(uts.release) + 1);
+   sprintf(path, "/usr/share/isdn/%s", uts.release);
+   firmwarepath[0] = path;
+   return 0;
+}
+
 /* ---------------- load module -------------------------------------- */
 
 static int is_module_loaded(char *module)
@@ -1607,6 +1622,8 @@
 		}
 	}
 
+	init_firmware_path();
+
  	if (optind == ac) {
 		return main_start(1, 0, 0);
 	} else if (optind+1 == ac) {