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,35 @@ /* 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][1024] = { "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++; + //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); }