summaryrefslogtreecommitdiff
blob: 99981c9d649d0145662e8adf267439aaa16912d0 (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
56
57
58
59
diff -Naur hwsetup-1.0/hwsetup.c hwsetup-1.0-patched/hwsetup.c
--- hwsetup-1.0/hwsetup.c	2003-06-02 22:01:28.000000000 +0300
+++ hwsetup-1.0-patched/hwsetup.c	2005-05-28 17:07:09.000000000 +0300
@@ -42,8 +42,36 @@
 /* Do not, under any circumstances, load these modules automatically, */
 /* even if in pcitable. (libkudzu may ignore this, and the KNOPPIX    */
 /* autoconfig scripts may probe them, too)  */
-const char *blacklist[] = { "apm","agpgart","yenta_socket","i82092","i82365","tcic",
+char blacklist[200][200] = { "apm","agpgart","yenta_socket","i82092","i82365","tcic",
                             "pcmcia_core","ds","ohci1394" };
+int blacklistsize = 9;
+
+void gen_blacklist(){
+    int n = 9;
+    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
 
 /* These need to be global, so we can kill them in case of problems */
@@ -349,7 +376,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))
     {
@@ -569,5 +596,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);
 }