summaryrefslogtreecommitdiff
blob: bc50cd3fe341590727696f652c88b9dbae481b14 (plain)
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
48
49
50
51
52
53
54
55
diff -urN hwsetup-1.2.orig/hwsetup.c hwsetup-1.2/hwsetup.c
--- hwsetup-1.2.orig/hwsetup.c	2005-05-28 18:11:51.000000000 -0400
+++ hwsetup-1.2/hwsetup.c	2005-11-17 14:08:03.000000000 -0500
@@ -43,12 +43,39 @@
   /* Winmodems, unusable, can block sound slot */
   "snd-atiixp-modem", "snd-intel8x0m","snd-via82xx-modem"
 };
+
+int blacklistsize = 13;
+void gen_blacklist(){
+		int n = 13;
+		int size = 0;
+		char *comment;
+		char module[1024];
+		FILE *stream;
+
+		if((stream = fopen ("/etc/hotplug/blacklist", "r")) != (FILE *)0) {
+				while((fgets(module, 1023, stream)) != (char *)0 ) {
+
+						comment = strchr(module, '#');
+						if (comment != 0) *comment = '\0';
+						comment = strchr(module, '\n');
+						if (comment != 0) *comment = '\0';
+						size = strlen(module);
+						if (size < 2) continue;
+						strcat (module , " \0");
+						strcpy(blacklist[n] , module);
+						n++;
+						if ( n == 200 ) break;
+						//printf(module);
+				}
+				blacklistsize = n;
+		}
+}
 #endif
 
 /* If a conflicting module in a row is already loaded, the new module will not be probed anymore */
@@ -412,7 +438,7 @@
  pid_t mpid;
  if((m==NULL)||(!strcmp("unknown",m))||(!strcmp("ignore",m))) return 0;
 #ifdef BLACKLIST
- for(i=0;i<(sizeof(blacklist)/sizeof(char*));i++)
+ for(i=0;i < blacklistsize;i++)
   {
    if(!strcmp(blacklist[i],m))
     {
@@ -638,5 +664,8 @@
  /* Allow SIGTERM, SIGINT: rmmod depends on this. */
  signal(SIGTERM,SIG_DFL); signal(SIGINT,SIG_DFL);
  signal(SIGALRM,alarm_handler); alarm(MAX_TIME);
+#ifdef BLACKLIST
+ gen_blacklist();
+#endif
  return hw_setup(dc,verbose,probeonly,skip);
 }