From dba229fc1a8969cbecc3e45fb4aab4eb59cdf395 Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Thu, 7 Aug 2008 11:14:39 +0300 Subject: [PATCH] Check if the required kernel is supported. Check for user id - only root can run install.sh. Signed-off-by: Vladimir Sokolovsky --- install.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install.pl b/install.pl index 1d65f4b..3ac577e 100755 --- a/install.pl +++ b/install.pl @@ -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"; -- 2.41.0