wok-current rev 1950

tazndis, fix load_ndiswrapper
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Dec 28 23:59:28 2008 +0100 (2008-12-28)
parents 5555a96d536b
children 4da64a9e2232
files tazndis/stuff/CHANGELOG tazndis/stuff/tazndis
line diff
     1.1 --- a/tazndis/stuff/CHANGELOG	Sun Dec 28 22:35:52 2008 +0000
     1.2 +++ b/tazndis/stuff/CHANGELOG	Sun Dec 28 23:59:28 2008 +0100
     1.3 @@ -1,3 +1,7 @@
     1.4 +2008-12-28	Eric Jsoeph-Alexandre	<erjoslitaz.org>
     1.5 +* Fix load_ndiswrapper, don't load ndiswrapper if stell loaded.
     1.6 +
     1.7 +
     1.8  2008-12-27	Eric Jsoeph-Alexandre	<erjoslitaz.org>
     1.9  
    1.10  * Add set_rcs_config, add ndiswrapper to LOAD_MODULES in /etc/rcS.conf.
    1.11 @@ -10,3 +14,4 @@
    1.12  			$rcs_config, set rcS.conf path.
    1.13  
    1.14  * Don't modify system file if we are in debug mode.
    1.15 +
     2.1 --- a/tazndis/stuff/tazndis	Sun Dec 28 22:35:52 2008 +0000
     2.2 +++ b/tazndis/stuff/tazndis	Sun Dec 28 23:59:28 2008 +0100
     2.3 @@ -48,7 +48,7 @@
     2.4  my $rcs_config = "/etc/rcS.conf";
     2.5  my $net_config = "/etc/network.conf";
     2.6  my $config_change = 1;
     2.7 -my $dbg = 1;
     2.8 +#my $dbg = 1;
     2.9  
    2.10  
    2.11  # fixup list for parameters.
    2.12 @@ -265,12 +265,15 @@
    2.13  
    2.14  sub load_ndiswrapper {
    2.15  	open (LSMOD, " lsmod |") or die "couldn't get loaded module list: $!";
    2.16 -	if(!/^ndiswrapper/){
    2.17 +	while(<LSMOD>) {
    2.18 +		if(/^ndiswrapper/){$tmp = 1;}
    2.19 +	}
    2.20 +	if(!$tmp) {
    2.21  		print "Loading ndiswrapper...\n";
    2.22  		`modprobe ndiswrapper`;
    2.23  	}
    2.24 -}
    2.25 -
    2.26 +}	
    2.27 +	
    2.28  sub install {
    2.29      my $inf = shift;
    2.30      chomp($inf);
    2.31 @@ -363,7 +366,7 @@
    2.32      my $name = shift;
    2.33      my $lines = get_section($name);
    2.34      if (!$lines) {
    2.35 -	return;
    2.36 +		return;
    2.37      }
    2.38      $parsed_sections{$name} = ();
    2.39      foreach my $line (@{$lines}) {
    2.40 @@ -476,7 +479,7 @@
    2.41  
    2.42      printf CONF "sys_files|";
    2.43      foreach my $file (@copyfiles) {
    2.44 -	parse_copy_file($file);
    2.45 +		parse_copy_file($file);
    2.46      }
    2.47      printf CONF "\n";
    2.48  
    2.49 @@ -501,7 +504,7 @@
    2.50        die "couldn't create file $confdir/$driver_name/$filename: $!";
    2.51  
    2.52      foreach my $reg (@addregs) {
    2.53 -	parse_registry($reg);
    2.54 +		parse_registry($reg);
    2.55      }
    2.56      close(CONF);
    2.57  }