Commit 58737dbf authored by John Fleck's avatar John Fleck

Initial commit

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

All the util_*pl files are provide utility functions for use.
The comp*pl files are various examples of comp.pl files for assorted products.
the main*pl files are the main installer algorithm for assorted packagings,
the one of interest for QLogicIB-IFS is main_openibwrap.pl
The comp_qlgc_fm.pl is a good example. It implements a component consisting of
two user space rpms with init.d scripts.
The main*pl defines which components are part of the packaging and what their
capabilities are. main_openibwrap.pl is a packaging for IntelOPA-IFS and
IntelOPA-Basic. A simpler example is main_qlgc_fm.pl which is a packaging
consisting of just the SM.
routines in a comp.pl file:
config_autostart_X - called to configure autostart of component. Only called if HasStart set in main.
start_X/stop_X - immediately stops or starts given component, only called if HasStart
available_X - is component X available on the install media (use of this allows for optional components in packaging or limited availability if a component isn't available on some OS/CPU combos)
installed_X - is component X presently installed on the system. This is a quick check, not a "verify".
installed_version_X - what is the version installed on system. Only called if installed_X is true. versions are short strings displayed and logged, no operations are done (eg. only compare for equality)
media_version_X - only called if available_X. Indicates version on media. Will be compared with installed_version_X to determine if present installation is up to date. Should return exact same format for version string so comparison of equality is possible.
build_X - used to build/rebuild component on local system (if supported). We support this for many items in comp_ofed.pl. Other components (like SM) are not available in source and hence do not support this and simply implement a noop.
need_reinstall_X - does this need to be reinstalled. Mainly used for ofed due to subtle changes such as install prefix or kernel options which may force a reinstall. You'll find this is a noop in most others.
check_os_prereqs_X - optional function to verify OS prereqs (such as required rpms) are installed already. Typically calls rpm_check_os_prereqs() to do the checks. see comp_fastfabric or comp_ofed for examples.
preinstall_X - called for all components before they are installed. Use to build things if needed, etc.
install_X - installs component. also handles reinstall on top of existing installation and upgrade.
postinstall_X - called after all components are installed.
uninstall_X - uninstalls component. May be called even if component is partially or not installed at all in which case should do its best to get rid or what might remain of component from a previously aborted uninstall or failed install
The above routines are called from util_component.pl which has functions to drive
the main menus and call these per component functions. main sets up lists of
what components will be in the menus and calls functions in util_component.pl
to perform the actions selected by the user in the main menu.
Portable Installation and opa_config code
these files are designed to permit cat at build time to join them into one
INSTALL script
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/usr/bin/perl
# BEGIN_ICS_COPYRIGHT8 ****************************************
#
# Copyright (c) 2015, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# END_ICS_COPYRIGHT8 ****************************************
# [ICS VERSION STRING: unknown]
use strict;
#use Term::ANSIColor;
#use Term::ANSIColor qw(:constants);
#use File::Basename;
#use Math::BigInt;
# ==========================================================================
# Fast Fabric installation
my $FF_CONF_FILE = "/opt/opa/tools/opafastfabric.conf";
my $FF_TLS_CONF_FILE = "/etc/sysconfig/opa/opaff.xml";
sub available_fastfabric
{
my $srcdir=$ComponentInfo{'fastfabric'}{'SrcDir'};
return ((rpm_resolve("$srcdir/RPMS/*/", "any", "opa-basic-tools") ne "") &&
(rpm_resolve("$srcdir/RPMS/*/", "any", "opa-fastfabric") ne ""));
}
sub installed_fastfabric
{
return(system("rpm -q --quiet opa-fastfabric") == 0)
}
# only called if installed_fastfabric is true
sub installed_version_fastfabric
{
my $version_file="$BASE_DIR/version_ff";
if ( -e "$version_file" ) {
return `cat $ROOT$version_file`;
} else {
return "";
}
}
# only called if available_fastfabric is true
sub media_version_fastfabric
{
my $srcdir=$ComponentInfo{'fastfabric'}{'SrcDir'};
return `cat "$srcdir/version"`;
}
sub build_fastfabric
{
my $osver = $_[0];
my $debug = $_[1]; # enable extra debug of build itself
my $build_temp = $_[2]; # temp area for use by build
my $force = $_[3]; # force a rebuild
return 0; # success
}
sub need_reinstall_fastfabric($$)
{
my $install_list = shift(); # total that will be installed when done
my $installing_list = shift(); # what items are being installed/reinstalled
return "no";
}
sub check_os_prereqs_fastfabric
{
return rpm_check_os_prereqs("fastfabric", "user", ( "tcl 8.4", "expect" ));
}
sub preinstall_fastfabric
{
my $install_list = $_[0]; # total that will be installed when done
my $installing_list = $_[1]; # what items are being installed/reinstalled
return 0; # success
}
sub install_fastfabric
{
my $install_list = $_[0]; # total that will be installed when done
my $installing_list = $_[1]; # what items are being installed/reinstalled
my $srcdir=$ComponentInfo{'fastfabric'}{'SrcDir'};
my $version=media_version_fastfabric();
chomp $version;
printf("Installing $ComponentInfo{'fastfabric'}{'Name'} $version $DBG_FREE...\n");
LogPrint "Installing $ComponentInfo{'fastfabric'}{'Name'} $version $DBG_FREE for $CUR_DISTRO_VENDOR $CUR_VENDOR_VER\n";
check_config_dirs();
if ( -e "$srcdir/comp.pl" ) {
check_dir("/opt/opa");
copy_systool_file("$srcdir/comp.pl", "/opt/opa/.comp_fastfabric.pl");
}
my $rpmfile = rpm_resolve("$srcdir/RPMS/*/", "any", "opa-fastfabric");
rpm_run_install($rpmfile, "any", "-U");
check_dir("/opt/opa/tools");
check_dir("/opt/opa/samples");
system "chmod ug+x $ROOT/opt/opa/samples/hostverify.sh";
system "rm -f $ROOT/opt/opa/samples/nodeverify.sh";
preserve_prev_rpm_conf("$FF_TLS_CONF_FILE");
printf("Default opaff.xml can be found in '/opt/opa/samples/opaff.xml-sample'\n");
preserve_prev_rpm_conf("$OPA_CONFIG_DIR/opamon.conf");
#install_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$FF_TLS_CONF_FILE", "$srcdir/fastfabric/tools/tls");
#remove_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$OPA_CONFIG_DIR/iba_stat.conf");
system("rm -rf $ROOT$OPA_CONFIG_DIR/iba_stat.conf"); # old config
install_shmem_apps($srcdir);
#
# If TCL was compiled with thread support, fork support is broken.
# and will not be used. In that case, warn the installer.
#
#my $BADTCL=`expect -c 'if { [ catch { set test \$tcl_platform(threaded) } result] } { set test 0 }; puts "\$test" '`;
#if ( $BADTCL != 0 ) {
# NormalPrint "WARNING: The TCL installed on this system has a known bug that prevents\nWARNING: parallel processes. Parallel operations in $ComponentInfo{'fastfabric'}{'Name'} are disabled.\nWARNING: Please contact customer support for more information.\n";
#}
$ComponentWasInstalled{'fastfabric'}=1;
}
sub postinstall_fastfabric
{
my $install_list = $_[0]; # total that will be installed when done
my $installing_list = $_[1]; # what items are being installed/reinstalled
}
sub uninstall_fastfabric
{
my $install_list = $_[0]; # total that will be left installed when done
my $uninstalling_list = $_[1]; # what items are being uninstalled
rpm_uninstall_list("any", "verbose", ("opa-fastfabric") );
NormalPrint("Uninstalling $ComponentInfo{'fastfabric'}{'Name'}...\n");
remove_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$FF_CONF_FILE");
remove_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$OPA_CONFIG_DIR/iba_stat.conf");
remove_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$FF_TLS_CONF_FILE");
uninstall_mpi_apps;
uninstall_shmem_apps;
# remove samples we installed (or user compiled), however do not remove
# any logs or other files the user may have created
remove_installed_files "/opt/opa/samples";
system "rmdir $ROOT/opt/opa/samples 2>/dev/null"; # remove only if empty
system("rm -rf $ROOT/opt/opa/.comp_fastfabric.pl");
system "rmdir $ROOT/opt/opa 2>/dev/null"; # remove only if empty
system "rmdir $ROOT$BASE_DIR 2>/dev/null"; # remove only if empty
system "rmdir $ROOT$OPA_CONFIG_DIR 2>/dev/null"; # remove only if empty
$ComponentWasInstalled{'fastfabric'}=0;
}
#!/usr/bin/perl
# BEGIN_ICS_COPYRIGHT8 ****************************************
#
# Copyright (c) 2015, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# END_ICS_COPYRIGHT8 ****************************************
# [ICS VERSION STRING: unknown]
use strict;
#use Term::ANSIColor;
#use Term::ANSIColor qw(:constants);
#use File::Basename;
#use Math::BigInt;
# ==========================================================================