[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] [PATCH] hwsetup and knoppix-autoconfig -> /etc/modules.tmpl



A small patch for hwsetup ... Yes, I know bash-fiddling is not nice, but was 
easiest and you can get the idea ... ;-)

And an idea how to automate this in knoppix-autoconfig, without rewriting the 
whole script:

Just add a stub function to the beginning and it'll work:

insmod()
{
  /sbin/insmod $*
  STATUS=$?
  if [ $STATUS -eq 0 ];
  then
    echo "$*">>/etc/modules.tmpl
    true
  else
    false
  fi
}

It'll only add it, when the insmod was successful ...

cu

Fabian

PS: I think this is necessary, because of increasing bug reports by users ...
--- hwsetup.c.old	2002-10-09 22:01:18.000000000 +0200
+++ hwsetup.c	2002-12-06 21:55:24.000000000 +0100
@@ -6,6 +6,7 @@
 \****************************************************************************/
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
@@ -333,6 +334,8 @@
  int pstatus;
  time_t now;
  pid_t mpid;
+ char buffer[2000];
+ 
  if((m==NULL)||(!strcmp("unknown",m))||(!strcmp("ignore",m))) return 0;
  if((mpid=fork())==0)
   {
@@ -349,6 +352,8 @@
    if(waitpid(mpid,&pstatus,WNOHANG)) break;
   }
  while((time(0) - now) < MAX_TIME_MODULE);
+ sprintf(buffer,"echo \"%s\">>/etc/modules.tmpl",m);
+ system(buffer);
  return pstatus;
 }
 

Reply to: