]> git.openfabrics.org - ~emulex/ofed_scripts/.git/commitdiff
Comment "install ib_core ..." line in the /etc/modprobe.conf.dist (if exist).
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Wed, 10 Sep 2008 12:51:23 +0000 (15:51 +0300)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Wed, 10 Sep 2008 12:51:23 +0000 (15:51 +0300)
This prevents from HCA driver to be unloaded.

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
install.pl

index e63f8d0f91a885c17f1476bffff0bb3574921499..7cb97da5148de5b0292273456840427e50cdf5bc 100755 (executable)
@@ -3885,7 +3885,7 @@ sub main
 {
     if ($print_available) {
         set_availability();
-        open(CONFIG, ">>$config") || die "Can't open $config: $!";;
+        open(CONFIG, ">>$config") || die "Can't open $config: $!";
         flock CONFIG, $LOCK_EXCLUSIVE;
         for my $package ( @all_packages, @hidden_packages) {
             next if (not $packages_info{$package}{'available'});
@@ -4028,6 +4028,26 @@ sub main
 
     system("/sbin/ldconfig > /dev/null 2>&1");
 
+    if (-f "/etc/modprobe.conf.dist") {
+        open(MDIST, "/etc/modprobe.conf.dist") or die "Can't open /etc/modprobe.conf.dist: $!";
+        my @mdist_lines;
+        while (<MDIST>) {
+            push @mdist_lines, $_;
+        }
+        close(MDIST);
+
+        open(MDIST, ">/etc/modprobe.conf.dist") or die "Can't open /etc/modprobe.conf.dist: $!";
+        foreach my $line (@mdist_lines) {
+            chomp $line;
+            if ($line =~ /^\s*install ib_core/) {
+                print MDIST "# $line\n";
+            } else {
+                print MDIST "$line\n";
+            }
+        }
+        close(MDIST);
+    }
+
     if (length($vendor_pre_uninstall) > 0) {
            system "cp $vendor_pre_uninstall $prefix/sbin/vendor_pre_uninstall.sh";
     }