#!/usr/bin/perl
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
-# Copyright (c) 2016 Mellanox Technologies. All rights reserved.
+# Copyright (c) 2018 Mellanox Technologies. All rights reserved.
#
# This Software is licensed under one of the following licenses:
#
use Term::ANSIColor qw(:constants);
use sigtrap 'handler', \&sig_handler, 'normal-signals';
-$ENV{"LANG"} = "en_US.UTF-8";
+$ENV{"LANG"} = "C";
if ($<) {
print RED "Only root can run $0", RESET "\n";
}
}
-if (-f "/etc/issue") {
- if (-f "/usr/bin/dpkg") {
- if ( `which rpm` eq ""){
- print RED "rpm package is not installed. Exiting...", RESET "\n";
- print RED "Please run 'sudo apt-get install rpm'", RESET "\n";
- exit 1;
- }
- if (-f "/etc/lsb-release") {
- $dist_rpm = `lsb_release -s -i`;
- $dist_rpm_ver = `lsb_release -s -r`;
- }
- else {
- print "lsb_release is required to continue\n";
- $dist_rpm = "unsupported";
- }
- }
- else {
- $dist_rpm = `rpm -qf /etc/issue 2> /dev/null | grep -v "is not owned by any package" | head -1`;
+if (-e "/etc/issue") {
+ $dist_rpm = `rpm -qf /etc/issue 2> /dev/null | grep -v "is not owned by any package" | head -1`;
+ chomp $dist_rpm;
+ if ($dist_rpm) {
+ $dist_rpm = `rpm -q --queryformat "[%{NAME}]-[%{VERSION}]-[%{RELEASE}]" $dist_rpm 2>/dev/null`;
+ chomp $dist_rpm;
+ $dist_rpm_ver = get_rpm_ver_inst($dist_rpm);
+ $dist_rpm_rel = get_rpm_rel_inst($dist_rpm);
+ } else {
+ $dist_rpm = `rpm -qf /etc/os-release 2> /dev/null | grep -v "is not owned by any package" | head -1`;
chomp $dist_rpm;
if ($dist_rpm) {
- $dist_rpm = `rpm -q --queryformat "[%{NAME}]-[%{VERSION}]-[%{RELEASE}]" $dist_rpm`;
- chomp $dist_rpm;
- $dist_rpm_ver = get_rpm_ver_inst($dist_rpm);
- $dist_rpm_rel = get_rpm_rel_inst($dist_rpm);
+ $dist_rpm = `rpm -q --queryformat "[%{NAME}]-[%{VERSION}]-[%{RELEASE}]" $dist_rpm 2>/dev/null`;
+ chomp $dist_rpm;
+ $dist_rpm_ver = get_rpm_ver_inst($dist_rpm);
+ $dist_rpm_rel = get_rpm_rel_inst($dist_rpm);
} else {
- $dist_rpm = "unsupported";
+ $dist_rpm = "unsupported";
}
}
}
} elsif ($dist_rpm =~ /sles-release-12|SLES.*release-12/) {
$DISTRO = "SLES12";
$rpm_distro = "sles12sp0";
+} elsif ($dist_rpm =~ /sles-release-15|SLES.*release-15/) {
+ $DISTRO = "SLES15";
+ $rpm_distro = "sles15sp0";
} elsif ($dist_rpm =~ /redhat-release-.*-7.4|sl-release-7.4|centos-release-7-4/) {
$DISTRO = "RHEL7.4";
$rpm_distro = "rhel7u4";
my $libgcc = 'libgcc';
my $libgfortran = '';
my $curl_devel = 'curl-devel';
-my $libudev_devel = 'libudev-devel';
+
+my $libudev = "libudev";
+my $libudev_devel = "libudev-devel";
+if ($DISTRO =~ m/SLES12|SLES15/) {
+ $libudev = "libudev1";
+} elsif ($DISTRO =~ m/RHEL7|OL7|FC|EULEROS|POWERKVM/) {
+ $libudev = "systemd-libs";
+ $libudev_devel = "systemd-devel";
+}
my $pkgconfig = "pkgconfig";
+my $glib2 = 'glib2';
+my $glib2_devel = 'glib2-devel';
my $glibc_devel = 'glibc-devel';
+my $libcurl = 'libcurl';
my $cmake = 'cmake';
my $ninja = '';
if ($DISTRO =~ m/SLES11/) {
$libnl = "libnl3-200";
$libnl_devel = "libnl3-devel";
$pkgconfig = "pkg-config";
+} elsif ($DISTRO =~ m/SLES15/) {
+ $libstdc = 'libstdc++6-devel-gcc7';
+ $libgcc = 'libgcc_s1';
+ $curl_devel = 'libcurl-devel';
+ $libcurl = "libcurl4";
+ $libnl_devel = 'libnl3-devel';
+ $libnl = 'libnl3-200';
+ $glib2 = 'libglib-2_0-0';
+ $pkgconfig = "pkg-config";
+ $libgfortran = "libgfortran4";
} elsif ($DISTRO =~ m/RHEL|OEL|FC/) {
$libstdc = 'libstdc++';
$libgcc = 'libgcc';
} else {
$libstdc = 'libstdc++';
}
+
+my $insserv_compat = "";
my $libstdc_devel = "$libstdc-devel";
if ($DISTRO =~ m/SLES12/) {
$libstdc_devel = 'libstdc++-devel';
+} elsif ($DISTRO =~ m/SLES15/){
+ $libstdc_devel = "libstdc++6-devel-gcc7";
+ $insserv_compat = "insserv-compat";
}
push (@rdma_core_build_deps, "systemd-devel");
my @ulp_modules = ("sdp", "srp", "srpt", "rds", "qlgc_vnic", "iser", "nfsrdma", "cxgb3i", "cxgb4i");
my @xeon_phi_kernel = ("ibscif", "ibp-server", "ibp-debug");
+my $libibverbs_parent = "libibverbs";
+my $libibverbs_devel = "libibverbs-devel";
+my $libibverbs_devel_static = "libibverbs-devel-static";
+my $libibverbs_debuginfo = "libibverbs-debuginfo";
+
+my $libibumad_parent = "libibumad";
+my $libibumad_devel = "libibumad-devel";
+my $libibumad_static = "libibumad-static";
+my $libibumad_debuginfo = "libibumad-debuginfo";
+
# kernel modules in "technology preview" status can be installed by
# adding "module=y" to the ofed.conf file in unattended installation mode
# or by selecting the module in custom installation mode during interactive installation
ofa_req_inst => [],
install32 => 0, exception => 0 },
+
+ 'srptools' =>
+ { name => "srptools", parent => "srptools",
+ selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+ available => 1, mode => "user",
+ dist_req_build => ["$insserv_compat"],
+ dist_req_inst => ["$insserv_compat"],
+ ofa_req_build => ["$libibumad_devel", "$libibverbs_devel"],
+ ofa_req_inst => ["libibumad", "libibverbs"],
+ install32 => 0, exception => 0, configure_options => '' },
+ 'srptools-debuginfo' =>
+ { name => "srptools-debuginfo", parent => "srptools",
+ selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
+ available => 1, mode => "user", dist_req_build => [],
+ dist_req_inst => [], ofa_req_build => ["$libibumad_devel"],
+ ofa_req_inst => [],
+ install32 => 0, exception => 0 },
'rnfs-utils' =>
{ name => "rnfs-utils", parent => "rnfs-utils",
selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0,
$packages_info{'rdma-ndd'}{'available'} = 0;
}
+ if ($DISTRO =~ m/SLES15/) {
+ $packages_info{'ibutils'}{'available'} = 0; #compilation failed with GCC6
+ }
+
if ($kernel =~ m/^4\.17/) {
$kernel_modules_info{'rds'}{'available'} = 1;
$packages_info{'rds-tools'}{'available'} = 1;