]> git.openfabrics.org - ~vlad/ofed_scripts.git/commitdiff
Check if the required kernel is supported.
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Thu, 7 Aug 2008 08:14:39 +0000 (11:14 +0300)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Thu, 7 Aug 2008 08:29:44 +0000 (11:29 +0300)
Check for user id - only root can run install.sh.

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

index 1d65f4ba504109017cdb593222561a659c79563a..3ac577ea3e5991e69a621d5edd387f3e39b27a40 100755 (executable)
@@ -35,6 +35,11 @@ use Cwd;
 use Term::ANSIColor qw(:constants);
 use sigtrap 'handler', \&sig_handler, 'normal-signals';
 
+if ($<) {
+    print RED "Only root can run $0", RESET "\n";
+    exit 1;
+}
+
 $| = 1;
 my $LOCK_EXCLUSIVE = 2;
 my $UNLOCK         = 8;
@@ -2420,6 +2425,13 @@ sub check_linux_dependencies
         # Check rpmbuild requirements
         if ($package =~ /kernel-ib|ib-bonding/) {
             if (not $packages_info{$package}{'rpm_exist'}) {
+                # Check that required kernel is supported
+                if ($kernel !~ /2.6.9-42|2.6.9-55|2.6.9-67|2.6.1[6-9]|2.6.2[0-7]/) {
+                    print RED "Kernel $kernel is not supported.", RESET "\n";
+                    print BLUE "For the list of Supported Platforms and Operating Systems see", RESET "\n";
+                    print BLUE "$CWD/docs/OFED_release_notes.txt", RESET "\n";
+                    exit 1;
+                }
                 # kernel sources required
                 if ( not -d "$kernel_sources/" ) {
                     print RED "$kernel_sources is required to build $package RPM.", RESET "\n";