commit_id
string
repo
string
commit_message
string
diff
string
label
int64
0236727e70cbec41b5700d2cca25e998015fa278
01org/opa-fm
Update to latest from build 10.9.3.1.1 (IFS 10.9.3.1.1)
commit 0236727e70cbec41b5700d2cca25e998015fa278 Author: Scott Breyer <[email protected]> Date: Mon Jun 24 11:55:57 2019 -0400 Update to latest from build 10.9.3.1.1 (IFS 10.9.3.1.1) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index d568643..cf43ebc 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -96,7 +96,10 @@ CMD_TARGETS_MISC = CLEAN_TARGETS_MISC = CLEAN_TARGETS = $(OBJECTS) $(RSCOBJECTS) $(IDL_TARGETS) $(CLEAN_TARGETS_MISC) # other files to remove during clobber phase -CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl +CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL8.pl \ + comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl \ + comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL8.pl \ + comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl # sub-directory to install to within bin BIN_SUBDIR = # sub-directory to install to within include @@ -123,11 +126,13 @@ INCLUDE_SUBDIR = LOCALDEPLIBS = FF_FILES = comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl \ - comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_SLES122.pl \ - comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl + comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL8.pl \ + comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl \ + comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl FM_FILES = comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl \ - comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_SLES122.pl \ - comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl + comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL8.pl \ + comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl \ + comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl # Include Make Rules definitions and rules include $(TL_DIR)/$(PROJ_FILE_DIR)/Makerules.project diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 894674d..6da2387 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -74,10 +74,12 @@ my @delta_kernel_srpms_sles12_sp2 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles12_sp3 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles12_sp4 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15 = ( 'ifs-kernel-updates-kmp-default' ); +my @delta_kernel_srpms_sles15_sp1 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_rhel73 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel74 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel75 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel76 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel8 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # This provides information for all kernel srpms @@ -146,12 +148,17 @@ sub init_delta_info($) } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' && "$CUR_VENDOR_VER" eq 'ES15') { @delta_kernel_srpms = ( @delta_kernel_srpms_sles15 ); + } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' + && "$CUR_VENDOR_VER" eq 'ES151') { + @delta_kernel_srpms = ( @delta_kernel_srpms_sles15_sp1 ); } elsif ( "$CUR_VENDOR_VER" eq "ES74" ) { if ($HFI2_INSTALL) { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74_hfi2); } else { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74); } + } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel8 ); } elsif ( "$CUR_VENDOR_VER" eq "ES76" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel76 ); } elsif ( "$CUR_VENDOR_VER" eq "ES75" ) { @@ -779,6 +786,9 @@ sub installed_delta_opa_stack() return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } + } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES76" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -797,6 +807,9 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq 'ES15' ) { return ( has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq 'ES151' ) { + return ( has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } else { return 0; } @@ -1081,6 +1094,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES76" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES123" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); @@ -1090,6 +1106,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { + return (has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } else { return 0; } diff --git a/CommonInstall/comp_delta_prereq_RHEL8.pl b/CommonInstall/comp_delta_prereq_RHEL8.pl new file mode 100644 index 0000000..804443d --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL8.pl @@ -0,0 +1,137 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python2", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_delta_prereq_SLES151.pl b/CommonInstall/comp_delta_prereq_SLES151.pl new file mode 100644 index 0000000..172a3ca --- /dev/null +++ b/CommonInstall/comp_delta_prereq_SLES151.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kmod", + "rdma-core", + "rdma-ndd", + "systemd", + "coreutils", + "grep", + "libosmcomp4", + "libibmad5", + "libibumad3", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @intel_hfi_prereq = ( + "glibc", + "libgcc_s1", + "bash", + "udev", + "libudev-devel", + "python-base", + "libedit0", + "libncurses6", + "libnuma1", + "irqbalance", + "libatomic1", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "glibc", + "bash", + "libpsm_infinipath1", + "pkg-config", + "libgcc_s1", + "libgfortran4", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs1", + "librdmacm1", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "glibc", + "bash", + "libz1", + "pkg-config", + "libgcc_s1", + "libgfortran3", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "opensm-libs3", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL8.pl b/CommonInstall/comp_ff_of_prereq_RHEL8.pl new file mode 100644 index 0000000..ee2fa78 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL8.pl @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL8.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL8.pl.base new file mode 100644 index 0000000..ee2fa78 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL8.pl.base @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES151.pl b/CommonInstall/comp_ff_of_prereq_SLES151.pl new file mode 100644 index 0000000..d51d011 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES151.pl @@ -0,0 +1,90 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses6", + "libopenssl1_1", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", + "qperf", + "perftest", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_1", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES151.pl.base b/CommonInstall/comp_ff_of_prereq_SLES151.pl.base new file mode 100644 index 0000000..d51d011 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES151.pl.base @@ -0,0 +1,90 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses6", + "libopenssl1_1", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", + "qperf", + "perftest", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_1", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL8.pl b/CommonInstall/comp_fm_prereq_RHEL8.pl new file mode 100644 index 0000000..c16ef21 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL8.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL8.pl.base b/CommonInstall/comp_fm_prereq_RHEL8.pl.base new file mode 100644 index 0000000..c16ef21 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL8.pl.base @@ -0,0 +1,52 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES151.pl b/CommonInstall/comp_fm_prereq_SLES151.pl new file mode 100644 index 0000000..289eddb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES151.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_1", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES151.pl.base b/CommonInstall/comp_fm_prereq_SLES151.pl.base new file mode 100644 index 0000000..289eddb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES151.pl.base @@ -0,0 +1,54 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_1", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/do_mvapich2_build.sh b/CommonInstall/do_mvapich2_build.sh index 6d85cb7..ddc5dce 100755 --- a/CommonInstall/do_mvapich2_build.sh +++ b/CommonInstall/do_mvapich2_build.sh @@ -511,6 +511,9 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="gfortran -m64" FC="gfortran -m64"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=gfortran FC=gfortran' + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" + fi fi else if [ "$ARCH" = "PPC64" ] @@ -518,6 +521,9 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="g77 -m64" FC="/bin/false"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=g77 FC=/bin/false' + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" + fi fi fi;; diff --git a/CommonInstall/do_openmpi_build.sh b/CommonInstall/do_openmpi_build.sh index 6e68fd4..e7aea1a 100755 --- a/CommonInstall/do_openmpi_build.sh +++ b/CommonInstall/do_openmpi_build.sh @@ -492,7 +492,11 @@ logfile=make.openmpi.$interface.$compiler case "$compiler" in gcc) - openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=-O3" + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS="-O3 -fPIC"" + else + openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=-O3" + fi if have_comp g++ then openmpi_comp_env="$openmpi_comp_env CXX=g++" @@ -727,7 +731,7 @@ egrep 'warning:' $logfile.res |sort -u | #egrep 'error:|Error | Stop' $logfile.res| sort -u | # egrep -v 'error: this file was generated for autoconf 2.61.' > $logfile.err egrep 'error:|Error | Stop' $logfile.res| sort -u | - egrep -v 'configure: error: no BPatch.h found; check path for Dyninst package|configure: error: no vtf3.h found; check path for VTF3 package|configure: error: MPI Correctness Checking support cannot be built inside Open MPI|configure: error: no bmi.h found; check path for BMI package first...|configure: error: no ctool/ctool.h found; check path for CTool package first...|configure: error: no cuda.h found; check path for CUDA Toolkit first...|configure: error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...|configure: error: no cupti.h found; check path for CUPTI package first...|configure: error: no f2c.h found; check path for CLAPACK package first...|configure: error: no jvmti.h found; check path for JVMTI package first...|configure: error: no libcpc.h found; check path for CPC package first...|configure: error: no tau_instrumentor found; check path for PDToolkit first...|configure: error: no unimci-config found; check path for UniMCI package first...|"Error code:|"Unknown error:|strerror_r|configure: error: CUPTI API version could not be determined...' > $logfile.err + egrep -v 'configure: error: no BPatch.h found; check path for Dyninst package|configure: error: no vtf3.h found; check path for VTF3 package|configure: error: MPI Correctness Checking support cannot be built inside Open MPI|configure: error: no bmi.h found; check path for BMI package first...|configure: error: no ctool/ctool.h found; check path for CTool package first...|configure: error: no cuda.h found; check path for CUDA Toolkit first...|configure: error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...|configure: error: no cupti.h found; check path for CUPTI package first...|configure: error: no f2c.h found; check path for CLAPACK package first...|configure: error: no jvmti.h found; check path for JVMTI package first...|configure: error: no libcpc.h found; check path for CPC package first...|configure: error: no tau_instrumentor found; check path for PDToolkit first...|configure: error: no unimci-config found; check path for UniMCI package first...|"Error code:|"Unknown error:|strerror_r|configure: error: CUPTI API version could not be determined...|asprintf(&msg, "Unexpected sendto() error: errno=%d (%s)",' > $logfile.err if [ -s $logfile.err ] then diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index f242a61..f84b431 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -70,13 +70,17 @@ my @Components_sles12_sp3 = ( "opa_stack", @OmniPathAllComponents ); my @Components_sles12_sp4 = ( "opa_stack", @OmniPathAllComponents ); +my @Components_sles15 = ( "opa_stack", + @OmniPathAllComponents ); +my @Components_sles15_sp1 = ( "opa_stack", + @OmniPathAllComponents ); my @Components_rhel74 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel75 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel76 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); -my @Components_sles15 = ( "opa_stack", +my @Components_rhel8 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); @Components = ( ); @@ -684,7 +688,7 @@ my %opa_stack_sles12_sp4_comp_info = ( }, ); -# for SLES15 +# for SLES15.x my %opa_stack_sles15_comp_info = ( "opa_stack" => { Name => "OFA OPA Stack", DefaultInstall => $State_Install, @@ -809,6 +813,37 @@ my %intel_hfi_comp_info = ( StartupParams => [ ] }, ); +# +# for RHEL8, which does not currently support opa_stack and does not require libfabric-psm +my %intel_hfi_rhel8_comp_info = ( + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ #"libhfi1", "libhfi1-static", + "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ #"hfi1_debuginfo", + "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", #"libhfi1-debuginfo" + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); # For SLES12sp3 that has different name for libpsm2 my %intel_hfi_sles123_comp_info = ( @@ -870,7 +905,7 @@ my %intel_hfi_sles124_comp_info = ( }, ); -# For SLES15 that has different name for libpsm2 +# For SLES15.x that has different name for libpsm2 my %intel_hfi_sles15_comp_info = ( "intel_hfi" => { Name => "Intel HFI Components", DefaultInstall => $State_Install, @@ -1105,6 +1140,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { + @Components = ( @Components_rhel8 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_rhel8_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @Components_sles15 ); @SubComponents = ( @SubComponents_newer ); @@ -1113,6 +1156,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_sles15_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { + @Components = ( @Components_sles15_sp1 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_sles15_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_sles15_comp_info, + ); } else { # unknown or unsupported distro, leave lists empty # verify_distrib_files will catch unsupported distro diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index a1487b3..ef75a31 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -78,11 +78,21 @@ my @delta_Components_rhel76 = ( "opa_stack", "mpi_selector", "intel_hfi", "delta_ipoib", "sandiashmem", "delta_debug", ); +my @delta_Components_rhel8 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "sandiashmem", + "delta_debug", ); my @delta_Components_sles15 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", "sandiashmem", "delta_debug", ); +my @delta_Components_sles15_sp1 = ( "opa_stack", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "sandiashmem", + "delta_debug", ); @Components = ( ); # RHEL7.2, ibacm is a full component with rpms to install @@ -111,8 +121,12 @@ sub overrides() @Components = ( @delta_Components_rhel75 ); } elsif ( "$CUR_VENDOR_VER" eq "ES76" ) { @Components = ( @delta_Components_rhel76 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { + @Components = ( @delta_Components_rhel8 ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @delta_Components_sles15 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { + @Components = ( @delta_Components_sles15_sp1 ); } else { # unsupported OS @Components = ( ); diff --git a/CommonInstall/util_components.pl b/CommonInstall/util_components.pl index 4022c8a..f19e822 100755 --- a/CommonInstall/util_components.pl +++ b/CommonInstall/util_components.pl @@ -1061,7 +1061,7 @@ sub show_install_menu($) } } - while() { + do {{ if ( $Default_Install) { # setstate set UnInstall or DoNotInstall for those not available # force install for all available even if UpToDate @@ -1433,7 +1433,7 @@ sub show_install_menu($) } if (! $have_all_os_prereqs) { HitKeyCont; - return + last; } # run pre-install for all components which will be installed @@ -1444,7 +1444,7 @@ sub show_install_menu($) if (0 != comp_preinstall($comp,$install_list,$installing_list)) { NormalPrint "Unable to Prepare $ComponentInfo{$comp}{'Name'} for Install\n"; HitKeyCont; - return + last; } } } @@ -1519,13 +1519,10 @@ sub show_install_menu($) HitKeyCont; } return; - # we had an error above - if ( $Default_Prompt ) { - $exit_code = 1; - return - } } - } + }} until ($Default_Prompt); + # we had an error above + $exit_code = 1; } sub show_installed($) diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index ea5abeb..05d5746 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -727,7 +727,7 @@ sub rpm_resolve($$) } else { my $osver = rpm_tr_os_version("$mode"); # OS version # we expect 1 match, ignore all other filenames returned - if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES15') { + if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES15' || "$CUR_VENDOR_VER" eq 'ES151') { DebugPrint("Checking for Kernel Rpm: ${rpmpath}-${osver}_k*.${cpu}.rpm\n"); $rpmfile = file_glob("${rpmpath}-${osver}_k*.${cpu}.rpm"); } else { diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index 4cc042f..adaa9df 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -130,6 +130,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES76" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL76.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES8" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL8.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES122" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES122.pl endif @@ -142,6 +145,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES15" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES15.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES151" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES151.pl +endif # Source files to include in DSP File diff --git a/Esm/build.env b/Esm/build.env index f0e0499..e4f7b18 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_2_2_1 +export RELEASE_TAG=10_9_3_1_1 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 3647992..473b697 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 06/07/19 16:21 Tag: VIEO_HOST_LINUX_opa-10_9_2_1_10_9_2_2_1 +Build of VIEO_HOST 06/11/19 17:57 Tag: VIEO_HOST_LINUX_opa-10_9_10_9_3_1_1 diff --git a/Esm/ib/Makerules.module b/Esm/ib/Makerules.module index 1171176..d370bca 100644 --- a/Esm/ib/Makerules.module +++ b/Esm/ib/Makerules.module @@ -85,6 +85,10 @@ RSCMOD = # Platform specific definitions: #-----------------------------------------------------------------------------# ifeq "$(BUILD_TARGET_OS)" "VXWORKS" +MOD_INCLUDE_DIRS += \ + $(TL_DIR)/BSP/bspcommon/wrs/config \ + $(TGT_DIR)/components/ip_net2-6.9/ipcrypto/include \ + $(TGT_DIR)/components/ip_net2-6.9/ipcrypto/$(OPENSSL_VER)/include # FIXME, change uses of __VXWORKS__ to VXWORKS CMOD += -DCAL_IBACCESS -D__VXWORKS__ ifeq "$(BUILD_TARGET)" "ATOM" diff --git a/Esm/ib/include/ib_sm.h b/Esm/ib/include/ib_sm.h index 6e184c7..e84b630 100644 --- a/Esm/ib/include/ib_sm.h +++ b/Esm/ib/include/ib_sm.h @@ -279,7 +279,8 @@ typedef SMDBSync_t *SMDBSyncp; /* SM DBSYNC pointer type */ // version 9 - 10.7 release // version 10 - 10.8 release // version 11 - 10.9 release -#define FM_PROTOCOL_VERSION 11 +// version 12 - 10.9.3 release +#define FM_PROTOCOL_VERSION 12 typedef struct { diff --git a/Esm/ib/src/config/Makefile b/Esm/ib/src/config/Makefile index 86f025b..0d524df 100644 --- a/Esm/ib/src/config/Makefile +++ b/Esm/ib/src/config/Makefile @@ -44,7 +44,7 @@ DIRS = # C files (.c) CFILES = \ fm_xml.c \ - fm_md5.c \ + fm_digest.c \ # Add more c files here # C++ files (.cpp) CCFILES = \ @@ -62,7 +62,7 @@ IDLFILE = DEFFILE = # targets to build during INCLUDES phase (add public includes here) INCLUDE_TARGETS = \ - fm_md5.h \ + fm_digest.h \ # Add more h hpp files here # Non-compiled files MISC_FILES = diff --git a/Esm/ib/src/config/fm_md5.c b/Esm/ib/src/config/fm_digest.c similarity index 74% rename from Esm/ib/src/config/fm_md5.c rename to Esm/ib/src/config/fm_digest.c index e2457f8..7a2b295 100644 --- a/Esm/ib/src/config/fm_md5.c +++ b/Esm/ib/src/config/fm_digest.c @@ -27,44 +27,44 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ** END_ICS_COPYRIGHT5 ****************************************/ +#include "fm_digest.h" + +#include <assert.h> #include <stdio.h> -#include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> #include "ib_types.h" -#ifndef __VXWORKS__ -#include <openssl/md5.h> -#else -#include <Md5.h> -#endif - -void fm_md5_start(void *ctx) +fm_digest_t * fm_digest_start(void) { -#ifndef __VXWORKS__ - MD5_Init((MD5_CTX *)ctx); -#else - Md5_Start((Md5_Context_t *)ctx); -#endif + fm_digest_t * ctx = EVP_MD_CTX_create(); + if (!ctx) return NULL; + if (!EVP_DigestInit_ex(ctx, EVP_sha256(), NULL)) { + EVP_MD_CTX_destroy(ctx); + return NULL; + } + return ctx; } -void fm_md5_update(void *ctx, const void *data, size_t len) +int fm_digest_update(fm_digest_t *ctx, const void *data, size_t len) { -#ifndef __VXWORKS__ - MD5_Update((MD5_CTX *)ctx, data, len); -#else - Md5_Update((Md5_Context_t *)ctx, (unsigned char *)data, len); -#endif + return EVP_DigestUpdate(ctx, data, len); } -void fm_md5_finish(void *ctx, uint8_t *computedMd5) +int fm_digest_finish(fm_digest_t *ctx, uint8_t *digest) { -#ifndef __VXWORKS__ - MD5_Final(computedMd5, (MD5_CTX *)ctx); -#else - Md5_Finish((Md5_Context_t *)ctx, computedMd5); -#endif + unsigned int len; + if (EVP_DigestFinal_ex(ctx, digest, &len) != 1) + return 0; + EVP_MD_CTX_destroy(ctx); + return 1; + +} +int fm_digest_len(fm_digest_t *ctx) +{ + return EVP_MD_CTX_size(ctx); } + diff --git a/Esm/ib/src/config/fm_md5.h b/Esm/ib/src/config/fm_digest.h similarity index 78% rename from Esm/ib/src/config/fm_md5.h rename to Esm/ib/src/config/fm_digest.h index 57cda5e..7d6a41e 100644 --- a/Esm/ib/src/config/fm_md5.h +++ b/Esm/ib/src/config/fm_digest.h @@ -29,25 +29,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* [ICS VERSION STRING: unknown] */ -#ifndef _FM_MD5_HELPER_H_ -#define _FM_MD5_HELPER_H_ +#ifndef _FM_DIGEST_HELPER_H_ +#define _FM_DIGEST_HELPER_H_ -#ifndef __VXWORKS__ -#include <openssl/md5.h> -#else -#include <Md5.h> -#endif - -#ifndef __VXWORKS__ -typedef MD5_CTX ctx_t; -#else -typedef Md5_Context_t ctx_t; -#endif +#include <stdint.h> +#include <stdlib.h> +#include <stdio.h> +#include <openssl/evp.h> +typedef EVP_MD_CTX fm_digest_t; -void fm_md5_start(void *ctx); -void fm_md5_update(void *ctx, const void *data, size_t len); -void fm_md5_finish(void *ctx, uint8_t *computedMd5); +// maximum length in bytes of a hash across all supported digests +#define FM_DIGEST_MAX 32 +fm_digest_t * fm_digest_start(void); +int fm_digest_update(fm_digest_t *ctx, const void *data, size_t len); +int fm_digest_finish(fm_digest_t *ctx, uint8_t *digest); +int fm_digest_len(fm_digest_t * ctx); #endif diff --git a/Esm/ib/src/config/fm_xml.c b/Esm/ib/src/config/fm_xml.c index 9aea419..6cd1b7c 100644 --- a/Esm/ib/src/config/fm_xml.c +++ b/Esm/ib/src/config/fm_xml.c @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <fm_xml.h> #define _GNU_SOURCE -#include "fm_md5.h" +#include "fm_digest.h" #ifdef __VXWORKS__ #include "Ism_Idb.h" @@ -379,12 +379,12 @@ uint32_t xml_compute_pool_size(uint8_t full) static void *cksumBegin(void) { - ctx_t *ctx; + fm_digest_t *ctx = fm_digest_start(); - ctx = getXmlMemory(sizeof(ctx_t), "ctx_t cksumBegin()"); - if (!ctx) return NULL; - - fm_md5_start((void *)ctx); + if (!ctx) { + fprintf(stderr, "%s: checksum algorithm initialization failed\n", __func__); + return NULL; + } return (void *)ctx; } @@ -393,29 +393,21 @@ static void cksumData(void *ctx, void *block, uint32_t length) { if (!ctx || !block || !length) return; - // MD5 checksum - fm_md5_update((void *)ctx, block, length); + fm_digest_update(ctx, block, length); } static uint32_t cksumEnd(void *ctx) { - uint8_t computedMd5[16]; - uint32_t sum = 0; - uint32_t *word; - uint32_t i; + uint8_t digest[FM_DIGEST_MAX]; + uint32_t checksum = 0; if (!ctx) return 0; + fm_digest_finish(ctx, digest); - // MD5 checksum - fm_md5_finish((void *)ctx, computedMd5); + checksum = *(uint32_t *)digest; - word = (uint32_t*)computedMd5; - for (i = 0; i < 4; i++) { - sum += word[i]; - } - freeXmlMemory(ctx, sizeof(ctx_t), "ctx_t cksumEnd()"); - return sum; + return checksum; } #define CKSUM_MAX 3 @@ -444,12 +436,6 @@ static uint32_t cksumEnd(void *ctx) #define CKSUM_FILE(file, flags) #endif -#ifdef CHECKSUM_DEBUG -#define CKSUM_BEGIN { printf("CKSUM_BEGIN %s\n",__func__); BeginCksums(); } -#else -#define CKSUM_BEGIN { BeginCksums(); } -#endif - /* * Generic 'DEFAULT' macro for all integer types. */ @@ -466,19 +452,16 @@ static uint32_t cksumEnd(void *ctx) #define DEFAULT_STR(data, default) { if (!strlen(data)) StringCopy(data,default,sizeof(data)); } #define DEFAULT_AND_CKSUM_STR(data, default, flags) { DEFAULT_STR(data, default); AddToCksums(#data, &data, strlen(data), flags); } -#ifdef CHECKSUM_DEBUG -#define CKSUM_END(overall, disruptive, consistency) { EndCksums(&overall, &disruptive, &consistency); printf("CKSUM_END %s %d, %d, %d\n",__func__,overall,disruptive,consistency); } -#else -#define CKSUM_END(overall, disruptive, consistency) { EndCksums(&overall, &disruptive, &consistency); } -#endif - +static fm_digest_t *cksum_ctx[CKSUM_MAX]; -static ctx_t *cksum_ctx[CKSUM_MAX]; - -static boolean BeginCksums(void) +static boolean BeginCksums(const char * scope) { uint32_t i; +#ifdef CHECKSUM_DEBUG + printf("CKSUM_BEGIN %s\n", scope); +#endif + for (i = 0; i < CKSUM_MAX; i++) { if (!(cksum_ctx[i] = cksumBegin())) { while(i > 0) { @@ -507,19 +490,23 @@ static void AddToCksums(char *txt, void *block, uint32_t length, uint32_t flags) } } -static void EndCksums(uint32_t *overall_checksum, uint32_t *disruptive_checksum, uint32_t *consistency_checksum) +static void EndCksums(const char * scope, uint32_t *overall_checksum, uint32_t *disruptive_checksum, uint32_t *consistency_checksum) { - uint32_t csum; + uint32_t csum0, csum1, csum2; - csum = cksumEnd(cksum_ctx[0]); + csum0 = cksumEnd(cksum_ctx[0]); if (overall_checksum) - *overall_checksum = csum; - csum = cksumEnd(cksum_ctx[1]); + *overall_checksum = csum0; + csum1 = cksumEnd(cksum_ctx[1]); if (disruptive_checksum) - *disruptive_checksum = csum; - csum = cksumEnd(cksum_ctx[2]); + *disruptive_checksum = csum1; + csum2 = cksumEnd(cksum_ctx[2]); if (consistency_checksum) - *consistency_checksum = csum; + *consistency_checksum = csum2; + +#ifdef CHECKSUM_DEBUG + printf("CKSUM_END %s %d, %d, %d\n", scope, csum0, csum1, csum2); +#endif } // Map handling routines @@ -1212,14 +1199,16 @@ boolean startPmChecksum(PMXmlConfig_t *pmp) return 0; } - CKSUM_BEGIN; + if (!BeginCksums(__func__)) + return 0; + return 1; } void endPmChecksum(PMXmlConfig_t *pmp, uint32_t instance) { - CKSUM_END(pmp->overall_checksum, pmp->disruptive_checksum, pmp->consistency_checksum); + EndCksums(__func__, &pmp->overall_checksum, &pmp->disruptive_checksum, &pmp->consistency_checksum); if (xml_parse_debug) fprintf(stdout, "Pm instance %u checksum overall %u disruptive %u consistency %u\n", (unsigned int)instance, @@ -1700,7 +1689,9 @@ boolean startSmChecksum(SMXmlConfig_t *smp) return 0; } - CKSUM_BEGIN; + if (!BeginCksums(__func__)) + return 0; + return 1; } @@ -1711,7 +1702,7 @@ boolean endSmChecksum(SMXmlConfig_t *smp, uint32_t instance) if (!smp) return 0; - CKSUM_END(smp->overall_checksum, smp->disruptive_checksum, smp->consistency_checksum); + EndCksums(__func__, &smp->overall_checksum, &smp->disruptive_checksum, &smp->consistency_checksum); if (xml_parse_debug) fprintf(stdout, "Sm instance %u checksum overall %u disruptive %u consistency %u\n", (unsigned int)instance, (unsigned int)smp->overall_checksum, (unsigned int)smp->disruptive_checksum, (unsigned int)smp->consistency_checksum); @@ -3781,25 +3772,28 @@ void checksumOneVirtualFabricsConfig(VFConfig_t *vf, VF_t *vfp, uint8_t requires } // create a total checksum for the Virtual Fabric database -void checksumVirtualFabricsConfig(VFXmlConfig_t *vf_config, VirtualFabrics_t *vfsip) +static boolean checksumVirtualFabricsConfig(VFXmlConfig_t *vf_config, VirtualFabrics_t *vfsip) { VF_t *vfp; uint32_t i; if (!vfsip) - return; + return FALSE; // Checksum each individual Virtual Fabric for (i = 0; i < vfsip->number_of_vfs_all; i++) { vfp = &vfsip->v_fabric_all[i]; - CKSUM_BEGIN; + if (!BeginCksums(__func__)) + return FALSE; + checksumOneVirtualFabricsConfig(vf_config->vf[i], vfp, vfsip->qos_all[vfp->qos_index].requires_resp_sl); - CKSUM_END(vfp->overall_checksum, vfp->disruptive_checksum, vfp->consistency_checksum); + EndCksums(__func__, &vfp->overall_checksum, &vfp->disruptive_checksum, &vfp->consistency_checksum); } // Checksum all of the Virtual Fabrics together - CKSUM_BEGIN; + if (!BeginCksums(__func__)) + return FALSE; // vfsip->securityEnabled // setup by SM // vfsip->qosEnabled // setup by SM @@ -3809,9 +3803,9 @@ void checksumVirtualFabricsConfig(VFXmlConfig_t *vf_config, VirtualFabrics_t *vf checksumOneVirtualFabricsConfig(vf_config->vf[i], vfp, vfsip->qos_all[vfp->qos_index].requires_resp_sl); } - CKSUM_END(vfsip->overall_checksum, vfsip->disruptive_checksum, vfsip->consistency_checksum); + EndCksums(__func__, &vfsip->overall_checksum, &vfsip->disruptive_checksum, &vfsip->consistency_checksum); - return; + return TRUE; } // find a pointer to a Application given the name @@ -4968,8 +4962,10 @@ VirtualFabrics_t* reRenderVirtualFabricsConfig(uint32_t fm, VirtualFabrics_t *ol fprintf(stdout, "Number of Virtual Fabrics %u\n", (unsigned int)vfsip->number_of_vfs_all); // calculate Virtual Fabric database checksum - if (vfsip) - checksumVirtualFabricsConfig(&fm_instance->vf_config, vfsip); + if (vfsip) { + if (!checksumVirtualFabricsConfig(&fm_instance->vf_config, vfsip)) + goto fail; + } if (xml_memory_debug) fprintf(stdout, "Memory level %u after reRenderVirtualFabricsConfig()\n", (unsigned int)memory); diff --git a/Esm/ib/src/pm/pa/pa_access.c b/Esm/ib/src/pm/pa/pa_access.c index 174b274..c441ead 100644 --- a/Esm/ib/src/pm/pa/pa_access.c +++ b/Esm/ib/src/pm/pa/pa_access.c @@ -1888,27 +1888,35 @@ error: goto done; } -// Add to the list only once. Add only if localStatus is set or when neighborStatus is set and local lid is lesser than neighbor lid. -#define CHECK_UNEXPECTED_CLEAR_STATUS() \ - ((STL_PA_SELECT_UNEXP_CLR_PORT == select) && \ - (((STL_PA_FOCUS_STATUS_UNEXPECTED_CLEAR == localStatus ) && (STL_PA_FOCUS_STATUS_UNEXPECTED_CLEAR != neighborStatus)) || \ - ((STL_PA_FOCUS_STATUS_UNEXPECTED_CLEAR == localStatus) && (STL_PA_FOCUS_STATUS_UNEXPECTED_CLEAR == neighborStatus) && \ - (lid < nbrPt->pmnodep->Image[imageIndex].lid)))) -// Add to the list only once. Add only if localStatus is set or when neighborStatus is set and local lid is lesser than neighbor lid. -#define CHECK_PMA_NRSP_STATUS() \ - ((STL_PA_SELECT_NO_RESP_PORT == select) && \ - (((STL_PA_FOCUS_STATUS_PMA_FAILURE == localStatus) && (STL_PA_FOCUS_STATUS_PMA_FAILURE != neighborStatus)) || \ - ((STL_PA_FOCUS_STATUS_PMA_FAILURE == localStatus) && (STL_PA_FOCUS_STATUS_PMA_FAILURE == neighborStatus) && \ - (lid < nbrPt->pmnodep->Image[imageIndex].lid)))) +static __inline uint8 SelectToStatus(uint32 select) { + switch (select) { + case STL_PA_SELECT_UNEXP_CLR_PORT: return STL_PA_FOCUS_STATUS_UNEXPECTED_CLEAR; + case STL_PA_SELECT_NO_RESP_PORT: return STL_PA_FOCUS_STATUS_PMA_FAILURE; + case STL_PA_SELECT_SKIPPED_PORT: return STL_PA_FOCUS_STATUS_PMA_IGNORE; + default: + return STL_PA_FOCUS_STATUS_OK; + } + return STL_PA_FOCUS_STATUS_OK; +} // Add to the list only once. Add only if localStatus is set or when neighborStatus is set and local lid is lesser than neighbor lid. -#define CHECK_SKIPPED_STATUS() \ - ((STL_PA_SELECT_SKIPPED_PORT == select) && \ - (((STL_PA_FOCUS_STATUS_PMA_IGNORE == localStatus) && (STL_PA_FOCUS_STATUS_PMA_IGNORE != neighborStatus)) || \ - ((STL_PA_FOCUS_STATUS_PMA_IGNORE == localStatus) && (STL_PA_FOCUS_STATUS_PMA_IGNORE == neighborStatus) && \ - (lid < nbrPt->pmnodep->Image[imageIndex].lid)))) +static __inline boolean isExtFocusSelect(uint32 select, uint32 imageIndex, PmPort_t *pmportp, STL_LID lid) { + PmPortImage_t *portImage = &pmportp->Image[imageIndex]; + uint8 selectStatus, localStatus, neighborStatus; + PmPort_t *nbrPt = portImage->neighbor; + selectStatus = SelectToStatus(select); + localStatus = pa_get_port_status(pmportp, imageIndex); + neighborStatus = (pmportp->portNum == 0 ? + STL_PA_FOCUS_STATUS_OK : pa_get_port_status(nbrPt, imageIndex)); + + return ( + ((selectStatus == localStatus ) && (selectStatus != neighborStatus)) + || ((selectStatus == localStatus) && (selectStatus == neighborStatus) + && (lid < nbrPt->pmnodep->Image[imageIndex].lid)) + ); +} FSTATUS processExtFocusPort(uint32 imageIndex, PmPort_t *pmportp, uint32 select, PmFocusPorts_t *pmFocusPorts, STL_LID lid) { @@ -1920,7 +1928,7 @@ FSTATUS processExtFocusPort(uint32 imageIndex, PmPort_t *pmportp, uint32 select, neighborStatus = (pmportp->portNum == 0 ? STL_PA_FOCUS_STATUS_OK : pa_get_port_status(nbrPt, imageIndex)); - if((CHECK_UNEXPECTED_CLEAR_STATUS()) || (CHECK_SKIPPED_STATUS()) || (CHECK_PMA_NRSP_STATUS())){ + if(isExtFocusSelect(select, imageIndex, pmportp, lid)){ pmFocusPorts->portList[pmFocusPorts->portCntr].lid = lid; pmFocusPorts->portList[pmFocusPorts->portCntr].portNum = pmportp->portNum; pmFocusPorts->portList[pmFocusPorts->portCntr].localStatus = localStatus; @@ -2030,12 +2038,16 @@ FSTATUS paGetExtFocusPorts(Pm_t *pm, char *groupName, PmFocusPorts_t *pmFocusPor // If Success, but Index is still -1, then it is All Group if (groupIndex == -1) isGroupAll = TRUE; - if(select == STL_PA_SELECT_UNEXP_CLR_PORT){ - allocatedItems = pmimagep->UnexpectedClearPorts; - } else if( select == STL_PA_SELECT_NO_RESP_PORT) { - allocatedItems = pmimagep->NoRespNodes; - } else { - allocatedItems = pmimagep->SkippedNodes; + // Get number of links + for_all_pmnodes(pmimagep, pmnodep, lid) { + for_all_pmports(pmnodep, pmportp, portnum, !requiresLock) { + portImage = &pmportp->Image[imageIndex]; + if (PmIsPortInGroup(pmimagep, portImage, groupIndex, isGroupAll, NULL)) { + if (isExtFocusSelect(select, imageIndex, pmportp, lid)){ + allocatedItems++; + } + } + } } if(allocatedItems == 0) { @@ -2733,12 +2745,16 @@ FSTATUS paGetExtVFFocusPorts(Pm_t *pm, char *vfName, PmFocusPorts_t *pmVFFocusPo goto done; } - if(select == STL_PA_SELECT_UNEXP_CLR_PORT){ - allocatedItems = pmimagep->UnexpectedClearPorts; - } else if( select == STL_PA_SELECT_NO_RESP_PORT) { - allocatedItems = pmimagep->NoRespNodes; - } else { - allocatedItems = pmimagep->SkippedNodes; + // Get number of links + for_all_pmnodes(pmimagep, pmnodep, lid) { + for_all_pmports(pmnodep, pmportp, portnum, !requiresLock) { + portImage = &pmportp->Image[imageIndex]; + if (PmIsPortInVF(pmimagep, portImage, vfIdx)) { + if (isExtFocusSelect(select, imageIndex, pmportp, lid)){ + allocatedItems++; + } + } + } } if(allocatedItems == 0) { diff --git a/Esm/ib/src/pm/pm/pm_sweep.c b/Esm/ib/src/pm/pm/pm_sweep.c index 3b7fd1e..a42cbb1 100644 --- a/Esm/ib/src/pm/pm/pm_sweep.c +++ b/Esm/ib/src/pm/pm/pm_sweep.c @@ -835,10 +835,7 @@ void update_pmport(Pm_t *pm, PmPort_t *pmportp, Node_t *nodep, Port_t *portp, Pm portImage->u.s.mtu = portp->portData->maxVlMtu; portImage->u.s.txActiveWidth = portp->portData->portInfo.LinkWidthDowngrade.TxActive; portImage->u.s.rxActiveWidth = portp->portData->portInfo.LinkWidthDowngrade.RxActive; - portImage->StlPortCounters.lq.s.NumLanesDown = - (portp->portData->portInfo.LinkWidthDowngrade.RxActive < portp->portData->portInfo.LinkWidth.Active ? - StlLinkWidthToInt(portp->portData->portInfo.LinkWidth.Active) - - StlLinkWidthToInt(portp->portData->portInfo.LinkWidthDowngrade.RxActive) : 0); + portImage->StlPortCounters.lq.s.NumLanesDown = StlGetNumLanesDown(&portp->portData->portInfo); portImage->u.s.activeSpeed = portp->portData->portInfo.LinkSpeed.Active; if (recalc_flags & PM_TOPO_RECALC_VFS) { bitset_copy(&pmportp->dgMember, &portp->portData->dgMember); diff --git a/Esm/update_opa-fm_spec.sh b/Esm/update_opa-fm_spec.sh index 75334b8..a923bac 100755 --- a/Esm/update_opa-fm_spec.sh +++ b/Esm/update_opa-fm_spec.sh @@ -54,9 +54,9 @@ then GE_7_5=$(echo "$versionid >= 7.5" | bc) if [ $GE_7_4 = 1 ] then - sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, zlib-devel, openssl-devel/g" $to fi if [ $GE_7_0 = 1 ] then @@ -78,9 +78,9 @@ then GE_12_3=$(echo "$versionid >= 12.3" | bc) if [ $GE_12_3 = 1 ] then - sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, zlib-devel, openssl-devel/g" $to fi if [ $GE_12_1 = 1 ] then @@ -101,7 +101,7 @@ then sed -i "s/__RPM_RQ2/Requires: libibumad3, libibverbs1, rdma, libexpat1, openssl/g" $to elif [ "$id" = "fedora" ] then - sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to sed -i "/__RPM_SYSCONF/,+1d" $to diff --git a/Esm/update_opa-fm_spec.sh.base b/Esm/update_opa-fm_spec.sh.base index 75334b8..a923bac 100755 --- a/Esm/update_opa-fm_spec.sh.base +++ b/Esm/update_opa-fm_spec.sh.base @@ -54,9 +54,9 @@ then GE_7_5=$(echo "$versionid >= 7.5" | bc) if [ $GE_7_4 = 1 ] then - sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, zlib-devel, openssl-devel/g" $to fi if [ $GE_7_0 = 1 ] then @@ -78,9 +78,9 @@ then GE_12_3=$(echo "$versionid >= 12.3" | bc) if [ $GE_12_3 = 1 ] then - sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, zlib-devel, openssl-devel/g" $to fi if [ $GE_12_1 = 1 ] then @@ -101,7 +101,7 @@ then sed -i "s/__RPM_RQ2/Requires: libibumad3, libibverbs1, rdma, libexpat1, openssl/g" $to elif [ "$id" = "fedora" ] then - sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, zlib-devel, openssl-devel/g" $to sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to sed -i "/__RPM_SYSCONF/,+1d" $to diff --git a/IbAccess/Common/Inc/stl_helper.h b/IbAccess/Common/Inc/stl_helper.h index 5831057..04309e9 100644 --- a/IbAccess/Common/Inc/stl_helper.h +++ b/IbAccess/Common/Inc/stl_helper.h @@ -1720,8 +1720,9 @@ FormatStlCounterSelectMask(char buf[128], CounterSelectMask_t mask) { /** * Compute difference of two sets of Port Counters * - * @param data1 - pointer to later set of STL_PORT_COUNTERS_DATA counters - * @param data2 - pointer to earlier set of STL_PORT_COUNTERS_DATA counters + * @param data1 - pointer to later (end) set of STL_PORT_COUNTERS_DATA counters + * @param data2 - pointer to earlier (begin) set of STL_PORT_COUNTERS_DATA + * counters * @param result - pointer to where result of data1 - data2 will be stored * * Note: data1 should be >= data2. If this is not the case, result will be @@ -1829,6 +1830,14 @@ static __inline CounterSelectMask_t DiffPAVFCounters(STL_PA_VF_PORT_COUNTERS_DAT PgftTable[i/NUM_PGFT_ELEMENTS_BLOCK].PgftBlock[i%NUM_PGFT_ELEMENTS_BLOCK] +static __inline uint8 +StlGetNumLanesDown(STL_PORT_INFO *portInfo) { + return (portInfo->LinkWidthDowngrade.RxActive < portInfo->LinkWidth.Active ? + StlLinkWidthToInt(portInfo->LinkWidth.Active) - + StlLinkWidthToInt(portInfo->LinkWidthDowngrade.RxActive) : 0); +} + + #ifdef __cplusplus }; #endif diff --git a/IbAccess/Common/Inc/stl_pa_types.h b/IbAccess/Common/Inc/stl_pa_types.h index 096a0f9..b003246 100644 --- a/IbAccess/Common/Inc/stl_pa_types.h +++ b/IbAccess/Common/Inc/stl_pa_types.h @@ -112,7 +112,13 @@ StlPaClassPortInfoCapMask2(char buf[80], uint32 cmask) } } -// Check to see if the VF Focus select is an UTIL BW category +// Check to see if the Focus Select has no Value +#define IS_FOCUS_SELECT_NO_VAL(SELECT) \ + ((SELECT == STL_PA_SELECT_UNEXP_CLR_PORT) || \ + (SELECT == STL_PA_SELECT_NO_RESP_PORT) || \ + (SELECT == STL_PA_SELECT_SKIPPED_PORT)) + +// Check to see if the Focus select is an UTIL BW category #define IS_FOCUS_SELECT_UTIL(SELECT) \ ((SELECT == STL_PA_SELECT_UTIL_HIGH) || \ (SELECT == STL_PA_SELECT_UTIL_LOW) || \ diff --git a/IbAccess/Common/Inc/stl_pm.h b/IbAccess/Common/Inc/stl_pm.h index d7f49e9..57627a9 100644 --- a/IbAccess/Common/Inc/stl_pm.h +++ b/IbAccess/Common/Inc/stl_pm.h @@ -35,6 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "iba/ib_generalServices.h" #include "iba/stl_types.h" #include "iba/stl_pa_types.h" +#include "iba/stl_helper.h" #if defined (__cplusplus) extern "C" { @@ -754,43 +755,46 @@ BSWAP_STL_ERROR_INFO_RSP(STL_ERROR_INFO_RSP *Dest) /** - * Copy data in a STL_PORT_COUNTERS_DATA variable into a STL_PortStatusData_t variable + * Copy data in a STL_PORT_STATUS_RSP variable into a STL_PORT_COUNTERS_DATA variable * - * @param portCounters - pointer to STL_PORT_COUNTERS_DATA variable from which to copy - * @param portStatusData - pointer to STL_PortStatusData_t variable to copy to + * @param SrcPortStatus - pointer to STL_PORT_STATUS_RSP variable from which to copy + * @param DestPortCounters - pointer to STL_PORT_COUNTERS_DATA variable to copy to + * @param portInfo - optional pointer to STL_PORT_INFO varaible to gather numLanesDown from * */ -static __inline void StlPortCountersToPortStatus(STL_PORT_COUNTERS_DATA *portCounters, STL_PORT_STATUS_RSP *portStatusData) +static __inline void StlPortStatusToPortCounters(STL_PORT_STATUS_RSP *SrcPortStatus, STL_PORT_COUNTERS_DATA *DestPortCounters, STL_PORT_INFO *portInfo) { - portStatusData->LinkErrorRecovery = portCounters->linkErrorRecovery; - portStatusData->LinkDowned = portCounters->linkDowned; - portStatusData->PortRcvErrors = portCounters->portRcvErrors; - portStatusData->PortRcvRemotePhysicalErrors = portCounters->portRcvRemotePhysicalErrors; - portStatusData->PortRcvSwitchRelayErrors = portCounters->portRcvSwitchRelayErrors; - portStatusData->PortXmitDiscards = portCounters->portXmitDiscards; - portStatusData->PortXmitConstraintErrors = portCounters->portXmitConstraintErrors; - portStatusData->PortRcvConstraintErrors = portCounters->portRcvConstraintErrors; - portStatusData->LocalLinkIntegrityErrors = portCounters->localLinkIntegrityErrors; - portStatusData->ExcessiveBufferOverruns = portCounters->excessiveBufferOverruns; - portStatusData->PortXmitData = portCounters->portXmitData; - portStatusData->PortRcvData = portCounters->portRcvData; - portStatusData->PortXmitPkts = portCounters->portXmitPkts; - portStatusData->PortRcvPkts = portCounters->portRcvPkts; - portStatusData->PortMulticastXmitPkts = portCounters->portMulticastXmitPkts; - portStatusData->PortMulticastRcvPkts = portCounters->portMulticastRcvPkts; - portStatusData->PortXmitWait = portCounters->portXmitWait; - portStatusData->SwPortCongestion = portCounters->swPortCongestion; - portStatusData->PortRcvFECN = portCounters->portRcvFECN; - portStatusData->PortRcvBECN = portCounters->portRcvBECN; - portStatusData->PortXmitTimeCong = portCounters->portXmitTimeCong; - portStatusData->PortXmitWastedBW = portCounters->portXmitWastedBW; - portStatusData->PortXmitWaitData = portCounters->portXmitWaitData; - portStatusData->PortRcvBubble = portCounters->portRcvBubble; - portStatusData->PortMarkFECN = portCounters->portMarkFECN; - portStatusData->FMConfigErrors = portCounters->fmConfigErrors; - portStatusData->UncorrectableErrors = portCounters->uncorrectableErrors; - portStatusData->lq.AsReg8 = portCounters->lq.AsReg8; - + DestPortCounters->linkErrorRecovery = SrcPortStatus->LinkErrorRecovery; + DestPortCounters->linkDowned = SrcPortStatus->LinkDowned; + DestPortCounters->portRcvErrors = SrcPortStatus->PortRcvErrors; + DestPortCounters->portRcvRemotePhysicalErrors = SrcPortStatus->PortRcvRemotePhysicalErrors; + DestPortCounters->portRcvSwitchRelayErrors = SrcPortStatus->PortRcvSwitchRelayErrors; + DestPortCounters->portXmitDiscards = SrcPortStatus->PortXmitDiscards; + DestPortCounters->portXmitConstraintErrors = SrcPortStatus->PortXmitConstraintErrors; + DestPortCounters->portRcvConstraintErrors = SrcPortStatus->PortRcvConstraintErrors; + DestPortCounters->localLinkIntegrityErrors = SrcPortStatus->LocalLinkIntegrityErrors; + DestPortCounters->excessiveBufferOverruns = SrcPortStatus->ExcessiveBufferOverruns; + DestPortCounters->portXmitData = SrcPortStatus->PortXmitData; + DestPortCounters->portRcvData = SrcPortStatus->PortRcvData; + DestPortCounters->portXmitPkts = SrcPortStatus->PortXmitPkts; + DestPortCounters->portRcvPkts = SrcPortStatus->PortRcvPkts; + DestPortCounters->portMulticastXmitPkts = SrcPortStatus->PortMulticastXmitPkts; + DestPortCounters->portMulticastRcvPkts = SrcPortStatus->PortMulticastRcvPkts; + DestPortCounters->portXmitWait = SrcPortStatus->PortXmitWait; + DestPortCounters->swPortCongestion = SrcPortStatus->SwPortCongestion; + DestPortCounters->portRcvFECN = SrcPortStatus->PortRcvFECN; + DestPortCounters->portRcvBECN = SrcPortStatus->PortRcvBECN; + DestPortCounters->portXmitTimeCong = SrcPortStatus->PortXmitTimeCong; + DestPortCounters->portXmitWastedBW = SrcPortStatus->PortXmitWastedBW; + DestPortCounters->portXmitWaitData = SrcPortStatus->PortXmitWaitData; + DestPortCounters->portRcvBubble = SrcPortStatus->PortRcvBubble; + DestPortCounters->portMarkFECN = SrcPortStatus->PortMarkFECN; + DestPortCounters->fmConfigErrors = SrcPortStatus->FMConfigErrors; + DestPortCounters->uncorrectableErrors = SrcPortStatus->UncorrectableErrors; + DestPortCounters->lq.s.linkQualityIndicator = SrcPortStatus->lq.s.LinkQualityIndicator; + if (portInfo) { + DestPortCounters->lq.s.numLanesDown = StlGetNumLanesDown(portInfo); + } } #include "iba/public/ipackoff.h" diff --git a/IbPrint/stl_pa.c b/IbPrint/stl_pa.c index bbce4ec..e2bc5e5 100644 --- a/IbPrint/stl_pa.c +++ b/IbPrint/stl_pa.c @@ -448,6 +448,7 @@ void PrintStlPMConfig(PrintDest_t *dest, int indent, const STL_PA_PM_CFG_DATA *p return; } + void PrintStlPAFocusPorts(PrintDest_t *dest, int indent, const char *groupName, const int numRecords, const uint32 select, const uint32 start, const uint32 range, const STL_FOCUS_PORTS_RSP *pFocusPorts) { @@ -463,14 +464,14 @@ void PrintStlPAFocusPorts(PrintDest_t *dest, int indent, const char *groupName, indent, "", i+start, pFocusPorts[i].nodeLid, pFocusPorts[i].portNumber, StlStaticRateToText(pFocusPorts[i].rate), IbMTUToText(pFocusPorts[i].maxVlMtu), pFocusPorts[i].neighborLid, pFocusPorts[i].neighborPortNumber); - if ( ( (select >= STL_PA_SELECT_CATEGORY_INTEG) && - (select <= STL_PA_SELECT_CATEGORY_ROUT) ) || - (select == STL_PA_SELECT_UTIL_PKTS_HIGH) ) { - PrintFunc(dest, "%*s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", - indent, "", pFocusPorts[i].value, pFocusPorts[i].neighborValue); + if (IS_FOCUS_SELECT_UTIL(select)) { + PrintFunc(dest, "%*s Value: %16.1f nbrValue: %16.1f\n", + indent, "", (float)pFocusPorts[i].value/10.0, (float)pFocusPorts[i].neighborValue/10.0); + } else if (IS_FOCUS_SELECT_NO_VAL(select)) { + // Skip print of Values } else { - PrintFunc(dest, "%*s Value: %16.1f nbrValue: %16.1f\n", - indent, "", (float)pFocusPorts[i].value/10.0, (float)pFocusPorts[i].neighborValue/10.0); + PrintFunc(dest, "%*s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", + indent, "", pFocusPorts[i].value, pFocusPorts[i].neighborValue); } PrintFunc(dest, "%*s GUID: 0x%016"PRIx64" nbrGuid: 0x%016"PRIx64"\n", indent, "", pFocusPorts[i].nodeGUID, pFocusPorts[i].neighborGuid); @@ -518,14 +519,12 @@ void PrintStlPAFocusPortsMultiSelect(PrintDest_t *dest, int indent, const char * pFocusPorts[i].neighborPortNumber); for (j = 0; j < MAX_NUM_FOCUS_PORT_TUPLES; j++) { if (tuple[j].comparator != FOCUS_PORTS_COMPARATOR_INVALID) { - if ( ( (tuple[j].select >= STL_PA_SELECT_CATEGORY_INTEG) && - tuple[j].select <= STL_PA_SELECT_CATEGORY_ROUT) || - (tuple[j].select == STL_PA_SELECT_UTIL_PKTS_HIGH) ) { - PrintFunc(dest, "%*s %-22s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", - indent, "", StlFocusAttributeToText(tuple[j].select), pFocusPorts[i].value[j], pFocusPorts[i].neighborValue[j]); - } else { + if (IS_FOCUS_SELECT_UTIL(tuple[j].select)) { PrintFunc(dest, "%*s %-22s Value: %16.1f" " nbrValue: %16.1f\n", indent, "", StlFocusAttributeToText(tuple[j].select), (float)pFocusPorts[i].value[j]/10.0, (float)pFocusPorts[i].neighborValue[j]/10.0); + } else { + PrintFunc(dest, "%*s %-22s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", + indent, "", StlFocusAttributeToText(tuple[j].select), pFocusPorts[i].value[j], pFocusPorts[i].neighborValue[j]); } } } @@ -769,13 +768,15 @@ void PrintStlPAVFFocusPorts(PrintDest_t *dest, int indent, const char *vfName, c pVFFocusPorts[i].neighborLid, pVFFocusPorts[i].neighborPortNumber); if (IS_FOCUS_SELECT_UTIL(select)) { - PrintFunc(dest, "%*s Value: %16.1f nbrValue: %16.1f\n", - indent, "", (float)pVFFocusPorts[i].value / 10.0, (float)pVFFocusPorts[i].neighborValue / 10.0); + PrintFunc(dest, "%*s Value: %16.1f nbrValue: %16.1f\n", + indent, "", (float)pVFFocusPorts[i].value/10.0, (float)pVFFocusPorts[i].neighborValue/10.0); + } else if (IS_FOCUS_SELECT_NO_VAL(select)) { + // Skip print of Values } else { - PrintFunc(dest, "%*s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", - indent, "", pVFFocusPorts[i].value, pVFFocusPorts[i].neighborValue); + PrintFunc(dest, "%*s Value: %16"PRIu64" nbrValue: %16"PRIu64"\n", + indent, "", pVFFocusPorts[i].value, pVFFocusPorts[i].neighborValue); } - PrintFunc(dest, "%*s GUID: 0x%016"PRIx64" nbrGuid: 0x%016"PRIx64"\n", + PrintFunc(dest, "%*s GUID: 0x%016"PRIx64" nbrGuid: 0x%016"PRIx64"\n", indent, "", pVFFocusPorts[i].nodeGUID, pVFFocusPorts[i].neighborGuid); PrintFunc(dest, "%*s Status: %s Name: %.*s\n", indent, "", diff --git a/IbaTools/FastFabric/opafastfabric.pl b/IbaTools/FastFabric/opafastfabric.pl index ba5c8cc..dc96b76 100755 --- a/IbaTools/FastFabric/opafastfabric.pl +++ b/IbaTools/FastFabric/opafastfabric.pl @@ -653,7 +653,7 @@ DO_MENU: if ($screens > 1 ) { printf ("N) Next Screen\n"); } - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); $inp = getch(); if ($inp =~ /[qQ]/ || $inp =~ /[xX]/ || ord($inp) == $KEY_ESC) { @@ -1485,7 +1485,7 @@ DO_SETUP: } printf ("\nP) Perform the Selected Actions N) Select None\n"); - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); %statusMessage = (); @@ -2036,7 +2036,7 @@ DO_SETUP: } printf ("\nP) Perform the Selected Actions N) Select None\n"); - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); %statusMessage = (); @@ -2113,7 +2113,7 @@ DO_SETUP: } printf ("\nP) Perform the Selected Actions N) Select None\n"); - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); %statusMessage = (); @@ -2879,7 +2879,7 @@ DO_SETUP: } printf ("\nP) Perform the Selected Actions N) Select None\n"); - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); %statusMessage = (); @@ -3233,7 +3233,7 @@ DO_SETUP: } printf ("\nP) Perform the Selected Actions N) Select None\n"); - printf ( "X) Return to Previous Menu (or ESC)\n"); + printf ( "X) Return to Previous Menu (or ESC or Q)\n"); %statusMessage = (); @@ -3295,7 +3295,7 @@ START: printf (" 3) Host Setup\n"); printf (" 4) Host Verification/Admin\n"); printf (" 5) Fabric Monitoring\n"); - printf ("\n X) Exit\n"); + printf ("\n X) Exit (or Q)\n"); $inp = getch(); diff --git a/IbaTools/FastFabric/opasetupssh.sh b/IbaTools/FastFabric/opasetupssh.sh index e0cd965..35c93a4 100755 --- a/IbaTools/FastFabric/opasetupssh.sh +++ b/IbaTools/FastFabric/opasetupssh.sh @@ -587,14 +587,14 @@ process_chassis() continue fi rm -f $tempfile $tempfile.2 2>/dev/null - /usr/lib/opa/tools/tcl_proc chassis_sftp_cmd "sftp $user@\[${tchassis}\]" "get /firmware/$user/authorized_keys $tempfile" 2>&1| grep -q 'FAILED' + /usr/lib/opa/tools/tcl_proc chassis_sftp_cmd "sftp $user@\[${tchassis}\]:" "get /firmware/$user/authorized_keys $tempfile" 2>&1| grep -q 'FAILED' if [ $? -eq 0 ] || [ ! -f $tempfile ] then echo "Unable to configure $tchassis for password-less ssh, skipping..." continue fi cat ~/.ssh/id_rsa.pub $tempfile | sort -u > $tempfile.2 - /usr/lib/opa/tools/tcl_proc chassis_sftp_cmd "sftp $user@\[${tchassis}\]" "put $tempfile.2 /firmware/$user/authorized_keys" 2>&1| grep -q 'FAILED' + /usr/lib/opa/tools/tcl_proc chassis_sftp_cmd "sftp $user@\[${tchassis}\]:" "put $tempfile.2 /firmware/$user/authorized_keys" 2>&1| grep -q 'FAILED' if [ $? -eq 0 ] then echo "$tchassis password-less ssh config failed, skipping..." diff --git a/LICENSE b/LICENSE index 7ef87da..d8eb6e5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ Copyright (c) 2015, Intel Corporation All rights reserved. +BSD 3-clause License: 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, diff --git a/MakeTools/Makefile b/MakeTools/Makefile index 2ba8f32..9682763 100644 --- a/MakeTools/Makefile +++ b/MakeTools/Makefile @@ -87,6 +87,10 @@ convert_releasetag: convert_releasetag.pl cp $< $@ chmod 755 $@ +format_releasetag: format_releasetag.sh + cp $< $@ + chmod 755 $@ + include $(TL_DIR)/Makerules/Maketargets.stage include $(TL_DIR)/Makerules/Maketargets.install diff --git a/Topology/fabricdata.c b/Topology/fabricdata.c index 4d513b8..b5e59b6 100644 --- a/Topology/fabricdata.c +++ b/Topology/fabricdata.c @@ -807,8 +807,8 @@ void PortDataFree(FabricData_t *fabricp, PortData *portp) if (portp->PortGUID) AllLidsRemove(fabricp, portp); cl_qmap_remove_item(&nodep->Ports, &portp->NodePortsEntry); - if (portp->pPortStatus) - MemoryDeallocate(portp->pPortStatus); + if (portp->pPortCounters) + MemoryDeallocate(portp->pPortCounters); PortDataFreeQOSData(fabricp, portp); PortDataFreeBufCtrlTable(fabricp, portp); PortDataFreePartitionTable(fabricp, portp); diff --git a/Topology/mad.c b/Topology/mad.c index d02a31c..26cca67 100644 --- a/Topology/mad.c +++ b/Topology/mad.c @@ -1772,7 +1772,7 @@ fail: * portp is the port to issue PMA request to (can be port 0 of switch), it need */ FSTATUS STLPmGetPortStatus(struct omgt_port *port, PortData *portp, uint8 portNum, - STL_PortStatusData_t *pPortStatus) + STL_PORT_STATUS_RSP *pPortStatus) { STL_PERF_MAD req; STL_PERF_MAD resp; @@ -1795,8 +1795,8 @@ FSTATUS STLPmGetPortStatus(struct omgt_port *port, PortData *portp, uint8 portNu 0x01000000, &req, &resp); if (FSUCCESS != fstatus) goto fail; - BSWAP_STL_PORT_STATUS_RSP((STL_PORT_STATUS_RSP*)resp.PerfData); - *pPortStatus = *(STL_PortStatusData_t*)resp.PerfData; + BSWAP_STL_PORT_STATUS_RSP((STL_PORT_STATUS_RSP *)resp.PerfData); + *pPortStatus = *(STL_PORT_STATUS_RSP *)resp.PerfData; DBGPRINT("SendPkts=0x%16"PRIx64"\n", pPortStatus->PortXmitPkts); fail: return fstatus; diff --git a/Topology/search.c b/Topology/search.c index f6fc5fc..0fbe7f2 100644 --- a/Topology/search.c +++ b/Topology/search.c @@ -2122,17 +2122,17 @@ FSTATUS FindLinkQualityPoint(FabricData_t *fabricp, uint16 quality, LinkQualityC PortData *portp = (PortData *)QListObj(p); boolean match = FALSE; - if (!portp->pPortStatus) + if (!portp->pPortCounters) continue; switch (comp) { case QUAL_EQ: - match = (uint16)(portp->pPortStatus->lq.s.LinkQualityIndicator) == quality; + match = (uint16)(portp->pPortCounters->lq.s.linkQualityIndicator) == quality; break; case QUAL_GE: - match = (uint16)(portp->pPortStatus->lq.s.LinkQualityIndicator) >= quality; + match = (uint16)(portp->pPortCounters->lq.s.linkQualityIndicator) >= quality; break; case QUAL_LE: - match = (uint16)(portp->pPortStatus->lq.s.LinkQualityIndicator) <= quality; + match = (uint16)(portp->pPortCounters->lq.s.linkQualityIndicator) <= quality; break; default: break; diff --git a/Topology/snapshot.c b/Topology/snapshot.c index b2c9275..b2b3aee 100644 --- a/Topology/snapshot.c +++ b/Topology/snapshot.c @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* bitfields needs special handling: LinkQualityIndicator */ static void PortStatusDataXmlOutputLinkQualityIndicator(IXmlOutputState_t *state, const char *tag, void *data) { - IXmlOutputUint(state, tag, ((STL_PortStatusData_t *)data)->lq.s.LinkQualityIndicator); + IXmlOutputUint(state, tag, ((STL_PORT_COUNTERS_DATA *)data)->lq.s.linkQualityIndicator); } static void PortStatusDataXmlParserEndLinkQualityIndicator(IXmlParserState_t *state, const IXML_FIELD *field, void *object, void *parent, XML_Char *content, unsigned len, boolean valid) @@ -49,70 +49,72 @@ static void PortStatusDataXmlParserEndLinkQualityIndicator(IXmlParserState_t *st uint8 value; if (IXmlParseUint8(state, content, len, &value)) - ((STL_PortStatusData_t *)object)->lq.s.LinkQualityIndicator = value; + ((STL_PORT_COUNTERS_DATA *)object)->lq.s.linkQualityIndicator = value; } IXML_FIELD PortStatusDataFields[] = { - { tag:"XmitData", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitData) }, - { tag:"RcvData", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvData) }, - { tag:"XmitPkts", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitPkts) }, - { tag:"RcvPkts", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvPkts) }, - { tag:"MulticastXmitPkts", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortMulticastXmitPkts) }, - { tag:"MulticastRcvPkts", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortMulticastRcvPkts) }, - { tag:"XmitWait", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitWait) }, - { tag:"CongDiscards", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, SwPortCongestion) }, - { tag:"RcvFECN", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvFECN) }, - { tag:"RcvBECN", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvBECN) }, - { tag:"XmitTimeCong", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitTimeCong) }, - { tag:"XmitWastedBW", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitWastedBW) }, - { tag:"XmitWaitData", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitWaitData) }, - { tag:"RcvBubble", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvBubble) }, - { tag:"MarkFECN", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortMarkFECN) }, - { tag:"RcvConstraintErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvConstraintErrors) }, - { tag:"RcvSwitchRelayErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvSwitchRelayErrors) }, - { tag:"XmitDiscards", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitDiscards) }, - { tag:"XmitConstraintErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortXmitConstraintErrors) }, - { tag:"RcvRemotePhysicalErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvRemotePhysicalErrors) }, - { tag:"LocalLinkIntegrityErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, LocalLinkIntegrityErrors) }, - { tag:"RcvErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, PortRcvErrors) }, - { tag:"ExcessiveBufferOverruns", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, ExcessiveBufferOverruns) }, - { tag:"FMConfigErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, FMConfigErrors) }, - { tag:"LinkErrorRecovery", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, LinkErrorRecovery) }, - { tag:"LinkDowned", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, LinkDowned) }, - { tag:"UncorrectableErrors", format:'U', IXML_FIELD_INFO(STL_PortStatusData_t, UncorrectableErrors) }, + { tag:"XmitData", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitData) }, + { tag:"RcvData", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvData) }, + { tag:"XmitPkts", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitPkts) }, + { tag:"RcvPkts", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvPkts) }, + { tag:"MulticastXmitPkts", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portMulticastXmitPkts) }, + { tag:"MulticastRcvPkts", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portMulticastRcvPkts) }, + { tag:"XmitWait", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitWait) }, + { tag:"CongDiscards", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, swPortCongestion) }, + { tag:"RcvFECN", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvFECN) }, + { tag:"RcvBECN", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvBECN) }, + { tag:"XmitTimeCong", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitTimeCong) }, + { tag:"XmitWastedBW", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitWastedBW) }, + { tag:"XmitWaitData", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitWaitData) }, + { tag:"RcvBubble", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvBubble) }, + { tag:"MarkFECN", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portMarkFECN) }, + { tag:"RcvConstraintErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvConstraintErrors) }, + { tag:"RcvSwitchRelayErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvSwitchRelayErrors) }, + { tag:"XmitDiscards", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitDiscards) }, + { tag:"XmitConstraintErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portXmitConstraintErrors) }, + { tag:"RcvRemotePhysicalErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvRemotePhysicalErrors) }, + { tag:"LocalLinkIntegrityErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, localLinkIntegrityErrors) }, + { tag:"RcvErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, portRcvErrors) }, + { tag:"ExcessiveBufferOverruns", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, excessiveBufferOverruns) }, + { tag:"FMConfigErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, fmConfigErrors) }, + { tag:"LinkErrorRecovery", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, linkErrorRecovery) }, + { tag:"LinkDowned", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, linkDowned) }, + { tag:"UncorrectableErrors", format:'U', IXML_FIELD_INFO(STL_PORT_COUNTERS_DATA, uncorrectableErrors) }, { tag:"LinkQualityIndicator", format:'K', format_func:PortStatusDataXmlOutputLinkQualityIndicator, end_func:PortStatusDataXmlParserEndLinkQualityIndicator }, // bitfield { NULL } }; void PortStatusDataXmlOutput(IXmlOutputState_t *state, const char *tag, void *data) { - IXmlOutputStruct(state, tag, (STL_PortStatusData_t*)data, NULL, PortStatusDataFields); + IXmlOutputStruct(state, tag, (STL_PORT_COUNTERS_DATA *)data, NULL, PortStatusDataFields); } // only output if value != NULL void PortStatusDataXmlOutputOptional(IXmlOutputState_t *state, const char *tag, void *data) { - IXmlOutputOptionalStruct(state, tag, (STL_PortStatusData_t*)data, NULL, PortStatusDataFields); + IXmlOutputOptionalStruct(state, tag, (STL_PORT_COUNTERS_DATA *)data, NULL, PortStatusDataFields); } static void PortStatusDataXmlParserEnd(IXmlParserState_t *state, const IXML_FIELD *field, void *object, void *parent, XML_Char *content, unsigned len, boolean valid) { - STL_PortStatusData_t *pPortStatusData = (STL_PortStatusData_t*)object; + STL_PORT_COUNTERS_DATA *pPortCountersData = (STL_PORT_COUNTERS_DATA *)object; PortData *portp = (PortData*)parent; if (! valid) // missing mandatory fields goto failvalidate; - if (portp->pPortStatus) { + if (portp->pPortCounters) { IXmlParserPrintError(state, "More than 1 PortStatus for Port"); goto failinsert; } - portp->pPortStatus = pPortStatusData; + portp->pPortCounters = pPortCountersData; + // NumLanesDown is set in PortDataXmlParserEnd() + return; failinsert: failvalidate: - MemoryDeallocate(pPortStatusData); + MemoryDeallocate(pPortCountersData); } /****************************************************************************/ @@ -2099,7 +2101,7 @@ static void PortDataXmlOutputPortStatusData(IXmlOutputState_t *state, const char { PortData *portp = (PortData*)data; - PortStatusDataXmlOutputOptional(state, "PortStatus", portp->pPortStatus); + PortStatusDataXmlOutputOptional(state, "PortStatus", portp->pPortCounters); } /* bitfields needs special handling: PassThroughControlDRControl */ @@ -2852,7 +2854,7 @@ static IXML_FIELD PortDataFields[] = { { tag:"VLArbitrationPreemptElements", format:'k', format_func:PortDataXmlOutputVLArbPreemptElements, subfields:VLArbFields, start_func:VLArbPreemptElementsXmlParserStart, end_func:VLArbPreemptElementsXmlParserEnd }, { tag:"VLArbitrationPreemptMatrix", format:'k', format_func:PortDataXmlOutputVLArbPreemptMatrix, subfields:VLArbPreemptMatrixFields, start_func:VLArbPreemptMatrixXmlParserStart, end_func:VLArbPreemptMatrixXmlParserEnd }, { tag:"PKeyTable", format:'k', format_func:PortDataXmlOutputPKeyTable, subfields:PKeyTableFields, start_func:PKeyTableXmlParserStart, end_func:PKeyTableXmlParserEnd }, // structure - { tag:"PortStatus", format:'k', size:sizeof(STL_PortStatusData_t), format_func:PortDataXmlOutputPortStatusData, subfields:PortStatusDataFields, start_func:IXmlParserStartStruct, end_func:PortStatusDataXmlParserEnd }, // structure + { tag:"PortStatus", format:'k', size:sizeof(STL_PORT_COUNTERS_DATA), format_func:PortDataXmlOutputPortStatusData, subfields:PortStatusDataFields, start_func:IXmlParserStartStruct, end_func:PortStatusDataXmlParserEnd }, // structure { tag:"CableInfo", format:'k', size:128, format_func:PortDataXmlOutputCableInfo, subfields:(IXML_FIELD*)CableInfoFields, start_func:CableInfoXmlParserStart}, { tag:"LocalPortNum", format:'u', IXML_FIELD_INFO(PortData, PortInfo.LocalPortNum) }, { tag:"PortStates", format:'h', IXML_FIELD_INFO(PortData, PortInfo.PortStates.AsReg32) }, @@ -3008,6 +3010,10 @@ static void PortDataXmlParserEnd(IXmlParserState_t *state, const IXML_FIELD *fie portp->PortInfo.LinkSpeed.Active, portp->PortInfo.LinkWidth.Active); + if (portp->pPortCounters) { + portp->pPortCounters->lq.s.numLanesDown = StlGetNumLanesDown(&portp->PortInfo); + } + if (parseCompleteFn) { if (parseCompleteFn(state, object, parent) != FSUCCESS) { goto failvalidate; @@ -3030,8 +3036,8 @@ failvalidate: */ void Snapshot_PortDataFree(PortData * portp, FabricData_t * fabricp) { - if (portp->pPortStatus) - MemoryDeallocate(portp->pPortStatus); + if (portp->pPortCounters) + MemoryDeallocate(portp->pPortCounters); PortDataFreeQOSData(fabricp, portp); PortDataFreePartitionTable(fabricp, portp); } diff --git a/Topology/sweep.c b/Topology/sweep.c index 0fe1396..1283130 100644 --- a/Topology/sweep.c +++ b/Topology/sweep.c @@ -2611,13 +2611,15 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric cl_map_item_t *p; #ifdef PRODUCT_OPENIB_FF STL_LID lid = 0; + STL_PA_IMAGE_ID_DATA img_id_end = {0}; + STL_PA_IMAGE_ID_DATA img_id_begin = {0}; #endif int i=0; int num_nodes = cl_qmap_count(&fabricp->AllNodes); uint32 node_count = 0; uint32 nrsp_node_count = 0; uint32 nrsp_port_count = 0; - STL_PortStatusData_t PortStatusData = { 0 }; + STL_PORT_COUNTERS_DATA PortCountersData = { 0 }; if (! quiet) ProgressPrint(TRUE, "Getting All Port Counters..."); @@ -2635,6 +2637,50 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric return FERROR; } } + + //verify pa has necessary capabilities + if (!(fabricp->flags & FF_PMADIRECT)) { + STL_CLASS_PORT_INFO *cpi; + + if (omgt_pa_get_classportinfo(g_portHandle, &cpi) == FSUCCESS) { + STL_PA_CLASS_PORT_INFO_CAPABILITY_MASK paCap; + + memcpy(&paCap, &cpi->CapMask, sizeof(STL_PA_CLASS_PORT_INFO_CAPABILITY_MASK)); + MemoryDeallocate(cpi); + //if trying to query by time, check if feature available + if (begin || end) { + if (!(paCap.s.IsAbsTimeQuerySupported)) { + fprintf(stderr, "%s: PA does not support time queries\n", __func__); + return FERROR; + } + } + } else { + fprintf(stderr, "%s: failed to determine PA capabilities\n", __func__); + return FERROR; + } + + // Verify Images exist before querying + if (end || begin) { + STL_PA_IMAGE_INFO_DATA img_info_end = {{0}}; + + img_id_end.imageNumber = PACLIENT_IMAGE_TIMED; + img_id_end.imageTime.absoluteTime = end ? end : begin; + status = omgt_pa_get_image_info(g_portHandle, img_id_end, &img_info_end); + if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to get image info at %s\n", __func__, ctime((time_t *)&img_id_end.imageTime.absoluteTime)); + return status; + } + img_id_end = img_info_end.imageId; + + status = omgt_pa_freeze_image(g_portHandle, img_id_end, &img_id_end); + if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to freeze image at %s\n", __func__, ctime((time_t *)&img_id_end.imageTime.absoluteTime)); + return status; + } + } + } else if (begin || end) { + DBGPRINT("%s: Ignoring begin and/or end as we are getting counters direct from PMA", __func__); + } #endif for (p=cl_qmap_head(&fabricp->AllNodes); p != cl_qmap_end(&fabricp->AllNodes); p = cl_qmap_next(p),i++) { NodeData *nodep = PARENT_STRUCT(p, NodeData, AllNodesEntry); @@ -2685,78 +2731,22 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric continue; #ifdef PRODUCT_OPENIB_FF - /* use PaClient if available */ - if (g_paclient_state == OMGT_SERVICE_STATE_OPERATIONAL) - { - if (!first_portp) - lid = portp->PortInfo.LID; + if (g_paclient_state == OMGT_SERVICE_STATE_OPERATIONAL) { + if (!first_portp) lid = portp->PortInfo.LID; //if getting port counters by time, get latest counters first STL_PORT_COUNTERS_DATA portCounters1 = {0}; - STL_PA_IMAGE_ID_DATA imageIdQuery1 = {0}; - - imageIdQuery1.imageNumber = (end || begin) ? PACLIENT_IMAGE_TIMED : PACLIENT_IMAGE_CURRENT; - imageIdQuery1.imageTime.absoluteTime = end ? end : begin; - - status = FERROR; - //verify pa has necessary capabilities - STL_CLASS_PORT_INFO * portInfo; - if (omgt_pa_get_classportinfo(g_portHandle, &portInfo) == FSUCCESS){ - STL_PA_CLASS_PORT_INFO_CAPABILITY_MASK paCap; - memcpy(&paCap, &portInfo->CapMask, sizeof(STL_PA_CLASS_PORT_INFO_CAPABILITY_MASK)); - //if trying to query by time, check if feature available - if (begin || end){ - if (!(paCap.s.IsAbsTimeQuerySupported)){ - DBGPRINT("PA does not support time queries\n"); - status = FERROR; - }else{ - status = FSUCCESS; - } - } - MemoryDeallocate(portInfo); - }else { - DBGPRINT("failed to determine PA capabilities\n"); - status = FERROR; - } - - - status = omgt_pa_get_port_stats2(g_portHandle, imageIdQuery1, lid, portp->PortNum, - NULL, &portCounters1, NULL, 0, !(end || begin)); //last param is user_counters flag, - //if begin or end set we want raw - //counters - if (FSUCCESS == status){ - if (begin && end){// need to perform another query - STL_PA_IMAGE_ID_DATA imageIdQuery2 = {0}; - imageIdQuery2.imageNumber = PACLIENT_IMAGE_TIMED; - imageIdQuery2.imageTime.absoluteTime = begin; //we got counters for end first - - STL_PORT_COUNTERS_DATA portCounters2 = {0}; - - status = omgt_pa_get_port_stats2(g_portHandle, imageIdQuery2, lid, portp->PortNum, - NULL, &portCounters2, NULL, 0, 0); - - if (FSUCCESS == status){ - CounterSelectMask_t clearedCounters = DiffPACounters(&portCounters1, &portCounters2, &portCounters1); - if (clearedCounters.AsReg32){ - char counterBuf[128]; - FormatStlCounterSelectMask(counterBuf, clearedCounters); - fprintf(stderr, "Counters reset, reporting latest count: %s\n", counterBuf); - } - StlPortCountersToPortStatus(&portCounters1, &PortStatusData); - } - }else{ - StlPortCountersToPortStatus(&portCounters1, &PortStatusData); - } + status = omgt_pa_get_port_stats2(g_portHandle, img_id_end, lid, portp->PortNum, + NULL, &portCounters1, NULL, 0, !(end || begin)); //last param is user_counters flag, + //if begin or end set we want raw counters + if (FSUCCESS == status) { + PortCountersData = portCounters1; } } #endif - /* issue direct PMA query */ - else { - if (begin || end){ - continue; - } + else { /* issue direct PMA query */ STL_PORT_STATUS_RSP PortStatus; if (! PortHasPma(portp)) @@ -2783,37 +2773,7 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric } } if (FSUCCESS == status) { - PortStatusData.PortXmitData = PortStatus.PortXmitData; - PortStatusData.PortRcvData = PortStatus.PortRcvData; - PortStatusData.PortXmitPkts = PortStatus.PortXmitPkts; - PortStatusData.PortRcvPkts = PortStatus.PortRcvPkts; - PortStatusData.PortMulticastXmitPkts = PortStatus.PortMulticastXmitPkts; - PortStatusData.PortMulticastRcvPkts = PortStatus.PortMulticastRcvPkts; - PortStatusData.LocalLinkIntegrityErrors = PortStatus.LocalLinkIntegrityErrors; - PortStatusData.FMConfigErrors = PortStatus.FMConfigErrors; - PortStatusData.PortRcvErrors = PortStatus.PortRcvErrors; - PortStatusData.ExcessiveBufferOverruns = PortStatus.ExcessiveBufferOverruns; - PortStatusData.PortRcvConstraintErrors = PortStatus.PortRcvConstraintErrors; - PortStatusData.PortRcvSwitchRelayErrors = PortStatus.PortRcvSwitchRelayErrors; - PortStatusData.PortXmitDiscards = PortStatus.PortXmitDiscards; - PortStatusData.PortXmitConstraintErrors = PortStatus.PortXmitConstraintErrors; - PortStatusData.PortRcvRemotePhysicalErrors = PortStatus.PortRcvRemotePhysicalErrors; - PortStatusData.SwPortCongestion = PortStatus.SwPortCongestion; - PortStatusData.PortXmitWait = PortStatus.PortXmitWait; - PortStatusData.PortRcvFECN = PortStatus.PortRcvFECN; - PortStatusData.PortRcvBECN = PortStatus.PortRcvBECN; - PortStatusData.PortXmitTimeCong = PortStatus.PortXmitTimeCong; - PortStatusData.PortXmitWastedBW = PortStatus.PortXmitWastedBW; - PortStatusData.PortXmitWaitData = PortStatus.PortXmitWaitData; - PortStatusData.PortRcvBubble = PortStatus.PortRcvBubble; - PortStatusData.PortMarkFECN = PortStatus.PortMarkFECN; - PortStatusData.LinkErrorRecovery = PortStatus.LinkErrorRecovery; - PortStatusData.LinkDowned = PortStatus.LinkDowned; - PortStatusData.UncorrectableErrors = PortStatus.UncorrectableErrors; - PortStatusData.lq = PortStatus.lq; - PortStatusData.lq.AsReg8 |= ((portp->PortInfo.LinkWidthDowngrade.RxActive < portp->PortInfo.LinkWidth.Active ? - StlLinkWidthToInt(portp->PortInfo.LinkWidth.Active) - - StlLinkWidthToInt(portp->PortInfo.LinkWidthDowngrade.RxActive) : 0) << 4); + StlPortStatusToPortCounters(&PortStatus, &PortCountersData, &portp->PortInfo); } } @@ -2829,8 +2789,9 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric continue; } - portp->pPortStatus = (STL_PortStatusData_t*)MemoryAllocate2AndClear(sizeof(STL_PortStatusData_t), IBA_MEM_FLAG_PREMPTABLE, MYTAG); - if (! portp->pPortStatus) { + portp->pPortCounters = (STL_PORT_COUNTERS_DATA *)MemoryAllocate2AndClear(sizeof(STL_PORT_COUNTERS_DATA), + IBA_MEM_FLAG_PREMPTABLE, MYTAG); + if (! portp->pPortCounters) { DBGPRINT("Unable to allocate memory for Port Counters for Port %d LID 0x%08x Node 0x%016"PRIx64"\n", portp->PortNum, portp->EndPortLID, portp->nodep->NodeInfo.NodeGUID); @@ -2842,7 +2803,7 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric continue; } - *(portp->pPortStatus) = PortStatusData; + *(portp->pPortCounters) = PortCountersData; got = TRUE; } if (got) @@ -2850,6 +2811,91 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric if (fail) nrsp_node_count++; } +#ifdef PRODUCT_OPENIB_FF + if ((begin || end) && (g_paclient_state == OMGT_SERVICE_STATE_OPERATIONAL)) { + status = omgt_pa_release_image(g_portHandle, img_id_end); + if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to release frozen image at %s\n", __func__, ctime((time_t *)&img_id_end.imageTime.absoluteTime)); + return status; + } + } + if (begin && end && (g_paclient_state == OMGT_SERVICE_STATE_OPERATIONAL)) { + STL_PA_IMAGE_INFO_DATA img_info_begin = {{0}}; + // Verify Image exists + img_id_begin.imageNumber = PACLIENT_IMAGE_TIMED; + img_id_begin.imageTime.absoluteTime = begin; + status = omgt_pa_get_image_info(g_portHandle, img_id_begin, &img_info_begin); + if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to get image info at %s\n", __func__, ctime((time_t *)&img_id_begin.imageTime.absoluteTime)); + return status; + } + img_id_begin = img_info_begin.imageId; + + status = omgt_pa_freeze_image(g_portHandle, img_id_begin, &img_id_begin); + if (status == FSUCCESS) { + for (i = 0, p = cl_qmap_head(&fabricp->AllNodes); p != cl_qmap_end(&fabricp->AllNodes); p = cl_qmap_next(p), i++) + { + NodeData *nodep = PARENT_STRUCT(p, NodeData, AllNodesEntry); + PortData *first_portp; + cl_map_item_t *q; + + if (limitstats && focus && ! CompareNodePoint(nodep, focus)) + continue; + if (i%PROGRESS_FREQ == 0) + if (! quiet) ProgressPrint(FALSE, "Processed %6d of %6d Nodes...", i, num_nodes); + if (cl_qmap_head(&nodep->Ports) == cl_qmap_end(&nodep->Ports)) + continue; /* no ports */ + /* issue all switch PMA requests to port 0, its only one with a LID */ + if (nodep->NodeInfo.NodeType == STL_NODE_SW) { + first_portp = PARENT_STRUCT(cl_qmap_head(&nodep->Ports), PortData, NodePortsEntry); + lid = first_portp->PortInfo.LID; + } else { + first_portp = NULL; + } + + for (q=cl_qmap_head(&nodep->Ports); q != cl_qmap_end(&nodep->Ports); q = cl_qmap_next(q)) { + PortData *portp = PARENT_STRUCT(q, PortData, NodePortsEntry); + + if (focus && ! ComparePortPoint(portp, focus) + && (limitstats || ! portp->neighbor || ! ComparePortPoint(portp->neighbor, focus))) + continue; + if (!portp->pPortCounters) continue; + + if (!first_portp) lid = portp->PortInfo.LID; + + STL_PORT_COUNTERS_DATA portCounters2 = {0}; + + status = omgt_pa_get_port_stats2(g_portHandle, img_id_begin, lid, portp->PortNum, + NULL, &portCounters2, NULL, 0, 0); + if (FSUCCESS == status) { + + CounterSelectMask_t clearedCounters = DiffPACounters( + portp->pPortCounters, &portCounters2, portp->pPortCounters); + + if (clearedCounters.AsReg32) { + char counterBuf[128]; + + FormatStlCounterSelectMask(counterBuf, clearedCounters); + fprintf(stderr, "Counters reset on LID 0x%x port %u Node 0x%016"PRIx64" Name: %.*s, reporting latest count: %s\n", + lid, portp->PortNum, portp->nodep->NodeInfo.NodeGUID, + STL_NODE_DESCRIPTION_ARRAY_SIZE, (char *)portp->nodep->NodeDesc.NodeString, + counterBuf); + } + } + } + } // END: for all nodes + status = omgt_pa_release_image(g_portHandle, img_id_begin); + if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to release frozen image at %s\n", __func__, ctime((time_t *)&img_id_begin.imageTime.absoluteTime)); + return status; + } + } else if (status != FSUCCESS) { + fprintf(stderr, "%s: failed to freeze image at %s\n", __func__, ctime((time_t *)&img_id_begin.imageTime.absoluteTime)); + return status; + } + } +#endif + //Close the opamgt port handle if (g_portHandle) { diff --git a/Topology/topology.h b/Topology/topology.h index 2a1cb81..8cec6f5 100644 --- a/Topology/topology.h +++ b/Topology/topology.h @@ -99,8 +99,6 @@ typedef struct QOSData_s { } QOSData; -typedef STL_PORT_STATUS_RSP STL_PortStatusData_t; - // How many STL_CABLE_INFO structs to store per port #define PORTDATA_CABLEINFO_SIZE 4 #define IFACE_MACLIST_SIZE 512 @@ -128,7 +126,7 @@ typedef struct PortData_s { STL_LED_INFO LedInfo; //Led Info for this port IB_PATH_RECORD *pathp; // Path Record to send to this port - STL_PortStatusData_t *pPortStatus; + STL_PORT_COUNTERS_DATA *pPortCounters; struct ExpectedLink_s *elinkp; // if supplied in topology input QOSData *pQOS; // optional QOS STL_PKEY_ELEMENT *pPartitionTable; // optional Partition Table @@ -1081,7 +1079,7 @@ extern boolean NodeHasPma(NodeData *nodep); extern boolean PortHasPma(PortData *portp); extern void UpdateNodePmaCapabilities(NodeData *nodep, boolean ProcessHFICounters); extern FSTATUS STLPmGetClassPortInfo(struct omgt_port *port, PortData *portp); -extern FSTATUS STLPmGetPortStatus(struct omgt_port *port, PortData *portp, uint8 portNum, STL_PortStatusData_t *pPortStatus); +extern FSTATUS STLPmGetPortStatus(struct omgt_port *port, PortData *portp, uint8 portNum, STL_PORT_STATUS_RSP *pPortStatus); extern FSTATUS STLPmClearPortCounters(struct omgt_port *port, PortData *portp, uint8 lastPortIndex, uint32 counterselect); #if !defined(VXWORKS) || defined(BUILD_DMC) extern FSTATUS DmGetIouInfo(struct omgt_port *port, IB_PATH_RECORD *pathp, IOUnitInfo *pIouInfo); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 8a66f22..4c9402f 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,14 +29,14 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.2.2 +Version: 10.9.3.1 Release: 1%{?dist} %if 0%{?rhel} Epoch: 1 %endif Summary: Intel Omni-Path Fabric Management Software -License: GPLv2 or BSD +License: BSD Url: https://github.com/intel/opa-fm # tarball created by: # git clone https://github.com/01org/opa-fm.git @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.2.2.1%{?dist} +IFSComponent: FM 10.9.3.1.1%{?dist} %prep %setup -q -c diff --git a/opamgt/src/opamgt_pa.c b/opamgt/src/opamgt_pa.c index 2b788d0..29841bd 100644 --- a/opamgt/src/opamgt_pa.c +++ b/opamgt/src/opamgt_pa.c @@ -953,10 +953,8 @@ iba_pa_single_mad_move_freeze_response_query( if (port == NULL) return response; p = (STL_MOVE_FREEZE_DATA *)(((SA_MAD *)request_data)->Data); - p->oldFreezeImage.imageNumber = hton64(move_info->oldFreezeImage.imageNumber); - p->oldFreezeImage.imageOffset = hton32(move_info->oldFreezeImage.imageOffset); - p->newFreezeImage.imageNumber = hton64(move_info->newFreezeImage.imageNumber); - p->newFreezeImage.imageOffset = hton32(move_info->newFreezeImage.imageOffset); + *p = *move_info; + BSWAP_STL_PA_MOVE_FREEZE(p); // submit request fstatus = pa_query_common(port, STL_PA_CMD_SET, STL_PA_ATTRID_MOVE_FREEZE_FRAME, 0,
0
5128b80853c550f708ba0e0bc321954ae37ed580
01org/opa-fm
Merge branch 'master' of https://github.com/01org/opa-fm
commit 5128b80853c550f708ba0e0bc321954ae37ed580 (from 1e057203a1f234b35024f2325dbc442a4ee1fcfd) Merge: 1e05720 82600d3 Author: Scott Breyer <[email protected]> Date: Thu May 5 06:18:40 2016 -0400 Merge branch 'master' of https://github.com/01org/opa-fm diff --git a/Esm/ib/src/linux/startup/opafm_src.xml b/Esm/ib/src/linux/startup/opafm_src.xml index 1a9582b..c816d9b 100644 --- a/Esm/ib/src/linux/startup/opafm_src.xml +++ b/Esm/ib/src/linux/startup/opafm_src.xml @@ -1720,7 +1720,7 @@ <!-- Enables fabric activation optimization to reduce packet counts --> <!-- during fabric bring up. 0-Disable, 1-Switches only, 2-All devices --> - <SwitchCascadeActivateEnable>2</SwitchCascadeActivateEnable> + <SwitchCascadeActivateEnable>0</SwitchCascadeActivateEnable> <!-- Number of times to retry activation upon detecting an armed port --> <!-- with a non-armed/active neighbor. --> diff --git a/Esm/ib/src/smi/sm/sm_topology.c b/Esm/ib/src/smi/sm/sm_topology.c index c70e6fa..556a891 100755 --- a/Esm/ib/src/smi/sm/sm_topology.c +++ b/Esm/ib/src/smi/sm/sm_topology.c @@ -3351,6 +3351,7 @@ topology_activate(void) if(portStateInfo != NULL) { vs_pool_free(&sm_pool, portStateInfo); + portStateInfo = NULL; } psiFailed = 1; @@ -3381,7 +3382,10 @@ topology_activate(void) } } - vs_pool_free(&sm_pool, portStateInfo); + if(portStateInfo != NULL) { + vs_pool_free(&sm_pool, portStateInfo); + portStateInfo = NULL; + } } } diff --git a/opafm.spec b/opafm.spec index 306979c..b8e37bd 100644 --- a/opafm.spec +++ b/opafm.spec @@ -119,7 +119,6 @@ install -D stage.rpm/opaxmlfilter $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlfilter #install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample #install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample - mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s /opt/opafm/bin/fm_cmd $RPM_BUILD_ROOT%{_sbindir}/opafmcmd ln -s /opt/opafm/bin/fm_cmdall $RPM_BUILD_ROOT%{_sbindir}/opafmcmdall @@ -158,7 +157,10 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* +<<<<<<< HEAD #/opt/opafm/samples/* +======= +>>>>>>> 82600d3632ee0c401c218fc0d9a462347e7ae2fb %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall commit 5128b80853c550f708ba0e0bc321954ae37ed580 (from 82600d3632ee0c401c218fc0d9a462347e7ae2fb) Merge: 1e05720 82600d3 Author: Scott Breyer <[email protected]> Date: Thu May 5 06:18:40 2016 -0400 Merge branch 'master' of https://github.com/01org/opa-fm diff --git a/Esm/ib/include/cs_hashtable.h b/Esm/ib/include/cs_hashtable.h index 4bce7a2..610ae90 100644 --- a/Esm/ib/include/cs_hashtable.h +++ b/Esm/ib/include/cs_hashtable.h @@ -91,10 +91,6 @@ * */ -#ifndef INLINE -# define INLINE extern inline -#endif - typedef enum { CS_HASH_KEY_NOT_ALLOCATED, CS_HASH_KEY_ALLOCATED @@ -245,7 +241,7 @@ valuetype * fncname (CS_HashTablep h, keytype *k) \ * @param h the hashtable * @return the number of items stored in the hashtable */ -INLINE uint32_t +static __inline uint32_t cs_hashtable_count(CS_HashTablep h) { return h->entrycount; @@ -281,7 +277,7 @@ int32_t cs_hashtable_change(CS_HashTablep h, void *k, void *v); * cs_hashtable_iterator */ -INLINE void +static __inline void cs_hashtable_iterator(CS_HashTablep h, CS_HashTableItr_t *itr) { itr->h = h; itr->e = h->listHead; @@ -292,7 +288,7 @@ cs_hashtable_iterator(CS_HashTablep h, CS_HashTableItr_t *itr) { * - return the value of the (key,value) pair at the current position */ -INLINE void * +static __inline void * cs_hashtable_iterator_key(CS_HashTableItrp i) { return i->e->k; @@ -302,7 +298,7 @@ cs_hashtable_iterator_key(CS_HashTableItrp i) * value - return the value of the (key,value) pair at the current position */ -INLINE void * +static __inline void * cs_hashtable_iterator_value(CS_HashTableItrp i) { return i->e->v; @@ -313,7 +309,7 @@ cs_hashtable_iterator_value(CS_HashTableItrp i) * returns zero if advanced to end of table */ -INLINE int32_t +static __inline int32_t cs_hashtable_iterator_advance(CS_HashTableItrp itr) { if (itr->e != NULL) return (itr->e = itr->e->listNext) == NULL ? 0 : -1; diff --git a/opafm.spec b/opafm.spec index 744ce9f..b8e37bd 100644 --- a/opafm.spec +++ b/opafm.spec @@ -38,20 +38,21 @@ License: BSD Url: http://www.intel.com/ Source0: %{name}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +ExclusiveArch: x86_64 Requires: rdma #BuildRequires: libibverbs-devel >= 1.1-1, libibumad-devel, libibmad-devel AutoReq: no -%if 0%{?rhel} -BuildRequires: expat-devel -Requires: expat, libibmad, libibumad, libibverbs +%if 0%{?rhel} || 0%{?fedora} +BuildRequires: expat-devel, libibumad-devel, libibverbs-devel, libibmad-devel, openssl-devel +Requires: expat, libibmad, libibumad, libibverbs, openssl %else -Requires: libexpat1, libibmad5, libibumad, libibverbs1 -BuildRequires: libexpat-devel +Requires: libexpat1, libibmad5, libibumad, libibverbs1, openssl +BuildRequires: libexpat-devel, libibumad-devel, libibverbs-devel, libibmad5-devel, libopenssl-devel %endif -%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7 +%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7 || 0%{?fedora} BuildRequires: systemd %{?systemd_requires} %{?BuildRequires} Requires: systemd %{?systemd_requires} %else @@ -116,6 +117,8 @@ install -D stage.rpm/opafm.xml $RPM_BUILD_ROOT/opt/opafm/etc/opafm.xml install -D stage.rpm/opaxmlextract $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlextract install -D stage.rpm/opaxmlfilter $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlfilter +#install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample +#install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s /opt/opafm/bin/fm_cmd $RPM_BUILD_ROOT%{_sbindir}/opafmcmd ln -s /opt/opafm/bin/fm_cmdall $RPM_BUILD_ROOT%{_sbindir}/opafmcmdall @@ -154,6 +157,10 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* +<<<<<<< HEAD +#/opt/opafm/samples/* +======= +>>>>>>> 82600d3632ee0c401c218fc0d9a462347e7ae2fb %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall
0
1d0b88a9876f266e0dc41c40509dd46e4e5676cd
01org/opa-fm
Removal of unused files
commit 1d0b88a9876f266e0dc41c40509dd46e4e5676cd Author: Scott Breyer <[email protected]> Date: Fri Nov 20 16:56:03 2015 -0500 Removal of unused files diff --git a/IbAccess/Common/Ibt/ibt.vssscc b/IbAccess/Common/Ibt/ibt.vssscc deleted file mode 100644 index 6cb031b..0000000 --- a/IbAccess/Common/Ibt/ibt.vssscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" -} diff --git a/MakeTools/Makefile b/MakeTools/Makefile index f56d263..9de8cc2 100644 --- a/MakeTools/Makefile +++ b/MakeTools/Makefile @@ -55,7 +55,6 @@ DIRS = \ installtargets \ stripdepends \ rm_version \ - zisofs-tools \ $(TEST) CMD_TARGETS_MISC = \ builddsw \ diff --git a/MakeTools/makeself-header.sh b/MakeTools/makeself-header.sh deleted file mode 100755 index 889a8c2..0000000 --- a/MakeTools/makeself-header.sh +++ /dev/null @@ -1,374 +0,0 @@ -# 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] -cat << EOF > "$archname" -#!/bin/sh -# This script was generated using Makeself $MS_VERSION -CRCsum="$CRCsum" -MD5="$MD5sum" -TMPROOT=\${TMPDIR:=/tmp} - -label="$LABEL" -script="$SCRIPT" -scriptargs="$SCRIPTARGS" -targetdir="$archdirname" -filesizes="$filesizes" -keep=$KEEP - -print_cmd_arg="" -if type printf > /dev/null; then - print_cmd="printf" -elif test -x /usr/ucb/echo; then - print_cmd="/usr/ucb/echo" -else - print_cmd="echo" -fi - -MS_Printf() -{ - \$print_cmd \$print_cmd_arg "\$1" -} - -MS_Progress() -{ - while read a; do - MS_Printf . - done -} - -MS_dd() -{ - blocks=\`expr \$3 / 1024\` - bytes=\`expr \$3 % 1024\` - dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\ - { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\ - test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null -} - -MS_Help() -{ - cat << EOH >&2 -Makeself version $MS_VERSION - 1) Getting help or info about \$0 : - \$0 --help Print this message - \$0 --info Print embedded info : title, default target directory, embedded script ... - \$0 --lsm Print embedded lsm entry (or no LSM) - \$0 --list Print the list of files in the archive - \$0 --check Checks integrity of the archive - - 2) Running \$0 : - \$0 [options] [--] [additional arguments to embedded script] - with following options (in that order) - --confirm Ask before running embedded script - --keep Do not erase target directory after running - the embedded script - --nox11 Do not spawn an xterm - --nochown Do not give the extracted files to the current user - --target NewDirectory Extract in NewDirectory - -- Following arguments will be passed to the embedded script -EOH -} - -MS_Check() -{ - OLD_PATH=\$PATH - PATH=\${GUESS_MD5_PATH:-"\$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} - MD5_PATH=\`which md5sum 2>/dev/null || type md5sum 2>/dev/null\` - MD5_PATH=\${MD5_PATH:-\`which md5 2>/dev/null || type md5 2>/dev/null\`} - PATH=\$OLD_PATH - MS_Printf "Verifying archive integrity..." - offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\` - verb=\$2 - i=1 - for s in \$filesizes - do - crc=\`echo \$CRCsum | cut -d" " -f\$i\` - if test -x "\$MD5_PATH"; then - md5=\`echo \$MD5 | cut -d" " -f\$i\` - if test \$md5 = "00000000000000000000000000000000"; then - test x\$verb = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 - else - md5sum=\`MS_dd "\$1" \$offset \$s | "\$MD5_PATH" | cut -b-32\`; - if test "\$md5sum" != "\$md5"; then - echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2 - exit 2 - else - test x\$verb = xy && MS_Printf " MD5 checksums are OK." >&2 - fi - crc="0000000000"; verb=n - fi - fi - if test \$crc = "0000000000"; then - test x\$verb = xy && echo " \$1 does not contain a CRC checksum." >&2 - else - sum1=\`MS_dd "\$1" \$offset \$s | cksum | awk '{print \$1}'\` - if test "\$sum1" = "\$crc"; then - test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2 - else - echo "Error in checksums: \$sum1 is different from \$crc" - exit 2; - fi - fi - i=\`expr \$i + 1\` - offset=\`expr \$offset + \$s\` - done - echo " All good." -} - -UnTAR() -{ - tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; } -} - -finish=true -xterm_loop= -nox11=$NOX11 -copy=$COPY -ownership= - -while true -do - case "\$1" in - -h | --help) - MS_Help - exit 0 - ;; - --info) - echo Identification: "\$label" - echo Target directory: "\$targetdir" - echo Uncompressed size: $USIZE KB - echo Compression: $COMPRESS - echo Date of packaging: $DATE - echo Built with Makeself version $MS_VERSION on $OSTYPE - if test x\$script != x; then - echo Script run after extraction: - echo " " \$script \$scriptargs - fi - if test x"$copy" = xcopy; then - echo "Archive will copy itself to a temporary location" - fi - if test x"$KEEP" = xy; then - echo "directory \$targetdir is permanent" - else - echo "\$targetdir will be removed after extraction" - fi - exit 0 - ;; - --dumpconf) - echo LABEL=\"\$label\" - echo SCRIPT=\"\$script\" - echo SCRIPTARGS=\"\$scriptargs\" - echo archdirname=\"$archdirname\" - echo KEEP=$KEEP - echo COMPRESS=$COMPRESS - echo filesizes=\"\$filesizes\" - echo CRCsum=\"\$CRCsum\" - echo MD5sum=\"\$MD5\" - echo OLDUSIZE=$USIZE - echo OLDSKIP=`expr $SKIP + 1` - exit 0 - ;; - --lsm) -cat << EOLSM -EOF -eval "$LSM_CMD" -cat << EOF >> "$archname" -EOLSM - exit 0 - ;; - --list) - echo Target directory: \$targetdir - offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` - for s in \$filesizes - do - MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | UnTAR t - offset=\`expr \$offset + \$s\` - done - exit 0 - ;; - --check) - MS_Check "\$0" y - exit 0 - ;; - --confirm) - verbose=y - shift - ;; - --keep) - keep=y - shift - ;; - --target) - keep=y - targetdir=\${2:-.} - shift 2 - ;; - --nox11) - nox11=y - shift - ;; - --nochown) - ownership=n - shift - ;; - --xwin) - finish="echo Press Return to close this window...; read junk" - xterm_loop=1 - shift - ;; - --phase2) - copy=phase2 - shift - ;; - --) - shift - break ;; - -*) - echo Unrecognized flag : "\$1" >&2 - MS_Help - exit 1 - ;; - *) - break ;; - esac -done - -case "\$copy" in -copy) - SCRIPT_COPY="\$TMPROOT/makeself\$\$" - echo "Copying to a temporary location..." >&2 - cp "\$0" "\$SCRIPT_COPY" - chmod +x "\$SCRIPT_COPY" - cd "\$TMPROOT" - exec "\$SCRIPT_COPY" --phase2 - ;; -phase2) - finish="\$finish ; rm -f \$0" - ;; -esac - -if test "\$nox11" = "n"; then - if tty -s; then # Do we have a terminal? - : - else - if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X? - if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable - GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm" - for a in \$GUESS_XTERMS; do - if type \$a >/dev/null 2>&1; then - XTERM=\$a - break - fi - done - chmod a+x \$0 || echo Please add execution rights on \$0 - if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal! - exec \$XTERM -title "\$label" -e "\$0" --xwin "\$@" - else - exec \$XTERM -title "\$label" -e "./\$0" --xwin "\$@" - fi - fi - fi - fi -fi - -if test "\$targetdir" = "."; then - tmpdir="." -else - if test "\$keep" = y; then - echo "Creating directory \$targetdir" >&2 - tmpdir="\$targetdir" - else - tmpdir="\$TMPROOT/selfgz\$\$" - fi - mkdir \$tmpdir || { - echo 'Cannot create target directory' \$tmpdir >&2 - echo 'You should try option --target OtherDirectory' >&2 - eval \$finish - exit 1 - } -fi - -location="\`pwd\`" -if test x\$SETUP_NOCHECK != x1; then - MS_Check "\$0" -fi -offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` - -if test x"\$verbose" = xy; then - MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] " - read yn - if test x"\$yn" = xn; then - eval \$finish; exit 1 - fi -fi - -MS_Printf "Uncompressing \$label" -res=3 -if test "\$keep" = n; then - trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15 -fi - -for s in \$filesizes -do - if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then - if test x"\$ownership" != x; then - (PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .) - fi - else - echo - echo "Unable to decompress \$0" >&2 - eval \$finish; exit 1 - fi - offset=\`expr \$offset + \$s\` -done -echo - -cd "\$tmpdir" -res=0 -if test x"\$script" != x; then - if test x"\$verbose" = xy; then - MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " - read yn - if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then - \$script \$scriptargs \$*; res=\$?; - fi - else - \$script \$scriptargs \$*; res=\$? - fi - if test \$res -ne 0; then - test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2 - fi -fi -if test "\$keep" = n; then - cd \$TMPROOT - /bin/rm -rf \$tmpdir -fi -eval \$finish; exit \$res -EOF diff --git a/MakeTools/makeself.sh b/MakeTools/makeself.sh deleted file mode 100755 index 5e8ddbd..0000000 --- a/MakeTools/makeself.sh +++ /dev/null @@ -1,362 +0,0 @@ -# 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] -#!/bin/sh -# -# Makeself version 2.1.x -# by Stephane Peter <[email protected]> -# -# $Id: makeself.sh,v 1.4 2015/01/30 17:04:00 mwheinz Exp $ -# -# Utility to create self-extracting tar.gz archives. -# The resulting archive is a file holding the tar.gz archive with -# a small Shell script stub that uncompresses the archive to a temporary -# directory and then executes a given script from withing that directory. -# -# Makeself home page: http://www.megastep.org/makeself/ -# -# Version 2.0 is a rewrite of version 1.0 to make the code easier to read and maintain. -# -# Version history : -# - 1.0 : Initial public release -# - 1.1 : The archive can be passed parameters that will be passed on to -# the embedded script, thanks to John C. Quillan -# - 1.2 : Package distribution, bzip2 compression, more command line options, -# support for non-temporary archives. Ideas thanks to Francois Petitjean -# - 1.3 : More patches from Bjarni R. Einarsson and Francois Petitjean: -# Support for no compression (--nocomp), script is no longer mandatory, -# automatic launch in an xterm, optional verbose output, and -target -# archive option to indicate where to extract the files. -# - 1.4 : Improved UNIX compatibility (Francois Petitjean) -# Automatic integrity checking, support of LSM files (Francois Petitjean) -# - 1.5 : Many bugfixes. Optionally disable xterm spawning. -# - 1.5.1 : More bugfixes, added archive options -list and -check. -# - 1.5.2 : Cosmetic changes to inform the user of what's going on with big -# archives (Quake III demo) -# - 1.5.3 : Check for validity of the DISPLAY variable before launching an xterm. -# More verbosity in xterms and check for embedded command's return value. -# Bugfix for Debian 2.0 systems that have a different "print" command. -# - 1.5.4 : Many bugfixes. Print out a message if the extraction failed. -# - 1.5.5 : More bugfixes. Added support for SETUP_NOCHECK environment variable to -# bypass checksum verification of archives. -# - 1.6.0 : Compute MD5 checksums with the md5sum command (patch from Ryan Gordon) -# - 2.0 : Brand new rewrite, cleaner architecture, separated header and UNIX ports. -# - 2.0.1 : Added --copy -# - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates. -# Added --nochown for archives -# Stopped doing redundant checksums when not necesary -# - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command -# Cleaned up the code to handle error codes from compress. Simplified the extraction code. -# - 2.1.2 : Some bug fixes. Use head -n to avoid problems. -# -# (C) 1998-2003 by St?phane Peter <[email protected]> -# -# This software is released under the terms of the GNU GPL -# Please read the license at http://www.gnu.org/copyleft/gpl.html -# - -MS_VERSION=2.1.2 - -# Procedures - -MS_Usage() -{ - echo "Usage: $0 [params] archive_dir file_name label [startup_script] [args]" - echo "params can be one or more of the following :" - echo " --version | -v : Print out Makeself version number and exit" - echo " --help | -h : Print out this help message" - echo " --gzip : Compress using gzip (default if detected)" - echo " --bzip2 : Compress using bzip2 instead of gzip" - echo " --compress : Compress using the UNIX 'compress' command" - echo " --nocomp : Do not compress the data" - echo " --notemp : The archive will create archive_dir in the" - echo " current directory and uncompress in ./archive_dir" - echo " --copy : Upon extraction, the archive will first copy itself to" - echo " a temporary directory" - echo " --append : Append more files to an existing Makeself archive" - echo " The label and startup scripts will then be ignored" - echo " --current : Files will be extracted to the current directory." - echo " Implies --notemp." - echo " --header file : Specify location of the header script" - echo " --follow : Follow the symlinks in the archive" - echo " --nox11 : Disable automatic spawn of a xterm" - echo " --nowait : Do not wait for user input after executing embedded" - echo " program from an xterm" - echo " --lsm file : LSM file describing the package" - echo - echo "Do not forget to give a fully qualified startup script name" - echo "(i.e. with a ./ prefix if inside the archive)." - exit 1 -} - -# Default settings -if type gzip 2>&1 > /dev/null; then - COMPRESS=gzip -else - COMPRESS=Unix -fi -KEEP=n -CURRENT=n -NOX11=n -APPEND=n -COPY=none -TAR_ARGS=cvf -HEADER=`dirname $0`/makeself-header.sh - -# LSM file stuff -LSM_CMD="echo No LSM. >> \"\$archname\"" - -while true -do - case "$1" in - --version | -v) - echo Makeself version $MS_VERSION - exit 0 - ;; - --bzip2) - COMPRESS=bzip2 - shift - ;; - --gzip) - COMPRESS=gzip - shift - ;; - --compress) - COMPRESS=Unix - shift - ;; - --nocomp) - COMPRESS=none - shift - ;; - --notemp) - KEEP=y - shift - ;; - --copy) - COPY=copy - shift - ;; - --current) - CURRENT=y - KEEP=y - shift - ;; - --header) - HEADER="$2" - shift 2 - ;; - --follow) - TAR_ARGS=cvfh - shift - ;; - --nox11) - NOX11=y - shift - ;; - --nowait) - shift - ;; - --append) - APPEND=y - shift - ;; - --lsm) - LSM_CMD="cat \"$2\" >> \"\$archname\"" - shift 2 - ;; - -h | --help) - MS_Usage - ;; - -*) - echo Unrecognized flag : "$1" - MS_Usage - ;; - *) - break - ;; - esac -done - -archdir="$1" -archname="$2" - -if test "$APPEND" = y; then - if test $# -lt 2; then - MS_Usage - fi - - # Gather the info from the original archive - OLDENV=`sh "$archname" --dumpconf` - if test $? -ne 0; then - echo "Unable to update archive: $archname" >&2 - exit 1 - else - eval "$OLDENV" - fi -else - if test "$KEEP" = n -a $# = 3; then - echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2 - echo - MS_Usage - fi - # We don't really want to create an absolute directory... - if test "$CURRENT" = y; then - archdirname="." - else - archdirname=`basename "$1"` - fi - - if test $# -lt 3; then - MS_Usage - fi - - LABEL="$3" - SCRIPT="$4" - test x$SCRIPT = x || shift 1 - shift 3 - SCRIPTARGS="$*" -fi - -if test "$KEEP" = n -a "$CURRENT" = y; then - echo "ERROR: It is A VERY DANGEROUS IDEA to try to combine --notemp and --current." >&2 - exit 1 -fi - -case $COMPRESS in -gzip) - GZIP_CMD="gzip -c9" - GUNZIP_CMD="gzip -cd" - ;; -bzip2) - GZIP_CMD="bzip2 -9" - GUNZIP_CMD="bzip2 -d" - ;; -Unix) - GZIP_CMD="compress -cf" - GUNZIP_CMD="uncompress -c 2>/dev/null || test \\\$? -eq 2 || gzip -cd" - ;; -none) - GZIP_CMD="cat" - GUNZIP_CMD="cat" - ;; -esac - -tmpfile="${TMPDIR:=/tmp}/mkself$$" - -if test -f $HEADER; then - oldarchname="$archname" - archname="$tmpfile" - # Generate a fake header to count its lines - SKIP=0 - . $HEADER - SKIP=`cat "$tmpfile" |wc -l` - # Get rid of any spaces - SKIP=`expr $SKIP` - rm -f "$tmpfile" - echo Header is $SKIP lines long >&2 - - archname="$oldarchname" -else - echo "Unable to open header file: $HEADER" >&2 - exit 1 -fi - -echo - -if test "$APPEND" = n; then - if test -f "$archname"; then - echo "WARNING: Overwriting existing file: $archname" >&2 - fi -fi - -USIZE=`du -ks $archdir | cut -f1` -DATE=`LC_ALL=C date` - -echo About to compress $USIZE KB of data... -echo Adding files to archive named \"$archname\"... -(cd "$archdir"; tar $TAR_ARGS - * | eval "$GZIP_CMD" ) >> "$tmpfile" || { echo Aborting; rm -f "$tmpfile"; exit 1; } -echo >> "$tmpfile" >&- # try to close the archive - -fsize=`cat "$tmpfile" | wc -c | tr -d " "` - -# Compute the checksums - -md5sum=00000000000000000000000000000000 -crcsum=`cat "$tmpfile" | cksum | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1` -echo "CRC: $crcsum" - -# Try to locate a MD5 binary -OLD_PATH=$PATH -PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} -MD5_PATH=`type -p md5sum` -MD5_PATH=${MD5_PATH:-`type -p md5`} -PATH=$OLD_PATH - -if test -x "$MD5_PATH"; then - md5sum=`cat "$tmpfile" | "$MD5_PATH" | cut -b-32`; - echo "MD5: $md5sum" -else - echo "MD5: none, md5sum binary not found" -fi - -if test "$APPEND" = y; then - mv "$archname" "$archname".bak || exit - - # Prepare entry for new archive - filesizes="$filesizes $fsize" - CRCsum="$CRCsum $crcsum" - MD5sum="$MD5sum $md5sum" - USIZE=`expr $USIZE + $OLDUSIZE` - # Generate the header - . $HEADER - # Append the original data - tail -n +$OLDSKIP "$archname".bak >> "$archname" - # Append the new data - cat "$tmpfile" >> "$archname" - - chmod +x "$archname" - rm -f "$archname".bak - echo Self-extractible archive \"$archname\" successfully updated. -else - filesizes="$fsize" - CRCsum="$crcsum" - MD5sum="$md5sum" - - # Generate the header - . $HEADER - - # Append the compressed tar data after the stub - echo - cat "$tmpfile" >> "$archname" - chmod +x "$archname" - echo Self-extractible archive \"$archname\" successfully created. -fi -rm -f "$tmpfile" diff --git a/MakeTools/regdll.bat b/MakeTools/regdll.bat deleted file mode 100755 index 7889233..0000000 --- a/MakeTools/regdll.bat +++ /dev/null @@ -1,47 +0,0 @@ -REM BEGIN_ICS_COPYRIGHTm **************************************** -REM -REM Copyright (c) 2015, Intel Corporation -REM -REM Redistribution and use in source and binary forms, with or without -REM modification, are permitted provided that the following conditions are met: -REM -REM * Redistributions of source code must retain the above copyright notice, -REM this list of conditions and the following disclaimer. -REM * Redistributions in binary form must reproduce the above copyright -REM notice, this list of conditions and the following disclaimer in the -REM documentation and/or other materials provided with the distribution. -REM * Neither the name of Intel Corporation nor the names of its contributors -REM may be used to endorse or promote products derived from this software -REM without specific prior written permission. -REM -REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -REM DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -REM SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -REM OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -REM -REM END_ICS_COPYRIGHTm **************************************** - -REM [ICS VERSION STRING: unknown] -@echo off -setlocal -SET REGSWITCHES=%1 -SET DLLDIR=%2 - -:loop - shift - if %1xx == xx goto done - if not exist %DLLDIR%\%1 goto loop - echo on - regsvr32 %REGSWITCHES% %DLLDIR%\%1 - @echo off - goto loop - -:done - -endlocal diff --git a/MakeTools/regexe.bat b/MakeTools/regexe.bat deleted file mode 100755 index 62083e7..0000000 --- a/MakeTools/regexe.bat +++ /dev/null @@ -1,48 +0,0 @@ -REM BEGIN_ICS_COPYRIGHTm **************************************** -REM -REM Copyright (c) 2015, Intel Corporation -REM -REM Redistribution and use in source and binary forms, with or without -REM modification, are permitted provided that the following conditions are met: -REM -REM * Redistributions of source code must retain the above copyright notice, -REM this list of conditions and the following disclaimer. -REM * Redistributions in binary form must reproduce the above copyright -REM notice, this list of conditions and the following disclaimer in the -REM documentation and/or other materials provided with the distribution. -REM * Neither the name of Intel Corporation nor the names of its contributors -REM may be used to endorse or promote products derived from this software -REM without specific prior written permission. -REM -REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -REM DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -REM SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -REM OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -REM -REM END_ICS_COPYRIGHTm **************************************** - -REM [ICS VERSION STRING: unknown] -@echo off -setlocal -SET REGSWITCH=%1 -SET EXEDIR=%2 -shift - -:loop - shift - if %1xx == xx goto done - if not exist %EXEDIR%\%1 goto loop - echo on - %EXEDIR%\%1 %REGSWITCH% - @echo off - goto loop - -:done - -endlocal diff --git a/MakeTools/zisofs-tools/CHANGES b/MakeTools/zisofs-tools/CHANGES deleted file mode 100644 index 4858564..0000000 --- a/MakeTools/zisofs-tools/CHANGES +++ /dev/null @@ -1,49 +0,0 @@ -Changes in zisofs-tools-1.0.4: - - Update the documentation. - -Changes in zisofs-tools-1.0.3: - - Update cdrtools patch. - -Changes in zisofs-tools-1.0.2: - - Add "make install" target :) - -Changes in zisofs-tools-1.0.1: - - By default, abort if file modes, times and ownership cannot be - set. Since this isn't always possible, add new option - -s/--sloppy to suppress this error. - - Fix man page typo, and add a BUGS section. - - Remove problems with extremely long symlinks. - - Move all command line options into common "opt" structure. - - Fix bug in command line parsing: -z option not recognized. - - -Changes in zisofs-tools-1.0: - - Restructured code; now split into a number of modules. - - Use autoconf for configuration. - - Add support for long options if the platform has - getopt_long(). - - Support compiling on systems without lchown(). - - Support the following new options: - -x Don't descend into other filesystems - -X Same as -x, but don't create mount point directories - -l Don't descend into any subdirectories - -L Same as -l, but don't create stub directories - -F Allow compression or decompression of single files. - -V Explicitly set the verbosity. - -w Display program version. - - Update the mkisofs patch to warn if -z is specified without - -r/-R. diff --git a/MakeTools/zisofs-tools/COPYING b/MakeTools/zisofs-tools/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/MakeTools/zisofs-tools/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/MakeTools/zisofs-tools/INSTALL b/MakeTools/zisofs-tools/INSTALL deleted file mode 100644 index b42a17a..0000000 --- a/MakeTools/zisofs-tools/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/MakeTools/zisofs-tools/MCONFIG.in b/MakeTools/zisofs-tools/MCONFIG.in deleted file mode 100644 index 1c0ba11..0000000 --- a/MakeTools/zisofs-tools/MCONFIG.in +++ /dev/null @@ -1,38 +0,0 @@ -# Prefixes -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# Directory for user binaries -bindir = @bindir@ - -# Man page tree -mandir = @mandir@ - -# System binaries -sbindir = @sbindir@ - -# Install into chroot area -# Useful when making rpms and similar -INSTALLROOT = - -# Install program -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -# Compiler and compiler flags -CC = @CC@ -CFLAGS = @CFLAGS@ - -# Link flags -LDFLAGS = @LDFLAGS@ - -# Libraries -LIBS = @LIBS@ - -# Additional library we need to build -LIBOBJS = @LIBOBJS@ - -# ar and ranlib (for making libraries) -AR = ar cq -RANLIB = @RANLIB@ diff --git a/MakeTools/zisofs-tools/MRULES b/MakeTools/zisofs-tools/MRULES deleted file mode 100644 index decd202..0000000 --- a/MakeTools/zisofs-tools/MRULES +++ /dev/null @@ -1,22 +0,0 @@ -# Standard compilation rules (don't use make builtins) - -.SUFFIXES: .c .cc .o .s .S .i - -.c.o: - $(CC) $(CFLAGS) -c $< - -.c.s: - $(CC) $(CFLAGS) -S -o $@ $< - -.c.i: - $(CC) $(CFLAGS) -E -o $@ $< - -.cc.o: - $(CXX) $(CXXFLAGS) -c $< - -.cc.s: - $(CXX) $(CXXFLAGS) -S -o $@ $< - -.cc.i: - $(CXX) $(CXXFLAGS) -E -o $@ $< - diff --git a/MakeTools/zisofs-tools/Makefile b/MakeTools/zisofs-tools/Makefile deleted file mode 100644 index b6b8237..0000000 --- a/MakeTools/zisofs-tools/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -## ----------------------------------------------------------------------- -## -## Copyright 2001 H. Peter Anvin - All Rights Reserved -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, -## USA; either version 2 of the License, or (at your option) any later -## version; incorporated herein by reference. -## -## ----------------------------------------------------------------------- - -## -## Makefile for mkzftree -## -## mkzftree mirrors a tree in a form suitable for "mkisofs -z". -## - --include MCONFIG -include MRULES - -PROGS = mkzftree -MAN1PAGES = mkzftree.1 - -OBJS = mkzftree.o walk.o workers.o util.o hash.o iso9660.o \ - compress.o uncompress.o - -all: $(PROGS) -includes INCLUDES libs libsonly LIBS STAGE: -ALL cmds cmdsonly CMDS stage: all -clobber: spotless - -clean: - rm -f *.o *.i *.s version.h $(PROGS) - -distclean: clean - rm -f MCONFIG config.status config.cache config.log config.h *~ \#* - rm -f core *.orig *.rej - -mkzftree: $(OBJS) - $(CC) $(LDFLAGS) -o mkzftree $(OBJS) $(LIBS) - -spotless: distclean - rm -f configure - rm -rf autom4te.cache - -install: all - mkdir -p $(INSTALLROOT)$(bindir) - $(INSTALL_PROGRAM) $(PROGS) $(INSTALLROOT)$(bindir) - mkdir -p $(INSTALLROOT)$(mandir)/man1 - $(INSTALL_DATA) $(MAN1PAGES) $(INSTALLROOT)$(mandir)/man1 - -config: MCONFIG - -MCONFIG: configure MCONFIG.in config.h.in - ./configure - -config.h: MCONFIG - : Generated by side effect - -configure: configure.in aclocal.m4 - autoconf - rm -f MCONFIG config.cache config.log config.status config.h - -# -# Version header -# -VERSION = $(shell cat version) - -version.h: version - echo "#define ZISOFS_TOOLS_VERSION \"$(VERSION)\"" > version.h - -# -# Dependencies -# -mkzftree.o: mkzftree.c mkzftree.h config.h version.h -workers.o: workers.c mkzftree.h config.h -compress.o: compress.c mkzftree.h config.h iso9660.h -hash.o: hash.c mkzftree.h config.h -iso9660.o: iso9660.c iso9660.h -uncompress.o: uncompress.c mkzftree.h config.h iso9660.h -util.o: util.c mkzftree.h config.h -walk.o: walk.c mkzftree.h config.h -workers.o: workers.c mkzftree.h config.h diff --git a/MakeTools/zisofs-tools/README b/MakeTools/zisofs-tools/README deleted file mode 100644 index 27444b0..0000000 --- a/MakeTools/zisofs-tools/README +++ /dev/null @@ -1,48 +0,0 @@ - H. Peter Anvin <[email protected]> - October 18, 2002 - - -User tools for zisofs: - -The user tools for zisofs come in two parts: a utility "mkzftree" and -a modification to mkisofs, which is part of the cdrtools package. The -mkisofs change has been integrated in the cdrtools distribution as of -cdrtools-1.11a20; a patch for cdrtools-1.11a09 which is also tested -and working on cdrtools-1.10 is included with this package if you -insist on running an older version. - - -First create a directory tree containing compressed files: - - mkzftree input_dir compressed_dir - -mkzftree will not overwrite an existing directory; you may want to "rm --rf" the directory tree if you are doing this from a script: - -Second, invoke the patched mkisofs with the -z option: - - mkisofs -z -R [other options] -o compressed.iso compressed_dir - -IMPORTANT: you *must* enable RockRidge (-R or -r) since this is an -extensions to the RockRidge specification. Without RockRidge, -z will -have no effect. - -Note that if there are files you do not want compressed (for example, -files involved in booting, or README files you want to be readable -under all circumstances) you can simply put them in a separate tree -and not run mkzftree on that tree. - -mkzftree will not compress files that end up larger when compressed; -if you want it to compress the files anyway, you can give the -f -option to mkzftree. - -mkzftree also accepts a -u option (uncompress), which can be used to -convert a compressed tree back to normal form. This can be used to -read a zisofs CD-ROM on a machine without zisofs kernel support. - -This version of mkzftree supports a -p option (parallelize.) -Specifying -p and a parallelism (e.g. -p4) allows files (up to the -number specified) to compress in parallel. Depending on your setup -and your data set size, this might speed things up if you are not -completely I/O bound. Use -p0 to completely disable parallel -execution; this is the default. diff --git a/MakeTools/zisofs-tools/aclocal.m4 b/MakeTools/zisofs-tools/aclocal.m4 deleted file mode 100644 index 6e0dbc7..0000000 --- a/MakeTools/zisofs-tools/aclocal.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl -------------------------------------------------------------------------- -dnl PA_ADD_CFLAGS() -dnl -dnl Attempt to add the given option to CFLAGS, if it doesn't break compilation -dnl -------------------------------------------------------------------------- -AC_DEFUN(PA_ADD_CFLAGS, -[AC_MSG_CHECKING([if $CC accepts $1]) - pa_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$CFLAGS $1" - AC_TRY_COMPILE([#include <stdio.h>], - [printf("Hello, World!\n");], - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) - CFLAGS="$pa_add_cflags__old_cflags")]) - -dnl ------------------------------------------------------------------------ -dnl PA_WITH_BOOL -dnl -dnl PA_WITH_BOOL(option, default, help, enable, disable) -dnl -dnl Provides a more convenient way to specify --with-option and -dnl --without-option, with a default. default should be either 0 or 1. -dnl ------------------------------------------------------------------------ -AC_DEFUN(PA_WITH_BOOL, -[AC_ARG_WITH([$1], [$3], -if test ["$withval"] != no; then -[$4] -else -[$5] -fi, -if test [$2] -ne 0; then -[$4] -else -[$5] -fi)]) diff --git a/MakeTools/zisofs-tools/cdrtools-1.11a09-zisofs.diff b/MakeTools/zisofs-tools/cdrtools-1.11a09-zisofs.diff deleted file mode 100644 index 946d7ae..0000000 --- a/MakeTools/zisofs-tools/cdrtools-1.11a09-zisofs.diff +++ /dev/null @@ -1,409 +0,0 @@ -diff -urN cdrtools-1.11a09/mkisofs/README.compression cdrtools-1.11a09-zisofs/mkisofs/README.compression ---- cdrtools-1.11a09/mkisofs/README.compression Wed Dec 31 16:00:00 1969 -+++ cdrtools-1.11a09-zisofs/mkisofs/README.compression Thu Nov 8 12:01:31 2001 -@@ -0,0 +1,17 @@ -+Transparent decompression (-z option) is available on Linux kernels -+using kernel version 2.4.14 or 2.4.9-ac14 or later. -+ -+You also need the zisofs-tools package, containing the mkzftree -+utility, to create the compressed files; this package is available at: -+ -+ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/ -+ -+The mkzftree utility can also be used to read compressed CD-ROMs on -+systems which do not support transparent decompression. -+ -+The use of a separate utility allows compression to be controlled on a -+per-file basis. A file which is not compressed can be read on any -+system. -+ -+Transparent decompression is implemented as an extension to Rock -+Ridge, so Rock Ridge needs to be enabled (-R or -r options.) -diff -urN cdrtools-1.11a09/mkisofs/mkisofs.8 cdrtools-1.11a09-zisofs/mkisofs/mkisofs.8 ---- cdrtools-1.11a09/mkisofs/mkisofs.8 Mon Jul 9 05:09:08 2001 -+++ cdrtools-1.11a09-zisofs/mkisofs/mkisofs.8 Thu Nov 8 12:11:13 2001 -@@ -206,7 +206,7 @@ - .B \-pad - ] - [ --.B \-no\-pad -+.B \-no-pad - ] - [ - .B \-path-list -@@ -383,40 +383,40 @@ - .I folder_name - ] - [ --.B \--cap -+.B \-\-cap - ] - [ --.B \--netatalk -+.B \-\-netatalk - ] - [ --.B \--double -+.B \-\-double - ] - [ --.B \--ethershare -+.B \-\-ethershare - ] - [ --.B \--ushare -+.B \-\-ushare - ] - [ --.B \--exchange -+.B \-\-exchange - ] - [ --.B \--sgi -+.B \-\-sgi - ] - [ --.B \--xinet -+.B \-\-xinet - ] - [ --.B \--macbin -+.B \-\-macbin - ] - [ --.B \--single -+.B \-\-single - ] - [ --.B \--dave -+.B \-\-dave - ] - [ --.B \--sfm -+.B \-\-sfm - ] - .\" end mkhybrid options - .B \-o -@@ -1398,15 +1398,25 @@ - - mkisofs \-o cd \-x /local/dir1 \-x /local/dir2 /local - .sp --NOTE: The \-m and \-x option description should both be updated, they are wrong. -+NOTE: The -+.B \-m -+and -+.B \-x -+option description should both be updated, they are wrong. - Both now work identical and use filename globbing. A file is excluded if either - the last component matches or the whole path matches. - .TP - .B \-z --Generate special SUSP records for transparently compressed files. This is --only of use and interest for hosts that support transparent decompression. --This is an experimental feature, and no hosts yet support this, but there --are ALPHA patches for Linux that can make use of this feature. -+Generate special RRIP records for transparently compressed files. -+This is only of use and interest for hosts that support transparent -+decompression, such as Linux 2.4.14 or later. You must specify the -+.B \-R -+or -+.B \-r -+options to enable RockRidge, and generate compressed files using the -+.B mkzftree -+utility before running -+.BR mkisofs . - - .SH "HFS OPTIONS - .TP -@@ -1505,7 +1515,7 @@ - .BI \-cluster-size " size - Set the size in bytes of the cluster or allocation units of PC Exchange - files. Implies the --.B \--exchange -+.B \-\-exchange - option. See the - .B HFS MACINTOSH FILE FORMATS - section below. -@@ -1612,44 +1622,44 @@ - called System Folder, then the whole path name is "./cddata/System Folder" - (remember to use quotes if the name contains spaces). - .TP --.B \--cap -+.B \-\-cap - Look for AUFS CAP Macintosh files. Search for CAP Apple/Unix file formats - only. Searching for the other possible Apple/Unix file formats is disabled, - unless other - .I double dash - options are given. - .TP --.B \--netatalk -+.B \-\-netatalk - Look for NETATALK Macintosh files - .TP --.B \--double -+.B \-\-double - Look for AppleDouble Macintosh files - .TP --.B \--ethershare -+.B \-\-ethershare - Look for Helios EtherShare Macintosh files - .TP --.B \--ushare -+.B \-\-ushare - Look for IPT UShare Macintosh files - .TP --.B \--exchange -+.B \-\-exchange - Look for PC Exchange Macintosh files - .TP --.B \--sgi -+.B \-\-sgi - Look for SGI Macintosh files - .TP --.B \--xinet -+.B \-\-xinet - Look for XINET Macintosh files - .TP --.B \--macbin -+.B \-\-macbin - Look for MacBinary Macintosh files - .TP --.B \--single -+.B \-\-single - Look for AppleSingle Macintosh files - .TP --.B \--dave -+.B \-\-dave - Look for Thursby Software Systems DAVE Macintosh files - .TP --.B \--sfm -+.B \-\-sfm - Look for Microsoft's Services for Macintosh files (NT only) (Alpha) - - .SH "CHARACTER SETS -@@ -2285,7 +2295,7 @@ - The floppy will be mounted as a CAP file system by default. Then run mkisofs - using something like: - -- mkisofs \--cap \-o output source_dir /mnt/floppy -+ mkisofs \-\-cap \-o output source_dir /mnt/floppy - - If you are not using Linux, then you can use the hfsutils to copy the icon - file from the floppy. However, care has to be taken, as the icon file -@@ -2301,7 +2311,7 @@ - .B mkisofs - by using something like: - -- mkisofs \--macbin \-o output source_dir icon_dir -+ mkisofs \-\-macbin \-o output source_dir icon_dir - .PP - The procedure for creating/using custom folder icons is very similar - paste - an icon to folder's "Get Info" box and transfer the resulting 'Icon\\r' -@@ -2520,7 +2530,7 @@ - that contains - Netatalk Apple/Unix files: - .PP --% mkisofs \-o cd.iso \--netatalk cd_dir -+% mkisofs \-o cd.iso \-\-netatalk cd_dir - .PP - To create a HFS hybrid CD from the source directory - .IR cd_dir , -@@ -2754,9 +2764,10 @@ - options. - - .SH "SEE ALSO --.BR cdrecord(1) -+.BR cdrecord (1), -+.BR mkzftree (1), - .BR magic (5), --.BR apple_driver (8) -+.BR apple_driver (8). - - .SH "FUTURE IMPROVEMENTS - Some sort of gui interface. -@@ -2764,8 +2775,13 @@ - .B m\&kisofs - is available as part of the cdrecord package from - ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ -+ - .B hfsutils - from ftp://ftp.mars.org/pub/hfs -+ -+.B mkzftree -+is available as part of the zisofs-tools package -+from ftp://ftp.kernel.org/pub/linux/utils/fs/zisofs/ - .SH "MAILING LISTS - If you want to actively take part on the development of m\&kisofs, - and/or mkhybrid, -diff -urN cdrtools-1.11a09/mkisofs/mkisofs.c cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c ---- cdrtools-1.11a09/mkisofs/mkisofs.c Sat Oct 20 15:00:34 2001 -+++ cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c Thu Nov 8 11:57:58 2001 -@@ -561,10 +561,8 @@ - '\0', "#", "Set numbers of load sectors", ONE_DASH}, - {{"boot-info-table", no_argument, NULL, OPTION_BOOT_INFO_TABLE}, - '\0', NULL, "Patch boot image with info table", ONE_DASH}, --#ifdef ERIC_neverdef - {{"transparent-compression", no_argument, NULL, 'z'}, - 'z', NULL, "Enable transparent compression of files", ONE_DASH}, --#endif - #ifdef APPLE_HYB - {{"hfs-type", required_argument, NULL, OPTION_HFS_TYPE}, - '\0', "TYPE", "Set HFS default TYPE", ONE_DASH}, -@@ -1984,7 +1982,11 @@ - error(" but without (standard) Rock Ridge extensions.\n"); - error(" It is highly recommended to add Rock Ridge\n"); - } -- -+ if (transparent_compression && !use_RockRidge) { -+ error("Warning: transparent decompression is a Rock Ridge extension, but\n"); -+ error(" creating filesystem without Rock Ridge attributes; files\n"); -+ error(" will not be transparently decompressed.\n"); -+ } - init_nls(); /* Initialize UNICODE tables */ - - /* initialize code tables from a file - if they exists */ -diff -urN cdrtools-1.11a09/mkisofs/mkisofs.c.orig cdrtools-1.11a09-zisofs/mkisofs/mkisofs.c.orig -diff -urN cdrtools-1.11a09/mkisofs/rock.c cdrtools-1.11a09-zisofs/mkisofs/rock.c ---- cdrtools-1.11a09/mkisofs/rock.c Tue Jan 23 04:28:34 2001 -+++ cdrtools-1.11a09-zisofs/mkisofs/rock.c Thu Nov 8 11:57:58 2001 -@@ -45,7 +45,7 @@ - #define PX_SIZE 36 - #define RE_SIZE 4 - #define SL_SIZE 20 --#define ZZ_SIZE 15 -+#define ZF_SIZE 16 - #ifdef APPLE_HYB - #define AA_SIZE 14 /* size of Apple extension */ - #endif /* APPLE_HYB */ -@@ -577,17 +577,24 @@ - #ifndef VMS - /* - * If transparent compression was requested, fill in the correct field -- * for this file -+ * for this file, if (and only if) it is actually a compressed file! -+ * This relies only on magic number, but it should in general not -+ * be an issue since if you're using -z odds are most of your -+ * files are already compressed. -+ * -+ * In the future it would be nice if mkisofs actually did the -+ * compression. - */ -- if (transparent_compression && -- S_ISREG(lstatbuf->st_mode) && -- strlen(name) > 3 && -- strcmp(name + strlen(name) - 3, ".gZ") == 0) { -- FILE *zipfile; -+ if (transparent_compression && S_ISREG(lstatbuf->st_mode)) { -+ static const unsigned char zisofs_magic[8] = -+ { 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07 }; -+ FILE *zffile; - char *checkname; - unsigned int file_size; -- unsigned char header[8]; -+ unsigned char header[16]; - int OK_flag; -+ int blocksize; -+ int headersize; - - /* - * First open file and verify that the correct algorithm was -@@ -596,73 +603,43 @@ - file_size = 0; - OK_flag = 1; - -- zipfile = fopen(whole_name, "rb"); -- fread(header, 1, sizeof(header), zipfile); -+ memset(header, 0, sizeof(header)); - -- /* Check some magic numbers from gzip. */ -- if (header[0] != 0x1f || header[1] != 0x8b || header[2] != 8) -- OK_flag = 0; -- /* Make sure file was blocksized. */ -- if (((header[3] & 0x40) == 0)) -- OK_flag = 0; -- /* OK, now go to the end of the file and get some more info */ -- if (OK_flag) { -- int status; -- -- status = (long) lseek(fileno(zipfile), (off_t)(-8), -- SEEK_END); -- if (status == -1) -+ zffile = fopen(whole_name, "rb"); -+ if ( zffile ) { -+ if ( fread(header, 1, sizeof(header), zffile) != sizeof(header) ) - OK_flag = 0; -- } -- if (OK_flag) { -- if (read(fileno(zipfile), (char *) header, -- sizeof(header)) != sizeof(header)) { -+ -+ /* Check magic number */ -+ if ( memcmp(header, zisofs_magic, sizeof zisofs_magic) ) - OK_flag = 0; -- } else { -- int blocksize; - -- blocksize = (header[3] << 8) | header[2]; -- file_size = ((unsigned int) header[7] << 24) | -- ((unsigned int) header[6] << 16) | -- ((unsigned int) header[5] << 8) | -- header[4]; --#if 0 -- fprintf(stderr, "Blocksize = %d %d\n", -- blocksize, file_size); --#endif -- if (blocksize != SECTOR_SIZE) -- OK_flag = 0; -- } -- } -- fclose(zipfile); -- -- checkname = strdup(whole_name); -- checkname[strlen(whole_name) - 3] = 0; -- zipfile = fopen(checkname, "rb"); -- if (zipfile) { -+ /* Get the real size of the file */ -+ file_size = get_731(header+8); -+ -+ /* Get the header size (>> 2) */ -+ headersize = header[12]; -+ -+ /* Get the block size (log2) */ -+ blocksize = header[13]; -+ -+ fclose(zffile); -+ } else { - OK_flag = 0; --#ifdef USE_LIBSCHILY -- errmsg( -- "Unable to insert transparent compressed file - name conflict\n"); --#else -- fprintf(stderr, -- "Unable to insert transparent compressed file - name conflict\n"); --#endif -- fclose(zipfile); - } -- free(checkname); -- -+ - if (OK_flag) { -- if (MAYBE_ADD_CE_ENTRY(ZZ_SIZE)) -+ if (MAYBE_ADD_CE_ENTRY(ZF_SIZE)) - add_CE_entry(); - Rock[ipnt++] = 'Z'; -- Rock[ipnt++] = 'Z'; -- Rock[ipnt++] = ZZ_SIZE; -+ Rock[ipnt++] = 'F'; -+ Rock[ipnt++] = ZF_SIZE; - Rock[ipnt++] = SU_VERSION; -- Rock[ipnt++] = 'g'; /* Identify compression -- technique used */ -+ Rock[ipnt++] = 'p'; /* Algorithm: "paged zlib" */ - Rock[ipnt++] = 'z'; -- Rock[ipnt++] = 3; -+ /* 2 bytes for algorithm-specific information */ -+ Rock[ipnt++] = headersize; -+ Rock[ipnt++] = blocksize; - set_733((char *) Rock + ipnt, file_size); /* Real file size */ - ipnt += 8; - }; diff --git a/MakeTools/zisofs-tools/compress.c b/MakeTools/zisofs-tools/compress.c deleted file mode 100644 index 1377ddb..0000000 --- a/MakeTools/zisofs-tools/compress.c +++ /dev/null @@ -1,142 +0,0 @@ -/* $Id: compress.c,v 1.4 2013/10/01 01:45:31 sbreyer Exp $ */ -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -#include <stdlib.h> -#include <stdio.h> -#include <utime.h> -#include <unistd.h> -#include <string.h> -#include <zlib.h> -#include "mkzftree.h" -#include "iso9660.h" - - -int block_compress_file(FILE *input, FILE *output, off_t size) -{ - struct compressed_file_header hdr; - char inbuf[CBLOCK_SIZE], outbuf[2*CBLOCK_SIZE]; - size_t bytes, pointer_bytes, nblocks, block; - uLong cbytes; /* uLong is a zlib datatype */ - char *pointer_block, *curptr; - off_t position; - int i; - int force_compress = opt.force; - int zerr; - int err = EX_SOFTWARE; - - if ( (sizeof hdr) & 3 ) { - fputs("INTERNAL ERROR: header is not a multiple of 4\n", stderr); - abort(); - } - - memset(&hdr, 0, sizeof hdr); - memcpy(&hdr.magic, zisofs_magic, sizeof zisofs_magic); - hdr.header_size = (sizeof hdr) >> 2; - hdr.block_size = CBLOCK_SIZE_LG2; - set_731(&hdr.uncompressed_len, size); - - if ( fwrite(&hdr, sizeof hdr, 1, output) != 1 ) - return EX_CANTCREAT; - - nblocks = (size+CBLOCK_SIZE-1) >> CBLOCK_SIZE_LG2; - pointer_bytes = 4*(nblocks+1); - pointer_block = xmalloc(pointer_bytes); - memset(pointer_block, 0, pointer_bytes); - - if ( fseek(output, pointer_bytes, SEEK_CUR) == -1 ) { - err = EX_CANTCREAT; - goto free_ptr_bail; - } - - curptr = pointer_block; - position = sizeof hdr + pointer_bytes; - - block = 0; - while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) { - if ( bytes < CBLOCK_SIZE && block < nblocks-1 ) { - err = EX_IOERR; - goto free_ptr_bail; - } - - /* HACK: If the file has our magic number, always compress */ - if ( block == 0 && bytes >= sizeof zisofs_magic ) { - if ( !memcmp(inbuf, zisofs_magic, sizeof zisofs_magic) ) - force_compress = 1; - } - - set_731(curptr, position); curptr += 4; - - /* We have two special cases: a zero-length block is defined as all zero, - and a block the length of which is equal to the block size is unencoded. */ - - for ( i = 0 ; i < (int)CBLOCK_SIZE ; i++ ) { - if ( inbuf[i] ) break; - } - - if ( i == CBLOCK_SIZE ) { - /* All-zero block. No output */ - } else { - cbytes = 2*CBLOCK_SIZE; - if ( (zerr = compress2((unsigned char*)outbuf, &cbytes, (unsigned char*)inbuf, bytes, opt.level)) - != Z_OK ) { - err = (zerr == Z_MEM_ERROR) ? EX_OSERR : EX_SOFTWARE; - goto free_ptr_bail; /* Compression failure */ - } - if ( fwrite(outbuf, 1, cbytes, output) != cbytes ) { - err = EX_CANTCREAT; - goto free_ptr_bail; - } - position += cbytes; - } - block++; - } - - /* Set pointer to the end of the final block */ - set_731(curptr, position); - - /* Now write the pointer table */ - if ( fseek(output, sizeof hdr, SEEK_SET) == -1 || - fwrite(pointer_block, 1, pointer_bytes, output) != pointer_bytes ) { - err = EX_CANTCREAT; - goto free_ptr_bail; - } - - free(pointer_block); - - /* Now make sure that this was actually the right thing to do */ - if ( !force_compress && position >= size ) { - /* Incompressible file, just copy it */ - rewind(input); - rewind(output); - - position = 0; - while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ) { - if ( fwrite(inbuf, 1, bytes, output) != bytes ) - return EX_CANTCREAT; - position += bytes; - } - - /* Truncate the file to the correct size */ - fflush(output); - ftruncate(fileno(output), position); - } - - /* If we get here, we're done! */ - return 0; - - /* Common bailout code */ - free_ptr_bail: - free(pointer_block); - return err; -} - diff --git a/MakeTools/zisofs-tools/config.h.in b/MakeTools/zisofs-tools/config.h.in deleted file mode 100644 index ad90c4a..0000000 --- a/MakeTools/zisofs-tools/config.h.in +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- c -*- ------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ -/* $Id: config.h.in,v 1.3 2013/10/01 01:45:37 sbreyer Exp $ */ - -/* - * config.h.in - * - * Pattern file for configurations - */ - -#undef HAVE_SYSEXITS_H /* Define if <sysexits.h> exists */ -#undef HAVE_GETOPT_H /* Define if <getopt.h> exists */ -#undef HAVE_GETOPT_LONG /* Define if we have getopt_long() */ -#undef HAVE_LCHOWN /* Define if we have lchown() */ -#undef off_t /* Define to long if off_t missing */ -#undef size_t /* Define to unsigned long if size_t missing */ -#undef ssize_t /* Define to long if ssize_t missing */ - diff --git a/MakeTools/zisofs-tools/configure.in b/MakeTools/zisofs-tools/configure.in deleted file mode 100644 index f44a1fa..0000000 --- a/MakeTools/zisofs-tools/configure.in +++ /dev/null @@ -1,42 +0,0 @@ -dnl -dnl autoconf input file to generate MCONFIG -dnl - -AC_INIT(MCONFIG.in) -AC_PREFIX_DEFAULT(/usr) - -AC_PROG_CC -AC_C_CONST -AC_C_INLINE - -PA_ADD_CFLAGS(-Wall) -PA_ADD_CFLAGS(-W) -PA_ADD_CFLAGS(-Wpointer-arith) -PA_ADD_CFLAGS(-Wbad-function-cast) -PA_ADD_CFLAGS(-Wcast-equal) -PA_ADD_CFLAGS(-Wstrict-prototypes) -PA_ADD_CFLAGS(-Wmissing-prototypes) -PA_ADD_CFLAGS(-Wmissing-declarations) -PA_ADD_CFLAGS(-Wnested-externs) -PA_ADD_CFLAGS(-Winline) -PA_ADD_CFLAGS(-Wshadow) -PA_ADD_CFLAGS(-Wcast-align) -PA_ADD_CFLAGS(-pipe) - -AC_CHECK_HEADERS(sysexits.h) -AC_CHECK_HEADERS(getopt.h) - -AC_CHECK_TYPE(off_t, signed long) -AC_CHECK_TYPE(size_t, unsigned long) -AC_CHECK_TYPE(ssize_t, signed long) - -AC_CHECK_FUNCS(lchown) - -AC_SEARCH_LIBS(compress2, z, , [AC_MSG_ERROR(zlib not found, cannot continue)]) -AC_SEARCH_LIBS(getopt_long, [getopt getopt_long], AC_DEFINE(HAVE_GETOPT_LONG)) - -AC_PROG_RANLIB -AC_PROG_INSTALL - -AC_CONFIG_HEADER(config.h) -AC_OUTPUT(MCONFIG) diff --git a/MakeTools/zisofs-tools/hash.c b/MakeTools/zisofs-tools/hash.c deleted file mode 100644 index 0b74ad2..0000000 --- a/MakeTools/zisofs-tools/hash.c +++ /dev/null @@ -1,69 +0,0 @@ -#ident "$Id: hash.c,v 1.3 2013/10/01 01:45:45 sbreyer Exp $" -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -/* - * hash.c - * - * Hash table used to find hard-linked files - */ - -#include <stdlib.h> -#include <string.h> -#include "mkzftree.h" - -#define HASH_BUCKETS 2683 - -struct file_hash { - struct file_hash *next; - struct stat st; - const char *outfile_name; -}; - -static struct file_hash *hashp[HASH_BUCKETS]; - -const char *hash_find_file(struct stat *st) -{ - int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS; - struct file_hash *hp; - - for ( hp = hashp[bucket] ; hp ; hp = hp->next ) { - if ( hp->st.st_ino == st->st_ino && - hp->st.st_dev == st->st_dev && - hp->st.st_mode == st->st_mode && - hp->st.st_nlink == st->st_nlink && - hp->st.st_uid == st->st_uid && - hp->st.st_gid == st->st_gid && - hp->st.st_size == st->st_size && - hp->st.st_mtime == st->st_mtime ) { - /* Good enough, it's the same file */ - return hp->outfile_name; - } - } - return NULL; /* No match */ -} - -/* Note: the stat structure is the input file; the name - is the output file to link to */ -void hash_insert_file(struct stat *st, const char *outfile) -{ - int bucket = (st->st_ino + st->st_dev) % HASH_BUCKETS; - struct file_hash *hp = xmalloc(sizeof(struct file_hash)); - - hp->next = hashp[bucket]; - memcpy(&hp->st, st, sizeof(struct stat)); - hp->outfile_name = xstrdup(outfile); - - hashp[bucket] = hp; -} - - diff --git a/MakeTools/zisofs-tools/install-sh b/MakeTools/zisofs-tools/install-sh deleted file mode 100755 index 89fc9b0..0000000 --- a/MakeTools/zisofs-tools/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/MakeTools/zisofs-tools/iso9660.c b/MakeTools/zisofs-tools/iso9660.c deleted file mode 100644 index 8199240..0000000 --- a/MakeTools/zisofs-tools/iso9660.c +++ /dev/null @@ -1,111 +0,0 @@ -/* $Id: iso9660.c,v 1.3 2013/10/01 01:45:51 sbreyer Exp $ */ -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -#include "iso9660.h" - -/* zisofs magic */ - -const unsigned char zisofs_magic[8] = { - 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07 -}; - -/* iso9660 integer formats */ - -void -set_721(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[0] = i & 0xff; - p[1] = (i >> 8) & 0xff; -} - -unsigned int -get_721(void *pnt) -{ - unsigned char *p = (unsigned char *)pnt; - return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8); -} - -void -set_722(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[0] = (i >> 8) & 0xff; - p[1] = i & 0xff; -} - -unsigned int -get_722(void *pnt) -{ - unsigned char *p = (unsigned char *)pnt; - return ((unsigned int)p[0] << 8) + ((unsigned int)p[1]); -} - -void -set_723(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[3] = p[0] = i & 0xff; - p[2] = p[1] = (i >> 8) & 0xff; -} - -#define get_723(x) get_721(x) - -void -set_731(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[0] = i & 0xff; - p[1] = (i >> 8) & 0xff; - p[2] = (i >> 16) & 0xff; - p[3] = (i >> 24) & 0xff; -} - -unsigned int -get_731(void *pnt) -{ - unsigned char *p = (unsigned char *)pnt; - return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8) + - ((unsigned int)p[2] << 16) + ((unsigned int)p[3] << 24); -} - -void -set_732(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[3] = i & 0xff; - p[2] = (i >> 8) & 0xff; - p[1] = (i >> 16) & 0xff; - p[0] = (i >> 24) & 0xff; -} - -unsigned int -get_732(void *pnt) -{ - unsigned char *p = (unsigned char *)pnt; - return ((unsigned int)p[0] << 24) + ((unsigned int)p[1] << 16) + - ((unsigned int)p[2] << 8) + ((unsigned int)p[3]); -} - -void -set_733(void *pnt, unsigned int i) -{ - unsigned char *p = (unsigned char *)pnt; - p[7] = p[0] = i & 0xff; - p[6] = p[1] = (i >> 8) & 0xff; - p[5] = p[2] = (i >> 16) & 0xff; - p[4] = p[3] = (i >> 24) & 0xff; -} - -#define get_733(x) get_731(x) - diff --git a/MakeTools/zisofs-tools/iso9660.h b/MakeTools/zisofs-tools/iso9660.h deleted file mode 100644 index 9a5d1dc..0000000 --- a/MakeTools/zisofs-tools/iso9660.h +++ /dev/null @@ -1,45 +0,0 @@ -#ident "$Id: iso9660.h,v 1.3 2013/10/01 01:45:57 sbreyer Exp $" -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -/* zisofs definitions */ - -#ifndef CBLOCK_SIZE_LG2 -#define CBLOCK_SIZE_LG2 15 /* Compressed block size */ -#endif -#define CBLOCK_SIZE (1 << CBLOCK_SIZE_LG2) - -/* Compressed file magic */ -extern const unsigned char zisofs_magic[8]; - -/* VERY VERY VERY IMPORTANT: Must be a multiple of 4 bytes */ -struct compressed_file_header { - char magic[8]; - char uncompressed_len[4]; - unsigned char header_size; - unsigned char block_size; - char reserved[2]; /* Reserved for future use, MBZ */ -}; - -/* iso9660 integer formats */ -void set_721(void *, unsigned int); -unsigned int get_721(void *); -void set_722(void *, unsigned int); -unsigned int get_722(void *); -void set_723(void *, unsigned int); -void set_731(void *, unsigned int); -unsigned int get_731(void *); -void set_732(void *, unsigned int); -unsigned int get_732(void *); -void set_733(void *, unsigned int); -#define get_723(x) get_721(x) -#define get_733(x) get_731(x) diff --git a/MakeTools/zisofs-tools/mkzftree.1 b/MakeTools/zisofs-tools/mkzftree.1 deleted file mode 100644 index 621ab34..0000000 --- a/MakeTools/zisofs-tools/mkzftree.1 +++ /dev/null @@ -1,120 +0,0 @@ -.\" $Id: mkzftree.1,v 1.3 2013/10/01 01:46:03 sbreyer Exp $ -.\" ----------------------------------------------------------------------- -.\" -.\" Copyright 2001 H. Peter Anvin - All Rights Reserved -.\" -.\" This program is free software; you can redistribute it and/or modify -.\" it under the terms of the GNU General Public License as published by -.\" the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, -.\" USA; either version 2 of the License, or (at your option) any later -.\" version; incorporated herein by reference. -.\" -.\" ----------------------------------------------------------------------- -.TH MKZFTREE "1" "30 July 2001" "zisofs-tools" "H. Peter Anvin" -.SH NAME -mkzftree \- Create a zisofs/RockRidge compressed file tree -.SH SYNOPSIS -.B mkzftree -[\fIOPTIONS\fR]... \fIINPUT\fR \fIOUTPUT\fR -.SH DESCRIPTION -.PP -Takes an input file tree (\fIINPUT\fR) and create a corresponding -compressed file tree (\fIOUTPUT\fR) that can be used with an -appropriately patched -.BR mkisofs (8) -to create a transparent-compression ISO 9660/Rock Ridge filesystem using -the "ZF" compression records. -.RP -.TP -\fB\-f\fP, \fB\-\-force\fP -Always compress all files, even if they get larger when compressed. -.TP -\fB\-z\fP \fIlevel\fP, \fB\-\-level\fP \fIlevel\fP -Select compression level (1-9, default is 9). Lower compression -levels are faster, but typically result in larger output. -.TP -\fB\-u\fP, \fB\-\-uncompress\fP -Uncompress an already compressed tree. This can be used to read a -compressed filesystem on a system which cannot read them natively. -.TP -\fB\-p\fP \fIparallelism\fP, \fB\-\-parallelism\fP \fIparallelism\fP -Compress in parallel. The -.I parallelism -value indicates how many compression threads are allowed to run. -.TP -\fB\-x\fP, \fB\-\-one-filesystem\fP -Do not cross filesystem boundaries, but create directory stubs at -mount points. -.TP -\fB\-X\fP, \fB\-\-strict-one-filesystem\fP -Do not cross filesystem boundaries, and do not create directory stubs -at mount points. -.TP -\fB\-C\fP \fIpath\fP, \fB\-\-crib-path\fP \fIpath\fP -Steal ("crib") files from another directory if it looks (based on -name, size, type and modification time) like they match entries in the -new filesystem. The "crib tree" is usually the compressed version of -an older version of the same workload; this thus allows for -"incremental rebuilds" of a compressed filesystem tree. The files are -hardlinked from the crib tree to the output tree, so if it is -desirable to keep the link count correct the crib path should be -deleted before running \fBmkisofs\fP. The crib tree must be on the -same filesystem as the output tree. -.TP -\fB\-l\fP, \fB\-\-local\fP -Do not recurse into subdirectories, but create the directories -themselves. -.TP -\fB\-L\fP, \fB\-\-strict-local\fP -Do not recurse into subdirectories, and do not create directories. -.TP -\fB\-F\fP, \fB\-\-file\fP -Indicates that \fIINPUT\fP may not necessarily be a directory; this -allows operation on a single file. Note especially that if \fI\-F\fP -is specified, and \fIINPUT\fP is a symlink, the symlink itself will be -copied rather than whatever it happens to point to. -.TP -\fB\-s\fP, \fB\-\-sloppy\fP -Treat file modes, times and ownership data as less than precious -information and don't abort if they cannot be set. This may be useful -if running -.B mkisofs -on an input tree you do not own. -.TP -\fB\-v\fP, \fB\-\-verbose\fP -Increase the program verbosity. -.TP -\fB\-V\fP \fIvalue\fP, \fB\-\-verbosity\fP \fIvalue\fP -Set the program verbosity to -.IR value . -.TP -\fB\-q\fP, \fB\-\-quiet\fP -Issue no messages whatsoever, including error messages. This is the same -as specifying -.IR "\-V\ 0" . -.TP -\fB\-h\fP, \fB\-\-help\fP -Display a brief help message. -.TP -\fB\-w\fP, \fB\-\-version\fP -Display the release version. -.SH BUGS -Long options (beginning with \fI\-\-\fP) may not work on all systems. -See the message printed out by \fImkzftree\ \-h\fP to see if this -applies to your system. -.PP -Inode change times (ctimes) are not copied. This is a system -limitation and applies to all file copy programs. -.PP -If using the parallel option (\fI\-z\fP) the access times (atimes) on -directories may or may not be copied. If it is important that the -atimes on directories are copied exactly, avoid using \fI\-z\fP. -.SH AUTHOR -Written by H. Peter Anvin <[email protected]>. -.SH COPYRIGHT -Copyright \(co 2001-2002 H. Peter Anvin. -.br -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -.SH "SEE ALSO" -.BR mkisofs (8) diff --git a/MakeTools/zisofs-tools/mkzftree.c b/MakeTools/zisofs-tools/mkzftree.c deleted file mode 100644 index 672df36..0000000 --- a/MakeTools/zisofs-tools/mkzftree.c +++ /dev/null @@ -1,284 +0,0 @@ -/* $Id: mkzftree.c,v 1.3 2013/10/01 01:46:09 sbreyer Exp $ */ -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -/* - * mkzffile.c - * - * - Generate block-compression of files for use with - * the "ZF" extension to the iso9660/RockRidge filesystem. - * - * The file compression technique used is the "deflate" - * algorithm used by the zlib library; each block must have a - * valid (12-byte) zlib header. In addition, the file itself - * has the following structure: - * - * Byte offset iso9660 type Contents - * 0 (8 bytes) Magic number (37 E4 53 96 C9 DB D6 07) - * 8 7.3.1 Uncompressed file size - * 12 7.1.1 header_size >> 2 (currently 4) - * 13 7.1.1 log2(block_size) - * 14 (2 bytes) Reserved, must be zero - * - * The header may get expanded in the future, at which point the - * header size field will be used to increase the space for the - * header. - * - * All implementations are required to support a block_size of 32K - * (byte 13 == 15). - * - * Note that bytes 12 and 13 and the uncompressed length are also - * present in the ZF record; THE TWO MUST BOTH BE CONSISTENT AND - * CORRECT. - * - * Given the uncompressed size, block_size, and header_size: - * - * Nblocks := ceil(size/block_size) - * - * After the header follow (nblock+1) 32-bit pointers, recorded as - * iso9660 7.3.1 (littleendian); each indicate the byte offset (from - * the start of the file) to one block and the first byte beyond the - * end of the previous block; the first pointer thus point to the - * start of the data area and the last pointer to the first byte - * beyond it: - * - * block_no := floor(byte_offset/block_size) - * - * block_start := read_pointer_731( (header_size+block_no)*4 ) - * block_end := read_pointer_731( (header_size+block_no+1)*4 ) - * - * The block data is compressed according to "zlib". - */ - -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <unistd.h> -#include <limits.h> -#include <utime.h> -#include <sys/stat.h> -#include <sys/types.h> - -#include "mkzftree.h" -#include "version.h" - -#ifdef HAVE_GETOPT_H -#include <getopt.h> -#endif - -/* Command line options */ -struct cmdline_options opt = { - 0, /* Force compression */ - 9, /* Compression level */ - 0, /* Parallelism (0 = strictly serial) */ - 0, /* One filesystem only */ - 0, /* One directory only */ - 1, /* Create stub directories */ - 0, /* Root may be a file */ - 0, /* Be paranoid about metadata */ - default_verbosity, /* Default verbosity */ - block_compress_file /* Default transformation function */ -}; - -/* Program name */ -const char *program; - -/* Long options */ -#define OPTSTRING "fz:up:xXC:lLFvqV:hw" -#ifdef HAVE_GETOPT_LONG -const struct option long_options[] = { - { "force", 0, 0, 'f' }, - { "level", 1, 0, 'z' }, - { "uncompress", 0, 0, 'u' }, - { "parallelism", 1, 0, 'p' }, - { "one-filesystem", 0, 0, 'x' }, - { "strict-one-filesystem", 0, 0, 'X' }, - { "crib-tree", 1, 0, 'C' }, - { "local", 0, 0, 'l' }, - { "strict-local", 0, 0, 'L' }, - { "file", 0, 0, 'F' }, - { "verbose", 0, 0, 'v' }, - { "quiet", 0, 0, 'q' }, - { "verbosity", 1, 0, 'V' }, - { "help", 0, 0, 'h' }, - { "version", 0, 0, 'w' }, - { 0, 0, 0, 0 } -}; -#define LO(X) X -#else -#define getopt_long(C,V,O,L,I) getopt(C,V,O) -#define LO(X) -#endif - -static void usage(enum verbosity level, int err) -{ - message(level, - "zisofs-tools " ZISOFS_TOOLS_VERSION "\n" - "Usage: %s [options] intree outtree\n" - LO(" --force ")" -f Always compress, even if result is larger\n" - LO(" --level # ")" -z # Set compression level (1-9)\n" - LO(" --uncompress ")" -u Uncompress an already compressed tree\n" - LO(" --parallelism # ")" -p # Process up to # files in parallel\n" - LO(" --one-filesystem ")" -x Do not cross filesystem boundaries\n" - LO(" --strict-one-filesystem")" -X Same as -x, but don't create stubs dirs\n" - LO(" --crib-tree ")" -C Steal \"crib\" files from an old tree\n" - LO(" --local ")" -l Do not recurse into subdirectoires\n" - LO(" --strict-local ")" -L Same as -l, but don't create stubs dirs\n" - LO(" --file ")" -F Operate possibly on a single file\n" - LO(" --sloppy ")" -s Don't abort if metadata cannot be set\n" - LO(" --verbose ")" -v Increase message verbosity\n" - LO(" --verbosity # ")" -V # Set message verbosity to # (default = %d)\n" - LO(" --quiet ")" -q No messages, not even errors (-V 0)\n" - LO(" --help ")" -h Display this message\n" - LO(" --version ")" -w Display the program version\n" - ,program, (int)default_verbosity); - exit(err); -} - -static int opt_atoi(const char *str) -{ - char *endptr; - long out; - - out = strtol(str, &endptr, 10); - if ( *endptr ) - usage(vl_error, EX_USAGE); - - return (int)out; -} - - -int main(int argc, char *argv[]) -{ - const char *in, *out, *crib = NULL; - struct stat st; - struct utimbuf ut; - int optch, err; - - program = argv[0]; - - while ( (optch = getopt_long(argc, argv, OPTSTRING, long_options, NULL)) - != EOF ) { - switch(optch) { - case 'f': - opt.force = 1; /* Always compress */ - break; - case 'z': - opt.level = opt_atoi(optarg); - if ( opt.level < 1 || opt.level > 9 ) { - message(vl_error, "%s: invalid compression level: %d\n", - program, optarg); - exit(EX_USAGE); - } - break; - case 'v': - opt.verbosity++; - break; - case 'V': - opt.verbosity = opt_atoi(optarg); - break; - case 'q': - opt.verbosity = vl_quiet; - break; - case 'u': - opt.munger = block_uncompress_file; - break; - case 'C': - crib = optarg; - break; - case 'p': - opt.parallel = opt_atoi(optarg); - break; - case 'x': - opt.onefs = 1; opt.do_mkdir = 1; - break; - case 'l': - opt.onedir = 1; opt.do_mkdir = 1; - break; - case 'X': - opt.onefs = 1; opt.do_mkdir = 0; - break; - case 'L': - opt.onedir = 1; opt.do_mkdir = 0; - break; - case 'F': - opt.file_root = 1; - break; - case 's': - opt.sloppy = 1; - break; - case 'h': - usage(vl_quiet, 0); - break; - case 'w': - message(vl_quiet, "zisofs-tools " ZISOFS_TOOLS_VERSION "\n"); - exit(0); - default: - usage(vl_error, EX_USAGE); - break; - } - } - - if ( (argc-optind) != 2 ) - usage(vl_error, EX_USAGE); - - in = argv[optind]; /* Input tree */ - out = argv[optind+1]; /* Output tree */ - - umask(077); - - if ( opt.file_root ) { - if ( lstat(in, &st) ) { - message(vl_error, "%s: %s: %s\n", program, in, strerror(errno)); - exit(EX_NOINPUT); - } - - err = munge_entry(in, out, crib, NULL); - } else { - /* Special case: we use stat() for the root, not lstat() */ - if ( stat(in, &st) ) { - message(vl_error, "%s: %s: %s\n", program, in, strerror(errno)); - exit(EX_NOINPUT); - } - if ( !S_ISDIR(st.st_mode) ) { - message(vl_error, "%s: %s: Not a directory\n", program, in); - exit(EX_DATAERR); - } - - err = munge_tree(in, out, crib); - } - - wait_for_all_workers(); - - if ( err ) - exit(err); - - if ( !opt.file_root ) { - if ( chown(out, st.st_uid, st.st_gid) && !opt.sloppy ) { - message(vl_error, "%s: %s: %s", program, out, strerror(errno)); - err = EX_CANTCREAT; - } - if ( chmod(out, st.st_mode) && !opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out, strerror(errno)); - err = EX_CANTCREAT; - } - ut.actime = st.st_atime; - ut.modtime = st.st_mtime; - if ( utime(out, &ut) && !opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out, strerror(errno)); - err = EX_CANTCREAT; - } - } - - return err; -} diff --git a/MakeTools/zisofs-tools/mkzftree.h b/MakeTools/zisofs-tools/mkzftree.h deleted file mode 100644 index f860307..0000000 --- a/MakeTools/zisofs-tools/mkzftree.h +++ /dev/null @@ -1,86 +0,0 @@ -#ident "$Id: mkzftree.h,v 1.3 2013/10/01 01:46:17 sbreyer Exp $" -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -#include "config.h" -#include <stddef.h> -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> - -#ifdef HAVE_SYSEXITS_H -#include <sysexits.h> -#else -#define EX_USAGE 64 /* command line usage error */ -#define EX_DATAERR 65 /* data format error */ -#define EX_NOINPUT 66 /* cannot open input */ -#define EX_NOUSER 67 /* addressee unknown */ -#define EX_NOHOST 68 /* host name unknown */ -#define EX_UNAVAILABLE 69 /* service unavailable */ -#define EX_SOFTWARE 70 /* internal software error */ -#define EX_OSERR 71 /* system error (e.g., can't fork) */ -#define EX_OSFILE 72 /* critical OS file missing */ -#define EX_CANTCREAT 73 /* can't create (user) output file */ -#define EX_IOERR 74 /* input/output error */ -#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ -#define EX_PROTOCOL 76 /* remote error in protocol */ -#define EX_NOPERM 77 /* permission denied */ -#define EX_CONFIG 78 /* configuration error */ -#endif - -/* File transformation functions */ -typedef int (*munger_func)(FILE *, FILE *, off_t); -int block_compress_file(FILE *, FILE *, off_t); -int block_uncompress_file(FILE *, FILE *, off_t); - -/* mkzftree.c */ -extern const char *program; /* Program name */ -enum verbosity { /* Message verbosity */ - vl_quiet, /* No messages */ - vl_error, /* Error messages only */ - vl_filename, /* Display filenames */ - vl_crib, /* Cribbing files */ -}; -#define default_verbosity vl_error -struct cmdline_options { - int force; /* Always compress */ - int level; /* Compression level */ - int parallel; /* Parallelism (0 = strictly serial) */ - int onefs; /* One filesystem only */ - int onedir; /* One directory only */ - int do_mkdir; /* Create stub directories */ - int file_root; /* The root may be a file */ - int sloppy; /* Don't make sure metadata is set correctly */ - enum verbosity verbosity; /* Message verbosity */ - munger_func munger; /* Default action */ -}; -extern struct cmdline_options opt; - -/* walk.c */ -int munge_tree(const char *, const char *, const char *); -int munge_entry(const char *, const char *, const char *, const struct stat *); - -/* workers.c */ -void wait_for_all_workers(void); -int spawn_worker(void); -void end_worker(int); - -/* util.c */ -void *xmalloc(size_t); -char *xstrdup(const char *); -void message(enum verbosity, const char *, ...); - -/* hash.c */ -const char *hash_find_file(struct stat *); -void hash_insert_file(struct stat *, const char *); - diff --git a/MakeTools/zisofs-tools/uncompress.c b/MakeTools/zisofs-tools/uncompress.c deleted file mode 100644 index b216423..0000000 --- a/MakeTools/zisofs-tools/uncompress.c +++ /dev/null @@ -1,136 +0,0 @@ -/* $Id: uncompress.c,v 1.5 2014/12/17 18:05:40 mwheinz Exp $ */ -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <zlib.h> -#include "mkzftree.h" -#include "iso9660.h" - -int block_uncompress_file(FILE *input, FILE *output, off_t size) -{ - struct compressed_file_header hdr; - char *inbuf, *outbuf; - int block_shift; - char *pointer_block, *pptr; - unsigned long nblocks; - unsigned long fullsize, block_size, block_size2; - size_t ptrblock_bytes; - unsigned long cstart, cend, csize; - uLong bytes; - int zerr; - int err = EX_SOFTWARE; - - if ( (bytes = fread(&hdr, 1, sizeof hdr, input)) != sizeof hdr ) { - if ( bytes == (size_t)size ) { - /* Very short file; not compressed */ - return ( fwrite(&hdr, 1, bytes, output) != bytes ) ? EX_CANTCREAT : 0; - } else { - return EX_IOERR; /* Read error */ - } - } - - if ( memcmp(&hdr.magic, zisofs_magic, sizeof zisofs_magic) ) { - inbuf = xmalloc(CBLOCK_SIZE); - /* Not compressed */ - memcpy(inbuf, &hdr, sizeof hdr); - bytes = sizeof hdr; - do { - if ( fwrite(inbuf, 1, bytes, output) != bytes ) { - free(inbuf); - return EX_CANTCREAT; - } - } while ( (bytes = fread(inbuf, 1, CBLOCK_SIZE, input)) > 0 ); - free(inbuf); - return ferror(input) ? EX_IOERR : 0; - } - - /* Now we know the file must be compressed. Get the pointer table. */ - if ( fseek(input, hdr.header_size << 2, SEEK_SET) == -1 ) - return EX_IOERR; - - fullsize = get_731(hdr.uncompressed_len); - block_shift = hdr.block_size; - block_size = 1UL << block_shift; - block_size2 = block_size << 1; - inbuf = xmalloc(block_size2); - outbuf = xmalloc(block_size); - - nblocks = (fullsize + block_size - 1) >> block_shift; - - ptrblock_bytes = (nblocks+1) * 4; - pointer_block = xmalloc(ptrblock_bytes); - - if ( (bytes = fread(pointer_block, 1, ptrblock_bytes, input)) != ptrblock_bytes ) { - err = EX_IOERR; - goto free_ptr_bail; - } - - pptr = pointer_block; - while ( fullsize ) { - cstart = get_731(pptr); - pptr += 4; - cend = get_731(pptr); - - csize = cend-cstart; - - if ( csize == 0 ) { - memset(outbuf, 0, block_size); - bytes = block_size; - } else { - if ( csize > block_size2 ) { - err = EX_DATAERR; - goto free_ptr_bail; - } - - if ( fseek(input, cstart, SEEK_SET) == -1 || - (bytes = fread(inbuf, 1, csize, input)) != csize ) { - err = EX_IOERR; - goto free_ptr_bail; - } - - bytes = block_size; /* Max output buffer size */ - if ( (zerr = uncompress((unsigned char*)outbuf, &bytes, (unsigned char*)inbuf, csize)) != Z_OK ) { - err = (zerr = Z_MEM_ERROR) ? EX_OSERR : EX_DATAERR; - goto free_ptr_bail; - } - } - - if ( ((fullsize > block_size) && (bytes != block_size)) - || ((fullsize <= block_size) && (bytes < fullsize)) ) { - err = EX_DATAERR; - goto free_ptr_bail; - } - - if ( bytes > fullsize ) - bytes = fullsize; - - if ( fwrite(outbuf, 1, bytes, output) != bytes ) { - err = EX_CANTCREAT; - goto free_ptr_bail; - } - - fullsize -= bytes; - } - - err = 0; - - free_ptr_bail: - free(pointer_block); - free(inbuf); - free(outbuf); - return err; -} - - diff --git a/MakeTools/zisofs-tools/util.c b/MakeTools/zisofs-tools/util.c deleted file mode 100644 index d7d3b7a..0000000 --- a/MakeTools/zisofs-tools/util.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id: util.c,v 1.3 2013/10/01 01:46:29 sbreyer Exp $ */ -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -#include <stdio.h> -#include <errno.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include "mkzftree.h" - -/* Convenience functions */ -void *xmalloc(size_t size) -{ - void *p = malloc(size); - - if ( !p ) { - perror(program); - exit(EX_OSERR); - } - - return p; -} - -char *xstrdup(const char *str) -{ - char *s = strdup(str); - - if ( !s ) { - perror(program); - exit(EX_OSERR); - } - - return s; -} - -void message(enum verbosity level, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - if ( opt.verbosity >= level ) - vfprintf(stderr, format, ap); - va_end(ap); -} - diff --git a/MakeTools/zisofs-tools/version b/MakeTools/zisofs-tools/version deleted file mode 100644 index ee90284..0000000 --- a/MakeTools/zisofs-tools/version +++ /dev/null @@ -1 +0,0 @@ -1.0.4 diff --git a/MakeTools/zisofs-tools/walk.c b/MakeTools/zisofs-tools/walk.c deleted file mode 100644 index f6852d8..0000000 --- a/MakeTools/zisofs-tools/walk.c +++ /dev/null @@ -1,338 +0,0 @@ -#ident "$Id: walk.c,v 1.4 2014/12/17 18:50:18 mwheinz Exp $" -/* ----------------------------------------------------------------------- * - * - * Copyright 2001-2002 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -/* - * walk.c - * - * Functions to walk the file tree - */ - -#include <stdlib.h> -#include <stdio.h> -#include <limits.h> -#include <utime.h> -#include <string.h> -#include <errno.h> -#include <dirent.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/types.h> -#include "mkzftree.h" -#include "iso9660.h" - -static int munge_file(const char *inpath, const char *outpath, - const char *cribpath, struct stat *st) -{ - FILE *in, *out; - int err = 0; - struct utimbuf ut; - - if ( cribpath ) { - struct stat cst; - struct compressed_file_header cfh; - - /* Compare as much as we realistically can */ - if ( !stat(cribpath, &cst) && - st->st_mode == cst.st_mode && - st->st_uid == cst.st_uid && - st->st_gid == cst.st_gid && - st->st_mtime == cst.st_mtime ) { - if ( (in = fopen(cribpath, "rb")) ) { - int e = fread(&cfh, 1, sizeof cfh, in); - fclose(in); - /* Attempt to restore the atime */ - ut.actime = cst.st_atime; - ut.modtime = cst.st_mtime; - utime(cribpath, &ut); - - if ( (e == sizeof cfh && - !memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic) && - (off_t)get_731(cfh.uncompressed_len) == st->st_size) || - (st->st_size == cst.st_size && - (e < (int)(sizeof zisofs_magic) || - memcmp(cfh.magic, zisofs_magic, sizeof zisofs_magic))) ) { - /* File is cribbable. Steal it. */ - if ( !link(cribpath, outpath) ) { - message(vl_crib, "crib: %s -> %s\n", cribpath, outpath); - ut.actime = st->st_atime; - ut.modtime = st->st_mtime; - utime(outpath, &ut); /* Set the the atime */ - - return 0; - } - } - } - } - } - - in = fopen(inpath, "rb"); - if ( !in ) - return EX_NOINPUT; - out = fopen(outpath, "wb"); - if ( !out ) { - fclose(in); - return EX_CANTCREAT; - } - - if ( spawn_worker() ) { - err = opt.munger(in, out, st->st_size); - fclose(in); - fclose(out); - - chown(outpath, st->st_uid, st->st_gid); - chmod(outpath, st->st_mode); - ut.actime = st->st_atime; - ut.modtime = st->st_mtime; - utime(outpath, &ut); - - end_worker(err); - } else { - fclose(in); - fclose(out); - } - - return err; -} - -int munge_tree(const char *intree, const char *outtree, const char *cribtree) -{ - char *in_path = NULL, *out_path = NULL, *crib_path = NULL; - char *in_file = NULL, *out_file = NULL, *crib_file = NULL; - DIR *thisdir; - struct dirent *dirent; - struct stat dirst; - int err = 0; - - /* Construct buffers with the common filename prefix, and point to the end */ - - in_path = xmalloc(strlen(intree) + NAME_MAX + 2); - strcpy(in_path, intree); - in_file = strchr(in_path, '\0'); - *in_file++ = '/'; - - out_path = xmalloc(strlen(outtree) + NAME_MAX + 2); - strcpy(out_path, outtree); - out_file = strchr(out_path, '\0'); - *out_file++ = '/'; - - if ( cribtree ) { - crib_path = xmalloc(strlen(cribtree) + NAME_MAX + 2); - strcpy(crib_path, cribtree); - crib_file = strchr(crib_path, '\0'); - *crib_file++ = '/'; - } else { - crib_path = crib_file = NULL; - } - - /* Get directory information */ - if ( stat(intree, &dirst) ) { - message(vl_error, "%s: Failed to stat directory %s: %s\n", - program, intree, strerror(errno)); - if (crib_path) free(crib_path); - if (in_path) free(in_path); - if (out_path) free(out_path); - return EX_NOINPUT; - } - - /* Open the directory */ - thisdir = opendir(intree); - if ( !thisdir ) { - message(vl_error, "%s: Failed to open directory %s: %s\n", - program, intree, strerror(errno)); - if (crib_path) free(crib_path); - if (in_path) free(in_path); - if (out_path) free(out_path); - return EX_NOINPUT; - } - - /* Create output directory */ - if ( mkdir(outtree, 0700) ) { - message(vl_error, "%s: Cannot create output directory %s: %s\n", - program, outtree, strerror(errno)); - if (crib_path) free(crib_path); - if (in_path) free(in_path); - if (out_path) free(out_path); - return EX_CANTCREAT; - } - - while ( (dirent = readdir(thisdir)) != NULL ) { - if ( !strcmp(dirent->d_name, ".") || - !strcmp(dirent->d_name, "..") ) - continue; /* Ignore . and .. */ - - strcpy(in_file, dirent->d_name); - strcpy(out_file, dirent->d_name); - if ( crib_file ) - strcpy(crib_file, dirent->d_name); - - err = munge_entry(in_path, out_path, crib_path, &dirst); - if ( err ) - break; - } - closedir(thisdir); - - if (crib_path) free(crib_path); - if (in_path) free(in_path); - if (out_path) free(out_path); - - return err; -} - - -int munge_entry(const char *in_path, const char *out_path, - const char *crib_path, const struct stat *dirst) -{ - struct stat st; - struct utimbuf ut; - int err = 0; - - message(vl_filename, "%s -> %s\n", in_path, out_path); - - if ( lstat(in_path, &st) ) { - message(vl_error, "%s: Failed to stat file %s: %s\n", - program, in_path, strerror(errno)); - return EX_NOINPUT; - } - - if ( S_ISREG(st.st_mode) ) { - if ( st.st_nlink > 1 ) { - /* Hard link. */ - const char *linkname; - - if ( (linkname = hash_find_file(&st)) != NULL ) { - /* We've seen it before, hard link it */ - - if ( link(linkname, out_path) ) { - message(vl_error, "%s: hard link %s -> %s failed: %s\n", - program, out_path, linkname, strerror(errno)); - return EX_CANTCREAT; - } - } else { - /* First encounter, compress and enter into hash */ - if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) { - message(vl_error, "%s: %s: %s", program, in_path, strerror(errno)); - return err; - } - hash_insert_file(&st, out_path); - } - } else { - /* Singleton file; no funnies */ - if ( (err = munge_file(in_path, out_path, crib_path, &st)) != 0 ) { - message(vl_error, "%s: %s: %s", program, in_path, strerror(errno)); - return err; - } - } - } else if ( S_ISDIR(st.st_mode) ) { - /* Recursion: see recursion */ - if ( !opt.onedir && - (!opt.onefs || (dirst && dirst->st_dev == st.st_dev)) ) { - if ( (err = munge_tree(in_path, out_path, crib_path)) != 0 ) - return err; - } else if ( opt.do_mkdir ) { - /* Create stub directories */ - if ( mkdir(out_path, st.st_mode) ) { - message(vl_error, "%s: %s: %s", program, out_path, strerror(errno)); - return EX_CANTCREAT; - } - } - } else if ( S_ISLNK(st.st_mode) ) { - int chars; -#ifdef PATH_MAX -#define BUFFER_SLACK PATH_MAX -#else -#define BUFFER_SLACK BUFSIZ -#endif - int buffer_len = st.st_size + BUFFER_SLACK + 1; - char *buffer = xmalloc(buffer_len); - if (!buffer) { - message(vl_error, "%s: xmalloc failed for %s: %d\n", - program, buffer_len, strerror(errno)); - return EX_CANTCREAT; - } - if ( (chars = readlink(in_path, buffer, buffer_len)) < 0 ) { - message(vl_error, "%s: readlink failed for %s: %s\n", - program, in_path, strerror(errno)); - free(buffer); - return EX_NOINPUT; - } - buffer[chars] = '\0'; - if ( symlink(buffer, out_path) ) { - message(vl_error, "%s: symlink %s -> %s failed: %s\n", - program, out_path, buffer, strerror(errno)); - free(buffer); - return EX_CANTCREAT; - } - free(buffer); - } else { - if ( st.st_nlink > 1 ) { - /* Hard link. */ - const char *linkname; - - if ( (linkname = hash_find_file(&st)) != NULL ) { - /* We've seen it before, hard link it */ - - if ( link(linkname, out_path) ) { - message(vl_error, "%s: hard link %s -> %s failed: %s\n", - program, out_path, linkname, strerror(errno)); - return EX_CANTCREAT; - } - } else { - /* First encounter, create and enter into hash */ - if ( mknod(out_path, st.st_mode, st.st_rdev) ) { - message(vl_error, "%s: mknod failed for %s: %s\n", - program, out_path, strerror(errno)); - return EX_CANTCREAT; - } - hash_insert_file(&st, out_path); - } - } else { - /* Singleton node; no funnies */ - if ( mknod(out_path, st.st_mode, st.st_rdev) ) { - message(vl_error, "%s: mknod failed for %s: %s\n", - program, out_path, strerror(errno)); - return EX_CANTCREAT; - } - } - } - - /* This is done by munge_file() for files */ - if ( !S_ISREG(st.st_mode) ) { -#ifdef HAVE_LCHOWN - if ( lchown(out_path, st.st_uid, st.st_gid) && opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out_path, strerror(errno)); - err = EX_CANTCREAT; - } -#endif - if ( !S_ISLNK(st.st_mode) ) { -#ifndef HAVE_LCHOWN - if ( chown(out_path, st.st_uid, st.st_gid) && !opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out_path, strerror(errno)); - err = EX_CANTCREAT; - } -#endif - if ( chmod(out_path, st.st_mode) && !opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out_path, strerror(errno)); - err = EX_CANTCREAT; - } - ut.actime = st.st_atime; - ut.modtime = st.st_mtime; - if ( utime(out_path, &ut) && !opt.sloppy && !err ) { - message(vl_error, "%s: %s: %s", program, out_path, strerror(errno)); - err = EX_CANTCREAT; - } - } - } - - return err; -} - diff --git a/MakeTools/zisofs-tools/workers.c b/MakeTools/zisofs-tools/workers.c deleted file mode 100644 index 11f2a8d..0000000 --- a/MakeTools/zisofs-tools/workers.c +++ /dev/null @@ -1,98 +0,0 @@ -#ident "$Id: workers.c,v 1.3 2013/10/01 01:46:47 sbreyer Exp $" -/* ----------------------------------------------------------------------- * - * - * Copyright 2001 H. Peter Anvin - All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, - * USA; either version 2 of the License, or (at your option) any later - * version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ - -/* - * workers.c - * - * Parallel job maintenance - */ - -#include <stddef.h> -#include <stdlib.h> -#include <unistd.h> -#include <signal.h> -#include <stdio.h> -#include <sys/wait.h> -#include "mkzftree.h" - -/* Global option */ -extern int parallel; /* Number of parallel jobs */ - -/* Functions related to parallel execution */ -static volatile int work_threads = 0; -static int is_worker = 0; - -/* This waits for one worker to finish */ -static void wait_for_one_worker(void) -{ - int status; - - if ( wait(&status) > 0 ) { - work_threads--; - - if ( WIFSIGNALED(status) ) { - kill(getpid(), WTERMSIG(status)); - exit(EX_SOFTWARE); - } else if ( WEXITSTATUS(status) ) { - exit(WEXITSTATUS(status)); - } - } -} - -/* This waits for *all* workers to finish */ -void wait_for_all_workers(void) -{ - while ( work_threads ) - wait_for_one_worker(); -} - -/* This returns 1 if the "job" at hand should be performed */ -int spawn_worker(void) -{ - pid_t f; - - if ( opt.parallel == 0 ) - return 1; - - fflush(NULL); - - /* Wait for a work slot */ - while ( work_threads >= opt.parallel ) - wait_for_one_worker(); - - /* Spawn worker process */ - work_threads++; /* Avoids race conditions */ - f = fork(); - if ( f == -1 ) { - work_threads--; - return 1; /* Do it ourselves */ - } - - if ( f == 0 ) { - /* Worker process */ - is_worker = 1; - return 1; - } else { - /* Control process */ - return 0; - } -} - -/* Routine to perform at the end of the job */ -void end_worker(int err) -{ - if ( is_worker ) { - exit(err); - } -} - diff --git a/MakeTools/zisofs-tools/zisofs.magic b/MakeTools/zisofs-tools/zisofs.magic deleted file mode 100644 index 9aeb61e..0000000 --- a/MakeTools/zisofs-tools/zisofs.magic +++ /dev/null @@ -1,8 +0,0 @@ - -#------------------------------------------------------------------------------ -# zisofs: file(1) magic for zisofs/RockRidge compressed files -# -# from H. Peter Anvin <[email protected]> May 4, 2001 -# -0 string \x37\xE4\x53\x96\xC9\xDB\xD6\x07 zisofs/Rockridge compressed file ->8 lelong x - %d bytes
0
736bd9dc3e094576d67e286d2e3a534e1dd05588
01org/opa-fm
Update to latest from build 10.4.0.0.196 (IFS 10.4.0.0.214)
commit 736bd9dc3e094576d67e286d2e3a534e1dd05588 Author: Scott Breyer <[email protected]> Date: Wed Apr 26 11:49:48 2017 -0400 Update to latest from build 10.4.0.0.196 (IFS 10.4.0.0.214) diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index d87e378..4347c17 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -1428,7 +1428,7 @@ sub delta_rpm_install_list($$$@) if ( "$delta_rpm_info{$package}{'Mode'}" eq "kernel" ) { if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" || "$CUR_VENDOR_VER" eq "ES122" ) { if ( $package =~ /ifs-kernel-updates/ ) { - if ($GPU_Install == 1 ){ + if ( $GPU_Install == 1 ) { $rpmdir_t=$rpmdir."/CUDA"; } next if ( $skip_kernelib); @@ -1445,13 +1445,16 @@ sub delta_rpm_install_list($$$@) $ret = 1; } } - rpm_install_with_options($rpmdir, $osver, $package, " -U --nodeps "); + rpm_install_with_options($rpmdir_t, $osver, $package, " -U --nodeps "); } else { - if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" || "$CUR_VENDOR_VER" eq "ES122" ) { - if ( $package =~ /libpsm/ ) { - if ($GPU_Install == 1 ){ + if ( $GPU_Install == 1 ) { + if ( -d $rpmdir."/CUDA" ) { + if ( $package =~ /libpsm/ || $package =~ /ifs-kernel-updates/) { $rpmdir_t=$rpmdir."/CUDA"; } + } else { + NormalPrint("CUDA specific packages do not exist\n"); + exit 0; } } rpm_install_with_options($rpmdir_t, "user", $package, " -U --nodeps "); @@ -1588,8 +1591,23 @@ sub delta_srpm_file($$) { my $srcdir = shift(); my $globname = shift(); # in $srcdir + my $result; + + if ( $GPU_Install == 1 ) { + if ( -d $srcdir."/SRPMS/CUDA" ) { + if ("$globname" eq "libpsm2*.src.rpm") { + $result = file_glob("$srcdir/$SRPMS_SUBDIR/CUDA/$globname"); + } elsif ("$globname" eq "ifs-kernel-updates*.src.rpm"){ + $result = file_glob("$srcdir/$SRPMS_SUBDIR/CUDA/$globname"); + } + } else { + NormalPrint("CUDA specific SRPMs do not exist\n"); + exit 0; + } + } else { + $result = file_glob("$srcdir/$SRPMS_SUBDIR/$globname"); + } - my $result = file_glob("$srcdir/$SRPMS_SUBDIR/$globname"); $result =~ s|^$srcdir/||; return $result; } @@ -2657,9 +2675,12 @@ sub install_kernel_ib($$) } $rpmdir_t = $rpmdir; - if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" || "$CUR_VENDOR_VER" eq "ES122" ) { - if ($GPU_Install == 1 ){ + if ( $GPU_Install == 1 ) { + if ( -d $rpmdir."/CUDA" ) { $rpmdir_t=$rpmdir."/CUDA"; + } else { + NormalPrint("CUDA specific packages do not exist\n"); + exit 0; } } @@ -3112,6 +3133,11 @@ sub uninstall_intel_hfi($$) rebuild_ramdisk(); } +sub check_os_prereqs_intel_hfi +{ + return rpm_check_os_prereqs("intel_hfi", "any"); +} + # ========================================================================== # ib_wfr_lite installation diff --git a/CommonInstall/comp_delta_prereq_RHEL73.pl b/CommonInstall/comp_delta_prereq_RHEL73.pl index 376e9b2..47d6712 100644 --- a/CommonInstall/comp_delta_prereq_RHEL73.pl +++ b/CommonInstall/comp_delta_prereq_RHEL73.pl @@ -62,6 +62,7 @@ $comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; my @intel_hfi_prereq = ( "bash", + "libhfi1", "glibc", "libgcc", "libuuid", diff --git a/CommonInstall/comp_delta_prereq_SLES121.pl b/CommonInstall/comp_delta_prereq_SLES121.pl index b5dcca7..ffad8c0 100644 --- a/CommonInstall/comp_delta_prereq_SLES121.pl +++ b/CommonInstall/comp_delta_prereq_SLES121.pl @@ -77,7 +77,6 @@ my @intel_hfi_prereq = ( "bash", "glibc", "libgcc_s1", - "libhfi1", "libibverbs1", "libncurses5", "libuuid1", diff --git a/CommonInstall/comp_delta_prereq_SLES122.pl b/CommonInstall/comp_delta_prereq_SLES122.pl index c5fffbc..6afdaaf 100644 --- a/CommonInstall/comp_delta_prereq_SLES122.pl +++ b/CommonInstall/comp_delta_prereq_SLES122.pl @@ -59,6 +59,7 @@ $comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; my @intel_hfi_prereq = ( "glibc", + "libhfi1verbs-rdmav2", "libgcc_s1", "libuuid1", "bash", diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index b5ffbe1..00d9302 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -435,6 +435,13 @@ sub rpm_check_os_prereqs($$) DebugPrint "Checking prereqs for $comp\n"; foreach (@rpm_list){ DebugPrint "Checking installation of $_\n"; + #Don't check dependencies for kernel RPMS if their installation is skipped + if($skip_kernel == 1){ + if( "$_" =~ /kernel/ || "$_" =~ /kmod/ || "$_" eq "pciutils" ) { + DebugPrint("Skipping check for $_ \n"); + next; + } + } if(!rpm_is_installed($_, $mode)){ NormalPrint("--> $comp requires $_ \n"); $prereq_check = 1; diff --git a/Esm/build.env b/Esm/build.env index 5066d08..79b3e9e 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_4_0_0_173 +export RELEASE_TAG=10_4_0_0_196 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/build_label b/Esm/build_label index 3afc3a1..ceec82f 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 03/09/17 22:08 Tag: VIEO_HOST_LINUX_opa-10_4_0_0_10_4_0_0_173 +Build of VIEO_HOST 04/04/17 20:04 Tag: VIEO_HOST_LINUX_opa-10_4_0_0_10_4_0_0_196 diff --git a/Topology/snapshot.c b/Topology/snapshot.c index 7e9bca6..017e3a9 100644 --- a/Topology/snapshot.c +++ b/Topology/snapshot.c @@ -2388,12 +2388,14 @@ static void McGMemberXmlParserEnd(IXmlParserState_t *state, const IXML_FIELD *fi //fill McMemberData with info from group if ((pMCH->MemberInfo.RID.PortGID.AsReg64s.H !=0) || (pMCH->MemberInfo.RID.PortGID.AsReg64s.L!=0)) { // add switches that belong to this group - if (pMCH->pPort->neighbor->nodep->NodeInfo.NodeType == STL_NODE_SW) { - NodeData *groupswitch = pMCH->pPort->neighbor->nodep; - uint8 switchentryport = pMCH->pPort->neighbor->PortNum ; - if (FSUCCESS !=XMLAddEdgeSwitchToGroup(fabricp, mcgmemberp, groupswitch, switchentryport)){ - IXmlParserPrintError(state, "No switch found for MC Group\n"); - return; + if (pMCH->pPort && pMCH->pPort->neighbor) { + if (pMCH->pPort->neighbor->nodep->NodeInfo.NodeType == STL_NODE_SW) { + NodeData *groupswitch = pMCH->pPort->neighbor->nodep; + uint8 switchentryport = pMCH->pPort->neighbor->PortNum ; + if (FSUCCESS !=XMLAddEdgeSwitchToGroup(fabricp, mcgmemberp, groupswitch, switchentryport)){ + IXmlParserPrintError(state, "No switch found for MC Group\n"); + return; + } } } } diff --git a/Topology/sweep.c b/Topology/sweep.c index ccb255d..782346d 100644 --- a/Topology/sweep.c +++ b/Topology/sweep.c @@ -1882,12 +1882,13 @@ FSTATUS GetAllMCGroupMember(FabricData_t *fabricp, McGroupData *mcgroupp, struct mcmemberp->MemberInfo.RID.PortGID = pIbMCRR->McMemberRecords[i].RID.PortGID; mcmemberp->pPort = FindPortGuid(fabricp, pIbMCRR->McMemberRecords[i].RID.PortGID.AsReg64s.L ); - if (mcmemberp->pPort !=NULL) + if (mcmemberp->pPort && mcmemberp->pPort->neighbor) { if (mcmemberp->pPort->neighbor->nodep->NodeInfo.NodeType == STL_NODE_SW) { NodeData *groupswitch = mcmemberp->pPort->neighbor->nodep; uint16 switchentryport = mcmemberp->pPort->neighbor->PortNum ; AddEdgeSwitchToGroup(fabricp, mcgroupp, groupswitch, switchentryport ); } + } if ((mcmemberp->MemberInfo.RID.PortGID.AsReg64s.H == 0) && (mcmemberp->MemberInfo.RID.PortGID.AsReg64s.L ==0 )) mcgroupp->NumOfMembers--; // do count as valid member if PortGID is zero QListSetObj(&mcmemberp->McMembersEntry, mcmemberp); @@ -2513,6 +2514,9 @@ FSTATUS GetAllPortCounters(EUI64 portGuid, IB_GID localGid, FabricData_t *fabric PortStatusData.LinkDowned = PortStatus.LinkDowned; PortStatusData.UncorrectableErrors = PortStatus.UncorrectableErrors; PortStatusData.lq = PortStatus.lq; + PortStatusData.lq.AsReg8 |= ((portp->PortInfo.LinkWidthDowngrade.RxActive < portp->PortInfo.LinkWidth.Active ? + StlLinkWidthToInt(portp->PortInfo.LinkWidth.Active) - + StlLinkWidthToInt(portp->PortInfo.LinkWidthDowngrade.RxActive) : 0) << 4); } } diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 5d4217b..caa9089 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.4.0.0 -Release: 173%{?dist} +Release: 196%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
1e057203a1f234b35024f2325dbc442a4ee1fcfd
01org/opa-fm
Improve dependencies in spec file; fix compile with new gcc
commit 1e057203a1f234b35024f2325dbc442a4ee1fcfd Author: Scott Breyer <[email protected]> Date: Thu May 5 06:16:17 2016 -0400 Improve dependencies in spec file; fix compile with new gcc diff --git a/Esm/ib/include/cs_hashtable.h b/Esm/ib/include/cs_hashtable.h index 4bce7a2..610ae90 100644 --- a/Esm/ib/include/cs_hashtable.h +++ b/Esm/ib/include/cs_hashtable.h @@ -91,10 +91,6 @@ * */ -#ifndef INLINE -# define INLINE extern inline -#endif - typedef enum { CS_HASH_KEY_NOT_ALLOCATED, CS_HASH_KEY_ALLOCATED @@ -245,7 +241,7 @@ valuetype * fncname (CS_HashTablep h, keytype *k) \ * @param h the hashtable * @return the number of items stored in the hashtable */ -INLINE uint32_t +static __inline uint32_t cs_hashtable_count(CS_HashTablep h) { return h->entrycount; @@ -281,7 +277,7 @@ int32_t cs_hashtable_change(CS_HashTablep h, void *k, void *v); * cs_hashtable_iterator */ -INLINE void +static __inline void cs_hashtable_iterator(CS_HashTablep h, CS_HashTableItr_t *itr) { itr->h = h; itr->e = h->listHead; @@ -292,7 +288,7 @@ cs_hashtable_iterator(CS_HashTablep h, CS_HashTableItr_t *itr) { * - return the value of the (key,value) pair at the current position */ -INLINE void * +static __inline void * cs_hashtable_iterator_key(CS_HashTableItrp i) { return i->e->k; @@ -302,7 +298,7 @@ cs_hashtable_iterator_key(CS_HashTableItrp i) * value - return the value of the (key,value) pair at the current position */ -INLINE void * +static __inline void * cs_hashtable_iterator_value(CS_HashTableItrp i) { return i->e->v; @@ -313,7 +309,7 @@ cs_hashtable_iterator_value(CS_HashTableItrp i) * returns zero if advanced to end of table */ -INLINE int32_t +static __inline int32_t cs_hashtable_iterator_advance(CS_HashTableItrp itr) { if (itr->e != NULL) return (itr->e = itr->e->listNext) == NULL ? 0 : -1; diff --git a/opafm.spec b/opafm.spec index af47596..306979c 100644 --- a/opafm.spec +++ b/opafm.spec @@ -38,20 +38,21 @@ License: BSD Url: http://www.intel.com/ Source0: %{name}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +ExclusiveArch: x86_64 Requires: rdma #BuildRequires: libibverbs-devel >= 1.1-1, libibumad-devel, libibmad-devel AutoReq: no -%if 0%{?rhel} -BuildRequires: expat-devel -Requires: expat, libibmad, libibumad, libibverbs +%if 0%{?rhel} || 0%{?fedora} +BuildRequires: expat-devel, libibumad-devel, libibverbs-devel, libibmad-devel, openssl-devel +Requires: expat, libibmad, libibumad, libibverbs, openssl %else -Requires: libexpat1, libibmad5, libibumad, libibverbs1 -BuildRequires: libexpat-devel +Requires: libexpat1, libibmad5, libibumad, libibverbs1, openssl +BuildRequires: libexpat-devel, libibumad-devel, libibverbs-devel, libibmad5-devel, libopenssl-devel %endif -%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7 +%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7 || 0%{?fedora} BuildRequires: systemd %{?systemd_requires} %{?BuildRequires} Requires: systemd %{?systemd_requires} %else @@ -116,8 +117,8 @@ install -D stage.rpm/opafm.xml $RPM_BUILD_ROOT/opt/opafm/etc/opafm.xml install -D stage.rpm/opaxmlextract $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlextract install -D stage.rpm/opaxmlfilter $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlfilter -install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample -install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample +#install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample +#install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s /opt/opafm/bin/fm_cmd $RPM_BUILD_ROOT%{_sbindir}/opafmcmd @@ -157,7 +158,7 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* -/opt/opafm/samples/* +#/opt/opafm/samples/* %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall
0
dcce22ef26d11e788666e578704c57ff6476e9ff
01org/opa-fm
Update to latest from build 10.9.2.0.7 (IFS 10.9.2.0.9)
commit dcce22ef26d11e788666e578704c57ff6476e9ff Author: Scott Breyer <[email protected]> Date: Mon Apr 15 12:02:40 2019 -0400 Update to latest from build 10.9.2.0.7 (IFS 10.9.2.0.9) diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 862da3a..894674d 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -894,8 +894,9 @@ sub install_opa_stack($$) # do the following before we set any system env vars if ( $Default_SameAutostart ) { - # set env vars to -1, so we will keep previous config - set_opascript_env_vars(-1); + # set env vars to -1 for SRP and SRPT, so we keep the autostart option + setup_env("OPA_SRP_LOAD", -1); + setup_env("OPA_SRPT_LOAD", -1); } #override the udev permissions. diff --git a/CommonInstall/do_mvapich2_build.sh b/CommonInstall/do_mvapich2_build.sh index d74d256..6d85cb7 100755 --- a/CommonInstall/do_mvapich2_build.sh +++ b/CommonInstall/do_mvapich2_build.sh @@ -548,7 +548,9 @@ logfile=make.mvapich2.$interface.$compiler exit 1;; esac - pref_env= + # HWLOC component auto detects CUDA and will use it if found on the system + # So, tell HWLOC to ignore CUDA: enable_gl=no + pref_env="enable_gl=no" if [ "$STACK_PREFIX" != "/usr" ] then pref_env="$pref_env LD_LIBRARY_PATH=$STACK_PREFIX/lib64:$STACK_PREFIX/lib:\$LD_LIBRARY_PATH" diff --git a/CommonInstall/do_openmpi_build.sh b/CommonInstall/do_openmpi_build.sh index ffc0367..6e68fd4 100755 --- a/CommonInstall/do_openmpi_build.sh +++ b/CommonInstall/do_openmpi_build.sh @@ -606,7 +606,12 @@ logfile=make.openmpi.$interface.$compiler if [ "$Cflag" = y ] then - pref_env = "$pref_env MPI_STRESS_CUDA=1" + pref_env="$pref_env MPI_STRESS_CUDA=1" + else + # HWLOC component auto detects CUDA and will use it even if it is NOT + # a CUDA OMPI build. So, tell HWLOC to ignore CUDA (if found on the system) + # when not creating a CUDA build. + pref_env="$pref_env enable_gl=no" fi cmd="$pref_env rpmbuild --rebuild \ diff --git a/CommonInstall/util_init.pl b/CommonInstall/util_init.pl index 4b38354..9c329c2 100755 --- a/CommonInstall/util_init.pl +++ b/CommonInstall/util_init.pl @@ -440,20 +440,6 @@ sub default_opascripts_env_vars() setup_env("OPA_IRQBALANCE", 1); } -# set the env vars for ALL opa-scripts system env variables. Use this subroutine with caution because it will set ALL -# the env vars. The typical use case for the routine is seting all vars to -1, so opa-scripts will skip config on them. -# This is useful when we intend to keep previous conf. -sub set_opascript_env_vars($) -{ - my $env_value = shift(); - setup_env("OPA_UDEV_RULES", $env_value); - setup_env("OPA_LIMITS_CONF", $env_value); - setup_env("OPA_ARPTABLE_TUNING", $env_value); - setup_env("OPA_SRP_LOAD", $env_value); - setup_env("OPA_SRPT_LOAD", $env_value); - setup_env("OPA_IRQBALANCE", $env_value); -} - # this will be replaced in component specific INSTALL with any special # overrides of things in main*pl sub overrides() diff --git a/Esm/build.env b/Esm/build.env index ef7464f..4248b06 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_1_0_14 +export RELEASE_TAG=10_9_2_0_7 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 3d10f2a..38d339f 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 02/05/19 16:23 Tag: VIEO_HOST_LINUX_opa-10_9_10_9_1_0_14 +Build of VIEO_HOST 03/07/19 00:03 Tag: VIEO_HOST_LINUX_opa-10_9_10_9_2_0_7 diff --git a/Esm/ib/src/linux/opafmvf/cmd_mgmt.c b/Esm/ib/src/linux/opafmvf/cmd_mgmt.c index 3348e59..da53dad 100644 --- a/Esm/ib/src/linux/opafmvf/cmd_mgmt.c +++ b/Esm/ib/src/linux/opafmvf/cmd_mgmt.c @@ -35,7 +35,11 @@ #include <signal.h> #include <string.h> #include <unistd.h> - +#include <stdio.h> +#include <regex.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <limits.h> extern const char* default_dg_dir; extern const char* default_vf_dir; @@ -58,7 +62,7 @@ const char* cmd_reset_help = const char* cmd_commit_help = "Usage:\n" - " opafmvf commit [-p path] [-o path] [-b] [-f]\n" + " opafmvf commit [-p path] [-o path] [-b] [-f] [-s]\n" " opafmvf commit --help\n" "\n" " --help - produce full help text\n" @@ -68,6 +72,7 @@ const char* cmd_commit_help = " default: /etc/opa-fm/opafm.xml\n" " -b/--backup - backup old output XML file if exists\n" " -f/--force - do not prompt\n" + " -s/--skip-check - Skip validation check on output. Speeds up command considerably\n" "\n" "Generate new configuration for OPA FM basing on the preprocess file and\n" "configuration files from /etc/opa-fm/vfs and /etc/opa-fm/dgs directories.\n" @@ -128,6 +133,7 @@ const char* cmd_restart_usage = const char* default_opafm_config = "/etc/opa-fm/opafm.xml"; +const char* default_ppfile = "/etc/opa-fm/opafm_pp.xml"; static int @@ -261,13 +267,153 @@ error: return status; } + +static int dump_vfdg_files(FILE *out_file, char *dir_name) +{ + struct dirent *dp; + DIR *dir = opendir(dir_name); + if(dir == NULL){ + log_error("Failed to open input directory %s: %s\n", dir_name, strerror(errno)); + return 1; + } + + while ((dp=readdir(dir))) + { + char* file_name = StringConcat(dir_name, "/",dp->d_name, NULL); + if (!file_name) + die("Out of memory"); + + if (dp->d_type == DT_REG) { + FILE *in_file = fopen(file_name, "r"); + if(!in_file){ + log_error("Failed to open input file %s: %s\n", file_name, strerror(errno)); + free(file_name); + closedir(dir); + return 1; + } + + char *line = NULL; + size_t len= 0; + ssize_t n_read = 0; + while((n_read = getline(&line, &len, in_file)) != -1) { + fwrite(line, n_read, 1, out_file); + } + fclose(in_file); + } + free(file_name); + } + closedir(dir); + return 0; +} + + +static int commit_file(FILE *in_file, FILE *out_file) +{ + char *line = NULL; + size_t len = 0; + ssize_t n_read = 0; + + /*keep first line at top*/ + n_read = getline(&line, &len, in_file); + fwrite(line, n_read, 1, out_file); + + /*write metadata to file*/ + fprintf(out_file,"<!-- Generated file. Do not edit. -->\n"); + time_t epoch_time; + char date[26]; + struct tm* tm_info; + time(&epoch_time); + tm_info = localtime(&epoch_time); + if(tm_info) { + strftime(date, 26, "%Y-%m-%d %H:%M:%S", tm_info); + fprintf(out_file,"<!-- Generated Date: %s -->\n", date); + } + + /* Process input file and insert VF/DG includes */ + char *pattern = "^[[:space:]]*<[!]--[[:space:]]*INCLUDE:.._DIR=\\(.*\\)[[:space:]]*-->.*"; + regex_t regex; + regmatch_t regmatch[2]; + regcomp(&regex, pattern, 0); + + while((n_read = getline(&line, &len, in_file)) != -1) { + + if(regexec(&regex, line, 2, regmatch, 0) == 0){ + char dir_name[PATH_MAX]; + if(regmatch[1].rm_eo - regmatch[1].rm_so >= PATH_MAX){ + log_error("Path name is too long\n"); + free(line); + regfree(&regex); + return 1; + } + + StringCopy(dir_name, &line[regmatch[1].rm_so], regmatch[1].rm_eo - regmatch[1].rm_so); + printf("Processing files in %s\n", dir_name); + if(dump_vfdg_files(out_file, dir_name)){ + regfree(&regex); + free(line); + return 1; + } + } else { + fwrite(line, n_read, 1, out_file); + } + } + + regfree(&regex); + free(line); + return 0; +} + +static int commit_check(char *output_temp, const char *output) +{ + size_t len = 0; + ssize_t n_read = 0; + char *line = NULL; + char* cmd = StringConcat("/usr/lib/opa-fm/bin/config_check -c ", output_temp, " -s 2>&1",NULL); + if (!cmd) + die("Out of memory"); + fflush(stdout); + FILE *config_check_pipe = popen(cmd, "r"); + free(cmd); + if(!config_check_pipe){ + log_error("Failed to open pipe to Config Check utility\n"); + return 1; + } + char *output_check = StringConcat(output,".check",NULL); + if (!output_check) + die("Out of memory"); + FILE *config_check_out_file = fopen(output_check,"w"); + if(!config_check_out_file){ + log_error("Failed to open output temp file %s: %s\n", output_check, strerror(errno)); + free(output_check); + pclose(config_check_pipe); + return 1; + } + free(output_check); + while((n_read = getline(&line, &len, config_check_pipe)) != -1) { + fwrite(line, n_read, 1, config_check_out_file); + fprintf(stderr, "%s",line); + } + free(line); + fclose(config_check_out_file); + int cmd_status = pclose(config_check_pipe); + if(cmd_status){ + log_error("Error: Config Check Failed: Review %s.check\n", output); + return 1; + } + log_info("Config Check Passed!\n"); + + return 0; +} + + CmdStatus cmd_commit(int argc, char* argv[]) { - const char* ppfile = NULL; + const char* ppfile = default_ppfile; const char* output = default_opafm_config; bool backup = false; bool force = false; + bool skip_check = false; /* parse options */ static struct option long_options[] = { @@ -275,13 +421,14 @@ cmd_commit(int argc, char* argv[]) {"output", required_argument, 0, 'o'}, {"backup", no_argument, 0, 'b'}, {"force", no_argument, 0, 'f'}, + {"skip-check", no_argument, 0, 's'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; optind = 0; while (true) { - int c = getopt_long(argc, argv, "p:o:bf", long_options, NULL); + int c = getopt_long(argc, argv, "p:o:bfs", long_options, NULL); if (c == -1) break; @@ -301,6 +448,9 @@ cmd_commit(int argc, char* argv[]) case 'f': force = true; break; + case 's': + skip_check = true; + break; default: print_usage(cmd_commit_usage); return CMD_STATUS_INVARG; @@ -325,12 +475,13 @@ cmd_commit(int argc, char* argv[]) goto error; } - /* check output file exists, if so prompt user */ - if (!force) { - if (access(output, F_OK) == 0) { + /* check if output file exists, if so prompt user */ + if (access(output, F_OK) == 0) { + if(!force) { fprintf(stdout, "%s will be overwritten!\n", output); fprintf(stdout, "Do you want to continue? [y/N] "); fflush(stdout); + fflush(stderr); if (!prompt_user()) { status = CMD_STATUS_CANNOT_PERFORM; goto error; @@ -338,32 +489,76 @@ cmd_commit(int argc, char* argv[]) } } - /* construct command line for opafmconfigpp */ - const char* main_cmd = "opafmconfigpp -f"; - const char* opt_1 = (ppfile) ? " -p" : ""; - const char* opt_1_val = (ppfile) ? ppfile : ""; - const char* opt_2 = (output) ? " -o" : ""; - const char* opt_2_val = (output) ? output : ""; - const char* opt_3 = (backup) ? " -b" : ""; - - char* cmd = StringConcat(main_cmd, opt_1, opt_1_val, opt_2, opt_2_val, opt_3, NULL); - if (!cmd) + FILE *in_file = fopen(ppfile, "r"); + if(!in_file){ + log_error("Failed to open input file %s: %s\n", ppfile, strerror(errno)); + status = CMD_STATUS_CANNOT_PERFORM; + goto error; + } + char *output_temp = StringConcat(output,".tmp",NULL); + if (!output_temp) die("Out of memory"); + FILE *out_file = fopen(output_temp, "w"); + if(!out_file){ + log_error("Failed to open output file %s: %s\n", output, strerror(errno)); + fclose(in_file); + status = CMD_STATUS_CANNOT_PERFORM; + free(output_temp); + goto error; + } + + if(commit_file(in_file, out_file)){ + fclose(in_file); + fclose(out_file); + status = CMD_STATUS_CANNOT_PERFORM; + free(output_temp); + goto error; + } - /* execute opafmconfigpp */ - int cmd_status = exec_cmd(cmd); + fclose(in_file); + fclose(out_file); - free(cmd); + if(!skip_check){ + if(commit_check(output_temp, output)){ + status = CMD_STATUS_CANNOT_PERFORM; + free(output_temp); + goto error; + } + } - if (cmd_status) { - log_fatal("Could not generate a new configuration for fabric manager"); + + /* backup old config file if it exists */ + if (access(output, F_OK) == 0 && backup) { + char* backup_name = StringConcat(output, ".bak", NULL); + if (!backup_name) + die("out of memory"); + if(rename(output, backup_name) != 0){ + free(output_temp); + free(backup_name); + log_error("Failed to backup file: %s\n", strerror(errno)); + status = CMD_STATUS_CANNOT_PERFORM; + goto error; + } + free(backup_name); + log_info("Generated backup file %s.bak", output); + } + + + /* Make temp file permanent */ + if(rename(output_temp, output) != 0){ + free(output_temp); + log_error("Failed to rename temp file: %s\n", strerror(errno)); status = CMD_STATUS_CANNOT_PERFORM; goto error; } + free(output_temp); log_info("Generated new configuration for fabric manager"); error: + + if(status != CMD_STATUS_OK) + log_fatal("Could not generate a new configuration for fabric manager"); program_lock_release(lock); return status; diff --git a/Esm/runmake b/Esm/runmake index d3779f7..a8d46e7 100755 --- a/Esm/runmake +++ b/Esm/runmake @@ -215,6 +215,12 @@ fi showenv echo "---------------------------------------" +# To run thew klocwork scans using klocwork_analyze script, it requires OPA_FEATURE_SET and BUILD_TARGET_OS_ID +# Copying the required variables to $TL_DIR/$PRODUCT_DIRNAME/klocwork.env +if [ "$KW_ENABLE" = "yes" ]; then + echo "export OPA_FEATURE_SET=${OPA_FEATURE_SET}" >> $TL_DIR/$PRODUCT_DIRNAME/klocwork.env + echo "export BUILD_TARGET_OS_ID=${BUILD_TARGET_OS_ID}" >> $TL_DIR/$PRODUCT_DIRNAME/klocwork.env +fi echo "build for: $BUILD_TARGET" echo "Stack to build for: $BUILD_WITH_STACK ($OFED_STACK_PREFIX)" diff --git a/MakeTools/ltsign b/MakeTools/ltsign deleted file mode 100755 index b7469aa..0000000 Binary files a/MakeTools/ltsign and /dev/null differ diff --git a/opa-fm.spec.in b/opa-fm.spec.in index ff07fda..80aadf4 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.1.0 -Release: 14%{?dist} +Version: 10.9.2.0 +Release: 7%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.1.0.14%{?dist} +IFSComponent: FM 10.9.2.0.7%{?dist} %prep %setup -q -c
0
6f1eb4579fc975a1e9e7f669a8afbf6569d09dd3
01org/opa-fm
Update to latest from build 10.12.1.0.6 (IFS 10.12.1.0.7)
commit 6f1eb4579fc975a1e9e7f669a8afbf6569d09dd3 Author: Greg Kresge <[email protected]> Date: Mon Feb 27 11:40:03 2023 -0500 Update to latest from build 10.12.1.0.6 (IFS 10.12.1.0.7) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index 9412fb2..5c5a7d8 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -106,6 +106,7 @@ CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL77.pl \ comp_ff_of_prereq_RHEL84.pl \ comp_ff_of_prereq_RHEL85.pl \ comp_ff_of_prereq_RHEL86.pl \ + comp_ff_of_prereq_RHEL9.pl \ comp_ff_of_prereq_SLES123.pl \ comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl \ @@ -121,6 +122,7 @@ CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL77.pl \ comp_fm_prereq_RHEL84.pl \ comp_fm_prereq_RHEL85.pl \ comp_fm_prereq_RHEL86.pl \ + comp_fm_prereq_RHEL9.pl \ comp_fm_prereq_SLES123.pl \ comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl \ @@ -162,6 +164,7 @@ FF_FILES = comp_ff_of_prereq_RHEL77.pl \ comp_ff_of_prereq_RHEL84.pl \ comp_ff_of_prereq_RHEL85.pl \ comp_ff_of_prereq_RHEL86.pl \ + comp_ff_of_prereq_RHEL9.pl \ comp_ff_of_prereq_SLES123.pl \ comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl \ @@ -178,6 +181,7 @@ FM_FILES = comp_fm_prereq_RHEL77.pl \ comp_fm_prereq_RHEL84.pl \ comp_fm_prereq_RHEL85.pl \ comp_fm_prereq_RHEL86.pl \ + comp_fm_prereq_RHEL9.pl \ comp_fm_prereq_SLES123.pl \ comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl \ diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 10119ea..29cccef 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -93,6 +93,7 @@ my @delta_kernel_srpms_rhel83 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel84 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel85 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel86 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel9 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # This provides information for all kernel srpms @@ -184,6 +185,8 @@ sub init_delta_info($) } } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel86 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES9" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel9 ); } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel85 ); } elsif ( "$CUR_VENDOR_VER" eq "ES84" ) { @@ -830,6 +833,9 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES9" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -1202,6 +1208,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES9" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES123" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); diff --git a/CommonInstall/comp_delta_prereq_RHEL9.pl b/CommonInstall/comp_delta_prereq_RHEL9.pl new file mode 100644 index 0000000..a0c18c6 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL9.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python3", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL9.pl b/CommonInstall/comp_ff_of_prereq_RHEL9.pl new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL9.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL9.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL9.pl.base new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL9.pl.base @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL9.pl b/CommonInstall/comp_fm_prereq_RHEL9.pl new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL9.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL9.pl.base b/CommonInstall/comp_fm_prereq_RHEL9.pl.base new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL9.pl.base @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/do_mvapich2_build.sh b/CommonInstall/do_mvapich2_build.sh index 58cd8ee..fac78c6 100755 --- a/CommonInstall/do_mvapich2_build.sh +++ b/CommonInstall/do_mvapich2_build.sh @@ -28,7 +28,7 @@ # # END_ICS_COPYRIGHT8 **************************************** -# This file incorporates work covered by the following copyright and permission notice +# This file incorporates work covered by the following copyright and permission notice #[ICS VERSION STRING: unknown] @@ -73,7 +73,8 @@ else fi if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID > 7.3" | bc -l) == 1 ) || \ - ( "$ID" == "sles" && $(echo "$VERSION_ID > 12.2" | bc -l) == 1 ) ]]; then + ( "$ID" == "sles" && $(echo "$VERSION_ID > 12.2" | bc -l) == 1 ) || \ + ( "$ID" == "rocky") ]]; then PREREQ=("rdma-core-devel" "mpi-selector") else PREREQ=("libibverbs-devel" "librdmacm-devel" "mpi-selector") @@ -103,7 +104,7 @@ CheckPreReqs() fi echo exit 2 - fi + fi } Usage() @@ -324,7 +325,7 @@ then choices+=("opa-psm2") PS3="Select MVAPICH2 Transport: " fi - if [ ${#choices[@]} -gt 0 ] + if [ ${#choices[@]} -gt 0 ] then select mvapich2_conf_impl in ${choices[*]} do @@ -426,16 +427,21 @@ then export CFLAGS="-m64 -g -O2" export CPPFLAGS="-m64 -g -O2" export CXXFLAGS="-m64 -g -O2" - export FFLAGS="-m64 -g -O2" export FCFLAGS="-m64 -g -O2" export LDLIBS="-m64 -g -O2 -L/usr/lib64 -L/usr/X11R6/lib64" else + if [[ ( "$ID" == "rocky" && $(echo "$VERSION_ID >= 9.0" | bc -l) == 1 ) || \ + ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 9.0" | bc -l) == 1 ) ]]; then + export CFLAGS="-fcommon" + export FFLAGS="-fallow-argument-mismatch" + else + unset CFLAGS + unset FFLAGS + fi # just to be safe - unset LDFLAGS - unset CFLAGS - unset CPPFLAGS - unset CXXFLAGS - unset FFLAGS + unset LDFLAGS + unset CPPFLAGS + unset CXXFLAGS unset FCFLAGS unset LDLIBS fi @@ -514,8 +520,12 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="gfortran -m64" FC="gfortran -m64"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=gfortran FC=gfortran' - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then - mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" + if [[ ( "$ID" == "rocky" ) || ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then + if [[ ( $(echo "$VERSION_ID >= 9.0" | bc -l) == 1 ) ]]; then + mvapich2_comp_env="$mvapich2_comp_env CFLAGS=\"-fPIC -fcommon\"" + else + mvapich2_comp_env="$mvapich2_comp_env CFLAGS=\"-fPIC\"" + fi fi fi else @@ -524,9 +534,13 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="g77 -m64" FC="/bin/false"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=g77 FC=/bin/false' - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then - mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" - fi + if [[ ( "$ID" == "rocky" ) || ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then + if [[ ( $(echo "$VERSION_ID >= 9.0" | bc -l) == 1 ) ]]; then + mvapich2_comp_env="$mvapich2_comp_env CFLAGS=\"-fPIC -fcommon\"" + else + mvapich2_comp_env="$mvapich2_comp_env CFLAGS=\"-fPIC\"" + fi + fi fi fi;; @@ -545,7 +559,7 @@ logfile=make.mvapich2.$interface.$compiler intel) disable_auto_requires="--define 'disable_auto_requires 1'" - if [ "$mvapich2_conf_shared_libs" = 1 ] + if [ "$mvapich2_conf_shared_libs" = 1 ] then mvapich2_comp_env='CC=icc CXX=icpc F77=ifort FC=ifort' else @@ -667,7 +681,7 @@ logfile=make.mvapich2.$interface.$compiler echo "error: mpitests_mvapich2_$compiler$mvapich2_rpm_suffix Build ERROR: bad exit code" exit 1 fi - + if [ "$iflag" = n ] then mv $RPM_DIR/RPMS/$target_cpu/mpitests_mvapich2_$compiler$mvapich2_rpm_suffix-$mpitests_fullversion.$target_cpu.rpm $DESTDIR diff --git a/CommonInstall/do_openmpi_build.sh b/CommonInstall/do_openmpi_build.sh index e6e16b4..2f6d180 100755 --- a/CommonInstall/do_openmpi_build.sh +++ b/CommonInstall/do_openmpi_build.sh @@ -2,6 +2,7 @@ # BEGIN_ICS_COPYRIGHT8 **************************************** # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2022, Cornelis Networks # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -63,6 +64,8 @@ ID="" VERSION_ID="" +DEF_CONFIG_OPTIONS='--with-hwloc=internal --with-libevent=internal --with-pmix=internal' + if [ -e /etc/os-release ]; then . /etc/os-release if [[ "$ID" == "sle_hpc" ]]; then @@ -124,7 +127,7 @@ Usage() echo " VERSION is openmpi version (eg. 1.0.0)" >&2 echo " CONFIG_OPTIONS - additional OpenMPI configuration options to be" >&2 echo " specified via configure_options parameter to srpm" >&2 - echo " Default is ''" >&2 + echo " Default is '$DEF_CONFIG_OPTIONS'" >&2 echo " INSTALL_ROOT - location of system image in which to install." >&2 echo " Default is '/'" >&2 echo "" >&2 @@ -308,7 +311,7 @@ fi # if -d (skip_prompt) the only option provided, ./configure will run with # no paramters and build what is auto-detected -openmpi_conf_psm='' +openmpi_conf='' # we no longer supports verbs. openmpi_verbs='--enable-mca-no-build=btl-openib --without-verbs' @@ -316,7 +319,7 @@ openmpi_verbs='--enable-mca-no-build=btl-openib --without-verbs' if [ "$Qflag" = y ] then PREREQ+=('infinipath-psm-devel') - openmpi_conf_psm='--with-psm=/usr ' + openmpi_conf='--with-psm=/usr ' # PSM indicated by qlc suffix so user can ID PSM vs OFI or PSM2 MPIs openmpi_path_suffix="-qlc" openmpi_rpm_suffix="_qlc" @@ -326,7 +329,7 @@ fi if [ "$Oflag" = y ] then PREREQ+=('libpsm2-devel' 'libfabric-devel') - openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-libfabric=/usr " + openmpi_conf=" $openmpi_conf --with-psm2=/usr --with-libfabric=/usr " # PSM2 indicated by hfi suffix so user can ID from PSM or OFI MPIs openmpi_path_suffix="-hfi" openmpi_rpm_suffix="_hfi" @@ -336,7 +339,7 @@ fi if [ "$Cflag" = y ] then PREREQ+=('libpsm2-devel' 'cuda-cudart-dev') - openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-cuda=/usr/local/cuda " + openmpi_conf=" $openmpi_conf --with-psm2=/usr --with-cuda=/usr/local/cuda " # CUDA indicated by -cuda suffix so user can ID from PSM2 without cuda, PSM or OFI MPIs openmpi_path_suffix="-cuda-hfi" openmpi_rpm_suffix="_cuda_hfi" @@ -377,7 +380,7 @@ logfile=make.openmpi.$interface.$compiler mpitests_version=$(ls $mpitests_srpm 2>/dev/null|head -1|cut -f2 -d-) mpitests_fullversion=$(ls $mpitests_srpm 2>/dev/null|head -1|cut -f2- -d-|sed -e 's/.src.rpm//') MPICH_PREFIX=${MPICH_PREFIX:-$STACK_PREFIX/mpi/$compiler/openmpi-$openmpi_version$openmpi_path_suffix} - CONFIG_OPTIONS=${CONFIG_OPTIONS:-""} + CONFIG_OPTIONS=${CONFIG_OPTIONS:-${DEF_CONFIG_OPTIONS}} if [ x"$openmpi_version" = x"" ] then @@ -437,7 +440,7 @@ logfile=make.openmpi.$interface.$compiler case "$compiler" in gcc) - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then + if [[ ( "$ID" == "rocky" ) || ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=\"-O3 -fPIC\"" else openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=-O3" @@ -453,9 +456,9 @@ logfile=make.openmpi.$interface.$compiler openmpi_comp_env="$openmpi_comp_env F77=gfortran FC=gfortran" elif have_comp g77 then - openmpi_comp_env="$openmpi_comp_env F77=g77 --disable-mpi-f90" + openmpi_comp_env="$openmpi_comp_env F77=g77 " else - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f77 --disable-mpi-f90" + openmpi_comp_env="$openmpi_comp_env --disable-mpi-fortran" fi;; pathscale) @@ -471,7 +474,7 @@ logfile=make.openmpi.$interface.$compiler then openmpi_comp_env="$openmpi_comp_env F77=pathf90 FC=pathf90" else - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f77 --disable-mpi-f90" + openmpi_comp_env="$openmpi_comp_env --disable-mpi-fortran" fi # test for fedora core 6 or redhat EL5 if { [ -f /etc/fedora-release ] && { uname -r|grep fc6; }; } \ @@ -496,13 +499,13 @@ logfile=make.openmpi.$interface.$compiler then openmpi_comp_env="$openmpi_comp_env F77=pgf77" else - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f77" + openmpi_comp_env="$openmpi_comp_env --disable-mpi-fortran" fi if have_comp pgf90 then openmpi_comp_env="$openmpi_comp_env FC=pgf90 FCFLAGS=-O2" else - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f90" + openmpi_comp_env="$openmpi_comp_env --disable-mpi-fortran" fi;; intel) @@ -518,7 +521,7 @@ logfile=make.openmpi.$interface.$compiler then openmpi_comp_env="$openmpi_comp_env F77=ifort FC=ifort" else - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f77 --disable-mpi-f90" + openmpi_comp_env="$openmpi_comp_env --disable-mpi-fortran" fi;; *) @@ -565,7 +568,7 @@ logfile=make.openmpi.$interface.$compiler --define '_defaultdocdir $MPICH_PREFIX/doc/..' \ --define '_mandir %{_prefix}/share/man' \ --define 'mflags -j 4' \ - --define 'configure_options $CONFIG_OPTIONS $openmpi_ldflags $openmpi_comp_env $openmpi_conf_psm --with-devel-headers --disable-oshmem $openmpi_verbs' \ + --define 'configure_options $CONFIG_OPTIONS $openmpi_ldflags $openmpi_comp_env $openmpi_conf --with-devel-headers --disable-oshmem $openmpi_verbs' \ --define 'use_default_rpm_opt_flags $use_default_rpm_opt_flags' \ $disable_auto_requires" cmd="$cmd \ @@ -604,6 +607,7 @@ logfile=make.openmpi.$interface.$compiler echo "Building test programs $mpitests_version for OpenMPI MPI $openmpi_version..." # mpitests uses buildroot instead of build_root, play it safe for future # and define both + export LD_LIBRARY_PATH=$MPICH_PREFIX/lib64:$LD_LIBRARY_PATH cmd="$pref_env rpmbuild --rebuild \ --define '_topdir $RPM_DIR' \ --buildroot '$BUILD_ROOT' \ diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 2f80c07..2a870e2 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -108,6 +108,8 @@ my @Components_rhel85 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel86 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); +my @Components_rhel9 = ( "opa_stack", "mpi_selector", + @OmniPathAllComponents ); @Components = ( ); @@ -224,7 +226,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ "opa-basic-tools", "opa-address-resolution" ], + UserRpms => [ "opa-basic-tools", "opa-address-resolution", "opa-address-resolution-devel" ], DebugRpms => [ ], HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", # TBD @@ -254,7 +256,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ "opa-fastfabric", "opa-mpi-apps" ], + UserRpms => [ "opa-fastfabric", "opa-mpi-apps", "opa-snapconfig" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", @@ -1075,6 +1077,36 @@ my %intel_hfi_rhel86_comp_info = ( }, ); +my %intel_hfi_rhel9_comp_info = ( + "intel_hfi" => { Name => "Cornelis HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./CornelisOPX-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ #"libhfi1", "libhfi1-static", + "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ #"hfi1_debuginfo", + "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", #"libhfi1-debuginfo" + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); + # For SLES12sp3 that has different name for libpsm2 my %intel_hfi_sles123_comp_info = ( "intel_hfi" => { Name => "Cornelis HFI Components", @@ -1477,6 +1509,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES9" ) { + @Components = ( @Components_rhel9 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_rhel85_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @Components_sles15 ); @SubComponents = ( @SubComponents_newer ); diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index d6ecdb2..679a2f4 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -111,6 +111,10 @@ my @delta_Components_rhel86 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_rhel9 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_sles15 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -179,6 +183,8 @@ sub overrides() @Components = ( @delta_Components_rhel85 ); } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { @Components = ( @delta_Components_rhel86 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES9" ) { + @Components = ( @delta_Components_rhel9 ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @delta_Components_sles15 ); } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index c5bd12d..0ad46db 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -143,6 +143,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES86" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL86.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES9" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL9.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES123" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES123.pl endif diff --git a/Esm/build.env b/Esm/build.env index 8438d4a..f85a8db 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_11_2_0_3 +export RELEASE_TAG=10_12_1_0_6 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 091b593..f108be5 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 08/29/22 12:13 Tag: VIEO_HOST_LINUX_opa-10_11_10_11_2_0_3 +Build of VIEO_HOST 12/01/22 16:53 Tag: VIEO_HOST_LINUX_opa-10_12_10_12_1_0_6 diff --git a/Esm/ib/src/config/fm_xml.c b/Esm/ib/src/config/fm_xml.c index 43b7e6d..a2aef23 100644 --- a/Esm/ib/src/config/fm_xml.c +++ b/Esm/ib/src/config/fm_xml.c @@ -4685,13 +4685,6 @@ VirtualFabrics_t* reRenderVirtualFabricsConfig(uint32_t fm, VirtualFabrics_t *ol "or PA Service ID configured in an Application", cfgtype, vfip->name); goto fail; } - // make sure that either All or AllMgmtAllowed is included in Admin fabric - this rule was added - // to make sure IBTA works for PR112665 - if (!is_all_or_allmgmt_full) { - RENDER_VF_LOGGER(printError, "%s: VF(%s) must have <Select>All</Select> or <Select>AllMgmtAllowed</Select> configured in a Member", - cfgtype, vfip->name); - goto fail; - } } else if (vfip->apps.select_sa || checkVFSID(vfip, STL_PM_SERVICE_ID) || vfip->apps.select_pm diff --git a/Esm/ib/src/smi/sa/sa_McMemberRecord.c b/Esm/ib/src/smi/sa/sa_McMemberRecord.c index 9e83d51..6359fce 100644 --- a/Esm/ib/src/smi/sa/sa_McMemberRecord.c +++ b/Esm/ib/src/smi/sa/sa_McMemberRecord.c @@ -1119,17 +1119,6 @@ sa_McMemberRecord_Set(Topology_t *topop, Mai_t *maip, uint32_t *records) goto done; } - if (VirtualFabrics != NULL && VirtualFabrics->securityEnabled && - bitset_test_intersection(&mcGroup->vfMembers, &req_portp->portData->fullPKeyMember) == 0) { - maip->base.status = MAD_STATUS_SA_REQ_INVALID; - IB_LOG_ERROR_FMT_VF( vfp, __func__, "Failing group join request for PortGUID "FMT_U64 - " from %s Port %d, PortGUID "FMT_U64", LID 0x%08X because it is not a full member of virtual fabric with MGid "FMT_GID, - portp->portData->guid, - req_nodeName, req_portp->index, req_portp->portData->guid, - maip->addrInfo.slid, mGid[0], mGid[1]); - goto done; - } - mcmp->MLID = mcGroup->mLid; mcmp->MtuSelector = IB_SELECTOR_EQ; mcmp->Mtu = mcGroup->mtu; diff --git a/Esm/ib/src/smi/sm/sm_partMgr.c b/Esm/ib/src/smi/sm/sm_partMgr.c index 07fcbb2..0762ab2 100644 --- a/Esm/ib/src/smi/sm/sm_partMgr.c +++ b/Esm/ib/src/smi/sm/sm_partMgr.c @@ -418,6 +418,17 @@ Status_t sm_set_delayed_pkeys(void) SmpAddr_t addr = SMP_ADDR_CREATE_LR(sm_lid, lidportp->portData->lid); + /* Sanity Check, Make sure at least Default Pkey(s) are present */ + if (nodep->nodeInfo.NodeType == STL_NODE_SW) { + if (portp->portData->pPKey[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 == 0) + portp->portData->pPKey[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 = STL_DEFAULT_CLIENT_PKEY; + if (portp->portData->pPKey[STL_DEFAULT_FM_PKEY_IDX].AsReg16 == 0) + portp->portData->pPKey[STL_DEFAULT_FM_PKEY_IDX].AsReg16 = STL_DEFAULT_FM_PKEY; + } else if (portp->portData->pPKey[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 == 0 && + portp->portData->pPKey[STL_DEFAULT_FM_PKEY_IDX].AsReg16 == 0) { + portp->portData->pPKey[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 = STL_DEFAULT_CLIENT_PKEY; + } + status = SM_Set_PKeyTable_Dispatch(fd_topology, amod, &addr, (STL_PARTITION_TABLE *)portp->portData->pPKey, sm_config.mkey, nodep, &sm_asyncDispatch, sm_set_delayed_pkeys_callback, ctx); @@ -612,8 +623,14 @@ sm_set_portPkey( } if (SendUpdateNow) { - /* Sanity Check, Make sure at least one Default Pkey is present */ - if (pkeyTable[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 == 0 && pkeyTable[STL_DEFAULT_FM_PKEY_IDX].AsReg16 == 0) { + /* Sanity Check, Make sure at least Default Pkey(s) are present */ + if (nodep->nodeInfo.NodeType == STL_NODE_SW) { + if (pkeyTable[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 == 0) + pkeyTable[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 = STL_DEFAULT_CLIENT_PKEY; + if (pkeyTable[STL_DEFAULT_FM_PKEY_IDX].AsReg16 == 0) + pkeyTable[STL_DEFAULT_FM_PKEY_IDX].AsReg16 = STL_DEFAULT_FM_PKEY; + } else if (pkeyTable[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 == 0 && + pkeyTable[STL_DEFAULT_FM_PKEY_IDX].AsReg16 == 0) { pkeyTable[STL_DEFAULT_CLIENT_PKEY_IDX].AsReg16 = STL_DEFAULT_CLIENT_PKEY; } diff --git a/MakeTools/patch_version/README.md b/MakeTools/patch_version/README.md new file mode 100644 index 0000000..4880a13 --- /dev/null +++ b/MakeTools/patch_version/README.md @@ -0,0 +1,60 @@ +# Building and modifying patch_brand tool + +## Where patch_brand normally exists: +``` +$ which patch_brand +/usr/local/ics/bin/patch_brand +``` + +## Usage for patch_brand: +``` +$ patch_brand -h +patch_brand: invalid option -- 'h' +Usage: patch_brand [-m marker] brand [file ...] +``` + +## How embedded build runs patch_brand: +This line in Makerules/Maketargets.bsp is run: +`$(PATCH_BRAND) "$(BUILD_BRAND)" $(EXECUTABLE)` +It will appear as follows in the capture build output for embedded: +`$ patch_brand "" build.STL1.q7.release/STL1.q7` +Note: The empty brand string tells patch_brand, aka, patch_version.c, to use DEFAULT_BRAND. + +## How to tell if the file has the default brand of Intel: +``` +grep Intel <ifs-all-dir>/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 +Binary file ../STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 matches +``` + +## How to build patch_version by itself (make your changes in opa-dev branch only): +``` +cd MakeTools/patch_version/ +target linux +setrel +setver ##choose 1 (which is probably the default Linux that was booted) +export PROJ_FILE_DIR=OpenIb_Host +make +``` +You will find patch_brand executable in your current directory. + +## How to run patch_version to test your change: +`./patch_brand “” <ifs-all-dir>/STL1_Firmware/Firmware/build.release*/STL1.q7` +For example: +``` +./patch_brand "" ~/HEAD-10_8/ifs-all/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 +Patching /home/usrinivasan/HEAD-10_8/ifs-all/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 with brand 'Cornelis' +``` + +## How to tell if the file has the default brand of Cornelis: +`grep Cornelis <ifs-all-dir>/STL1_Firmware/Firmware/build.release*/STL1.q7` +For example: +``` +grep "THIS_IS_THE_ICS_BRAND:Cornelis" /home/usrinivasan/HEAD-10_8/ifs-all/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 +Binary file /home/usrinivasan/HEAD-10_8/ifs-all/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 matches +``` +## Finally, verify that a grep for Intel yields nothing. +`grep "THIS_IS_THE_ICS_BRAND:Intel" <ifs-all-dir>/STL1_Firmware/Firmware/build.STL1.q7.release/STL1.q7 + + + + diff --git a/MakeTools/patch_version/patch_version.c b/MakeTools/patch_version/patch_version.c index 6592b94..8097922 100755 --- a/MakeTools/patch_version/patch_version.c +++ b/MakeTools/patch_version/patch_version.c @@ -8,6 +8,7 @@ /* BEGIN_ICS_COPYRIGHT7 **************************************** Copyright (c) 2015-2020, Intel Corporation +Copyright (c) 2021, Cornelis Networks, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -67,7 +68,7 @@ and/or the product takes a long amount of time to compile. patch_brand brand [file ...] @param release_tag - version tag of the form R#_#M#P#I# or R#_#A#I# or R#_#B#I# -@param brand - a branding string such as "Intel" +@param brand - a branding string such as "Cornelis Networks" @param file - object/exe file(s) to place the #.#.#.# style version string in If no files are specified, the program merely performs the simpler behaviour of outputing the #.#.#.# @@ -107,7 +108,7 @@ and/or the product takes a long amount of time to compile. return(version); } - #define ICS_BUILD_BRAND "THIS_IS_THE_ICS_BRAND:Intel\000 " + #define ICS_BUILD_BRAND "THIS_IS_THE_ICS_BRAND:Cornelis Networks\000 " const char* GetCodeBrand(void) { static const char* BuildBrand=ICS_BUILD_BRAND; @@ -142,8 +143,8 @@ and/or the product takes a long amount of time to compile. #define ICS_BUILD_VERSION "THIS_IS_THE_ICS_VERSION_NUMBER:@(#)000.000.000.000B000" #define ICS_BUILD_INTERNAL_VERSION "THIS_IS_THE_ICS_INTERNAL_VERSION_NUMBER:@(#)000.000.000.000B000I0000" -#define ICS_BUILD_BRAND "THIS_IS_THE_ICS_BRAND:Intel\000 " -#define DEFAULT_BRAND "Intel" +#define ICS_BUILD_BRAND "THIS_IS_THE_ICS_BRAND:Cornelis\000 " +#define DEFAULT_BRAND "Cornelis" typedef enum { B_FALSE=0, B_TRUE } boolean; diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 45b34fe..c462284 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,7 +29,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.11.2.0 +Version: 10.12.1.0 Release: 3%{?dist} %if 0%{?rhel} Epoch: 1 @@ -62,7 +62,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.11.2.0.3%{?dist} +IFSComponent: FM 10.12.1.0.6%{?dist} %prep %setup -q -c
0
9977f03d6226c189bf018766c76d8184d011d211
01org/opa-fm
Update to latest from build 10.9.0.3.1
commit 9977f03d6226c189bf018766c76d8184d011d211 Author: Scott Breyer <[email protected]> Date: Mon Feb 11 14:13:10 2019 -0500 Update to latest from build 10.9.0.3.1 diff --git a/Esm/build.env b/Esm/build.env index 11695ce..b4a11ad 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_0_2_1 +export RELEASE_TAG=10_9_0_3_1 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/build_label b/Esm/build_label index 240fc66..5d805ed 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 02/05/19 11:43 Tag: VIEO_HOST_LINUX_opa-10_9_0_2_10_9_0_2_1 +Build of VIEO_HOST 02/08/19 17:12 Tag: VIEO_HOST_LINUX_opa-10_9_0_2_10_9_0_3_1 diff --git a/Esm/ib/include/cs_g.h b/Esm/ib/include/cs_g.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/cs_log.h b/Esm/ib/include/cs_log.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/hsm_com_srvr_api.h b/Esm/ib/include/hsm_com_srvr_api.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/hsm_config_srvr_api.h b/Esm/ib/include/hsm_config_srvr_api.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/hsm_config_srvr_data.h b/Esm/ib/include/hsm_config_srvr_data.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ib_mad.h b/Esm/ib/include/ib_mad.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ib_sa.h b/Esm/ib/include/ib_sa.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ib_sm.h b/Esm/ib/include/ib_sm.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ib_status.h b/Esm/ib/include/ib_status.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ib_types.h b/Esm/ib/include/ib_types.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/if3.h b/Esm/ib/include/if3.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/ifs_g.h b/Esm/ib/include/ifs_g.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/mai_g.h b/Esm/ib/include/mai_g.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/vfi_g.h b/Esm/ib/include/vfi_g.h old mode 100755 new mode 100644 diff --git a/Esm/ib/include/vs_g.h b/Esm/ib/include/vs_g.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/cs/cs_sema.c b/Esm/ib/src/cs/cs_sema.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/cs/cs_string.c b/Esm/ib/src/cs/cs_string.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/cs/cs_utility.c b/Esm/ib/src/cs/cs_utility.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/cs/vs_pool_common.c b/Esm/ib/src/cs/vs_pool_common.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/cs/vs_thr_common.c b/Esm/ib/src/cs/vs_thr_common.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe.h b/Esm/ib/src/fe/fe.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_cmds.c b/Esm/ib/src/fe/fe_cmds.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_cmds.h b/Esm/ib/src/fe/fe_cmds.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_linux.c b/Esm/ib/src/fe/fe_linux.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_mad.c b/Esm/ib/src/fe/fe_mad.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_mad.h b/Esm/ib/src/fe/fe_mad.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_main.c b/Esm/ib/src/fe/fe_main.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/fe_main.h b/Esm/ib/src/fe/fe_main.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/libnet.c b/Esm/ib/src/fe/net/libnet.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/libnet.h b/Esm/ib/src/fe/net/libnet.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/netblob.c b/Esm/ib/src/fe/net/netblob.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/netblob.h b/Esm/ib/src/fe/net/netblob.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/netqueue.c b/Esm/ib/src/fe/net/netqueue.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/netqueue.h b/Esm/ib/src/fe/net/netqueue.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/unixdefs.h b/Esm/ib/src/fe/net/unixdefs.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/net/windowsdefs.h b/Esm/ib/src/fe/net/windowsdefs.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/sa/fe_main.h b/Esm/ib/src/fe/sa/fe_main.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/sa/if3_sa.c b/Esm/ib/src/fe/sa/if3_sa.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/sa/if3_sa.h b/Esm/ib/src/fe/sa/if3_sa.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/fe/test/vssappl.c b/Esm/ib/src/fe/test/vssappl.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/ibaccess/vs_lck.c b/Esm/ib/src/ibaccess/vs_lck.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/ibaccess/vs_pool.c b/Esm/ib/src/ibaccess/vs_pool.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/ibaccess/vs_thr.c b/Esm/ib/src/ibaccess/vs_thr.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/ibaccess/vs_utility.c b/Esm/ib/src/ibaccess/vs_utility.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/felib.c b/Esm/ib/src/if3/felib.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/hsm_com_server.c b/Esm/ib/src/if3/hsm_com_server.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/hsm_com_srvr_api.c b/Esm/ib/src/if3/hsm_com_srvr_api.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/hsm_com_srvr_common.c b/Esm/ib/src/if3/hsm_com_srvr_common.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/hsm_com_srvr_data.h b/Esm/ib/src/if3/hsm_com_srvr_data.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/if3_ssl.c b/Esm/ib/src/if3/if3_ssl.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/reli.c b/Esm/ib/src/if3/reli.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/rmpp.c b/Esm/ib/src/if3/rmpp.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/rmpp_l.h b/Esm/ib/src/if3/rmpp_l.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/service.c b/Esm/ib/src/if3/service.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/if3/vfi.c b/Esm/ib/src/if3/vfi.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_com_client.c b/Esm/ib/src/linux/fm_cmd/hsm_com_client.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_com_client_api.c b/Esm/ib/src/linux/fm_cmd/hsm_com_client_api.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_com_client_api.h b/Esm/ib/src/linux/fm_cmd/hsm_com_client_api.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_com_client_common.c b/Esm/ib/src/linux/fm_cmd/hsm_com_client_common.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_com_client_data.h b/Esm/ib/src/linux/fm_cmd/hsm_com_client_data.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_config_client.c b/Esm/ib/src/linux/fm_cmd/hsm_config_client.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_config_client_api.h b/Esm/ib/src/linux/fm_cmd/hsm_config_client_api.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/fm_cmd/hsm_config_client_data.h b/Esm/ib/src/linux/fm_cmd/hsm_config_client_data.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/log/common/vslog.c b/Esm/ib/src/linux/log/common/vslog.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/linux/startup/fm_config/config_convert.c b/Esm/ib/src/linux/startup/fm_config/config_convert.c index 6fec8c2..bc23aec 100644 --- a/Esm/ib/src/linux/startup/fm_config/config_convert.c +++ b/Esm/ib/src/linux/startup/fm_config/config_convert.c @@ -1300,7 +1300,7 @@ is_special (void) { StringCopy ((void *)subnetSize, equals + 1, sizeof(subnetSize)); /* add SUBNET_SIZE to each manager environment */ memset (line_key, 0, 100); - strncpy ((void *)line_key, "SUBNET_SIZE", 11); + StringCopy ((void *)line_key, "SUBNET_SIZE", strlen("SUBNET_SIZE") + 1); memset (line_value, 0, 200); strncpy ((void *)line_value, (void *)subnetSize, 128); for (i = 0; i < MAX_INSTANCES; i++) { @@ -1319,7 +1319,7 @@ is_special (void) { /* add SYSLOG_MODE to each manager's environment */ StringCopy ((void *)syslogMode, equals + 1, sizeof(syslogMode)); memset (line_key, 0, 100); - strncpy ((void *)line_key, "SYSLOG_MODE", 11); + StringCopy ((void *)line_key, "SYSLOG_MODE", strlen("SYSLOG_MODE") + 1); memset (line_value, 0, 200); strncpy ((void *)line_value, (void *)syslogMode, 16); for (i = 0; i < MAX_INSTANCES; i++) { diff --git a/Esm/ib/src/linux/startup/opafm_src.xml.base b/Esm/ib/src/linux/startup/opafm_src.xml.base old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai.c b/Esm/ib/src/mai/mai.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_config.c b/Esm/ib/src/mai/mai_config.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_dc.c b/Esm/ib/src/mai/mai_dc.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_fcmp.c b/Esm/ib/src/mai/mai_fcmp.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_filter.c b/Esm/ib/src/mai/mai_filter.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_filter_common.c b/Esm/ib/src/mai/mai_filter_common.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_futil.c b/Esm/ib/src/mai/mai_futil.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_info.h b/Esm/ib/src/mai/mai_info.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_l.h b/Esm/ib/src/mai/mai_l.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_tid.c b/Esm/ib/src/mai/mai_tid.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/mai/mai_util.c b/Esm/ib/src/mai/mai_util.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/pm/pm/pm.c b/Esm/ib/src/pm/pm/pm.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/pm/pm/pm_linux.c b/Esm/ib/src/pm/pm/pm_linux.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/include/sa_l.h b/Esm/ib/src/smi/include/sa_l.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/include/sm_l.h b/Esm/ib/src/smi/include/sm_l.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_ClassPortInfo.c b/Esm/ib/src/smi/sa/sa_ClassPortInfo.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_DeviceGroupMembership.c b/Esm/ib/src/smi/sa/sa_DeviceGroupMembership.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_DeviceGroupName.c b/Esm/ib/src/smi/sa/sa_DeviceGroupName.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_DeviceTree.c b/Esm/ib/src/smi/sa/sa_DeviceTree.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_FabricInfoRecord.c b/Esm/ib/src/smi/sa/sa_FabricInfoRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_InformInfo.c b/Esm/ib/src/smi/sa/sa_InformInfo.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_InformRecord.c b/Esm/ib/src/smi/sa/sa_InformRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_LFTableRecord.c b/Esm/ib/src/smi/sa/sa_LFTableRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_LinkRecord.c b/Esm/ib/src/smi/sa/sa_LinkRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_MFTableRecord.c b/Esm/ib/src/smi/sa/sa_MFTableRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_McMemberRecord.c b/Esm/ib/src/smi/sa/sa_McMemberRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_NodeRecord.c b/Esm/ib/src/smi/sa/sa_NodeRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_PartitionRecord.c b/Esm/ib/src/smi/sa/sa_PartitionRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_PathRecord.c b/Esm/ib/src/smi/sa/sa_PathRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_PortInfoRecord.c b/Esm/ib/src/smi/sa/sa_PortInfoRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_QuarantinedNodeRecord.c b/Esm/ib/src/smi/sa/sa_QuarantinedNodeRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_SCSCTableRecord.c b/Esm/ib/src/smi/sa/sa_SCSCTableRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_SLSCTableRecord.c b/Esm/ib/src/smi/sa/sa_SLSCTableRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_SMInfoRecord.c b/Esm/ib/src/smi/sa/sa_SMInfoRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_ServiceRecord.c b/Esm/ib/src/smi/sa/sa_ServiceRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_SwitchInfoRecord.c b/Esm/ib/src/smi/sa/sa_SwitchInfoRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_TraceRecord.c b/Esm/ib/src/smi/sa/sa_TraceRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_Trap.c b/Esm/ib/src/smi/sa/sa_Trap.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_VFabricRecord.c b/Esm/ib/src/smi/sa/sa_VFabricRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_VLArbitrationRecord.c b/Esm/ib/src/smi/sa/sa_VLArbitrationRecord.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_db.c b/Esm/ib/src/smi/sa/sa_db.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_m.h b/Esm/ib/src/smi/sa/sa_m.h old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_main.c b/Esm/ib/src/smi/sa/sa_main.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_userexits.c b/Esm/ib/src/smi/sa/sa_userexits.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sa/sa_utility.c b/Esm/ib/src/smi/sa/sa_utility.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_async.c b/Esm/ib/src/smi/sm/sm_async.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_attribute.c b/Esm/ib/src/smi/sm/sm_attribute.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_congestion.c b/Esm/ib/src/smi/sm/sm_congestion.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_control.c b/Esm/ib/src/smi/sm/sm_control.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_fsm.c b/Esm/ib/src/smi/sm/sm_fsm.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_linux.c b/Esm/ib/src/smi/sm/sm_linux.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_main.c b/Esm/ib/src/smi/sm/sm_main.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_mkey.c b/Esm/ib/src/smi/sm/sm_mkey.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_multicast.c b/Esm/ib/src/smi/sm/sm_multicast.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_partMgr.c b/Esm/ib/src/smi/sm/sm_partMgr.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_userexits.c b/Esm/ib/src/smi/sm/sm_userexits.c old mode 100755 new mode 100644 diff --git a/Esm/ib/src/smi/sm/sm_utility.c b/Esm/ib/src/smi/sm/sm_utility.c old mode 100755 new mode 100644 diff --git a/Esm/ib/test/smi/sm/smpoolsize.c b/Esm/ib/test/smi/sm/smpoolsize.c old mode 100755 new mode 100644 diff --git a/Esm/update_opa-fm_spec.sh b/Esm/update_opa-fm_spec.sh index 8bb0cf6..75334b8 100755 --- a/Esm/update_opa-fm_spec.sh +++ b/Esm/update_opa-fm_spec.sh @@ -99,6 +99,14 @@ then sed -i "/__RPM_INS/,+1d" $to sed -i "/__RPM_SYSCONF/,+1d" $to sed -i "s/__RPM_RQ2/Requires: libibumad3, libibverbs1, rdma, libexpat1, openssl/g" $to +elif [ "$id" = "fedora" ] +then + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to + sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to + sed -i "/__RPM_SYSCONF/,+1d" $to + sed -i "s/__RPM_RQ2/Requires: libibumad%{?_isa}, libibverbs%{?_isa}, rdma, expat%{?_isa}, libhfi1, openssl%{?_isa}/g" $to + sed -i "/__RPM_DEBUG/,+1d" $to else echo ERROR: Unsupported distribution: $id $versionid exit 1 diff --git a/Esm/update_opa-fm_spec.sh.base b/Esm/update_opa-fm_spec.sh.base index c7296f1..75334b8 100755 --- a/Esm/update_opa-fm_spec.sh.base +++ b/Esm/update_opa-fm_spec.sh.base @@ -28,16 +28,25 @@ # # END_ICS_COPYRIGHT8 **************************************** -sed -i "s/__RPM_FS/OPA_FEATURE_SET=$OPA_FEATURE_SET/g" opa-fm.spec +id=$(./Esm/get_id_and_versionid.sh | cut -f1 -d' ') +versionid=$(./Esm/get_id_and_versionid.sh | cut -f2 -d' ') -id=$(./get_id_and_versionid.sh | cut -f1 -d' ') -versionid=$(./get_id_and_versionid.sh | cut -f2 -d' ') +from=$1 +to=$2 -if [ "$id" = "" -o "$versionid" = "" ] +if [ "$from" = "" -o "$to" = "" ] then + echo "Usage: update_opa-ff_spec.sh spec-in-file spec-file" exit 1 fi +if [ "$from" != "$to" ] +then + cp $from $to +fi + +sed -i "s/__RPM_FS/OPA_FEATURE_SET=$OPA_FEATURE_SET/g" $to + if [ "$id" = "rhel" -o "$id" = "centos" ] then GE_7_0=$(echo "$versionid >= 7.0" | bc) @@ -45,23 +54,23 @@ then GE_7_5=$(echo "$versionid >= 7.5" | bc) if [ $GE_7_4 = 1 ] then - sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ1/expat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to fi if [ $GE_7_0 = 1 ] then - sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" opa-fm.spec - sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" opa-fm.spec - sed -i "/__RPM_SYSCONF/,+1d" opa-fm.spec + sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to + sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to + sed -i "/__RPM_SYSCONF/,+1d" $to else - sed -i "s/__RPM_BLDRQ2/Requires(post): \/sbin\/chkconfig/g" opa-fm.spec - sed -i "s/__RPM_RQ1/Requires(preun): \/sbin\/chkconfig/g" opa-fm.spec - sed -i 's/RPM_INS=n/RPM_INS=y/g' opa-fm.spec - sed -i "s/__RPM_SYSCONF/%{_sysconfdir}\/init.d\/opafm/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ2/Requires(post): \/sbin\/chkconfig/g" $to + sed -i "s/__RPM_RQ1/Requires(preun): \/sbin\/chkconfig/g" $to + sed -i 's/RPM_INS=n/RPM_INS=y/g' $to + sed -i "s/__RPM_SYSCONF/%{_sysconfdir}\/init.d\/opafm/g" $to fi - sed -i "s/__RPM_RQ2/Requires: libibumad%{?_isa}, libibverbs%{?_isa}, rdma, expat%{?_isa}, libhfi1, openssl%{?_isa}/g" opa-fm.spec - sed -i "/__RPM_DEBUG/,+1d" opa-fm.spec + sed -i "s/__RPM_RQ2/Requires: libibumad%{?_isa}, libibverbs%{?_isa}, rdma, expat%{?_isa}, libhfi1, openssl%{?_isa}/g" $to + sed -i "/__RPM_DEBUG/,+1d" $to elif [ "$id" = "sles" ] then GE_11_1=$(echo "$versionid >= 11.1" | bc) @@ -69,26 +78,35 @@ then GE_12_3=$(echo "$versionid >= 12.3" | bc) if [ $GE_12_3 = 1 ] then - sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, openssl-devel/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ1/libexpat-devel, rdma-core-devel, openssl-devel/g" $to else - sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ1/libexpat-devel, libibumad-devel, libibverbs-devel, openssl-devel/g" $to fi if [ $GE_12_1 = 1 ] then - sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" opa-fm.spec - sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to + sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to else - sed -i "s/__RPM_BLDRQ2/Requires(post): /sbin/chkconfig/g" opa-fm.spec - sed -i "s/__RPM_RQ1/Requires(preun): /sbin/chkconfig/g" opa-fm.spec + sed -i "s/__RPM_BLDRQ2/Requires(post): /sbin/chkconfig/g" $to + sed -i "s/__RPM_RQ1/Requires(preun): /sbin/chkconfig/g" $to fi if [ $GE_11_1 = 1 ] then - sed -i "s/__RPM_DEBUG/%debug_package/g" opa-fm.spec + sed -i "s/__RPM_DEBUG/%debug_package/g" $to else - sed -i "/__RPM_DEBUG/,+1d" opa-fm.spec + sed -i "/__RPM_DEBUG/,+1d" $to fi - sed -i "/__RPM_SYSCONF/,+1d" opa-fm.spec - sed -i "s/__RPM_RQ2/Requires: libibumad3, libibverbs1, rdma, libexpat1, openssl/g" opa-fm.spec + sed -i "/__RPM_INS/,+1d" $to + sed -i "/__RPM_SYSCONF/,+1d" $to + sed -i "s/__RPM_RQ2/Requires: libibumad3, libibverbs1, rdma, libexpat1, openssl/g" $to +elif [ "$id" = "fedora" ] +then + sed -i "s/__RPM_BLDRQ1/expat-devel, rdma-core-devel, openssl-devel/g" $to + sed -i "s/__RPM_BLDRQ2/BuildRequires: systemd %{?systemd_requires} %{?BuildRequires}/g" $to + sed -i "s/__RPM_RQ1/Requires: systemd %{?systemd_requires}/g" $to + sed -i "/__RPM_SYSCONF/,+1d" $to + sed -i "s/__RPM_RQ2/Requires: libibumad%{?_isa}, libibverbs%{?_isa}, rdma, expat%{?_isa}, libhfi1, openssl%{?_isa}/g" $to + sed -i "/__RPM_DEBUG/,+1d" $to else echo ERROR: Unsupported distribution: $id $versionid exit 1 diff --git a/IbAccess/Common/Inc/stl_helper.h b/IbAccess/Common/Inc/stl_helper.h index bc6a46e..5831057 100644 --- a/IbAccess/Common/Inc/stl_helper.h +++ b/IbAccess/Common/Inc/stl_helper.h @@ -904,20 +904,20 @@ void StlCableInfoDecodeCableType(uint8_t cableType, uint8_t mediaConnType, uint8 if ((cableType <= STL_CIB_STD_TXTECH_1490_DFB) && (cableType != STL_CIB_STD_TXTECH_OTHER)) { if (mediaConnType == STL_CIB_STD_CONNECTOR_NO_SEP) { - strncat(cableTypeInfo->cableTypeShortDesc, " AOC", 4); + strncat(cableTypeInfo->cableTypeShortDesc, " AOC", strlen(" AOC") + 1); cableTypeInfo->cableLengthValid = 1; } else { - strncat(cableTypeInfo->cableTypeShortDesc, " Xcvr", 5); + strncat(cableTypeInfo->cableTypeShortDesc, " Xcvr", strlen(" Xcvr") + 1); cableTypeInfo->cableLengthValid = 0; } cableTypeInfo->activeCable = 1; } else { if (cableType >= STL_CIB_STD_TXTECH_CU_UNEQ) { if (cableType <= STL_CIB_STD_TXTECH_CU_PASSIVEQ) { - strncat(cableTypeInfo->cableTypeShortDesc, " Copper", 7); + strncat(cableTypeInfo->cableTypeShortDesc, " Copper", strlen(" Copper") + 1); cableTypeInfo->activeCable = 0; } else { - strncat(cableTypeInfo->cableTypeShortDesc, " ActCu", 6); + strncat(cableTypeInfo->cableTypeShortDesc, " ActCu", strlen(" ActCu") + 1); cableTypeInfo->activeCable = 1; } cableTypeInfo->cableLengthValid = 1; diff --git a/IbPrint/stl_sma.c b/IbPrint/stl_sma.c index a4091c4..cac8cae 100644 --- a/IbPrint/stl_sma.c +++ b/IbPrint/stl_sma.c @@ -1832,7 +1832,7 @@ void PrintStlCableInfoLowPage(PrintDest_t *dest, int indent, const uint8_t *cabl case CABLEINFO_DETAIL_VERBOSE: if (printLineByLine) { StringCopy(tempBuf, tempBuf2, strlen(tempBuf2)); - strncat(tempBuf2, ": Direct CableInfo", strlen(": Direct CableInfo")); + strncat(tempBuf2, ": Direct CableInfo", strlen(": Direct CableInfo") + 1); PrintStrWithDots(dest, indent, tempBuf2, ""); PrintStrWithDots(dest, indent, "Temperature", temperature); PrintStrWithDots(dest, indent, "Supply Voltage", vcc); @@ -1848,7 +1848,7 @@ void PrintStlCableInfoLowPage(PrintDest_t *dest, int indent, const uint8_t *cabl default: if (printLineByLine) { StringCopy(tempBuf, tempBuf2, strlen(tempBuf2)); - strncat(tempBuf2, ": Direct CableInfo", strlen(": Direct CableInfo")); + strncat(tempBuf2, ": Direct CableInfo", strlen(": Direct CableInfo") + 1); PrintStrWithDots(dest, indent, tempBuf2, ""); PrintStrWithDots(dest, indent, "Temperature", temperature); PrintStrWithDots(dest, indent, "Supply Voltage", vcc); diff --git a/MakeTools/funcs-ext.sh b/MakeTools/funcs-ext.sh index 28c187d..9aa4cd2 100755 --- a/MakeTools/funcs-ext.sh +++ b/MakeTools/funcs-ext.sh @@ -722,6 +722,9 @@ function os_vendor() centos) rval=redhat ;; + fedora) + rval=redhat + ;; *) rval="" ;; diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 9016299..c976eea 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,7 +29,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.0.2 +Version: 10.9.0.3 Release: 1%{?dist} %if 0%{?rhel} Epoch: 1 @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.0.2.1%{?dist} +IFSComponent: FM 10.9.0.3.1%{?dist} %prep %setup -q -c
0
7dfd60a2f4771f20cc4e326a6fab9ecdd15fbd0f
01org/opa-fm
Updated to latest from build 10.0.0.0.686
commit 7dfd60a2f4771f20cc4e326a6fab9ecdd15fbd0f Author: Scott Breyer <[email protected]> Date: Fri Jan 22 14:10:21 2016 -0500 Updated to latest from build 10.0.0.0.686 diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 0010a97..dd7bce6 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -92,6 +92,7 @@ my @delta_components_other = ( my @delta_components_rhel72 = ( "opa_stack", # Kernel drivers. + "ibacm", # OFA IB communication manager assistant. "intel_hfi", # HFI drivers "delta_ipoib", # ipoib module. "mpi_selector", @@ -306,8 +307,6 @@ my %delta_comp_info_rhel72 = ( KernelRpms => [ "hfi1" ], # special case UserRpms => [ "opa-scripts", "srptools", - "libibmad", - "infiniband-diags", ], DebugRpms => [ "srptools-debuginfo", ], @@ -315,6 +314,14 @@ my %delta_comp_info_rhel72 = ( StartupScript => "opa", StartupParams => [ "ARPTABLE_TUNING" ], }, + 'ibacm' => { + KernelRpms => [ ], + UserRpms => [ "ibacm", ], + DebugRpms => [ "ibacm-debuginfo" ], + Drivers => "", # none + StartupScript => "ibacm", + StartupParams => [ ], + }, 'intel_hfi' => { KernelRpms => [ ], UserRpms => [ "libhfi1verbs", "libhfi1verbs-devel", @@ -390,7 +397,7 @@ my %delta_comp_info_rhel72 = ( }, 'opa_stack_dev' => { KernelRpms => [ "hfi1-devel" ], - UserRpms => [ ], + UserRpms => [ "ibacm-devel" ], DebugRpms => [ ], Drivers => "", # none StartupScript => "", @@ -615,7 +622,7 @@ my @delta_user_srpms_other = ( "shmem-benchmarks", "srptools", "libibmad", "infiniband-diags", "hfi1_uefi" ); my @delta_user_srpms_rhel72 = ( - "opa-scripts", "mpi-selector", + "opa-scripts", "mpi-selector", "ibacm", "libhfi1verbs", "hfi1-psm", "hfi1-diagtools-sw", "hfi1-firmware", "hfi1-firmware_debug", "mvapich2", "openmpi", "gasnet", "openshmem", "openshmem-test-suite", "shmem-benchmarks", "srptools", "hfi1_uefi" @@ -853,6 +860,12 @@ my %delta_srpm_info_rhel72 = ( PartOf => "", # filled in at runtime BuildPrereq => [ 'libtool any user' ], }, + "ibacm" => { Available => "", + Builds => "ibacm ibacm-devel", + PostReq => "", + PartOf => "", # filled in at runtime + BuildPrereq => [], + }, "mpi-selector" => { Available => "", Builds => "mpi-selector", PostReq => "mpi-selector", @@ -1973,6 +1986,7 @@ sub build_delta($$$$$$) } @need_install = ( @need_install, split /[[:space:]]+/, $delta_srpm_info{$srpm}{'PostReq'}); $must_force_rpm=1; + delta_move_rpms("$RPM_DIR/$RPMS_SUBDIR", "$rpmsdir"); } } @@ -4151,7 +4165,7 @@ sub postinstall_hfi1_uefi($$) { } -sub uninstall_hfi_uefi($$) +sub uninstall_hfi1_uefi($$) { my $install_list = shift(); # total that will be left installed when done my $uninstalling_list = shift(); # what items are being uninstalled diff --git a/CommonInstall/main_delta.pl b/CommonInstall/main_delta.pl index 0bdbba7..1b8c063 100755 --- a/CommonInstall/main_delta.pl +++ b/CommonInstall/main_delta.pl @@ -61,7 +61,7 @@ my @Components_other = ( "opa_stack", "ibacm", "intel_hfi", "mpi_selector", "delta_mpisrc", "hfi1_uefi", "delta_debug", ); -my @Components_rhel72 = ( "opa_stack", "intel_hfi", "mpi_selector", +my @Components_rhel72 = ( "opa_stack", "ibacm", "intel_hfi", "mpi_selector", "delta_ipoib", "opa_stack_dev", "gasnet", "openshmem", @@ -279,6 +279,15 @@ my %ComponentInfo_rhel72 = ( StartPreReq => "", StartComponents => [ "opa_stack" ], }, + "ibacm" => { Name => "OFA IBACM", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + StartComponents => [ "ibacm" ], + }, "intel_hfi" => { Name => "Intel HFI Components", DefaultInstall => $State_Install, SrcDir => ".", DriverSubdir => "updates", diff --git a/CommonInstall/main_omnipathwrap.pl b/CommonInstall/main_omnipathwrap.pl index d8b3285..22dc500 100644 --- a/CommonInstall/main_omnipathwrap.pl +++ b/CommonInstall/main_omnipathwrap.pl @@ -392,7 +392,7 @@ $WrapperComponent = "opaconfig"; DriverSubdir => "", PreReq => " opa_stack ", CoReq => "", Hidden => 0, Disabled => 0, - HasStart => 1, HasFirmware => 0, DefaultStart => 1, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", #StartComponents => [ "qlgc_fm", "qlgc_fm_snmp"], StartComponents => [ "opafm" ], diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index f82bede..afd4449 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -69,7 +69,7 @@ my @Components_other = ( "opa_stack", "ibacm", "mpi_selector", "intel_hfi", "gasnet", "openshmem", "mvapich2", "openmpi", "delta_mpisrc", "hfi1_uefi", "delta_debug", ); -my @Components_rhel72 = ( "opa_stack", "mpi_selector", "intel_hfi", +my @Components_rhel72 = ( "opa_stack", "ibacm", "mpi_selector", "intel_hfi", "oftools", "opa_stack_dev", "fastfabric", "delta_ipoib", "opafm", @OmniPathAllComponents, @@ -347,7 +347,7 @@ my %ComponentInfo_other = ( DriverSubdir => "", PreReq => " opa_stack ", CoReq => "", Hidden => 0, Disabled => 0, - HasStart => 1, HasFirmware => 0, DefaultStart => 1, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", #StartComponents => [ "qlgc_fm", "qlgc_fm_snmp"], StartComponents => [ "opafm" ], @@ -399,6 +399,16 @@ my %ComponentInfo_rhel72 = ( StartPreReq => "", StartComponents => [ "opa_stack" ], }, + "ibacm" => { Name => "OFA IBACM", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + StartComponents => [ "ibacm" ], + }, "intel_hfi" => { Name => "Intel HFI Components", DefaultInstall => $State_Install, SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), @@ -576,7 +586,7 @@ my %ComponentInfo_rhel72 = ( DriverSubdir => "", PreReq => " opa_stack ", CoReq => "", Hidden => 0, Disabled => 0, - HasStart => 1, HasFirmware => 0, DefaultStart => 1, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", #StartComponents => [ "qlgc_fm", "qlgc_fm_snmp"], StartComponents => [ "opafm" ], diff --git a/CommonInstall/main_qlgc_fm.pl b/CommonInstall/main_qlgc_fm.pl index 5686983..f9793a0 100644 --- a/CommonInstall/main_qlgc_fm.pl +++ b/CommonInstall/main_qlgc_fm.pl @@ -112,7 +112,7 @@ $WrapperComponent = "opa_config_fm"; SrcDir => ".", DriverSubdir => "", PreReq => " opa_stack ", CoReq => "", Hidden => 0, Disabled => 0, - HasStart => 1, HasFirmware => 0, DefaultStart => 1, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", StartComponents => [ "opafm" ], }, diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index 87ad128..78c9e2d 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -209,10 +209,8 @@ sub rpm_is_installed($$) # $mode is kernel rev, verify proper kernel version is installed # for kernel packages, RELEASE is kernel rev my $release = rpm_tr_os_version($mode); - DebugPrint "chroot /$ROOT $RPM --queryformat '[%{RELEASE}\\n]' -q $package 2>/dev/null|egrep '^$release\$' >/dev/null 2>&1\n"; - #MWHEINZ - hack to deal with odd rpm name. - #$rc = system "chroot /$ROOT $RPM --queryformat '[%{RELEASE}\\n]' -q $package 2>/dev/null|egrep '^$release\$' >/dev/null 2>&1"; - $rc = system "chroot /$ROOT $RPM --queryformat '[%{RELEASE}\\n]' -q $package >/dev/null 2>&1"; + DebugPrint "chroot /$ROOT $RPM --queryformat '[%{VERSION}\\n]' -q $package 2>/dev/null|egrep '$release' >/dev/null 2>&1\n"; + $rc = system "chroot /$ROOT $RPM --queryformat '[%{VERSION}\\n]' -q $package 2>/dev/null|egrep '$release' >/dev/null 2>&1"; $last_checked = "for kernel $release"; } DebugPrint("Checked if $package $mode is installed: ".(($rc==0)?"yes":"no")."\n"); @@ -711,13 +709,11 @@ sub rpm_resolve($$$) } else { my $osver = rpm_tr_os_version("$mode"); # OS version # we expect 1 match, ignore all other filenames returned - DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-[0-9]*-${osver}.${cpu}.rpm\n"); - #$rpmfile = file_glob("$rpmdir/${package}-[0-9]*-${osver}.${cpu}.rpm"); - #MWHEINZ - hack to deal with non-standard rpm package name. - $rpmfile = file_glob("$rpmdir/${package}-*.${cpu}.rpm"); + DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm\n"); + $rpmfile = file_glob("$rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm"); if ( "$rpmfile" eq "" || ! -e "$rpmfile" ) { - DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-r[0-9]*-${osver}.${cpu}.rpm\n"); - $rpmfile = file_glob("$rpmdir/${package}-r[0-9]*-${osver}.${cpu}.rpm"); + DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-${osver}-[0-9]*.${cpu}.rpm\n"); + $rpmfile = file_glob("$rpmdir/${package}-${osver}-[0-9]*.${cpu}.rpm"); } if ( "$rpmfile" eq "" || ! -e "$rpmfile" ) { DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-trunk-[0-9]*-${osver}.${cpu}.rpm\n"); @@ -748,9 +744,26 @@ sub rpm_install($$$) my $package = shift(); # package name my $rpmfile; + # use a different directory for BUILD_ROOT to limit conflict with OFED + my $build_temp = "/var/tmp/IntelOPA-DELTA"; + my $BUILD_ROOT="$build_temp/build"; + my $RPM_DIR="$build_temp/DELTARPMS"; + my $RPMS_SUBDIR = "RPMS"; + my $prefix=$OFED_prefix; + +RPM_RES: + $rpmfile = rpm_resolve($rpmdir, $mode, $package); if ( "$rpmfile" eq "" || ! -e "$rpmfile" ) { NormalPrint "Not Found: $package $mode\n"; + if ( "$mode" ne "user" && "$mode" ne "any" ) # kernel mode + { + NormalPrint "Rebuilding $package SRPM $mode\n"; + if (0 == build_srpm($package, $RPM_DIR, $BUILD_ROOT, $prefix, "append")) { + delta_move_rpms("$RPM_DIR/$RPMS_SUBDIR", "$rpmdir"); + goto RPM_RES; + } + } } else { if ("$mode" eq "user" || "$mode" eq "any" ) { rpm_run_install($rpmfile, $mode, ""); @@ -776,9 +789,26 @@ sub rpm_install_with_options($$$$) my($options) = shift(); # additional rpm command options my $rpmfile; + # use a different directory for BUILD_ROOT to limit conflict with OFED + my $build_temp = "/var/tmp/IntelOPA-DELTA"; + my $BUILD_ROOT="$build_temp/build"; + my $RPM_DIR="$build_temp/DELTARPMS"; + my $RPMS_SUBDIR = "RPMS"; + my $prefix=$OFED_prefix; + +RPM_RES: + $rpmfile = rpm_resolve($rpmdir, $mode, $package); if ( "$rpmfile" eq "" || ! -e "$rpmfile" ) { NormalPrint "Not Found: $package $mode\n"; + if ( "$mode" ne "user" && "$mode" ne "any" ) # kernel mode + { + NormalPrint "Rebuilding $package SRPM $mode\n"; + if (0 == build_srpm($package, $RPM_DIR, $BUILD_ROOT, $prefix, "append")) { + delta_move_rpms("$RPM_DIR/$RPMS_SUBDIR", "$rpmdir"); + goto RPM_RES; + } + } } else { if ("$mode" eq "user" || "$mode" eq "any" ) { rpm_run_install($rpmfile, $mode, $options); diff --git a/CommonInstall/util_startup.pl b/CommonInstall/util_startup.pl index efaa0be..643b18f 100755 --- a/CommonInstall/util_startup.pl +++ b/CommonInstall/util_startup.pl @@ -89,7 +89,7 @@ sub IsAutostart($) { my($isEnabled) = `systemctl is-enabled $WhichStartup 2>/dev/null`; chomp($isEnabled); - if($isEnabled eq "disabled") + if($isEnabled eq "disabled" || $isEnabled eq "") { return 0; } else { diff --git a/Esm/build.env b/Esm/build.env index e031202..a20b670 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=ALL_EMB -export RELEASE_TAG=10_0_0_0_655 +export RELEASE_TAG=10_0_0_0_686 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/include/fm_xml.h b/Esm/ib/include/fm_xml.h index b16fa87..219945c 100644 --- a/Esm/ib/include/fm_xml.h +++ b/Esm/ib/include/fm_xml.h @@ -871,7 +871,8 @@ typedef struct _SMXmlConfig { uint32_t force_rebalance; uint32_t use_cached_node_data; - SMLinkPolicyXmlConfig_t link_policy; + SMLinkPolicyXmlConfig_t hfi_link_policy; + SMLinkPolicyXmlConfig_t isl_link_policy; SMPreemptionXmlConfig_t preemption; SmCongestionXmlConfig_t congestion; diff --git a/Esm/ib/src/config/fm_xml.c b/Esm/ib/src/config/fm_xml.c index 4bfca91..1ad794d 100644 --- a/Esm/ib/src/config/fm_xml.c +++ b/Esm/ib/src/config/fm_xml.c @@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <ctype.h> #include <ib_helper.h> #include <ixml_ib.h> -#include <cs_g.h> +#include <cs_g.h> #include <fm_xml.h> #define _GNU_SOURCE @@ -61,8 +61,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <xml.h> #include "sftp.h" -void updateLastScpRetCodeForXML(scpFastFabricRetCode_t retCode) { - Sftp_updateLastScpRetCodeForXML(retCode); +#include "bspcommon/h/configDirName.h" +extern STATUS rm (const char *fileName); + +void updateLastScpRetCode(scpFastFabricRetCode_t retCode) { + Sftp_updateLastScpRetCode(retCode); } extern uint32_t sm_state; @@ -75,6 +78,7 @@ extern void* getEsmXmlParserMemory(uint32_t size, char* info); extern void freeEsmXmlParserMemory(void *address, uint32_t size, char* info); #if defined(__VXWORKS__) extern void idbSmGetManagersToStart(int * pm, int * fe); +extern STATUS cmuRed_cfgIfMasterSyncSlavePEM(char *pem_filename); extern STATUS cmuRed_cfgIfMasterSyncSlave(char *remote); #endif @@ -1644,11 +1648,16 @@ void smInitConfig(SMXmlConfig_t *smp, SMDPLXmlConfig_t *dplp, SMMcastConfig_t *m DEFAULT_AND_CKSUM_U32(smp->force_rebalance, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_U32(smp->use_cached_node_data, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_U32(smp->sma_spoofing_check, 1, CKSUM_OVERALL_DISRUPT_CONSIST); - DEFAULT_AND_CKSUM_U16(smp->link_policy.link_max_downgrade, 1, CKSUM_OVERALL_DISRUPT_CONSIST); - DEFAULT_AND_CKSUM_U8(smp->link_policy.width_policy.enabled, 1, CKSUM_OVERALL_DISRUPT_CONSIST); - DEFAULT_AND_CKSUM_U16(smp->link_policy.width_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); - DEFAULT_AND_CKSUM_U8(smp->link_policy.speed_policy.enabled, 0, CKSUM_OVERALL_DISRUPT_CONSIST); - DEFAULT_AND_CKSUM_U16(smp->link_policy.speed_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->hfi_link_policy.link_max_downgrade, 1, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U8(smp->hfi_link_policy.width_policy.enabled, 1, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->hfi_link_policy.width_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U8(smp->hfi_link_policy.speed_policy.enabled, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->hfi_link_policy.speed_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->isl_link_policy.link_max_downgrade, 1, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U8(smp->isl_link_policy.width_policy.enabled, 1, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->isl_link_policy.width_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U8(smp->isl_link_policy.speed_policy.enabled, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_U16(smp->isl_link_policy.speed_policy.policy, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_U32(smp->preemption.small_packet, SM_PREEMPT_SMALL_PACKET_DEF, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_U32(smp->preemption.large_packet, SM_PREEMPT_LARGE_PACKET_DEF, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_U32(smp->preemption.preempt_limit, SM_PREEMPT_LIMIT_DEF, CKSUM_OVERALL_DISRUPT_CONSIST); @@ -1969,11 +1978,16 @@ void smShowConfig(SMXmlConfig_t *smp, SMDPLXmlConfig_t *dplp, SMMcastConfig_t *m printf("XML - replayDepthOverride %d\n", (unsigned int)smp->replayDepthOverride); printf("XML - timerScalingEnable %d\n", (unsigned int) smp->timerScalingEnable); printf("XML - min_supported_vls %d\n", (unsigned int)smp->min_supported_vls); - printf("XML - link_policy.link_max_downgrade 0x%x\n", (unsigned int)smp->link_policy.link_max_downgrade); - printf("XML - link_policy.link_width.enabled 0x%x\n", (unsigned int)smp->link_policy.width_policy.enabled); - printf("XML - link_policy.link_width.policy 0x%x\n", (unsigned int)smp->link_policy.width_policy.policy); - printf("XML - link_policy.link_speed.enabled 0x%x\n", (unsigned int)smp->link_policy.speed_policy.enabled); - printf("XML - link_policy.link_speed.policy 0x%x\n", (unsigned int)smp->link_policy.speed_policy.policy); + printf("XML - hfi_link_policy.link_max_downgrade 0x%x\n", (unsigned int)smp->hfi_link_policy.link_max_downgrade); + printf("XML - hfi_link_policy.link_width.enabled 0x%x\n", (unsigned int)smp->hfi_link_policy.width_policy.enabled); + printf("XML - hfi_link_policy.link_width.policy 0x%x\n", (unsigned int)smp->hfi_link_policy.width_policy.policy); + printf("XML - hfi_link_policy.link_speed.enabled 0x%x\n", (unsigned int)smp->hfi_link_policy.speed_policy.enabled); + printf("XML - hfi_link_policy.link_speed.policy 0x%x\n", (unsigned int)smp->hfi_link_policy.speed_policy.policy); + printf("XML - isl_link_policy.link_max_downgrade 0x%x\n", (unsigned int)smp->isl_link_policy.link_max_downgrade); + printf("XML - isl_link_policy.link_width.enabled 0x%x\n", (unsigned int)smp->isl_link_policy.width_policy.enabled); + printf("XML - isl_link_policy.link_width.policy 0x%x\n", (unsigned int)smp->isl_link_policy.width_policy.policy); + printf("XML - isl_link_policy.link_speed.enabled 0x%x\n", (unsigned int)smp->isl_link_policy.speed_policy.enabled); + printf("XML - isl_link_policy.link_speed.policy 0x%x\n", (unsigned int)smp->isl_link_policy.speed_policy.policy); printf("XML - preemption.small_packet 0x%x\n", (unsigned int) smp->preemption.small_packet); printf("XML - preemption.large_packet 0x%x\n", (unsigned int) smp->preemption.large_packet); printf("XML - preemption.preempt_limit 0x%x\n", (unsigned int) smp->preemption.preempt_limit); @@ -3879,7 +3893,8 @@ VirtualFabrics_t* renderVirtualFabricsConfig(uint32_t fm, FMXmlCompositeConfig_t vfip->routing_sls = vfip->routing_scs; vfip->percent_bandwidth = vfp->percent_bandwidth; - if (vfp->qos_enable && vfp->percent_bandwidth != UNDEFINED_XML8) + if (vfp->qos_enable && + ((vfp->percent_bandwidth != UNDEFINED_XML8) || (vfp->priority == 1))) num_qos_defined++; if (vfp->priority == UNDEFINED_XML8) { @@ -5350,10 +5365,15 @@ static IXML_FIELD SmLinkPolicyFields[] = { { NULL } }; -// "Sm/Link Policy" start tag -static void* SmLinkPolicyXmlParserStart(IXmlParserState_t *state, void *parent, const char **attr) +// "Sm/HFILink Policy" start tag +static void* SmHFILinkPolicyXmlParserStart(IXmlParserState_t *state, void *parent, const char **attr) +{ + return &((SMXmlConfig_t *)parent)->hfi_link_policy; +} +// "Sm/ISLLink Policy" start tag +static void* SmISLLinkPolicyXmlParserStart(IXmlParserState_t *state, void *parent, const char **attr) { - return &((SMXmlConfig_t *)parent)->link_policy; + return &((SMXmlConfig_t *)parent)->isl_link_policy; } static boolean minMaxNumString(uint32_t *p, char *str, uint32_t min, uint32_t max) @@ -5993,7 +6013,8 @@ static IXML_FIELD SmFields[] = { { tag:"Multicast", format:'k', subfields:SmMcastFields, start_func:SmMcastXmlParserStart, end_func:SmMcastXmlParserEnd }, { tag:"RoutingAlgorithm", format:'s', IXML_FIELD_INFO(SMXmlConfig_t, routing_algorithm) }, { tag:"DebugJm", format:'u', IXML_FIELD_INFO(SMXmlConfig_t, debug_jm) }, - { tag:"LinkPolicy", format:'k', subfields:SmLinkPolicyFields, start_func:SmLinkPolicyXmlParserStart }, + { tag:"HFILinkPolicy", format:'k', subfields:SmLinkPolicyFields, start_func:SmHFILinkPolicyXmlParserStart }, + { tag:"ISLLinkPolicy", format:'k', subfields:SmLinkPolicyFields, start_func:SmISLLinkPolicyXmlParserStart }, { tag:"Preemption", format:'k', subfields:SmPreemptionFields, start_func:SmPreemptionXmlParserStart }, { tag:"CongestionControl", format:'k', subfields:SmCongestionFields, start_func:SmCongestionXmlParserStart }, { tag:"AdaptiveRouting", format:'k', subfields:SmAdaptiveRoutingFields, start_func:SmAdaptiveRoutingXmlParserStart, end_func:SmAdaptiveRoutingXmlParserEnd }, @@ -9257,25 +9278,49 @@ verifyFmConfig(char* filename, uint32_t flags) return 0; } +int copyPEMFile(char *src, char *pem_filename) { + char fn[64]; + + /* copy new file replacing old one */ + snprintf(fn, sizeof(fn),"%s/%s.pem", DIR_BASE_NAME, pem_filename); + if (vcopy(src, fn, FALSE) != OK) { + sysPrintf("%s %d vcopy %s to %s failed\n", __FUNCTION__, __LINE__, src, fn); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); + rm(src); + return 0; + } + + // mirror the XML file to remote CPU - if this is not a multi-CPU system then + // the call will simply return without doing any mirroring +#if defined(__VXWORKS__) + cmuRed_cfgIfMasterSyncSlavePEM(pem_filename); +#endif + + rm(src); + updateLastScpRetCode(SCP_FF_ERR_OK); + SCP_LOG( "Copy file %s to %s successful.", src, fn); + return 1; +} + /*********************************** This function will: - 1 - copy (src) [/firmware/opafm.xml] file to dst compressed file + 1 - copy (src) [/firmware/opafm.xml] file to compressed file [/firmware/temp.xml.z] 2 - check max compressed file size limit 2a - If file size too big, reove both files 3 - verify XML config file. If invalid remove both files - 4 - if ok, copy file to dst [/rfa1/opafm.xml.z]. + 4 - if ok, copy file to flash [/<flashdir>/opafm.xml.z]. 5 - remove src file *************************/ -int copyCompressXMLConfigFile(char *src, char *dst) { +int copyCompressXMLConfigFile(char *src, char *dst_unused_param) { long fileSize=0; uint8_t ret; if (parsingInProcess) { XmlParsePrintError("scp: unable to compress XML config file while parser is in the process of parsing a file already"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf ("scp:Unable to compress into %s while parser is in the process of parsing a file already\n",IFS_FM_CFG_NAME_TEMP); return 0; } @@ -9284,16 +9329,18 @@ int copyCompressXMLConfigFile(char *src, char *dst) { if (copyFile(src, IFS_FM_CFG_NAME_TEMP,-1,&fileSize)) { XmlParsePrintError("scp: unable to compress XML config file"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf ("scp:Unable to compress into %s\n", IFS_FM_CFG_NAME_TEMP); + rm(src); scpInProcess = 0; return 0; } if (fileSize>MAX_XML_COMPRESSED_FILE_SIZE) { XmlParsePrintError("scp: compressed XML config file exceeds max size"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf ("scp:Compressed file size exceeds limit of %ld\n",MAX_XML_COMPRESSED_FILE_SIZE); - rdRemove(RD_DIR_FIRMWARE); + rm(src); + rm(IFS_FM_CFG_NAME_TEMP); scpInProcess = 0; return 0; } @@ -9303,22 +9350,24 @@ int copyCompressXMLConfigFile(char *src, char *dst) { SCP_LOG( "XML parsed ok!"); } else { XmlParsePrintError("scp: Invalid XML config file!"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf("scp: Invalid XML config file!\n"); - rdRemove(RD_DIR_FIRMWARE); + rm(src); + rm(IFS_FM_CFG_NAME_TEMP); scpInProcess = 0; return 0; } SCP_LOG( "Removing old config file %s.",IFS_FM_CFG_NAME); - remove(IFS_FM_CFG_NAME); + rm(IFS_FM_CFG_NAME); SCP_LOG( "copying over %s to %s.",IFS_FM_CFG_NAME_TEMP, IFS_FM_CFG_NAME); if (copyFile( IFS_FM_CFG_NAME_TEMP, IFS_FM_CFG_NAME, 0,NULL)) { XmlParsePrintError("scp: unable to copy compressed XML config file to destination"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf("scp:Unable to copy %s to %s\n", IFS_FM_CFG_NAME_TEMP, IFS_FM_CFG_NAME); - rdRemove(RD_DIR_FIRMWARE); + rm(src); + rm(IFS_FM_CFG_NAME_TEMP); scpInProcess = 0; return 0; } @@ -9328,15 +9377,17 @@ int copyCompressXMLConfigFile(char *src, char *dst) { SCP_LOG( "XML parsed ok on second pass!"); } else { XmlParsePrintError("scp: Invalid XML new config file on second pass!"); - updateLastScpRetCodeForXML(SCP_FF_ERR_XML_UPDATE); + updateLastScpRetCode(SCP_FF_ERR_XML_UPDATE); sysPrintf("scp: Invalid XML new config file in second pass!\n"); - remove(IFS_FM_CFG_NAME); + rm(src); + rm(IFS_FM_CFG_NAME_TEMP); + rm(IFS_FM_CFG_NAME); scpInProcess = 0; return 0; } - // remove the uncompressed xml file from /firmware - rdRemove(RD_DIR_FIRMWARE); + rm(src); + rm(IFS_FM_CFG_NAME_TEMP); // mirror the XML file to remote CPU - if this is not a multi-CPU system then // the call will simply return without doing any mirroring @@ -9344,7 +9395,7 @@ int copyCompressXMLConfigFile(char *src, char *dst) { cmuRed_cfgIfMasterSyncSlave(NULL); #endif - updateLastScpRetCodeForXML(SCP_FF_ERR_OK); + updateLastScpRetCode(SCP_FF_ERR_OK); scpInProcess = 0; diff --git a/Esm/ib/src/fe/fe.h b/Esm/ib/src/fe/fe.h index 8f1067c..2f1ffff 100755 --- a/Esm/ib/src/fe/fe.h +++ b/Esm/ib/src/fe/fe.h @@ -59,8 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************/ #ifndef FE_H #define FE_H -#include "iba/stl_mad.h" -#include "iba/ib_generalServices.h" +#include "net/libnet.h" /* Configuration Defines */ #define PSWD_SIZE 16 @@ -70,11 +69,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /************************************************************************** * OOB PROTOCOL STRUCTURES **************************************************************************/ -typedef struct __OOBHeader { - uint32_t HeaderVersion; /* Version of the FE protocol header */ - uint32_t Length; /* Length of the message data payload */ - uint32_t Reserved[2]; /* Reserved */ -} OOBHeader; /* Header byte swap for OOB network transmission */ static __inline @@ -86,11 +80,6 @@ void BSWAP_OOB_HEADER(OOBHeader *header) header->Reserved[1] = 0; } -typedef struct _OOBPacket { - OOBHeader Header; - MAD_RMPP MadData; -} OOBPacket; - /* Byte swap for OOB packet */ static __inline void BSWAP_OOB_PACKET(OOBPacket *packet) diff --git a/Esm/ib/src/fe/fe_main.c b/Esm/ib/src/fe/fe_main.c index bef2624..9fd0380 100755 --- a/Esm/ib/src/fe/fe_main.c +++ b/Esm/ib/src/fe/fe_main.c @@ -242,7 +242,7 @@ void fe_init_globals(void) // } -uint32_t fe_process_passthrough(uint8_t *netbuf, FE_ConnList *clist) { +uint32_t fe_process_passthrough(uint8_t *netbuf, int buflen, FE_ConnList *clist) { OOBPacket* message; /* Pointer to the incoming packet */ uint32_t rc; /* Return code */ @@ -262,9 +262,16 @@ uint32_t fe_process_passthrough(uint8_t *netbuf, FE_ConnList *clist) { return rc; } - /* Get the header from the message */ + /* First do a simple sanity check on the OOB header */ message= ((OOBPacket *) netbuf); - BSWAP_OOB_PACKET(message); + + BSWAP_OOB_HEADER(&(message->Header)); + if (message->Header.HeaderVersion != STL_BASE_VERSION || message->Header.Length > buflen) { + return FE_NO_COMPLETE; + } + + /* OOB header appears reasonable, so continue to process the message */ + BSWAP_MAD_HEADER((MAD*) &(message->MadData)); /* Process message type and route to the apropriate manager */ switch(message->MadData.common.MgmtClass) { @@ -274,6 +281,9 @@ uint32_t fe_process_passthrough(uint8_t *netbuf, FE_ConnList *clist) { case MCLASS_VFI_PM: /* PA */ rc = fe_pa_passthrough(netbuf, clist, fdsa); break; + default: + rc = FE_NO_COMPLETE; + break; } IB_EXIT(__func__, rc); @@ -436,7 +446,7 @@ int fe_main() while (tlist && !Shutdown) { fe_net_get_next_message(tlist->conn, &netbuf, &buflen, NULL); if (netbuf) - if ((error = fe_process_passthrough((void *)netbuf, tlist))) { + if ((error = fe_process_passthrough((void *)netbuf, buflen, tlist))) { if (error == FE_UNLOGGED) { IB_LOG_ERROR0("Connection not logged in"); } else { diff --git a/Esm/ib/src/fe/net/libnet.c b/Esm/ib/src/fe/net/libnet.c index e4e91f3..d385402 100755 --- a/Esm/ib/src/fe/net/libnet.c +++ b/Esm/ib/src/fe/net/libnet.c @@ -583,7 +583,7 @@ static int ReadFromSocket(NetConnection *conn) { } blob->len = ntohl (blob->magic[1]) - 2 * sizeof (int); - if (blob->len < MIN_PACKET_SIZE) { + if (blob->len < MIN_PACKET_SIZE || blob->len > sizeof(OOBPacket)) { IB_LOG_WARN("packet size is incorrect len:", blob->len); IB_EXIT(__func__, rc); return(NET_FAILED); diff --git a/Esm/ib/src/fe/net/libnet.h b/Esm/ib/src/fe/net/libnet.h index 83ae031..1f50429 100755 --- a/Esm/ib/src/fe/net/libnet.h +++ b/Esm/ib/src/fe/net/libnet.h @@ -70,6 +70,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif +#include "iba/stl_mad.h" +#include "iba/ib_generalServices.h" + #include "netblob.h" #include "netqueue.h" #include "cs_g.h" @@ -153,6 +156,20 @@ struct NetConnection_t { }; typedef struct NetConnection_t NetConnection; +/************************************************************************** +* OOB PROTOCOL STRUCTURES +**************************************************************************/ +typedef struct __OOBHeader { + uint32_t HeaderVersion; /* Version of the FE protocol header */ + uint32_t Length; /* Length of the message data payload */ + uint32_t Reserved[2]; /* Reserved */ +} OOBHeader; + +typedef struct _OOBPacket { + OOBHeader Header; + MAD_RMPP MadData; +} OOBPacket; + /* * Error defines */ @@ -168,7 +185,7 @@ typedef struct NetConnection_t NetConnection; #define NET_CANNOT_CONNECT 6 typedef int NetError; -#define MIN_PACKET_SIZE 24 +#define MIN_PACKET_SIZE (sizeof(MAD_COMMON) + sizeof(RMPP_HEADER)) /* * Prototypes of externally callable Net functions diff --git a/Esm/ib/src/if3/felib.c b/Esm/ib/src/if3/felib.c index 8cf6f9d..30645c1 100755 --- a/Esm/ib/src/if3/felib.c +++ b/Esm/ib/src/if3/felib.c @@ -2470,8 +2470,8 @@ if3_dbsync_send_mad(IBhandle_t fd, SA_MAD *psa, uint32_t dataLength, uint8_t *bu mi->rmppPool, mi->rmppDataLength, mi->rmppMaxCntxt, - &mi->rmppGetfd, - &mi->rmppGetTablefd, + (mi->rmppCreateFilters) ? &mi->rmppGetfd : NULL, + (mi->rmppCreateFilters) ? &mi->rmppGetTablefd : NULL, mi->mclass, if3_rmpp_get_method_text, cs_getAidName, @@ -2697,9 +2697,9 @@ if3_dbsync_send_multi_mad (IBhandle_t fd, SA_MAD *psa, mi->port, mi->rmppPool, mi->rmppDataLength, - mi->rmppMaxCntxt, - &mi->rmppGetfd, - &mi->rmppGetTablefd, + mi->rmppMaxCntxt, + (mi->rmppCreateFilters) ? &mi->rmppGetfd : NULL, + (mi->rmppCreateFilters) ? &mi->rmppGetTablefd : NULL, mi->mclass, if3_rmpp_get_method_text, cs_getAidName, @@ -2860,8 +2860,8 @@ if3_dbsync_cmd_from_mngr (IBhandle_t fd, Mai_t *maip, uint8_t *buffer, uint32_t mi->rmppPool, mi->rmppDataLength, mi->rmppMaxCntxt, - &mi->rmppGetfd, - &mi->rmppGetTablefd, + (mi->rmppCreateFilters) ? &mi->rmppGetfd : NULL, + (mi->rmppCreateFilters) ? &mi->rmppGetTablefd : NULL, mi->mclass, if3_rmpp_get_method_text, cs_getAidName, diff --git a/Esm/ib/src/linux/startup/opafm_src.xml b/Esm/ib/src/linux/startup/opafm_src.xml index 03000f9..1a9582b 100644 --- a/Esm/ib/src/linux/startup/opafm_src.xml +++ b/Esm/ib/src/linux/startup/opafm_src.xml @@ -1261,6 +1261,7 @@ <!-- **************Link Policy************** --> <!-- LinkPolicy --> + <!-- There is a separate LinkPolicy for HFI and ISL --> <!-- These settings set bounds on acceptable Link Width values. --> <!-- --> <!-- MaxDroppedLanes --> @@ -1282,14 +1283,22 @@ <!-- "4x" - disable any links initialized with less than 4 lanes--> <!-- *Note that the "Supported" link policy is implicitly enabled when --> <!-- using any of the available policies. --> - <LinkPolicy> + + <HFILinkPolicy> <MaxDroppedLanes>1</MaxDroppedLanes> <WidthPolicy> <Enable>1</Enable> <Policy>Supported</Policy> </WidthPolicy> - </LinkPolicy> - + </HFILinkPolicy> + + <ISLLinkPolicy> + <MaxDroppedLanes>1</MaxDroppedLanes> + <WidthPolicy> + <Enable>1</Enable> + <Policy>Supported</Policy> + </WidthPolicy> + </ISLLinkPolicy> <!-- Preemption Configuration --> <!-- Preemption is based on packet size and a VL/VF Preemption matrix. --> <!-- Preemption allows a "small" packet to preempt a "large" packet to --> @@ -1711,7 +1720,7 @@ <!-- Enables fabric activation optimization to reduce packet counts --> <!-- during fabric bring up. 0-Disable, 1-Switches only, 2-All devices --> - <SwitchCascadeActivateEnable>0</SwitchCascadeActivateEnable> + <SwitchCascadeActivateEnable>2</SwitchCascadeActivateEnable> <!-- Number of times to retry activation upon detecting an armed port --> <!-- with a non-armed/active neighbor. --> diff --git a/Esm/ib/src/pm/pm/paAccess.c b/Esm/ib/src/pm/pm/paAccess.c index ebfa377..9e375d1 100644 --- a/Esm/ib/src/pm/pm/paAccess.c +++ b/Esm/ib/src/pm/pm/paAccess.c @@ -3654,7 +3654,7 @@ int getPMHistFileData(char *filename, uint32_t histindex, uint8_t *buffer, uint3 } // End of getPMHistFileData() // return latest Master PM Sweep Image Data copied into memory pointed to by buffer -int getPMSweepImageData(char *filename, uint32_t histindex, uint8_t *buffer, uint32_t bufflen, uint32_t *filelen) +int getPMSweepImageData(char *filename, uint32_t histindex, uint8_t isCompressed, uint8_t *buffer, uint32_t bufflen, uint32_t *filelen) { uint32_t index=0; @@ -3681,7 +3681,7 @@ int getPMSweepImageData(char *filename, uint32_t histindex, uint8_t *buffer, uin } IB_LOG_VERBOSE_FMT(__func__, "Going to send latest hist imageIndex=0x%x size=0x%x", histindex, computeCompositeSize()); snprintf(filename, SMDBSYNCFILE_NAME_LEN, "%s/latest_sweep", pm->ShortTermHistory.filepath); - writeImageToBuffer(pm, histindex, buffer, &index); + writeImageToBuffer(pm, histindex, isCompressed, buffer, &index); appendFreezeFrameDetails(buffer, &index); *filelen = index; } @@ -4165,8 +4165,9 @@ FSTATUS putPMSweepImageDataR(uint8_t *p_img_in, uint32_t len_img_in) { return -1; } + BSWAP_PM_FILE_HEADER(&((PmCompositeImage_t *)p_img_in)->header); #ifndef __VXWORKS__ - // Decompress image if compressed (PmLoadComposite as a model) + // Decompress image if compressed if (cimg_in->header.common.isCompressed) { status = vs_pool_alloc(&pm_pool, cimg_in->header.flatSize, (void *)&bf_decompress); if (status != VSTATUS_OK || !bf_decompress) { @@ -4195,8 +4196,9 @@ FSTATUS putPMSweepImageDataR(uint8_t *p_img_in, uint32_t len_img_in) { #ifndef __VXWORKS__ } #endif + BSWAP_PM_COMPOSITE_IMAGE_FLAT((PmCompositeImage_t *)p_decompress, 0); - // Rebuild composite (PmLoadComposite as a model) + // Rebuild composite //status = vs_pool_alloc(&pm_pool, sizeof(PmCompositeImage_t), (void *)&cimg_out); cimg_out = calloc(1,sizeof(PmCompositeImage_t)); if (!cimg_out) { diff --git a/Esm/ib/src/pm/pm/pm_sweep.c b/Esm/ib/src/pm/pm/pm_sweep.c index 7d2f3ff..0c32206 100644 --- a/Esm/ib/src/pm/pm/pm_sweep.c +++ b/Esm/ib/src/pm/pm/pm_sweep.c @@ -1759,7 +1759,7 @@ void *threadDecompress(void *args) { * * *************************************************************************************/ -FSTATUS decompressAndReassemble(unsigned char *input_data, size_t input_size, uint8 divs, size_t *input_sizes, unsigned char *output_data, size_t output_size) { +FSTATUS decompressAndReassemble(unsigned char *input_data, size_t input_size, uint8 divs, uint64 *input_sizes, unsigned char *output_data, size_t output_size) { // first check divs, make sure it isn't over the max if (divs > PM_MAX_COMPRESSION_DIVISIONS) { IB_LOG_ERROR_FMT(NULL, "Unable to decompress, invalid number of divisions: %d", divs); @@ -1785,7 +1785,7 @@ FSTATUS decompressAndReassemble(unsigned char *input_data, size_t input_size, ui // input input_pieces[i] = loc; loc += input_sizes[i]; - total_in += input_sizes[i]; + total_in += (size_t)input_sizes[i]; } if (total_in > input_size) { IB_LOG_ERROR0("Unable to decompress, invalid division sizes"); @@ -1801,7 +1801,7 @@ FSTATUS decompressAndReassemble(unsigned char *input_data, size_t input_size, ui pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); for (i = 0; i < divs; i++) { args[i].input_data = input_pieces[i]; - args[i].input_size = input_sizes[i]; + args[i].input_size = (size_t)input_sizes[i]; args[i].output_data = output_data + (i * len); args[i].output_size = MIN(len, output_size - (i * len)); @@ -2391,7 +2391,7 @@ static void copyCompositeVF(PmVF_t *VF, PmCompositeVF_t *cVF, uint64 imageIndex) *************************************************************************************/ static void setFilename(PmShortTermHistory_t *sth, PmCompositeImage_t *cimg) { struct tm *now_tm; - now_tm = gmtime(&cimg->sweepStart); + now_tm = gmtime((time_t *)&cimg->sweepStart); if (!now_tm) { // This should never happen IB_LOG_ERROR0("Unable to get current time"); @@ -2477,13 +2477,14 @@ void PmFreeComposite(PmCompositeImage_t *cimg) { * Inputs: * pm - the PM * imageIndex - the index of the image to use to create the composite +* isCompressed - the image is compressed * * Returns: * A pointer to the newly created composite * -* Note: filename, recordID, timestamp, isCompressed, and previousFileName are -not- handled by this function +* Note: filename, recordID, timestamp and previousFileName are -not- handled by this function *************************************************************************************/ -PmCompositeImage_t *PmCreateComposite(Pm_t *pm, uint32 imageIndex) { +PmCompositeImage_t *PmCreateComposite(Pm_t *pm, uint32 imageIndex, uint8 isCompressed) { PmCompositeImage_t *cimg; PmImage_t *img = &(pm->Image[pm->history[imageIndex]]); int i; @@ -2493,20 +2494,14 @@ PmCompositeImage_t *PmCreateComposite(Pm_t *pm, uint32 imageIndex) { return NULL; // intialize some of the header fields + cimg->header.common.isCompressed = isCompressed; cimg->header.common.imagesPerComposite = 1; cimg->header.common.imageSweepInterval = pm_config.sweep_interval; cimg->header.common.imageIDs[0] = buildShortTermHistoryImageId(pm, imageIndex); cimg->header.historyVersion = PM_HISTORY_VERSION; -#ifdef __VXWORKS__ - // embedded composites are not compressed - cimg->header.common.isCompressed = 0; -#else - // otherwise composites are always compressed - cimg->header.common.isCompressed = 1; -#endif // initialize the composite vales from the image - cimg->sweepStart = img->sweepStart; + cimg->sweepStart = (uint64)img->sweepStart; cimg->sweepDuration = img->sweepDuration; cimg->topologyChanged = 0; cimg->written = 0; @@ -2526,7 +2521,7 @@ PmCompositeImage_t *PmCreateComposite(Pm_t *pm, uint32 imageIndex) { cimg->numVFsActive = pm->numVFsActive; cimg->maxLid = img->maxLid; cimg->numPorts = 0; - memcpy(cimg->SMs, img->SMs, sizeof(cimg->SMs[0]) * 2); + memcpy(cimg->SMs, img->SMs, sizeof(cimg->SMs[0]) * PM_HISTORY_MAX_SMS_PER_COMPOSITE); // copy all of the groups copyCompositeGroup(pm->AllPorts, &(cimg->allPortsGroup), pm->history[imageIndex]); @@ -3120,7 +3115,7 @@ PmImage_t *PmReconstituteImage(PmShortTermHistory_t *sth, PmCompositeImage_t *ci return NULL; } img->maxLid = cimg->maxLid; - img->sweepStart = cimg->sweepStart; + img->sweepStart = (time_t)cimg->sweepStart; img->sweepDuration = cimg->sweepDuration; img->HFIPorts = cimg->HFIPorts; img->SwitchNodes = cimg->switchNodes; @@ -3293,7 +3288,7 @@ FSTATUS PmLoadComposite(Pm_t *pm, PmHistoryRecord_t *record, PmCompositeImage_t } // allocate the img_data buffer - img_len = ((PmFileHeader_t*)raw_data)->flatSize; + img_len = (size_t)((PmFileHeader_t*)raw_data)->flatSize; // checkout the flat size - it needs to be at least enough to hold the image header if (img_len < sizeof(PmFileHeader_t)) { #ifdef __VXWORKS__ @@ -3532,7 +3527,7 @@ FSTATUS storeComposite(Pm_t *pm, PmCompositeImage_t *cimg) { writeLen = len = computeFlatSize(cimg); // update the header cimg->header.flatSize = len; - vs_stdtime_get(&(cimg->header.common.timestamp)); + vs_stdtime_get((time_t *)&(cimg->header.common.timestamp)); // data will hold the flattened image data = calloc(1, len); @@ -3566,7 +3561,7 @@ FSTATUS storeComposite(Pm_t *pm, PmCompositeImage_t *cimg) { writeLen = sizeof(PmFileHeader_t); for (i=0; i < pm_config.shortTermHistory.compressionDivisions; i++) { writeLen += compressed_sizes[i]; - ((PmFileHeader_t*)data)->divisionSizes[i] = compressed_sizes[i]; + ((PmFileHeader_t*)data)->divisionSizes[i] = (uint64)compressed_sizes[i]; } // check disk space @@ -3644,6 +3639,14 @@ error: // non-static is temporary FSTATUS compoundNewImage(Pm_t *pm) { FSTATUS ret = FSUCCESS; +#ifdef __VXWORKS__ + // composites are not compressed for embedded + uint8_t isCompressed = 0; +#else + // composites are always compressed otherwise + uint8_t isCompressed = 1; +#endif + // if there is no image, or the current one has already been written if (!pm->ShortTermHistory.currentComposite || pm->ShortTermHistory.currentComposite->written) { if (pm->ShortTermHistory.currentComposite) { @@ -3652,7 +3655,7 @@ FSTATUS compoundNewImage(Pm_t *pm) { pm->ShortTermHistory.currentComposite = NULL; } //create a new composite from the latest image - pm->ShortTermHistory.currentComposite = PmCreateComposite(pm, pm->lastHistoryIndex); + pm->ShortTermHistory.currentComposite = PmCreateComposite(pm, pm->lastHistoryIndex, isCompressed); if (!pm->ShortTermHistory.currentComposite) { IB_LOG_WARN0("Failed to create a new composite Image"); return FERROR; @@ -3674,13 +3677,6 @@ FSTATUS compoundNewImage(Pm_t *pm) { pruneOneStoredHistoryFile(&pm->ShortTermHistory, cindex); // finalize the header -#ifdef __VXWORKS__ - // composites are not compressed for embedded - pm->ShortTermHistory.currentComposite->header.common.isCompressed = 0; -#else - // composites are always compressed otherwise - pm->ShortTermHistory.currentComposite->header.common.isCompressed = 1; -#endif setFilename(&(pm->ShortTermHistory), pm->ShortTermHistory.currentComposite); ret = storeComposite(pm, pm->ShortTermHistory.currentComposite); @@ -4176,7 +4172,7 @@ FSTATUS storeCompositeToBuffer(PmCompositeImage_t *cimg, uint8_t *buffer, uint32 len = computeFlatSize(cimg); // update the header cimg->header.flatSize = len; - vs_stdtime_get(&(cimg->header.common.timestamp)); + vs_stdtime_get((time_t *)&(cimg->header.common.timestamp)); // data will hold the flattened image data = calloc(1, len); @@ -4190,6 +4186,7 @@ FSTATUS storeCompositeToBuffer(PmCompositeImage_t *cimg, uint8_t *buffer, uint32 free(data); return ret; } + BSWAP_PM_COMPOSITE_IMAGE_FLAT((PmCompositeImage_t *)data, 1); if (cimg->header.common.isCompressed) { #ifdef __VXWORKS__ @@ -4199,6 +4196,7 @@ FSTATUS storeCompositeToBuffer(PmCompositeImage_t *cimg, uint8_t *buffer, uint32 #else unsigned char **compressed_divisions = calloc(1, sizeof(unsigned char*) * pm_config.shortTermHistory.compressionDivisions); size_t *compressed_sizes = calloc(1, sizeof(size_t) * pm_config.shortTermHistory.compressionDivisions); + if (!compressed_divisions || !compressed_sizes) { IB_LOG_ERROR0("Failed to allocate data for compression"); if (compressed_divisions) free(compressed_divisions); @@ -4238,12 +4236,14 @@ FSTATUS storeCompositeToBuffer(PmCompositeImage_t *cimg, uint8_t *buffer, uint32 *bIndex += len; } + BSWAP_PM_FILE_HEADER(&((PmCompositeImage_t *)buffer)->header); + done: free(data); return ret; } -void writeImageToBuffer(Pm_t *pm, uint32 histindex, uint8_t *buffer, uint32_t *bIndex) { +void writeImageToBuffer(Pm_t *pm, uint32 histindex, uint8_t isCompressed, uint8_t *buffer, uint32_t *bIndex) { FSTATUS ret; if (!buffer || !bIndex || histindex == PM_IMAGE_INDEX_INVALID) { @@ -4252,19 +4252,12 @@ void writeImageToBuffer(Pm_t *pm, uint32 histindex, uint8_t *buffer, uint32_t *b } PmCompositeImage_t *cimg1; - cimg1 = PmCreateComposite(pm, histindex); + cimg1 = PmCreateComposite(pm, histindex, isCompressed); if (cimg1 == NULL) { IB_LOG_ERROR0("Failed to create PM Composite Image"); return; } -#ifdef __VXWORKS__ - // embedded composites are not compressed - cimg1->header.common.isCompressed = 0; -#else - // otherwise composites are always compressed - cimg1->header.common.isCompressed = 1; -#endif ret = storeCompositeToBuffer(cimg1, buffer, bIndex); PmFreeComposite(cimg1); if (ret != FSUCCESS) { diff --git a/Esm/ib/src/pm/pm/pm_topology.h b/Esm/ib/src/pm/pm/pm_topology.h index fd4dfe6..8347285 100644 --- a/Esm/ib/src/pm/pm/pm_topology.h +++ b/Esm/ib/src/pm/pm/pm_topology.h @@ -144,19 +144,27 @@ typedef struct PmCompositePortCounters_s { union { uint8 AsReg8; struct { +#if CPU_BE uint8 NumLanesDown:4; uint8 Reserved:1; uint8 LinkQualityIndicator:3; +#else + uint8 LinkQualityIndicator:3; + uint8 Reserved:1; + uint8 NumLanesDown:4; +#endif // CPU_BE } s; } lq; + uint8 Reserved2[6]; } PmCompositePortCounters_t; typedef struct _vls_pctrs PmCompositeVLCounters_t; typedef struct PmCompositeVfvlmap_s { - uint8 VF; //index into vf array uint32 vl; + uint8 VF; //index into vf array + uint8 Reserved[3]; } PmCompositeVfvlmap_t; #define UPDATE_MAX(max, cnt) do { if (cnt > max) max = cnt; } while (0) @@ -202,6 +210,7 @@ typedef struct ErrorSummary_s { uint16 UtilizationPct10; /* in units of 10% */ uint16 DiscardsPct10; /* in units of 10% */ + uint32 Reserved; } ErrorSummary_t; // weight to use for each Integrity counter in weighted sum @@ -521,6 +530,7 @@ typedef struct PmPort_s { uint32 spare:2; struct _vl_bucket_flagbucket_flags { +#if CPU_BE uint32 IntLinkFlags:8; // not used here uint32 UtilBucket:4;// MBps utilization bucket: 0 - PM_UTIL_BUCKETS-1 // Error Buckets (0-PM_ERR_BUCKETS-1) @@ -531,6 +541,17 @@ typedef struct PmPort_s { uint32 SecurityBucket:3; // Security Errors uint32 RoutingBucket:3;// Routing Errors uint32 spare:2; +#else + uint32 spare:2; + uint32 RoutingBucket:3; + uint32 SecurityBucket:3; + uint32 BubbleBucket:3; + uint32 SmaCongestionBucket:3; + uint32 CongestionBucket:3; + uint32 IntegrityBucket:3; + uint32 UtilBucket:4; + uint32 IntLinkFlags:8; +#endif // CPU_BE } VLBucketFlags [MAX_PM_VLS]; // for statistics below, each interval we: @@ -732,16 +753,20 @@ typedef struct PmImage_s { #define PM_HISTORY_FILENAME_LEN 133 #define PM_HISTORY_MAX_IMAGES_PER_COMPOSITE 60 +#define PM_HISTORY_MAX_SMS_PER_COMPOSITE 2 #define PM_HISTORY_MAX_LOCATION_LEN 111 -#define PM_HISTORY_VERSION 3 +#define PM_HISTORY_VERSION 4 #define PM_MAX_COMPRESSION_DIVISIONS 32 typedef struct PmCompositePort_s { - Guid_t guid; - uint8 portNum; + uint64 guid; + // This is problematic to maintain, but a short-term work-around: + // Single instances of uint32 are gathered here so that an even number of them + // can be maintained to ensure HSM and ESM have the same 64-bit data alignment union { uint32 AsReg32; struct { +#if CPU_BE uint32 active:1; uint32 mtu:4; uint32 txActiveWidth:4; @@ -757,20 +782,33 @@ typedef struct PmCompositePort_s { uint32 ClearAll:1; #if PM_COMPRESS_GROUPS uint32 InGroups:3; +#else + uint32 reserved:3; +#endif +#else +#if PM_COMPRESS_GROUPS + uint32 InGroups:3; +#else + uint32 reserved:3; #endif + uint32 ClearAll:1; + uint32 ClearSome:1; + uint32 gotErrorCntrs:1; + uint32 gotDataCntrs:1; + uint32 UnexpectedClear:1; + uint32 queryStatus:2; + uint32 Initialized:1; + uint32 bucketComputed:1; + uint32 activeSpeed:2; + uint32 rxActiveWidth:4; + uint32 txActiveWidth:4; + uint32 mtu:4; + uint32 active:1; +#endif // CPU_BE } s; } u; - STL_LID_32 neighborLid; - PORT neighborPort; - uint8 numVFs; - uint32 sendMBps; - uint32 sendKPps; - uint32 VFSendMBps[MAX_VFABRICS]; - uint32 VFSendKPps[MAX_VFABRICS]; - uint8 groups[PM_MAX_GROUPS_PER_PORT]; - PmCompositeVfvlmap_t compVfVlmap[MAX_VFABRICS]; - uint32 vlSelectMask; +#if CPU_BE uint32 intLinkFlags:8; uint32 utilBucket:4; uint32 integrityBucket:3; @@ -780,30 +818,58 @@ typedef struct PmCompositePort_s { uint32 securityBucket:3; uint32 routingBucket:3; uint32 spare:2; +#else + uint32 spare:2; + uint32 routingBucket:3; + uint32 securityBucket:3; + uint32 bubbleBucket:3; + uint32 smaCongestionBucket:3; + uint32 congestionBucket:3; + uint32 integrityBucket:3; + uint32 utilBucket:4; + uint32 intLinkFlags:8; +#endif // CPU_BE + + STL_LID_32 neighborLid; + uint8 portNum; + PORT neighborPort; + uint8 numVFs; + uint8 reserved; + uint32 sendMBps; + uint32 sendKPps; + uint8 groups[PM_MAX_GROUPS_PER_PORT]; + uint32 vlSelectMask; + CounterSelectMask_t clearSelectMask; + uint32 reserved99; + // End of single instances of uint32; see above + uint32 VFSendMBps[MAX_VFABRICS]; + uint32 VFSendKPps[MAX_VFABRICS]; + PmCompositeVfvlmap_t compVfVlmap[MAX_VFABRICS]; struct _vl_bucket_flagbucket_flags VLBucketFlags[MAX_PM_VLS]; PmCompositePortCounters_t stlPortCounters; PmCompositeVLCounters_t stlVLPortCounters[MAX_PM_VLS]; - CounterSelectMask_t clearSelectMask; ErrorSummary_t errors; ErrorSummary_t VFErrors[MAX_VFABRICS]; } PmCompositePort_t; typedef struct PmCompositeNode_s { - Guid_t guid; + uint64 guid; char nodeDesc[STL_NODE_DESCRIPTION_ARRAY_SIZE]; uint16 lid; uint8 nodeType; uint8 numPorts; + uint32 reserved; PmCompositePort_t **ports; } PmCompositeNode_t; typedef struct PmCompositeVF_s { char name[MAX_VFABRIC_NAME]; - uint8 isActive; uint32 numPorts; + uint8 isActive; uint8 minIntRate; uint8 maxIntRate; + uint8 reserved; PmUtilStats_t intUtil; PmErrStats_t intErr; } PmCompositeVF_t; @@ -816,6 +882,7 @@ typedef struct PmCompositeGroups_s { uint8 maxIntRate; uint8 minExtRate; uint8 maxExtRate; + uint32 reserved; PmUtilStats_t intUtil; PmUtilStats_t sendUtil; PmUtilStats_t recvUtil; @@ -825,8 +892,9 @@ typedef struct PmCompositeGroups_s { typedef struct PmHistoryHeaderCommon_s { char filename[PM_HISTORY_FILENAME_LEN]; - time_t timestamp; - boolean isCompressed; + uint64 timestamp; + uint8 isCompressed; + uint8 reserved; uint16 imagesPerComposite; uint32 imageSweepInterval; uint64 imageIDs[PM_HISTORY_MAX_IMAGES_PER_COMPOSITE]; @@ -834,20 +902,22 @@ typedef struct PmHistoryHeaderCommon_s { typedef struct PmFileHeader_s { PmHistoryHeaderCommon_t common; + uint64 flatSize; uint16 historyVersion; - size_t flatSize; - uint8 numDivisions; - size_t divisionSizes[PM_MAX_COMPRESSION_DIVISIONS]; + uint8 numDivisions; + uint8 reserved[5]; + uint64 divisionSizes[PM_MAX_COMPRESSION_DIVISIONS]; } PmFileHeader_t; typedef struct PmCompositeImage_s { PmFileHeader_t header; - time_t sweepStart; + uint64 sweepStart; uint32 sweepDuration; - boolean topologyChanged; - boolean written; + uint8 topologyChanged; + uint8 written; uint16 HFIPorts; uint16 switchNodes; + uint16 reserved; uint32 switchPorts; uint32 numLinks; uint32 numSMs; @@ -864,9 +934,16 @@ typedef struct PmCompositeImage_s { uint32 numPorts; struct PmCompositeSmInfo { uint16 smLid; // implies port, 0 if empty record +#if CPU_BE uint8 priority:4; // present priority uint8 state:4; // present state - } SMs[2]; +#else + uint8 state:4; + uint8 priority:4; +#endif + uint8 reserved; + } SMs[PM_HISTORY_MAX_SMS_PER_COMPOSITE]; + uint32 reserved2; PmCompositeGroup_t allPortsGroup; PmCompositeGroup_t groups[PM_MAX_GROUPS]; PmCompositeVF_t VFs[MAX_VFABRICS]; @@ -982,11 +1059,332 @@ typedef struct Pm_s { PmImage_t *Image; } Pm_t; + +static __inline +void +BSWAP_PM_BUCKET(pm_bucket_t *Dest, uint32 numBuckets) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numBuckets; i++) + Dest[i] = ntoh32(Dest[i]); +#endif +} // End of BSWAP_PM_BUCKET + +static __inline +void +BSWAP_PM_UTIL_STATS(PmUtilStats_t *Dest) +{ +#if CPU_LE + Dest->TotMBps = ntoh64(Dest->TotMBps); + Dest->TotKPps = ntoh64(Dest->TotKPps); + Dest->AvgMBps = ntoh32(Dest->AvgMBps); + Dest->MinMBps = ntoh32(Dest->MinMBps); + Dest->MaxMBps = ntoh32(Dest->MaxMBps); + BSWAP_PM_BUCKET(Dest->BwPorts, PM_UTIL_BUCKETS); + Dest->AvgKPps = ntoh32(Dest->AvgKPps); + Dest->MinKPps = ntoh32(Dest->MinKPps); + Dest->MaxKPps = ntoh32(Dest->MaxKPps); +#endif +} // End of BSWAP_PM_UTIL_STATS + +static __inline +void +BSWAP_PM_ERROR_SUMMARY(ErrorSummary_t *Dest, uint32 numErrors) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numErrors; i++) { + Dest[i].Integrity = ntoh32(Dest[i].Integrity); + Dest[i].Congestion = ntoh32(Dest[i].Congestion); + Dest[i].SmaCongestion = ntoh32(Dest[i].SmaCongestion); + Dest[i].Bubble = ntoh32(Dest->Bubble); + Dest[i].Security = ntoh32(Dest[i].Security); + Dest[i].Routing = ntoh32(Dest[i].Routing); + Dest[i].UtilizationPct10 = ntoh16(Dest[i].UtilizationPct10); + Dest[i].DiscardsPct10 = ntoh16(Dest[i].DiscardsPct10); + } +#endif +} // End of BSWAP_PM_ERROR_SUMMARY + +static __inline +void +BSWAP_PM_ERROR_BUCKET(ErrorBucket_t *Dest, uint32 numBuckets) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numBuckets; i++) { + BSWAP_PM_BUCKET(&Dest[i].Integrity, 1); + BSWAP_PM_BUCKET(&Dest[i].Congestion, 1); + BSWAP_PM_BUCKET(&Dest[i].SmaCongestion, 1); + BSWAP_PM_BUCKET(&Dest[i].Bubble, 1); + BSWAP_PM_BUCKET(&Dest[i].Security, 1); + BSWAP_PM_BUCKET(&Dest[i].Routing, 1); + } +#endif +} // End of BSWAP_PM_ERROR_BUCKET + +static __inline +void +BSWAP_PM_ERR_STATS(PmErrStats_t *Dest) +{ +#if CPU_LE + BSWAP_PM_ERROR_SUMMARY(&Dest->Max, 1); + BSWAP_PM_ERROR_BUCKET(Dest->Ports, PM_ERR_BUCKETS); +#endif +} // End of BSWAP_PM_ERR_STATS + +static __inline +void +BSWAP_PM_COMPOSITE_VFVLMAP(PmCompositeVfvlmap_t *Dest, uint32 numVFs) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numVFs; i++) { + Dest[i].vl = ntoh32(Dest[i].vl); + } +#endif +} // End of BSWAP_PM_COMPOSITE_VFVLMAP + +static __inline +void +BSWAP_PM_COMPOSITE_PORT_COUNTERS(PmCompositePortCounters_t *Dest) +{ +#if CPU_LE + Dest->VLSelectMask = ntoh32(Dest->VLSelectMask); + Dest->PortXmitData = ntoh64(Dest->PortXmitData); + Dest->PortRcvData = ntoh64(Dest->PortRcvData); + Dest->PortXmitPkts = ntoh64(Dest->PortXmitPkts); + Dest->PortRcvPkts = ntoh64(Dest->PortRcvPkts); + Dest->PortMulticastXmitPkts = ntoh64(Dest->PortMulticastXmitPkts); + Dest->PortMulticastRcvPkts = ntoh64(Dest->PortMulticastRcvPkts); + Dest->SwPortCongestion = ntoh64(Dest->SwPortCongestion); + Dest->SwPortCongestion = ntoh64(Dest->SwPortCongestion); + Dest->PortRcvFECN = ntoh64(Dest->PortRcvFECN); + Dest->PortRcvBECN = ntoh64(Dest->PortRcvBECN); + Dest->PortXmitTimeCong = ntoh64(Dest->PortXmitTimeCong); + Dest->PortXmitWastedBW = ntoh64(Dest->PortXmitWastedBW); + Dest->PortXmitWaitData = ntoh64(Dest->PortXmitWaitData); + Dest->PortRcvBubble = ntoh64(Dest->PortRcvBubble); + Dest->PortMarkFECN = ntoh64(Dest->PortMarkFECN); + Dest->PortRcvConstraintErrors = ntoh64(Dest->PortRcvConstraintErrors); + Dest->PortRcvSwitchRelayErrors = ntoh64(Dest->PortRcvSwitchRelayErrors); + Dest->PortXmitDiscards = ntoh64(Dest->PortXmitDiscards); + Dest->PortXmitConstraintErrors = ntoh64(Dest->PortXmitConstraintErrors); + Dest->PortRcvRemotePhysicalErrors = ntoh64(Dest->PortRcvRemotePhysicalErrors); + Dest->LocalLinkIntegrityErrors = ntoh64(Dest->LocalLinkIntegrityErrors); + Dest->PortRcvErrors = ntoh64(Dest->PortRcvErrors); + Dest->ExcessiveBufferOverruns = ntoh64(Dest->ExcessiveBufferOverruns); + Dest->FMConfigErrors = ntoh64(Dest->FMConfigErrors); + Dest->LinkErrorRecovery = ntoh32(Dest->LinkErrorRecovery); + Dest->LinkDowned = ntoh32(Dest->LinkDowned); +#endif +} // End of BSWAP_PM_COMPOSITE_PORT_COUNTERS + +static __inline +void +BSWAP_PM_COMPOSITE_VL_COUNTERS(PmCompositeVLCounters_t *Dest, uint32 numVLs) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numVLs; i++) { + Dest[i].PortVLXmitData = ntoh64(Dest[i].PortVLXmitData); + Dest[i].PortVLRcvData = ntoh64(Dest[i].PortVLRcvData); + Dest[i].PortVLXmitPkts = ntoh64(Dest[i].PortVLXmitPkts); + Dest[i].PortVLRcvPkts = ntoh64(Dest[i].PortVLRcvPkts); + Dest[i].PortVLXmitWait = ntoh64(Dest[i].PortVLXmitWait); + Dest[i].SwPortVLCongestion = ntoh64(Dest[i].SwPortVLCongestion); + Dest[i].PortVLRcvFECN = ntoh64(Dest[i].PortVLRcvFECN); + Dest[i].PortVLRcvBECN = ntoh64(Dest[i].PortVLRcvBECN); + Dest[i].PortVLXmitTimeCong = ntoh64(Dest[i].PortVLXmitTimeCong); + Dest[i].PortVLXmitWastedBW = ntoh64(Dest[i].PortVLXmitWastedBW); + Dest[i].PortVLXmitWaitData = ntoh64(Dest[i].PortVLXmitWaitData); + Dest[i].PortVLRcvBubble = ntoh64(Dest[i].PortVLRcvBubble); + Dest[i].PortVLMarkFECN = ntoh64(Dest[i].PortVLMarkFECN); + Dest[i].PortVLXmitDiscards = ntoh64(Dest[i].PortVLXmitDiscards); + } +#endif +} // End of BSWAP_PM_COMPOSITE_VL_COUNTERS + +// Composite Ports are flattened (not array of pointers) +static __inline +void +BSWAP_PM_COMPOSITE_PORT(PmCompositePort_t *Dest, uint32 numPorts) +{ +#if CPU_LE + uint32 i, j; + + for (i = 0; i < numPorts; i++) { + Dest[i].guid = ntoh64(Dest[i].guid); + Dest[i].neighborLid = ntoh32(Dest[i].neighborLid); + Dest[i].sendMBps = ntoh32(Dest[i].sendMBps); + Dest[i].sendKPps = ntoh32(Dest[i].sendKPps); + + for (j = 0; j < MAX_VFABRICS; j++) + Dest[i].VFSendMBps[j] = ntoh32(Dest[i].VFSendMBps[j]); + for (j = 0; j < MAX_VFABRICS; j++) + Dest[i].VFSendKPps[j] = ntoh32(Dest[i].VFSendKPps[j]); + + BSWAP_PM_COMPOSITE_VFVLMAP(Dest[i].compVfVlmap, MAX_VFABRICS); + Dest[i].vlSelectMask = ntoh32(Dest[i].vlSelectMask); + // VLBucketFlags is an endian-aware bit structure + BSWAP_PM_COMPOSITE_PORT_COUNTERS(&Dest[i].stlPortCounters); + BSWAP_PM_COMPOSITE_VL_COUNTERS(Dest[i].stlVLPortCounters, MAX_PM_VLS); + // clearSelectMask is an endian-aware bit structure + BSWAP_PM_ERROR_SUMMARY(&Dest[i].errors, 1); + BSWAP_PM_ERROR_SUMMARY(Dest[i].VFErrors, MAX_VFABRICS); + } +#endif +} // End of BSWAP_PM_COMPOSITE_PORT + +// Composite Nodes are flattened (not array of pointers) +static __inline +void +BSWAP_PM_COMPOSITE_NODE(PmCompositeNode_t *Dest, uint32 numNodes) +{ +#if CPU_LE + PmCompositeNode_t *cnode = Dest; + uint32 i; + + for (i = 0; i < numNodes; i++) { + cnode->guid = ntoh64(cnode->guid); + cnode->lid = ntoh16(cnode->lid); + BSWAP_PM_COMPOSITE_PORT((PmCompositePort_t *)&cnode->ports, cnode->numPorts); + // Calc address of next (flattened) composite node + cnode = (PmCompositeNode_t *)((size_t)cnode + (sizeof(PmCompositePort_t) * cnode->numPorts)); + } +#endif +} // End of BSWAP_PM_COMPOSITE_NODE + +static __inline +void +BSWAP_PM_COMPOSITE_VF(PmCompositeVF_t *Dest, uint32 numVFs) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numVFs; i++) { + Dest[i].numPorts = ntoh32(Dest[i].numPorts); + BSWAP_PM_UTIL_STATS(&Dest[i].intUtil); + BSWAP_PM_ERR_STATS(&Dest[i].intErr); + } +#endif +} // End of BSWAP_PM_COMPOSITE_VF + +static __inline +void +BSWAP_PM_COMPOSITE_GROUP(PmCompositeGroup_t *Dest, uint32 numGroups) +{ +#if CPU_LE + uint32 i; + + for (i = 0; i < numGroups; i++) { + Dest[i].numIntPorts = ntoh32(Dest[i].numIntPorts); + Dest[i].numExtPorts = ntoh32(Dest[i].numExtPorts); + BSWAP_PM_UTIL_STATS(&Dest[i].intUtil); + BSWAP_PM_UTIL_STATS(&Dest[i].sendUtil); + BSWAP_PM_UTIL_STATS(&Dest[i].recvUtil); + BSWAP_PM_ERR_STATS(&Dest[i].intErr); + BSWAP_PM_ERR_STATS(&Dest[i].extErr); + } +#endif +} // End of BSWAP_PM_COMPOSITE_GROUP + +static __inline +void +BSWAP_PM_COMPOSITE_SM_INFO(struct PmCompositeSmInfo *Dest, uint32 numSMs) +{ +#if CPU_LE + uint32 i; + for (i = 0; i < numSMs; i++) + Dest[i].smLid = ntoh16(Dest[i].smLid); +#endif +} // End of BSWAP_PM_COMPOSITE_SM_INFO + +static __inline +void +BSWAP_PM_HISTORY_HEADER_COMMON(PmHistoryHeaderCommon_t *Dest) +{ +#if CPU_LE + uint32 i; + + Dest->timestamp = ntoh64(Dest->timestamp); + Dest->imagesPerComposite = ntoh16(Dest->imagesPerComposite); + Dest->imageSweepInterval = ntoh32(Dest->imageSweepInterval); + for (i = 0; i < PM_HISTORY_MAX_IMAGES_PER_COMPOSITE; i++) + Dest->imageIDs[i] = ntoh64(Dest->imageIDs[i]); +#endif +} // End of BSWAP_PM_HISTORY_HEADER_COMMON + +static __inline +void +BSWAP_PM_FILE_HEADER(PmFileHeader_t *Dest) +{ +#if CPU_LE + uint32 i; + + BSWAP_PM_HISTORY_HEADER_COMMON(&Dest->common); + Dest->flatSize = ntoh64(Dest->flatSize); + Dest->historyVersion = ntoh16(Dest->historyVersion); + for (i = 0; i < PM_MAX_COMPRESSION_DIVISIONS; i++) + Dest->divisionSizes[i] = ntoh64(Dest->divisionSizes[i]); +#endif +} // End of BSWAP_PM_FILE_HEADER + +// Byte-swap flattened Composite Image +static __inline +void +BSWAP_PM_COMPOSITE_IMAGE_FLAT(PmCompositeImage_t *Dest, boolean hton) +{ +#if CPU_LE + uint32 numNodes; + + // Note that header is swapped independently + + if (hton) { + numNodes = Dest->maxLid + 1; + Dest->maxLid = ntoh32(Dest->maxLid); + } else { + Dest->maxLid = ntoh32(Dest->maxLid); + numNodes = Dest->maxLid + 1; + } + Dest->sweepStart = ntoh64(Dest->sweepStart); + Dest->sweepDuration = ntoh32(Dest->sweepDuration); + Dest->HFIPorts = ntoh16(Dest->HFIPorts); + Dest->switchNodes = ntoh16(Dest->switchNodes); + Dest->switchPorts = ntoh32(Dest->switchPorts); + Dest->numLinks = ntoh32(Dest->numLinks); + Dest->numSMs = ntoh32(Dest->numSMs); + Dest->failedNodes = ntoh32(Dest->failedNodes); + Dest->failedPorts = ntoh32(Dest->failedPorts); + Dest->skippedNodes = ntoh32(Dest->skippedNodes); + Dest->skippedPorts = ntoh32(Dest->skippedPorts); + Dest->unexpectedClearPorts = ntoh32(Dest->unexpectedClearPorts); + Dest->downgradedPorts = ntoh32(Dest->downgradedPorts); + Dest->numGroups = ntoh32(Dest->numGroups); + Dest->numVFs = ntoh32(Dest->numVFs); + Dest->numVFsActive = ntoh32(Dest->numVFsActive); + Dest->maxLid = ntoh32(Dest->maxLid); + Dest->numPorts = ntoh32(Dest->numPorts); + BSWAP_PM_COMPOSITE_SM_INFO(Dest->SMs, PM_HISTORY_MAX_SMS_PER_COMPOSITE); + BSWAP_PM_COMPOSITE_GROUP(&Dest->allPortsGroup, 1); + BSWAP_PM_COMPOSITE_GROUP(Dest->groups, PM_MAX_GROUPS); + BSWAP_PM_COMPOSITE_VF(Dest->VFs, MAX_VFABRICS); + BSWAP_PM_COMPOSITE_NODE((PmCompositeNode_t *)&Dest->nodes, numNodes); +#endif +} // End of BSWAP_PM_COMPOSITE_IMAGE_FLAT + + void clearLoadedImage(PmShortTermHistory_t *sth); size_t computeCompositeSize(void); FSTATUS decompressAndReassemble(unsigned char *input_data, size_t input_size, uint8 divs, size_t *input_sizes, unsigned char *output_data, size_t output_size); FSTATUS rebuildComposite(PmCompositeImage_t *cimg, unsigned char *data); -void writeImageToBuffer(Pm_t *pm, uint32 histindex, uint8_t *buffer, uint32_t *bIndex); +void writeImageToBuffer(Pm_t *pm, uint32 histindex, uint8_t isCompressed, uint8_t *buffer, uint32_t *bIndex); void PmFreeComposite(PmCompositeImage_t *cimg); FSTATUS PmLoadComposite(Pm_t *pm, PmHistoryRecord_t *record, PmCompositeImage_t **cimg); FSTATUS PmFreezeComposite(Pm_t *pm, PmHistoryRecord_t *record); diff --git a/Esm/ib/src/smi/include/sm_dbsync.h b/Esm/ib/src/smi/include/sm_dbsync.h index ec5532e..ba0e310 100644 --- a/Esm/ib/src/smi/include/sm_dbsync.h +++ b/Esm/ib/src/smi/include/sm_dbsync.h @@ -157,6 +157,7 @@ typedef struct { uint8_t nodeDescString[ND_LEN+1]; /* node description of SM node */ uint8_t path[64]; /* directed path to SM node */ uint8_t portNumber; /* port Number of remote node - used only for reporting */ + uint8_t isEmbedded; /* 1: SM is embedded */ uint64_t lastHello; /* if standby, last hello check */ } SmRec_t; typedef SmRec_t *SmRecp; /* sm record pointer type */ @@ -171,6 +172,7 @@ typedef struct { DBSyncDatTyp_t datatype; /* 1=all (full sync only), 2=InformInfo, 3=groups, 4=services */ uint64_t portguid; /* portguid of standby SM */ Lid_t standbyLid; /* lid of the standby SM */ + uint8_t isEmbedded; /* 1: standby SM is embedded */ SMSyncData_t data; /* opaque data buffer to hold specific sync data */ }SMSyncReq_t; typedef SMSyncReq_t *SMSyncReqp; /* Sm Sync Request pointer type */ @@ -300,7 +302,7 @@ BSWAPCOPY_SM_DBSYNC_RECORD_CNT(uint32_t *Src, uint32_t *Dest) void sm_dbsync(uint32_t, uint8_t **); /* sm db sync main function */ Status_t sm_dbsync_filter_add(IBhandle_t fd, Filter_t *filter, uint8_t mclass, uint8_t method, uint16_t aid, uint32_t amod, uint64_t tid, const char *subRoutine); -void sm_dbsync_queueMsg(DBSyncType_t syncType, DBSyncDatTyp_t syncDataTye, Lid_t lid, Guid_t portguid, SMSyncData_t); +void sm_dbsync_queueMsg(DBSyncType_t syncType, DBSyncDatTyp_t syncDataTye, Lid_t lid, Guid_t portguid, uint8_t isEmbedded, SMSyncData_t); void sm_dbsync_addSm(Node_t *, Port_t *, STL_SMINFO_RECORD *); void sm_dbsync_deleteSm(uint64_t); void sm_dbsync_updateSm(SmRecKey_t, STL_SM_INFO *); diff --git a/Esm/ib/src/smi/include/sm_l.h b/Esm/ib/src/smi/include/sm_l.h index 3e5a62f..8792e72 100755 --- a/Esm/ib/src/smi/include/sm_l.h +++ b/Esm/ib/src/smi/include/sm_l.h @@ -316,6 +316,7 @@ typedef struct _PortData { uint8_t init:1; uint8_t slsc:1; uint8_t scsl:1; + uint8_t portInfo:1; } dirty; struct { diff --git a/Esm/ib/src/smi/sa/sa_Trap.c b/Esm/ib/src/smi/sa/sa_Trap.c index ec650d0..5aef10c 100755 --- a/Esm/ib/src/smi/sa/sa_Trap.c +++ b/Esm/ib/src/smi/sa/sa_Trap.c @@ -543,45 +543,42 @@ sa_Trap(Mai_t *maip) { /* Must tell sm_top to re-sweep fabric */ sm_discovery_needed("Port State Change Trap", notice.IssuerLID); } else if (notice.Attributes.Generic.TrapNumber == MAD_SMT_CAPABILITYMASK_CHANGE) { - uint32_t capMask; - memcpy(&capMask, &notice.Data[6], 4); - capMask = ntoh32(capMask); + STL_TRAP_CHANGE_CAPABILITY_DATA ccTrap; + + BSWAPCOPY_STL_TRAP_CHANGE_CAPABILITY_DATA((STL_TRAP_CHANGE_CAPABILITY_DATA*)notice.Data, &ccTrap); sm_get_lid_info(desc, notice.IssuerLID); - /* - * Must tell sm_top to re-sweep fabric if port state - * change or capability mask change with no MKEY. - * We can't react to capability change when using - * MKEYs until mellanox firmware SMA bug is resolved. - * After setting the mkey, subsequent getPortInfo's - * return the key as zero which causes us to set it - * again. Setting it in turn causes the sma to gen a - * capability change trap leading to an infinite loop. - */ - if (!(notice.Data[5] & 0x1)) { - /* OtherLocalChanges flag is 0 so that means there are changes to capability mask */ - if (!sm_config.mkey && (capMask & PI_CM_IS_SM)) { + + if (ccTrap.u.AsReg16 == 0) { + /* Change fields are zero so one of the capability bits must + * have changed. Realistically, the only bit that might have + * changed is the IS_SM bit. */ + if (ccTrap.CapabilityMask.s.IsSM) { IB_LOG_INFINI_INFO_FMT( "sa_Trap", "Received an (IS_SM on) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - capMask, desc, tid); + ccTrap.CapabilityMask.AsReg32, desc, tid); sm_discovery_needed("Port CapabilityMask Change isSM on", 0); - } else if (!sm_config.mkey && !(capMask & PI_CM_IS_SM)) { + } else { IB_LOG_INFINI_INFO_FMT( "sa_Trap", "Received an (IS_SM off) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - capMask, desc, tid); + ccTrap.CapabilityMask.AsReg32, desc, tid); sm_discovery_needed("Port CapabilityMask Change isSM off", 0); } } else { + /* A local change has occurred. */ IB_LOG_INFINI_INFO_FMT( "sa_Trap", "Received a (OtherLocalChanges) CAPABILITYMASK CHANGE trap from %s, TID="FMT_U64, desc, tid); - if (notice.Data[11] & 0x4) { - IB_LOG_INFINI_INFO_FMT("sa_Trap", "OtherLocalChanges are PortInfo:LinkSpeedEnabled changed"); + if (ccTrap.u.s.LinkSpeedEnabledChange) { + IB_LOG_INFINI_INFO_FMT("sa_Trap", "OtherLocalChanges: PortInfo:LinkSpeedEnabled changed"); + } + if (ccTrap.u.s.LinkWidthEnabledChange) { + IB_LOG_INFINI_INFO_FMT( "sa_Trap", "OtherLocalChanges: PortInfo:LinkWidthEnabled changed"); } - if (notice.Data[11] & 0x2) { - IB_LOG_INFINI_INFO_FMT( "sa_Trap", "OtherLocalChanges are PortInfo:LinkWidthEnabled changed"); + if (ccTrap.u.s.LinkWidthDowngradeEnabledChange) { + IB_LOG_INFINI_INFO_FMT( "sa_Trap", "OtherLocalChanges: PortInfo:LinkWidthDowngradeEnabled changed"); } - if (notice.Data[11] & 0x1) { - IB_LOG_INFINI_INFO_FMT( "sa_Trap", "OtherLocalChanges are Node Description changed"); + if (ccTrap.u.s.NodeDescriptionChange) { + IB_LOG_INFINI_INFO_FMT( "sa_Trap", "OtherLocalChanges: NodeDescription changed"); (void)vs_wrlock(&old_topology_lock); if (sm_find_node_and_port_lid(&old_topology, notice.IssuerLID, &nodep) != NULL) { nodep->nodeDescChgTrap = 1; diff --git a/Esm/ib/src/smi/sm/sm_dbsync.c b/Esm/ib/src/smi/sm/sm_dbsync.c index ad1ed52..cfa0365 100644 --- a/Esm/ib/src/smi/sm/sm_dbsync.c +++ b/Esm/ib/src/smi/sm/sm_dbsync.c @@ -304,7 +304,7 @@ static Status_t dbsync_getSMDBSync(SMSyncReq_t *syncReqp) { "Failed to set sync status of SM node at Lid 0x%x, portGuid "FMT_U64" to SM table", syncReqp->standbyLid, syncReqp->portguid); } else { - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, syncReqp->standbyLid, syncReqp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, syncReqp->standbyLid, syncReqp->portguid, syncReqp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "requested full sync of SM node at Lid 0x%x, portGuid "FMT_U64" to SM table", syncReqp->standbyLid, syncReqp->portguid); @@ -472,7 +472,7 @@ static Status_t dbsync_setSMDBSync(SMSyncReq_t *syncReqp) { /* * send a file to a standby SM */ -extern int getPMSweepImageData(char *filename, uint32_t imageIndex, uint8_t *buffer, uint32_t bufflen, uint32_t *filelen); +extern int getPMSweepImageData(char *filename, uint32_t imageIndex, uint8_t isCompressed, uint8_t *buffer, uint32_t bufflen, uint32_t *filelen); extern int putPMSweepImageData(char *filename, uint8_t *buffer, uint32_t filelen); extern FSTATUS putPMSweepImageDataR(uint8_t *p_img_in, uint32_t len_img_in); @@ -506,7 +506,12 @@ static Status_t dbsync_sendFileSMDBSync(SMSyncReq_t *syncReqp) { } } else if (syncFile.type == DBSYNC_PM_SWEEP_IMAGE || syncFile.type == DBSYNC_PM_HIST_IMAGE) { - if (getPMSweepImageData(syncFile.name, syncFile.activate /* hist index */, msgbuf + sizeof(SMDBSyncFile_t), buflen - sizeof(SMDBSyncFile_t), &syncFile.size) < 0) { + // Composites are not compressed for embedded, compressed otherwise + uint8_t isCompressed = !syncReqp->isEmbedded; +#ifdef __VXWORKS__ + isCompressed = 0; +#endif + if (getPMSweepImageData(syncFile.name, syncFile.activate /* hist index */, isCompressed, msgbuf + sizeof(SMDBSyncFile_t), buflen - sizeof(SMDBSyncFile_t), &syncFile.size) < 0) { status = VSTATUS_BAD; IB_EXIT(__func__, status); return status; @@ -2207,7 +2212,6 @@ static void dbsync_procReqQ(void) { void sm_dbsync(uint32_t argc, uint8_t ** argv) { Status_t status; Mai_t mad; - Filter_t filter,filter2,filter3; uint32_t madrc, msglen; #ifdef __SIMULATOR__ uint64_t if3open_retry_time = (VTIMER_1S * 10); @@ -2223,9 +2227,7 @@ void sm_dbsync(uint32_t argc, uint8_t ** argv) { /* Get my thread name. */ (void)vs_thread_name(&sm_threads[SM_THREAD_DBSYNC].name); - memset((void *)&filter, 0, sizeof(filter)); - memset((void *)&filter2, 0, sizeof(filter2)); - memset((void *)&filter3, 0, sizeof(filter3)); + /* * Open a connection to the IF3 interface. * Stay here until connection is opened and we have our port guid @@ -2276,16 +2278,9 @@ void sm_dbsync(uint32_t argc, uint8_t ** argv) { * standby SM */ while (sm_config.db_sync_interval && sm_state == SM_STATE_MASTER && !dbsync_main_exit) { - /* we don't want any filters on the FD when we're master */ - if (filter.active) { - (void)mai_filter_delete (dbsyncfd_if3, &filter, VFILTER_SHARE|VFILTER_PURGE); - memset((void *)&filter, 0, sizeof(filter)); - } - if (filter2.active) { - (void)mai_filter_delete (dbsyncfd_if3, &filter2, VFILTER_SHARE|VFILTER_PURGE); - memset((void *)&filter2, 0, sizeof(filter2)); - } - + /* we don't want any filters on the FD when we're master, this is + * handled at the if3 layer. + */ (void) dbsync_procReqQ(); (void) vs_thread_sleep (VTIMER_1S); } @@ -2294,24 +2289,9 @@ void sm_dbsync(uint32_t argc, uint8_t ** argv) { */ while (sm_config.db_sync_interval && sm_state == SM_STATE_STANDBY && !dbsync_main_exit) { /* - * have to have a filter for receiving dbsync messages when we're standby - */ - if (!filter.active) { - if ((status=sm_dbsync_filter_add(dbsyncfd_if3, &filter, MAD_CV_VENDOR_DBSYNC, - RMPP_CMD_GET, 0, 0, 0, __func__)) != VSTATUS_OK) { - IB_FATAL_ERROR("sm_dbsync: STANDBY SM failed to add filter to dbsync handle"); - } - } - if (!filter2.active) { - if ((status=sm_dbsync_filter_add(dbsyncfd_if3, &filter2, MAD_CV_VENDOR_DBSYNC, - RMPP_CMD_GETTABLE, 0, 0, 0, __func__)) != VSTATUS_OK) { - IB_FATAL_ERROR("sm_dbsync: STANDBY SM failed to add filter to dbsync handle"); - } - } - if (filter3.active) { - (void)mai_filter_delete (dbsyncfd_if3, &filter3, VFILTER_SHARE|VFILTER_PURGE); - memset((void *)&filter3, 0, sizeof(filter3)); - } + * filter handling for receiving dbsync messages when we're standby + * is handled at the if3 layer. + */ /* wait for command from the master SM */ msglen = buflen; @@ -2376,9 +2356,6 @@ void sm_dbsync(uint32_t argc, uint8_t ** argv) { /* free the SM dbsync request queue, sm record table, and close if3 handle and associated filters */ cs_queue_DisposeQueue( &sm_pool, sm_dbsync_queue ); bail: - if (filter.active ) (void)mai_filter_delete(dbsyncfd_if3, &filter, VFILTER_SHARE|VFILTER_PURGE); - if (filter2.active) (void)mai_filter_delete(dbsyncfd_if3, &filter2, VFILTER_SHARE|VFILTER_PURGE); - if (filter3.active) (void)mai_filter_delete(dbsyncfd_if3, &filter3, VFILTER_SHARE|VFILTER_PURGE); if (dbsyncfd_if3 > 0) (void)if3_dbsync_close(dbsyncfd_if3); dbsyncfd_if3 = -1; dbsync_initialized_flag = 0; diff --git a/Esm/ib/src/smi/sm/sm_dbsync_util.c b/Esm/ib/src/smi/sm/sm_dbsync_util.c index db3ad9c..1e90c02 100644 --- a/Esm/ib/src/smi/sm/sm_dbsync_util.c +++ b/Esm/ib/src/smi/sm/sm_dbsync_util.c @@ -197,7 +197,7 @@ void sm_dbsync_initSmRec(SmRecp smrecp) { /* * send sync request on sync queue to db_sync thread */ -void sm_dbsync_queueMsg(DBSyncType_t syncType, DBSyncDatTyp_t syncDataTye, Lid_t lid, Guid_t portguid, SMSyncData_t data) { +void sm_dbsync_queueMsg(DBSyncType_t syncType, DBSyncDatTyp_t syncDataTye, Lid_t lid, Guid_t portguid, uint8_t isEmbedded, SMSyncData_t data) { SMSyncReqp srp; Status_t status; @@ -211,6 +211,7 @@ void sm_dbsync_queueMsg(DBSyncType_t syncType, DBSyncDatTyp_t syncDataTye, Lid_t srp->datatype = syncDataTye; srp->portguid = portguid; srp->standbyLid = lid; + srp->isEmbedded = isEmbedded; /* copy the data if not null */ if (data) { memcpy(srp->data, data, sizeof(SMSyncData_t)); @@ -294,6 +295,16 @@ sm_dbsync_addSm(Node_t *nodep, Port_t * portp, STL_SMINFO_RECORD *sminforec) smrecp->portguid = sminforec->SMInfo.PortGUID; smrecp->lid = sminforec->RID.LID; smrecp->portNumber = portp->index; + if (nodep == sm_newTopology.node_head) { +#ifdef __VXWORKS__ + smrecp->isEmbedded = 1; +#else + smrecp->isEmbedded = 0; +#endif + } else { + smrecp->isEmbedded = portp->index ? 0 : 1; + } + /* fill in dbsync for our node */ if (nodep == sm_newTopology.node_head) { sm_dbsync_initSmRec(smrecp); @@ -385,14 +396,14 @@ Status_t sm_dbsync_fullSyncCheck(SmRecKey_t recKey) { smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_UNINITIALIZED) { /* request full sync of this SM */ smrecp->dbsync.fullSyncStatus = DBSYNC_STAT_INPROGRESS; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "requested initial full sync of SM node at Lid 0x%x, portGuid "FMT_U64, smrecp->lid, recKey); } else if (!collectiveFailStatus && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (tnow - smrecp->dbsync.fullTimeLastSync > sm_config.db_sync_interval) { smrecp->dbsync.fullSyncStatus = DBSYNC_STAT_INPROGRESS; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "requested full sync of SM node at Lid 0x%x, portGuid "FMT_U64" on configured (%d seconds) interval", smrecp->lid, recKey, sm_config.db_sync_interval); @@ -409,7 +420,7 @@ Status_t sm_dbsync_fullSyncCheck(SmRecKey_t recKey) { || ( smrecp->dbsync.fullSyncFailCount >= DBSYNC_MAX_FAIL_SYNC_ATTEMPTS && tnow - timeLastFail > sm_config.db_sync_interval)) { smrecp->dbsync.fullSyncStatus = DBSYNC_STAT_INPROGRESS; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "requested full sync of SM node at Lid 0x%x, portGuid "FMT_U64" on failure retry (%d seconds) interval", smrecp->lid, recKey, DBSYNC_TIME_BETWEEN_SYNC_FAILURES); @@ -515,7 +526,7 @@ DBSyncCap_t sm_dbsync_getDbsyncSupport(SmRecKey_t recKey) { if (smrecp->syncCapability == DBSYNC_CAP_UNKNOWN) { /* If Capability is unknown, try to find out */ smrecp->syncCapability = DBSYNC_CAP_ASKING; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_GET_CAPABILITY, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_GET_CAPABILITY, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); } syncCap = smrecp->syncCapability; } @@ -985,7 +996,7 @@ Status_t sm_dbsync_upsmlist(void) { smrecp->syncCapability == DBSYNC_CAP_UNKNOWN) {/* and we don't know remote sync capability yet */ /* request GET of the sync capability of this SM */ smrecp->syncCapability = DBSYNC_CAP_ASKING; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_GET_CAPABILITY, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_GET_CAPABILITY, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "queued request for sync capability of SM node at Lid 0x%x, portGuid "FMT_U64" to SM table", smrecp->lid, *smreckeyp); @@ -994,7 +1005,7 @@ Status_t sm_dbsync_upsmlist(void) { smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_UNINITIALIZED && !smrecp->configDiff) { /* request full sync of this SM unless deactivated */ smrecp->dbsync.fullSyncStatus = DBSYNC_STAT_INPROGRESS; - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); IB_LOG_INFO_FMT(__func__, "requested full sync of SM node at Lid 0x%x, portGuid "FMT_U64" to SM table", portp->portData->lid, *smreckeyp); @@ -1204,7 +1215,7 @@ Status_t sm_dbsync_syncService(DBSyncType_t synctype, OpaServiceRecordp osrp) { smrecp->syncCapability == DBSYNC_CAP_SUPPORTED && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (smrecp->dbsync.serviceSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_SERVICE, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_SERVICE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #if 0 else if (smrecp->dbsync.serviceSyncStatus == DBSYNC_STAT_FAILURE && @@ -1213,12 +1224,12 @@ Status_t sm_dbsync_syncService(DBSyncType_t synctype, OpaServiceRecordp osrp) { /* * see if a full sync can clear things up after DBSYNC_TIME_BETWEEN_SYNC_FAILURES seconds */ - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_SERVICE, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_SERVICE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } else if (smrecp->dbsync.serviceSyncStatus == DBSYNC_STAT_FAILURE && smrecp->dbsync.serviceSyncFailCount >= DBSYNC_MAX_FAIL_SYNC_ATTEMPTS && ((tnow - smrecp->dbsync.serviceTimeSyncFail) > DBSYNC_TIME_BETWEEN_SYNC_FAILURES)) { /* last attempt, try a full sync of everything */ - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #endif } @@ -1265,7 +1276,7 @@ Status_t sm_dbsync_syncInform(DBSyncType_t synctype, SubscriberKeyp keyp, STL_IN smrecp->syncCapability == DBSYNC_CAP_SUPPORTED && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (smrecp->dbsync.informSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_INFORM, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_INFORM, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #if 0 else if (smrecp->dbsync.informSyncStatus == DBSYNC_STAT_FAILURE && @@ -1274,12 +1285,12 @@ Status_t sm_dbsync_syncInform(DBSyncType_t synctype, SubscriberKeyp keyp, STL_IN /* * see if a full sync can clear things up after DBSYNC_TIME_BETWEEN_SYNC_FAILURES seconds */ - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_INFORM, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_INFORM, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } else if (smrecp->dbsync.informSyncStatus == DBSYNC_STAT_FAILURE && smrecp->dbsync.informSyncFailCount >= DBSYNC_MAX_FAIL_SYNC_ATTEMPTS && ((tnow - smrecp->dbsync.informTimeSyncFail) > DBSYNC_TIME_BETWEEN_SYNC_FAILURES)) { /* last attempt, try a full sync of everything */ - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #endif } @@ -1325,7 +1336,7 @@ Status_t sm_dbsync_syncGroup(DBSyncType_t synctype, IB_GID * pGid) { smrecp->syncCapability == DBSYNC_CAP_SUPPORTED && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (smrecp->dbsync.groupSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_GROUP, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_GROUP, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #if 0 else if (smrecp->dbsync.groupSyncStatus == DBSYNC_STAT_FAILURE && @@ -1339,7 +1350,7 @@ Status_t sm_dbsync_syncGroup(DBSyncType_t synctype, IB_GID * pGid) { smrecp->dbsync.groupSyncFailCount >= DBSYNC_MAX_FAIL_SYNC_ATTEMPTS && ((tnow - smrecp->dbsync.groupTimeSyncFail) > DBSYNC_TIME_BETWEEN_SYNC_FAILURES)) { /* last attempt, try a full sync of everything */ - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_FULL, DBSYNC_DATATYPE_ALL, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } #endif } @@ -1378,7 +1389,7 @@ Status_t sm_dbsync_syncMCRoot(DBSyncType_t synctype) { smrecp->syncCapability == DBSYNC_CAP_SUPPORTED && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (smrecp->dbsync.groupSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_MCROOT, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_MCROOT, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } } } while (cs_hashtable_iterator_advance(&itr)); @@ -1423,12 +1434,12 @@ Status_t sm_dbsync_syncFile(DBSyncType_t synctype, SMDBSyncFile_t *syncFile) { smrecp->syncCapability == DBSYNC_CAP_SUPPORTED && smrecp->dbsync.fullSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { if (smrecp->dbsync.serviceSyncStatus == DBSYNC_STAT_SYNCHRONIZED) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); } /* // even allow a SM that has been set Inactive to receive a new file } else if (smrecp->portguid != sm_smInfo.PortGUID && smrecp->configDiff) { - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); */ } @@ -1458,7 +1469,7 @@ Status_t sm_dbsync_queuePmFile(SmRecp smrecp, DBSyncType_t synctype, SMSyncData_ } smrecp->pmdbsync.firstUpdateState = DBSYNC_STAT_INPROGRESS; } - (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, syncData); + (void) sm_dbsync_queueMsg(synctype, DBSYNC_DATATYPE_FILE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, syncData); if (smDebugPerf) IB_LOG_INFINI_INFO_FMT(__func__, "COMPLETED: Queuing PM DBSYNC_DATATYPE_FILE request"); diff --git a/Esm/ib/src/smi/sm/sm_linux.c b/Esm/ib/src/smi/sm/sm_linux.c index 8c2b849..9800a93 100755 --- a/Esm/ib/src/smi/sm/sm_linux.c +++ b/Esm/ib/src/smi/sm/sm_linux.c @@ -601,6 +601,9 @@ void if3_set_rmpp_minfo (ManagerInfo_t *mi) case MAD_CV_VENDOR_DBSYNC: mi->rmppMngrfd = &dbsyncfd_if3; mi->rmppPool = &sm_pool; + // SM DB Sync uses other filter mechanism to handle inbound MAD requests, + // so RMPP filters not required + mi->rmppCreateFilters = 0; (void)if3_set_rmpp_cntx_pool_size_params(mi); break; default: diff --git a/Esm/ib/src/smi/sm/sm_main.c b/Esm/ib/src/smi/sm/sm_main.c index f0a1cc0..4d43e8a 100755 --- a/Esm/ib/src/smi/sm/sm_main.c +++ b/Esm/ib/src/smi/sm/sm_main.c @@ -2778,7 +2778,7 @@ smProcessReconfigureRequest(void){ IB_LOG_INFINI_INFO_FMT(__func__, "SM: Forwarding reconfiguration request to standby SM at Lid 0x%x, portGuid "FMT_U64, smrecp->lid, *smreckeyp); - (void) sm_dbsync_queueMsg(DBSYNC_TYPE_RECONFIG, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, NULL); + (void) sm_dbsync_queueMsg(DBSYNC_TYPE_RECONFIG, DBSYNC_DATATYPE_NONE, smrecp->lid, smrecp->portguid, smrecp->isEmbedded, NULL); } } while (cs_hashtable_iterator_advance(&itr)); } diff --git a/Esm/ib/src/smi/sm/sm_utility.c b/Esm/ib/src/smi/sm/sm_utility.c index efa8a77..1a2566f 100755 --- a/Esm/ib/src/smi/sm/sm_utility.c +++ b/Esm/ib/src/smi/sm/sm_utility.c @@ -3051,6 +3051,7 @@ sm_setup_node(Topology_t * topop, FabricData_t * pdtop, Node_t * cnp, Port_t * c portp->index, oldportp->portData->lid, portp->portData->lid); portp->portData->lid = oldportp->portData->lid; + portp->portData->dirty.portInfo=1; } } } @@ -3393,13 +3394,21 @@ sm_find_node_by_path(Topology_t * topop, uint8_t * path) return NULL; } - node_ptr = topop->node_head; + node_ptr = topop->node_head; + if (!node_ptr) { + IB_EXIT(__func__, NULL); + return NULL; + } for (pathIndex=1; pathIndex<=path[0]; pathIndex++) { nextNodeNumber = node_ptr->port[ path[pathIndex] ].nodeno; - if (topop->nodeArray[nextNodeNumber]) + if (nextNodeNumber < 0 || nextNodeNumber >= topop->num_nodes) { + IB_EXIT(__func__, NULL); + return NULL; + } + if (topop->nodeArray[nextNodeNumber]) { node_ptr = topop->nodeArray[nextNodeNumber]; - else { - IB_EXIT(__func__, NULL); + } else { + IB_EXIT(__func__, NULL); return NULL; } } @@ -3910,15 +3919,24 @@ sm_verifyPortSpeedAndWidth(Topology_t *topop, Node_t *nodep, Port_t *portp) Port_t *con_portp; uint16_t best_width, best_speed; + SMLinkPolicyXmlConfig_t sm_link_policy; if(!sm_valid_port(portp)) return(VSTATUS_BAD); + + if (nodep->nodeInfo.NodeType == NI_TYPE_SWITCH && + portp->portData->portInfo.PortNeighborMode.NeighborNodeType == STL_NEIGH_NODE_TYPE_SW) + sm_link_policy = sm_config.isl_link_policy; + else + sm_link_policy = sm_config.hfi_link_policy; + + /**mark this port as down if speed or width violate policy.**/ //check if LW.A outside policy - if(sm_config.link_policy.width_policy.enabled) { - if(sm_config.link_policy.width_policy.policy && - (portp->portData->portInfo.LinkWidth.Active < sm_config.link_policy.width_policy.policy)) { + if(sm_link_policy.width_policy.enabled) { + if(sm_link_policy.width_policy.policy && + (portp->portData->portInfo.LinkWidth.Active < sm_link_policy.width_policy.policy)) { IB_LOG_WARN_FMT(__func__,"node %s port %d: Link width lower than policy spec", sm_nodeDescString(nodep), portp->index, portp->portData->portInfo.LinkWidth.Active); if(portp->portData->portInfo.PortStates.s.PortState != IB_PORT_INIT) @@ -3930,9 +3948,9 @@ sm_verifyPortSpeedAndWidth(Topology_t *topop, Node_t *nodep, Port_t *portp) } //check if LS.A outside policy - if(sm_config.link_policy.speed_policy.enabled) { - if(sm_config.link_policy.speed_policy.policy && - (portp->portData->portInfo.LinkSpeed.Active < sm_config.link_policy.speed_policy.policy)) { + if(sm_link_policy.speed_policy.enabled) { + if(sm_link_policy.speed_policy.policy && + (portp->portData->portInfo.LinkSpeed.Active < sm_link_policy.speed_policy.policy)) { IB_LOG_WARN_FMT(__func__,"node %s port %d: Link Speed lower than policy spec", sm_nodeDescString(nodep), portp->index, portp->portData->portInfo.LinkSpeed.Active); if(portp->portData->portInfo.PortStates.s.PortState != IB_PORT_INIT) @@ -3968,7 +3986,7 @@ sm_verifyPortSpeedAndWidth(Topology_t *topop, Node_t *nodep, Port_t *portp) sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, portp->index, StlLinkWidthToInt(portp->portData->portInfo.LinkWidth.Active), StlLinkWidthToInt(best_width)); - if(sm_config.link_policy.width_policy.enabled) { + if(sm_link_policy.width_policy.enabled) { if(portp->portData->portInfo.PortStates.s.PortState != IB_PORT_INIT){ //We will bounce port from the switch side to bring it back to init, // This may cause problems in back to back configurations. Link Policy can be disabled @@ -3984,14 +4002,14 @@ sm_verifyPortSpeedAndWidth(Topology_t *topop, Node_t *nodep, Port_t *portp) } //Check if LS.A is not highest common supported best_speed = StlBestLinkSpeed(portp->portData->portInfo.LinkSpeed.Supported & - con_portp->portData->portInfo.LinkSpeed.Supported) ; + con_portp->portData->portInfo.LinkSpeed.Supported) ; if(portp->portData->portInfo.LinkSpeed.Active != best_speed) { char buffer1[16], buffer2[16]; IB_LOG_WARN_FMT(__func__,"node %s nodeGuid "FMT_U64" port %d: Link Speed (%s) not set to highest supported speed (%s)", sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, portp->index, StlLinkSpeedToText(portp->portData->portInfo.LinkSpeed.Active, buffer1, 16), StlLinkSpeedToText(best_speed, buffer2, 16)); - if(sm_config.link_policy.speed_policy.enabled) { + if(sm_link_policy.speed_policy.enabled) { if(portp->portData->portInfo.PortStates.s.PortState != IB_PORT_INIT) { //We will bounce port from the switch side to bring it back to init, //This may cause problems in back to back configurations. Link Policy can be disabled @@ -4033,6 +4051,7 @@ sm_initialize_port(Topology_t * topop, Node_t * nodep, Port_t * portp, int use_l uint32_t amod = 0; VirtualFabrics_t *VirtualFabrics = topop->vfs_ptr; uint8_t maxLinkMTU; + SMLinkPolicyXmlConfig_t sm_link_policy; // Setup the port MTU per VL map. int vl, i, vf, mtu, activeVf; @@ -4121,7 +4140,15 @@ sm_initialize_port(Topology_t * topop, Node_t * nodep, Port_t * portp, int use_l needSet = 1; } + if (nodep->nodeInfo.NodeType == NI_TYPE_SWITCH && + portp->portData->portInfo.PortNeighborMode.NeighborNodeType == STL_NEIGH_NODE_TYPE_SW) + sm_link_policy = sm_config.isl_link_policy; + else + sm_link_policy = sm_config.hfi_link_policy; + + /***** applicable to everyone except switch external ports *****/ + if (nodep->nodeInfo.NodeType != NI_TYPE_SWITCH || (nodep->nodeInfo.NodeType == NI_TYPE_SWITCH && portp->index == 0)) { if (portInfo.M_Key != sm_config.mkey @@ -4151,6 +4178,9 @@ sm_initialize_port(Topology_t * topop, Node_t * nodep, Port_t * portp, int use_l portInfo.SubnetPrefix = sm_config.subnet_prefix; needSet = 1; } + if (portp->portData->dirty.portInfo) { + needSet = 1; + } if (portInfo.LID != portp->portData->lid) { portInfo.LID = portp->portData->lid; needSet = 1; @@ -4209,20 +4239,21 @@ sm_initialize_port(Topology_t * topop, Node_t * nodep, Port_t * portp, int use_l portInfo.LinkSpeed.Enabled = STL_LINK_SPEED_NOP; uint16_t lwde = portp->portData->portInfo.LinkWidth.Active; + if(lwde == STL_LINK_WIDTH_4X){ - if(sm_config.link_policy.link_max_downgrade >= 3) + if(sm_link_policy.link_max_downgrade >= 3) lwde |= STL_LINK_WIDTH_3X | STL_LINK_WIDTH_2X | STL_LINK_WIDTH_1X; - if(sm_config.link_policy.link_max_downgrade == 2) + if(sm_link_policy.link_max_downgrade == 2) lwde |= STL_LINK_WIDTH_3X | STL_LINK_WIDTH_2X; - if(sm_config.link_policy.link_max_downgrade == 1) + if(sm_link_policy.link_max_downgrade == 1) lwde |= STL_LINK_WIDTH_3X; }else if(lwde == STL_LINK_WIDTH_3X){ - if(sm_config.link_policy.link_max_downgrade >= 2) + if(sm_link_policy.link_max_downgrade >= 2) lwde |= STL_LINK_WIDTH_2X | STL_LINK_WIDTH_1X; - if(sm_config.link_policy.link_max_downgrade == 1) + if(sm_link_policy.link_max_downgrade == 1) lwde |= STL_LINK_WIDTH_2X; }else if(lwde == STL_LINK_WIDTH_2X){ - if(sm_config.link_policy.link_max_downgrade >= 1) + if(sm_link_policy.link_max_downgrade >= 1) lwde |= STL_LINK_WIDTH_1X; } lwde &= portp->portData->portInfo.LinkWidthDowngrade.Supported; @@ -4538,19 +4569,21 @@ sm_initialize_port(Topology_t * topop, Node_t * nodep, Port_t * portp, int use_l return (status); } - // Don't check preempt values if preempt is disabled. - if (portInfo.FlitControl.Interleave.s.MaxNestLevelTxEnabled != 0) { - if (!sm_eq_Preempt - (&preemptVals, &portInfo.FlitControl.Preemption, sm_uses_PreemptRemap(portp))) { - IB_LOG_ERROR_FMT(__func__, - "FlitControl.Preemption requested/response value mismatch for " - "node %s nodeGuid " FMT_U64 - " port %d. Failed to set portinfo for node", - sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, portp->index); - IB_EXIT(__func__, VSTATUS_BAD); - return VSTATUS_BAD; - } - } + portp->portData->dirty.portInfo=0; + + // Don't check preempt values if preempt is disabled. + if (portInfo.FlitControl.Interleave.s.MaxNestLevelTxEnabled != 0) { + if (!sm_eq_Preempt + (&preemptVals, &portInfo.FlitControl.Preemption, sm_uses_PreemptRemap(portp))) { + IB_LOG_ERROR_FMT(__func__, + "FlitControl.Preemption requested/response value mismatch for " + "node %s nodeGuid " FMT_U64 + " port %d. Failed to set portinfo for node", + sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, portp->index); + IB_EXIT(__func__, VSTATUS_BAD); + return VSTATUS_BAD; + } + } /* * update the STL_PORT_INFO for SA queries. Set returns back actual settings (Get) */ @@ -5334,9 +5367,11 @@ sm_set_node_port_states(Topology_t * topop, Node_t * nodep, Port_t * portp, uint memset(portStateInfo, 0, sizeof(STL_PORT_STATE_INFO) * numPSIs); // Set all the port states to active - for(i = 0; i < numPSIs; i++) { - portStateInfo[i].PortStates.s.PortState = portStateToSet; - } + for_all_ports(nodep, portp) { + if (portp->state == IB_PORT_ARMED) { + portStateInfo[portp->index].PortStates.s.PortState = portStateToSet; + } + } // Send out the PortStateInfo packets for(i = 0; i < numPackets; i++) { diff --git a/Esm/opafm.spec b/Esm/opafm.spec index 1c6c43b..b055970 100644 --- a/Esm/opafm.spec +++ b/Esm/opafm.spec @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.0.0.0 -Release: 655 +Release: 686 Summary: Intel Omni-Path Fabric Management Software Group: System Environment/Daemons diff --git a/IbAccess/Common/Inc/stl_helper.h b/IbAccess/Common/Inc/stl_helper.h index 08c85d7..8244822 100644 --- a/IbAccess/Common/Inc/stl_helper.h +++ b/IbAccess/Common/Inc/stl_helper.h @@ -955,6 +955,13 @@ uint32_t StlCableInfoOM4Length(uint8_t code_len, uint8_t code_valid) } // End of StlCableInfoOM4Length() +static __inline +void StlCableInfoOM4LengthToText(uint8_t code_len, uint8_t code_valid, int max_chars, char *text_out) +{ + if (! text_out) + return; + snprintf(text_out, max_chars, "%um", StlCableInfoOM4Length(code_len,code_valid)); +} #if 0 // This macro is based on stl_sma.c/GET_LENGTH() but contains invalid logic // for current CableInfo configurations @@ -1116,7 +1123,7 @@ StlLinkQualToText(uint8 linkQual) switch (linkQual) { case STL_LINKQUALITY_NONE: - return "None"; + return "Down"; case STL_LINKQUALITY_BAD: return "Bad"; case STL_LINKQUALITY_POOR: diff --git a/IbAccess/Common/Inc/stl_pm.h b/IbAccess/Common/Inc/stl_pm.h index ce2b70a..1b92823 100644 --- a/IbAccess/Common/Inc/stl_pm.h +++ b/IbAccess/Common/Inc/stl_pm.h @@ -717,6 +717,7 @@ BSWAP_STL_ERROR_INFO_REQ(STL_ERROR_INFO_REQ *Dest) for (i = 0; i < 4; i++) { Dest->PortSelectMask[3-i] = ntoh64(Dest->PortSelectMask[3-i]); } + Dest->ErrorInfoSelectMask.AsReg32 = ntoh32(Dest->ErrorInfoSelectMask.AsReg32); #endif } @@ -743,6 +744,7 @@ BSWAP_STL_ERROR_INFO_RSP(STL_ERROR_INFO_RSP *Dest) if (Dest->Port[i].PortRcvSwitchRelayErrorInfo.s.ErrorCode == 0) Dest->Port[i].PortRcvSwitchRelayErrorInfo.ErrorInfo.AsReg32 = ntoh32(Dest->Port[i].PortRcvSwitchRelayErrorInfo.ErrorInfo.AsReg32); } + Dest->ErrorInfoSelectMask.AsReg32 = ntoh32(Dest->ErrorInfoSelectMask.AsReg32); #endif } diff --git a/IbAccess/Common/Inc/stl_sm.h b/IbAccess/Common/Inc/stl_sm.h index c307e81..0abd973 100644 --- a/IbAccess/Common/Inc/stl_sm.h +++ b/IbAccess/Common/Inc/stl_sm.h @@ -198,18 +198,84 @@ typedef struct { #define STL_TRAP_BUFFER_OVERRUN_DATA STL_TRAP_LINK #define STL_TRAP_FLOW_WATCHDOG_DATA STL_TRAP_LINK +typedef STL_FIELDUNION16(STL_CAPABILITY_MASK, 32, + CmReserved6: 1, /* shall be zero */ + CmReserved24: 2, /* shall be zero */ + CmReserved5: 2, /* shall be zero */ + CmReserved23: 4, /* shall be zero */ + IsCapabilityMaskNoticeSupported: 1, + CmReserved22: 1, /* shall be zero */ + IsVendorClassSupported: 1, + IsDeviceManagementSupported: 1, + CmReserved21: 2, /* shall be zero */ + IsConnectionManagementSupported: 1, + CmReserved25: 10, /* shall be zero */ + IsAutomaticMigrationSupported: 1, + CmReserved2: 1, /* shall be zero */ + CmReserved20: 2, + IsSM: 1, + CmReserved1: 1 ); /* shall be zero */ + +/* Capability Mask 3 - a bit set to 1 for affirmation of supported capability + * by a given port + */ +typedef union { + uint16 AsReg16; + struct { IB_BITFIELD9( uint16, /* RO/H-PE */ + CmReserved: 8, + IsSnoopSupported: 1, /* RO/--PE Packet snoop */ + /* Reserved in Gen1 */ + IsAsyncSC2VLSupported: 1, /* RO/H-PE Port 0 indicates whole switch */ + IsAddrRangeConfigSupported: 1, /* RO/H-PE Can addr range for Multicast */ + /* and Collectives be configured */ + /* Port 0 indicates whole switch */ + IsPassThroughSupported: 1, /* RO/--PE Packet pass through */ + /* Port 0 indicates whole switch */ + IsSharedSpaceSupported: 1, /* RO/H-PE Shared Space */ + /* Port 0 indicates whole switch */ + CmReserved2: 1, + IsVLMarkerSupported: 1, /* RO/H-PE VL Marker */ + /* Port 0 indicates whole switch */ + IsVLrSupported: 1 ) /* RO/H-PE SC->VL_r table */ + /* Reserved in Gen1 */ + /* Port 0 indicates whole switch */ + } s; +} STL_CAPABILITY_MASK3; + typedef struct { - uint32 Lid; - uint32 CapabilityMask; - uint16 CapabilityMask2; - uint16 CapabilityMask3; - STL_FIELDUNION4(u,16, - Reserved:13, - LinkSpeedEnabledChange:1, - LinkWidthEnabledChange:1, - NodeDescriptionChange:1); + STL_LID_32 Lid; + STL_CAPABILITY_MASK CapabilityMask; + uint16 Reserved; + STL_CAPABILITY_MASK3 CapabilityMask3; + STL_FIELDUNION5(u,16, + Reserved:12, + LinkWidthDowngradeEnabledChange:1, + LinkSpeedEnabledChange:1, + LinkWidthEnabledChange:1, + NodeDescriptionChange:1); } PACK_SUFFIX STL_TRAP_CHANGE_CAPABILITY_DATA; +static __inline +void +BSWAP_STL_TRAP_CHANGE_CAPABILITY_DATA(STL_TRAP_CHANGE_CAPABILITY_DATA *Src) +{ +#if CPU_LE + Src->Lid = ntoh32(Src->Lid); + Src->CapabilityMask.AsReg32 = ntoh32(Src->CapabilityMask.AsReg32); + Src->CapabilityMask3.AsReg16 = ntoh16(Src->CapabilityMask3.AsReg16); + Src->u.AsReg16 = ntoh16(Src->u.AsReg16); +#endif +} + +static __inline +void +BSWAPCOPY_STL_TRAP_CHANGE_CAPABILITY_DATA(STL_TRAP_CHANGE_CAPABILITY_DATA *Src, + STL_TRAP_CHANGE_CAPABILITY_DATA *Dest) +{ + memcpy(Dest, Src, sizeof(STL_TRAP_CHANGE_CAPABILITY_DATA)); + BSWAP_STL_TRAP_CHANGE_CAPABILITY_DATA(Dest); +} + typedef struct { uint64 SystemImageGuid; uint32 Lid; @@ -763,50 +829,6 @@ typedef union { /* STL Port Flit preemption limits of unlimited */ #define STL_PORT_PREEMPTION_LIMIT_NONE 255 /* Unlimited */ -typedef STL_FIELDUNION16(STL_CAPABILITY_MASK, 32, - CmReserved6: 1, /* shall be zero */ - CmReserved24: 2, /* shall be zero */ - CmReserved5: 2, /* shall be zero */ - CmReserved23: 4, /* shall be zero */ - IsCapabilityMaskNoticeSupported: 1, - CmReserved22: 1, /* shall be zero */ - IsVendorClassSupported: 1, - IsDeviceManagementSupported: 1, - CmReserved21: 2, /* shall be zero */ - IsConnectionManagementSupported: 1, - CmReserved25: 10, /* shall be zero */ - IsAutomaticMigrationSupported: 1, - CmReserved2: 1, /* shall be zero */ - CmReserved20: 2, - IsSM: 1, - CmReserved1: 1 ); /* shall be zero */ - -/* Capability Mask 3 - a bit set to 1 for affirmation of supported capability - * by a given port - */ -typedef union { - uint16 AsReg16; - struct { IB_BITFIELD9( uint16, /* RO/H-PE */ - CmReserved: 8, - IsSnoopSupported: 1, /* RO/--PE Packet snoop */ - /* Reserved in Gen1 */ - IsAsyncSC2VLSupported: 1, /* RO/H-PE Port 0 indicates whole switch */ - IsAddrRangeConfigSupported: 1, /* RO/H-PE Can addr range for Multicast */ - /* and Collectives be configured */ - /* Port 0 indicates whole switch */ - IsPassThroughSupported: 1, /* RO/--PE Packet pass through */ - /* Port 0 indicates whole switch */ - IsSharedSpaceSupported: 1, /* RO/H-PE Shared Space */ - /* Port 0 indicates whole switch */ - CmReserved2: 1, - IsVLMarkerSupported: 1, /* RO/H-PE VL Marker */ - /* Port 0 indicates whole switch */ - IsVLrSupported: 1 ) /* RO/H-PE SC->VL_r table */ - /* Reserved in Gen1 */ - /* Port 0 indicates whole switch */ - } s; -} STL_CAPABILITY_MASK3; - #define BYTES_PER_LTP 128 /* NOTE - first-pass ordering of PortInfo members: diff --git a/IbaTools/opaxmlextract/opaextractlink.sh b/IbaTools/opaxmlextract/opaextractlink.sh index 97e36eb..3f74917 100755 --- a/IbaTools/opaxmlextract/opaextractlink.sh +++ b/IbaTools/opaxmlextract/opaextractlink.sh @@ -79,21 +79,23 @@ fi ix=0 -/usr/sbin/opareport -x -o links "$@" | \ +/usr/sbin/opareport -x -o links -d 3 "$@" | \ /usr/sbin/opaxmlextract -d \; -e Rate -e LinkDetails -e CableLength \ - -e CableLabel -e CableDetails -e Port.NodeDesc -e Port.PortNum | while read line + -e CableLabel -e CableDetails -e DeviceTechShort -e CableInfo.Length \ + -e CableInfo.VendorName -e CableInfo.VendorPN -e CableInfo.VendorRev \ + -e Port.NodeDesc -e Port.PortNum | while read line do case $ix in 0) - echo $line";"`echo $line | cut -d \; -f 6-` + echo $line";"`echo $line | cut -d \; -f 11-` ix=$((ix+1)) ;; 1) - line1=`echo $line | cut -d \; -f 1-5` + line1=`echo $line | cut -d \; -f 1-10` if echo "$line1" | cut -d \; -f3-5 | grep ";;" >/dev/null 2>&1 then - line2=`echo $line | cut -d \; -f 6-` + line2=`echo $line | cut -d \; -f 11-` ix=3 else ix=$((ix+1)) @@ -101,12 +103,12 @@ do ;; 2) - line2=`echo $line | cut -d \; -f 6-` + line2=`echo $line | cut -d \; -f 11-` ix=$((ix+1)) ;; 3) - line3=`echo $line | cut -d \; -f 6-` + line3=`echo $line | cut -d \; -f 11-` echo $line1";"$line2";"$line3 ix=1 ;; diff --git a/MakeTools/Test/Err.msg b/MakeTools/Test/Err.msg index bdb4b6a..d94eb74 100755 --- a/MakeTools/Test/Err.msg +++ b/MakeTools/Test/Err.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Err.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Log.msg b/MakeTools/Test/Log.msg index 6d73f84..c762dc2 100755 --- a/MakeTools/Test/Log.msg +++ b/MakeTools/Test/Log.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Log.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Osa.msg b/MakeTools/Test/Osa.msg index aad62ae..128527a 100755 --- a/MakeTools/Test/Osa.msg +++ b/MakeTools/Test/Osa.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Osa.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Test.msg b/MakeTools/Test/Test.msg index 7512106..b08d2dc 100755 --- a/MakeTools/Test/Test.msg +++ b/MakeTools/Test/Test.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Test.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ # $Revision: 1.4 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/UiUtil.msg b/MakeTools/Test/UiUtil.msg index daacdd6..11b761f 100755 --- a/MakeTools/Test/UiUtil.msg +++ b/MakeTools/Test/UiUtil.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/UiUtil.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/patch_version/patch_version.c b/MakeTools/patch_version/patch_version.c index 80c2a72..97150fa 100755 --- a/MakeTools/patch_version/patch_version.c +++ b/MakeTools/patch_version/patch_version.c @@ -1,7 +1,7 @@ /*! @file $Source: /cvs/ics/MakeTools/patch_version/patch_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ $Revision: 1.14 $ $Date: 2015/01/22 18:03:59 $ @brief Utility to manage version and branding strings in executable code diff --git a/MakeTools/rm_version/rm_version.c b/MakeTools/rm_version/rm_version.c index 5530f5c..debbb7c 100755 --- a/MakeTools/rm_version/rm_version.c +++ b/MakeTools/rm_version/rm_version.c @@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/MakeTools/rm_version/rm_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ $Revision: 1.5 $ $Date: 2015/01/22 18:04:00 $ @brief Program to remove version strings appended at end of file by prep diff --git a/Md5/Md5.c b/Md5/Md5.c index 7a8a7d0..935312e 100644 --- a/Md5/Md5.c +++ b/Md5/Md5.c @@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ $Revision: 1.3 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API diff --git a/Md5/Md5.h b/Md5/Md5.h index 5b26ed5..a64c660 100644 --- a/Md5/Md5.h +++ b/Md5/Md5.h @@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.h,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_HEAD_10_0_0_0_655 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ $Revision: 1.4 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API
0
38c90b085eab2ccfc90c3b05e2f38993d2cde5a3
01org/opa-fm
Fix improper downcasting of MFT portmask.
commit 38c90b085eab2ccfc90c3b05e2f38993d2cde5a3 Author: Scott Breyer <[email protected]> Date: Fri Oct 19 14:46:34 2018 -0400 Fix improper downcasting of MFT portmask. diff --git a/Esm/ib/src/smi/sm/sm_multicast.c b/Esm/ib/src/smi/sm/sm_multicast.c index 7e9fa98..c6d1f65 100755 --- a/Esm/ib/src/smi/sm/sm_multicast.c +++ b/Esm/ib/src/smi/sm/sm_multicast.c @@ -1196,7 +1196,7 @@ Status_t sm_set_all_mft(int force, Topology_t *curr_tp, Topology_t *prev_tp) SmpAddr_t addr; uint64_t sTime, eTime; int dispatched = 0, mftBlockChange = 0; - uint16_t old_portMask = 0; + STL_PORTMASK old_portMask = 0; if (smDebugPerf) { vs_time_get(&sTime); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 652252f..d45e193 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.8.0.0 -Release: 202%{?dist} +Release: 203%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
e5e693081cb826c5ab4a0268964b5222043f3305
01org/opa-fm
Update to latest from build 10.3.0.0.58 (FM 10.3.0.0.56) Fix spec file changelog.
commit e5e693081cb826c5ab4a0268964b5222043f3305 Author: Anton Bodner <[email protected]> Date: Fri Sep 23 18:53:02 2016 -0400 Update to latest from build 10.3.0.0.58 (FM 10.3.0.0.56) Fix spec file changelog. diff --git a/opa-fm.spec b/opa-fm.spec index eefc157..4e552b6 100644 --- a/opa-fm.spec +++ b/opa-fm.spec @@ -153,6 +153,6 @@ fi %{_mandir}/man8/* %changelog -* Thu Jun 2 2016 Anton Bodner <[email protected]> - 10.3.0.0-56 +* Fri Sep 23 2016 Anton Bodner <[email protected]> - 10.3.0.0-56 - Update to latest from build 10.3.0.0.58 (FM 10.3.0.0.56)
0
f26ab6dce0d2d9c98d1485cef5ef8d3f8772f382
01org/opa-fm
Updated to latest from build 10.0.0.0.697
commit f26ab6dce0d2d9c98d1485cef5ef8d3f8772f382 Author: Scott Breyer <[email protected]> Date: Tue Feb 16 17:18:38 2016 -0500 Updated to latest from build 10.0.0.0.697 diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index dd7bce6..f05ec90 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -304,7 +304,7 @@ my %delta_comp_info_other = ( my %delta_comp_info_rhel72 = ( 'opa_stack' => { - KernelRpms => [ "hfi1" ], # special case + KernelRpms => [ "ifs-kernel-updates", "hfi1" ], # special case UserRpms => [ "opa-scripts", "srptools", ], @@ -609,7 +609,7 @@ my %delta_kernel_ib_options = ( # all kernel srpms # these are in the order we must build/process them to meet basic dependencies my @delta_kernel_srpms_other = ( 'compat-rdma' ); -my @delta_kernel_srpms_rhel72 = ( 'hfi1' ); +my @delta_kernel_srpms_rhel72 = ( 'ifs-kernel-updates', 'hfi1' ); my @delta_kernel_srpms_rhel70 = ( 'ifs-kernel-updates', 'compat-rdma', 'hfi1' ); my @delta_kernel_srpms = ( ); @@ -812,6 +812,12 @@ my %delta_srpm_info_rhel72 = ( PartOf => "", # filled in at runtime BuildPrereq => [], }, + "ifs-kernel-updates" => { Available => "", + Builds => "ifs-kernel-updates", + PostReq => "", + PartOf => "", # filled in at runtime + BuildPrereq => [], + }, "hfi1-psm" => { Available => "", Builds => "hfi1-psm hfi1-psm-devel hfi1-psm-compat", PostReq => "hfi1-psm hfi1-psm-devel hfi1-psm-compat", @@ -1307,6 +1313,10 @@ sub delta_rpm_install_list($$$@) next if ( $skip_kernelib); $ret = 1; } + if ( " $package " =~ / ifs-kernel-updates / ) { + next if ( $skip_kernelib); + $ret = 1; + } } else { if ( " $package " =~ / compat-rdma / ) { next if ( $skip_kernelib); @@ -2876,6 +2886,10 @@ sub preinstall_intel_hfi($$) return preinstall_delta("intel_hfi", $install_list, $installing_list); } +my $irq_perm_string = "Set IrqBalance to Exact?"; +AddAnswerHelp("IrqBalance", "$irq_perm_string"); +my $Default_IrqBalance = 1; + sub install_intel_hfi($$) { my $install_list = shift(); # total that will be installed when done @@ -2884,6 +2898,16 @@ sub install_intel_hfi($$) print_install_banner_delta_comp('intel_hfi'); install_delta_comp('intel_hfi', $install_list); + # Adjust irqbalance + if ( -e "/etc/sysconfig/irqbalance" ) { + print "Intel strongly recommends that the irqbalance service be enabled\n"; + print "and run using the --hintpolicy=exact option.\n"; + $Default_IrqBalance = GetYesNoWithMemory("IrqBalance", 1, "$irq_perm_string", "y"); + if ( $Default_IrqBalance == 1 ) { + set_opairqbalance(); + } + } + need_reboot(); $ComponentWasInstalled{'intel_hfi'}=1; } diff --git a/CommonInstall/util_init.pl b/CommonInstall/util_init.pl index d27f9d9..9ae9c98 100755 --- a/CommonInstall/util_init.pl +++ b/CommonInstall/util_init.pl @@ -209,6 +209,11 @@ sub os_vendor_version($) $rval=`cat /etc/os-release | grep VERSION_ID | cut -d'=' -f2 | tr -d [\\"\\.0]`; chop($rval); $rval="ES".$rval; + if (!system("grep -qi centos /etc/redhat-release")) { + $rval = `cat /etc/redhat-release | cut -d' ' -f4`; + $rval =~ m/(\d+).(\d+)/; + $rval="ES".$1.$2; + } } elsif ($vendor eq "apple") { $rval=`sw_vers -productVersion|cut -f1-2 -d.`; chop($rval); diff --git a/CommonInstall/util_linuxconfig.pl b/CommonInstall/util_linuxconfig.pl index 7420f38..d276501 100755 --- a/CommonInstall/util_linuxconfig.pl +++ b/CommonInstall/util_linuxconfig.pl @@ -324,3 +324,61 @@ sub enable_mod_force_load($) "$OPA_MODPROBE_DIR/$module.conf"); } } + +my $OPA_IRQBALANCE_FILE = "/etc/sysconfig/irqbalance"; +my $OPA_IRQBALANCE_BAK = "/etc/sysconfig/irqbalance.bak"; +sub set_opairqbalance() +{ + print "Updating $ROOT$OPA_IRQBALANCE_FILE\n"; + + # Look up the current arguments. Note that this may be an empty string. + my ($original_line) = `egrep -e '^IRQBALANCE_ARGS=' $ROOT$OPA_IRQBALANCE_FILE`; + chomp($original_line); + + if ($original_line =~ /--hintpolicy=exact/ || $original_line =~ /-h exact/) { + # Already set to exact. No action is needed. + } else { + # Make a backup. + copy_data_file("$ROOT$OPA_IRQBALANCE_FILE", "$ROOT/$OPA_IRQBALANCE_BAK"); + + # Replace the existing hint policy with the new one. + my ($original_args) = $original_line; + $original_args =~ s/IRQBALANCE_ARGS=//; + $original_args =~ s/["']//g; + my ($new_args) = $original_args; + $new_args =~ s/--hintpolicy=[a-z]*//; + $new_args =~ s/-h [a-z]*//; + $new_args = "$new_args --hintpolicy=exact"; + + if ($original_line eq "") { + # If there were no arguments in the existing file, just append. + open (OUTPUT, ">>$ROOT$OPA_IRQBALANCE_FILE"); + select (OUTPUT); + print "IRQBALANCE_ARGS=$new_args\n"; + select(STDOUT); + close(OUTPUT); + } else { + # Otherwise, rewrite the existing line. + open (INPUT, "$ROOT$OPA_IRQBALANCE_BAK"); + open (OUTPUT, ">$ROOT$OPA_IRQBALANCE_FILE"); + select (OUTPUT); + + while (($_=<INPUT>)) { + if (/^$original_line/) { + print "# $_"; + print "IRQBALANCE_ARGS=$new_args\n"; + } else { + print $_; + } + } + select(STDOUT); + + close (INPUT); + close (OUTPUT); + unlink("$ROOT$OPA_IRQBALANCE_BAK"); + } + } + + # Make sure irqbalance is enabled and started. + `systemctl enable irqbalance; systemctl restart irqbalance` +} diff --git a/Esm/build.env b/Esm/build.env index a20b670..1e89736 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=ALL_EMB -export RELEASE_TAG=10_0_0_0_686 +export RELEASE_TAG=10_0_0_0_696 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/pm/pm/pm_sweep.c b/Esm/ib/src/pm/pm/pm_sweep.c index 0c32206..7189bc4 100644 --- a/Esm/ib/src/pm/pm/pm_sweep.c +++ b/Esm/ib/src/pm/pm/pm_sweep.c @@ -2758,7 +2758,8 @@ FSTATUS compoundImage(Pm_t *pm, uint32 imageIndex, PmCompositeImage_t *cimg) { IB_LOG_WARN0("Node lids do not match"); } if (cnode->guid != node->guid) { - IB_LOG_WARN0("Node GUIDs do not match"); + IB_LOG_WARN_FMT(__func__, "Node GUIDs do not match: 0x%016"PRIx64", 0x%016"PRIx64"", cnode->guid, node->guid); + continue; } diff --git a/Esm/ib/src/smi/sm/sm_linux.c b/Esm/ib/src/smi/sm/sm_linux.c index 9800a93..6df2c8f 100755 --- a/Esm/ib/src/smi/sm/sm_linux.c +++ b/Esm/ib/src/smi/sm/sm_linux.c @@ -97,6 +97,7 @@ extern Status_t sm_parse_xml_config(void); extern Status_t handleVfDgMemory(void); extern Status_t sm_initialize_sm_pool(void); extern void smLogLevelOverride(void); +extern size_t computeCompositeSize(void); /* * External SM independent routine. @@ -604,7 +605,8 @@ void if3_set_rmpp_minfo (ManagerInfo_t *mi) // SM DB Sync uses other filter mechanism to handle inbound MAD requests, // so RMPP filters not required mi->rmppCreateFilters = 0; - (void)if3_set_rmpp_cntx_pool_size_params(mi); + mi->rmppDataLength = computeCompositeSize(); + mi->rmppMaxCntxt = sa_max_cntxt; break; default: IB_LOG_INFINI_INFO_FMT(__func__, "MCLASS 0x%x not supported", mi->mclass); diff --git a/Esm/ib/src/smi/sm/sm_utility.c b/Esm/ib/src/smi/sm/sm_utility.c index 1a2566f..d28bbe4 100755 --- a/Esm/ib/src/smi/sm/sm_utility.c +++ b/Esm/ib/src/smi/sm/sm_utility.c @@ -5308,8 +5308,8 @@ sm_get_node_port_states(Topology_t * topop, Node_t * nodep, Port_t * portp, uint IB_LOG_WARN_FMT(__func__, "Cannot get PORT_STATE_INFO for node %s nodeGuid " FMT_U64 " status=%d", sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, status); - IB_EXIT(__func__, status); memset(portStateInfo, 0, sizeof(STL_PORT_STATE_INFO) * numPSIs); + break; } } @@ -5395,8 +5395,7 @@ sm_set_node_port_states(Topology_t * topop, Node_t * nodep, Port_t * portp, uint IB_LOG_WARN_FMT(__func__, "Cannot set PORT_STATE_INFO for node %s nodeGuid " FMT_U64 " status=%d", sm_nodeDescString(nodep), nodep->nodeInfo.NodeGUID, status); - IB_EXIT(__func__, status); - return status; + break; } } diff --git a/Esm/opafm.spec b/Esm/opafm.spec index b055970..b2dd440 100644 --- a/Esm/opafm.spec +++ b/Esm/opafm.spec @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.0.0.0 -Release: 686 +Release: 696 Summary: Intel Omni-Path Fabric Management Software Group: System Environment/Daemons diff --git a/MakeTools/Test/Err.msg b/MakeTools/Test/Err.msg index d94eb74..ba0e055 100755 --- a/MakeTools/Test/Err.msg +++ b/MakeTools/Test/Err.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Err.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Log.msg b/MakeTools/Test/Log.msg index c762dc2..5371bbf 100755 --- a/MakeTools/Test/Log.msg +++ b/MakeTools/Test/Log.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Log.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Osa.msg b/MakeTools/Test/Osa.msg index 128527a..bd27230 100755 --- a/MakeTools/Test/Osa.msg +++ b/MakeTools/Test/Osa.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Osa.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Test.msg b/MakeTools/Test/Test.msg index b08d2dc..703c052 100755 --- a/MakeTools/Test/Test.msg +++ b/MakeTools/Test/Test.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Test.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ # $Revision: 1.4 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/UiUtil.msg b/MakeTools/Test/UiUtil.msg index 11b761f..34dc459 100755 --- a/MakeTools/Test/UiUtil.msg +++ b/MakeTools/Test/UiUtil.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/UiUtil.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/patch_version/patch_version.c b/MakeTools/patch_version/patch_version.c index 97150fa..2754c1c 100755 --- a/MakeTools/patch_version/patch_version.c +++ b/MakeTools/patch_version/patch_version.c @@ -1,7 +1,7 @@ /*! @file $Source: /cvs/ics/MakeTools/patch_version/patch_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ $Revision: 1.14 $ $Date: 2015/01/22 18:03:59 $ @brief Utility to manage version and branding strings in executable code diff --git a/MakeTools/rm_version/rm_version.c b/MakeTools/rm_version/rm_version.c index debbb7c..5697aa6 100755 --- a/MakeTools/rm_version/rm_version.c +++ b/MakeTools/rm_version/rm_version.c @@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/MakeTools/rm_version/rm_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ $Revision: 1.5 $ $Date: 2015/01/22 18:04:00 $ @brief Program to remove version strings appended at end of file by prep diff --git a/Md5/Md5.c b/Md5/Md5.c index 935312e..110f2c7 100644 --- a/Md5/Md5.c +++ b/Md5/Md5.c @@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ $Revision: 1.3 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API diff --git a/Md5/Md5.h b/Md5/Md5.h index a64c660..9566479 100644 --- a/Md5/Md5.h +++ b/Md5/Md5.h @@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.h,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_686 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ $Revision: 1.4 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API diff --git a/opafm.spec b/opafm.spec index c308c36..627b605 100644 --- a/opafm.spec +++ b/opafm.spec @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.0.0.0 -Release: 625 +Release: 696 Summary: Intel Omni-Path Fabric Management Software Group: System Environment/Daemons
0
3117bba5cf249fd9e721d7273b645fa7f49ca076
01org/opa-fm
Add script for building (S)RPMs
commit 3117bba5cf249fd9e721d7273b645fa7f49ca076 Author: Brendan Cunningham <[email protected]> Date: Mon Sep 21 11:51:54 2015 -0400 Add script for building (S)RPMs diff --git a/build_rpms.bash b/build_rpms.bash new file mode 100755 index 0000000..1bfc2bf --- /dev/null +++ b/build_rpms.bash @@ -0,0 +1,4 @@ +#!/bin/bash +mkdir -p $HOME/rpmbuild/{SOURCES,RPMS,SRPMS} +tar czf $HOME/rpmbuild/SOURCES/opa-fm.tar.gz --exclude-vcs . +rpmbuild -ba ./opafm.spec
0
82600d3632ee0c401c218fc0d9a462347e7ae2fb
01org/opa-fm
Fix for spec file
commit 82600d3632ee0c401c218fc0d9a462347e7ae2fb Author: Scott Breyer <[email protected]> Date: Tue Mar 15 13:52:33 2016 -0400 Fix for spec file diff --git a/opafm.spec b/opafm.spec index af47596..744ce9f 100644 --- a/opafm.spec +++ b/opafm.spec @@ -116,9 +116,6 @@ install -D stage.rpm/opafm.xml $RPM_BUILD_ROOT/opt/opafm/etc/opafm.xml install -D stage.rpm/opaxmlextract $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlextract install -D stage.rpm/opaxmlfilter $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlfilter -install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample -install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample - mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s /opt/opafm/bin/fm_cmd $RPM_BUILD_ROOT%{_sbindir}/opafmcmd ln -s /opt/opafm/bin/fm_cmdall $RPM_BUILD_ROOT%{_sbindir}/opafmcmdall @@ -157,7 +154,6 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* -/opt/opafm/samples/* %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall
0
6b512ad44ab9ec48ad1814091823d601a37fd717
01org/opa-fm
Update to latest from build 10.10.2.0.44 (IFS 10.10.2.0.44)
commit 6b512ad44ab9ec48ad1814091823d601a37fd717 Author: Scott Breyer <[email protected]> Date: Wed Jun 10 11:41:27 2020 -0400 Update to latest from build 10.10.2.0.44 (IFS 10.10.2.0.44) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index 31fb1a3..3526e51 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -128,11 +128,13 @@ INCLUDE_SUBDIR = LOCALDEPLIBS = FF_FILES = comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl \ - comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl \ + comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL78.pl \ + comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl \ comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl FM_FILES = comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl \ - comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl \ + comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL78.pl \ + comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl \ comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 5e280e8..6839bcc 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -81,6 +81,7 @@ my @delta_kernel_srpms_rhel74 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel75 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel76 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel77 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel78 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel8 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel81 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); @@ -167,6 +168,8 @@ sub init_delta_info($) @delta_kernel_srpms = ( @delta_kernel_srpms_rhel81 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel8 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel78 ); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel77 ); } elsif ( "$CUR_VENDOR_VER" eq "ES76" ) { @@ -226,7 +229,7 @@ sub delta_srpm_file($$) $result = file_glob("$srcdir/$SRPMS_SUBDIR/CUDA/$globname"); } else { NormalPrint("CUDA specific SRPMs do not exist\n"); - exit 0; + exit 1; } } else { $result = file_glob("$srcdir/$SRPMS_SUBDIR/$globname"); @@ -265,7 +268,7 @@ sub get_rpms_dir_delta($) $rpmsdir=$rpmsdir."/CUDA"; } else { NormalPrint("CUDA specific packages do not exist\n"); - exit 0; + exit 1; } } return $rpmsdir; @@ -802,6 +805,9 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -1120,6 +1126,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); diff --git a/CommonInstall/comp_delta_prereq_RHEL78.pl b/CommonInstall/comp_delta_prereq_RHEL78.pl new file mode 100644 index 0000000..8125735 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL78.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconfig", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "infinipath-psm", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconfig", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL78.pl b/CommonInstall/comp_ff_of_prereq_RHEL78.pl new file mode 100644 index 0000000..af44df6 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL78.pl @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL78.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL78.pl.base new file mode 100644 index 0000000..af44df6 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL78.pl.base @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL78.pl b/CommonInstall/comp_fm_prereq_RHEL78.pl new file mode 100644 index 0000000..a166489 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL78.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; + diff --git a/CommonInstall/comp_fm_prereq_RHEL78.pl.base b/CommonInstall/comp_fm_prereq_RHEL78.pl.base new file mode 100644 index 0000000..a166489 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL78.pl.base @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; + diff --git a/CommonInstall/comp_omnipath.pl b/CommonInstall/comp_omnipath.pl index 3f137c3..db95710 100644 --- a/CommonInstall/comp_omnipath.pl +++ b/CommonInstall/comp_omnipath.pl @@ -1193,7 +1193,7 @@ sub available_mpisrc() sub installed_mpisrc() { - my $srcdir = "/usr/src/opa/MPI"; + my $srcdir = $ExtraMpisrcInfo{'Dest'}; my $old_srcdir = "/usr/lib/opa/src/MPI"; return (has_mpisrc($srcdir) || has_mpisrc($old_srcdir)); } @@ -1201,15 +1201,18 @@ sub installed_mpisrc() sub has_mpisrc($) { my $srcdir = shift(); - return (file_glob("$srcdir/mvapich*.src.rpm") ne "" - && file_glob("$srcdir/openmpi*.src.rpm") ne "" - && file_glob("$srcdir/mpitests*.src.rpm") ne ""); + foreach my $srpm (@{$ExtraMpisrcInfo{'SrcRpms'}}) { + if (file_glob("$srcdir/${srpm}*.src.rpm") eq "") { + return 0; + } + } + return 1; } # only called if installed_mpisrc is true sub installed_version_mpisrc() { - return `cat /usr/src/opa/MPI/.version`; + return `cat $ExtraMpisrcInfo{'Dest'}/.version`; } # only called if available_mpisrc is true @@ -1255,36 +1258,41 @@ sub install_mpisrc($$) my $installing_list = shift(); # what items are being installed/reinstalled my $srcdir=$ComponentInfo{'mpisrc'}{'SrcDir'}; - my $version = media_version_mpisrc(); - chomp $version; + my $version = media_version_mpisrc(); + chomp $version; - printf ("Installing $ComponentInfo{'mpisrc'}{'Name'} $version...\n"); - LogPrint ("Installing $ComponentInfo{'mpisrc'}{'Name'} $version for $CUR_OS_VER\n"); + printf ("Installing $ComponentInfo{'mpisrc'}{'Name'} $version...\n"); + LogPrint ("Installing $ComponentInfo{'mpisrc'}{'Name'} $version for $CUR_OS_VER\n"); - check_dir("/usr/src/opa"); - check_dir("/usr/src/opa/MPI"); + my $destdir = $ExtraMpisrcInfo{'Dest'}; + check_dir($destdir); # remove old versions (.src.rpm and built .rpm files too) - system "rm -rf /usr/src/opa/MPI/mvapich[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mvapich2[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/openmpi[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mpitests[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.res 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.err 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.warn 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; + system "rm -f $destdir/mvapich[-_]*.rpm 2>/dev/null"; + foreach my $srpm (@{$ExtraMpisrcInfo{'SrcRpms'}}) + { + system "rm -f $destdir/$srpm-*.rpm 2>/dev/null"; + } + foreach my $file (@{$ExtraMpisrcInfo{'DirtyFiles'}}) + { + system "rm -f $destdir/$file 2>/dev/null"; + } # install new versions - foreach my $srpm ( "mvapich2", "openmpi", "mpitests" ) { + foreach my $srpm (@{$ExtraMpisrcInfo{'SrcRpms'}}) { my $srpmfile = file_glob("$srcdir/${srpm}-*.src.rpm"); if ( "$srpmfile" ne "" ) { my $file = my_basename($srpmfile); - copy_data_file($srpmfile, "/usr/src/opa/MPI/$file"); + copy_data_file($srpmfile, "$destdir/$file"); } } - copy_systool_file("$srcdir/do_build", "/usr/src/opa/MPI/do_build"); - copy_systool_file("$srcdir/do_mvapich2_build", "/usr/src/opa/MPI/do_mvapich2_build"); - copy_systool_file("$srcdir/do_openmpi_build", "/usr/src/opa/MPI/do_openmpi_build"); - copy_data_file("$srcdir/version", "/usr/src/opa/MPI/.version"); + foreach my $script (@{$ExtraMpisrcInfo{'BuildScripts'}}) { + copy_systool_file("$srcdir/$script", "$destdir/$script"); + } + foreach my $file (@{$ExtraMpisrcInfo{'MiscFiles'}}) { + my $src = ${$file}{'Src'}; + my $dest = ${$file}{'Dest'}; + copy_data_file("$srcdir/$src", "$destdir/$dest"); + } $ComponentWasInstalled{'mpisrc'}=1; } @@ -1307,21 +1315,23 @@ sub uninstall_mpisrc($$) rpm_is_installed("opameta_mpisrc_userspace", "any")) { rpm_uninstall_matches("opameta_mpisrc", "opameta_mpisrc", "", ""); } else { + my $destdir = $ExtraMpisrcInfo{'Dest'}; # remove old versions (.src.rpm and built .rpm files too) - system "rm -rf /usr/src/opa/MPI/.version 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mvapich2[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/openmpi[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mpitests[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.res 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.err 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.warn 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_mvapich2_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_openmpi_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; - - system "rmdir /usr/src/opa/MPI 2>/dev/null"; # remove only if empty + foreach my $srpm (@{$ExtraMpisrcInfo{'SrcRpms'}}) { + system "rm -f $destdir/$srpm-*.rpm 2>/dev/null"; + } + foreach my $script (@{$ExtraMpisrcInfo{'BuildScripts'}}) { + system "rm -f $destdir/$script 2>/dev/null"; + } + foreach my $file (@{$ExtraMpisrcInfo{'MiscFiles'}}) { + my $destfile = ${$file}{'Dest'}; + system "rm -f $destdir/$destfile 2>/dev/null"; + } + foreach my $file (@{$ExtraMpisrcInfo{'DirtyFiles'}}) { + system "rm -f $destdir/$file 2>/dev/null"; + } + + system "rmdir $destdir 2>/dev/null"; # remove only if empty system "rmdir /usr/src/opa 2>/dev/null"; # remove only if empty } diff --git a/CommonInstall/do_mvapich2_build.sh b/CommonInstall/do_mvapich2_build.sh index 4cc34b1..ba0abfc 100755 --- a/CommonInstall/do_mvapich2_build.sh +++ b/CommonInstall/do_mvapich2_build.sh @@ -65,6 +65,9 @@ VERSION_ID="" if [ -e /etc/os-release ]; then . /etc/os-release + if [[ "$ID" == "sle_hpc" ]]; then + ID="sles" + fi else echo /etc/os-release is not available !!! fi diff --git a/CommonInstall/do_openmpi_build.sh b/CommonInstall/do_openmpi_build.sh index fad9e14..1f91ea0 100755 --- a/CommonInstall/do_openmpi_build.sh +++ b/CommonInstall/do_openmpi_build.sh @@ -1,7 +1,7 @@ #!/bin/bash # BEGIN_ICS_COPYRIGHT8 **************************************** # -# Copyright (c) 2015-2018, Intel Corporation +# Copyright (c) 2015-2020, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -65,16 +65,14 @@ VERSION_ID="" if [ -e /etc/os-release ]; then . /etc/os-release + if [[ "$ID" == "sle_hpc" ]]; then + ID="sles" + fi else echo /etc/os-release is not available !!! fi -if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID > 7.3" | bc -l) == 1 ) || \ - ( "$ID" == "sles" && $(echo "$VERSION_ID > 12.2" | bc -l) == 1 ) ]]; then - PREREQ=("rdma-core-devel" "mpi-selector") -else - PREREQ=("libibverbs-devel" "librdmacm-devel" "mpi-selector") -fi +PREREQ=( "mpi-selector" ) CheckPreReqs() { @@ -137,27 +135,11 @@ Usage() unset MAKEFLAGS -ARCH=$(uname -m | sed -e s/ppc/PPC/ -e s/powerpc/PPC/ -e s/i.86/IA32/ -e s/ia64/IA64/ -e s/x86_64/X86_64/) +# Convert the architecture to all-caps to simplify comparisons. +ARCH=$(uname -m | tr "[:lower:]" "[:upper:]") target_cpu=$(rpm --eval '%{_target_cpu}') dist_rpm_rel_int=0 -if [ "$ARCH" = "PPC64" -a -f /etc/issue -a -f /etc/SuSE-release ] -then - # needed to test for SLES 10 SP1 on PPC64 below - dist_rpm_rel=$(rpm --queryformat "[%{RELEASE}]\n" -q $(rpm -qf /etc/issue)|uniq) - dist_rpm_rel_major="$(echo $dist_rpm_rel|cut -f1 -d.)" - dist_rpm_rel_minor="$(echo $dist_rpm_rel|cut -f2 -d.)" - # convert version to a 4 digit integer - if [ $dist_rpm_rel_major -lt 10 ] - then - dist_rpm_rel_major="0$dist_rpm_rel_major"; - fi - if [ $dist_rpm_rel_minor -lt 10 ] - then - dist_rpm_rel_minor="0$dist_rpm_rel_minor"; - fi - dist_rpm_rel_int="$dist_rpm_rel_major$dist_rpm_rel_minor" -fi nocomp() { @@ -198,15 +180,13 @@ iflag=n # undocumented option, build in context of install Qflag=n Oflag=n Cflag=n -Vflag=n # undocumented option, build verbs only transport -while getopts "idQOCV" o +while getopts "idQOC" o do case "$o" in i) iflag=y;; Q) Qflag=y;; O) Oflag=y;; C) Cflag=y;; - V) Vflag=y;; d) skip_prompt=y;; *) Usage;; esac @@ -217,12 +197,6 @@ then Usage fi -if [[ "$Vflag" == "y" && \ - ( "$Qflag" == "y" || "$Oflag" == "y" || "$Cflag" == "y" ) ]]; then - echo "ERROR: Option -V cannot be used with any other" >&2 - exit 1 -fi - if [ "$(/usr/bin/id -u)" != 0 ] then echo "ERROR: You must be 'root' to run this program" >&2 @@ -291,117 +265,94 @@ then fi # now get openmpi options. -if [ "$Vflag" != y ] +if [ "$skip_prompt" != y -a "$Qflag" != y ] then - if [ "$skip_prompt" != y -a "$Qflag" != y ] + if rpm -qa|grep infinipath-psm-devel >/dev/null 2>&1 then - if rpm -qa|grep infinipath-psm-devel >/dev/null 2>&1 + echo + get_yes_no "Build for True Scale HCA PSM" "y" + if [ "$ans" = 1 ] then - echo - get_yes_no "Build for True Scale HCA PSM" "y" - if [ "$ans" = 1 ] - then - Qflag=y - fi + Qflag=y fi fi +fi - if [ "$skip_prompt" != y -a "$Oflag" != y ] +if [ "$skip_prompt" != y -a "$Oflag" != y ] +then + if rpm -qa|grep libpsm2-devel >/dev/null 2>&1 && + rpm -qa|grep libfabric-devel >/dev/null 2>&1 then - if rpm -qa|grep libpsm2-devel >/dev/null 2>&1 && - rpm -qa|grep libfabric-devel >/dev/null 2>&1 + echo + get_yes_no "Build for Omnipath HFI PSM2 and OFI" "y" + if [ "$ans" = 1 ] then - echo - get_yes_no "Build for Omnipath HFI PSM2 and OFI" "y" - if [ "$ans" = 1 ] - then - Oflag=y - fi + Oflag=y fi fi +fi - if [ "$skip_prompt" != y -a "$Cflag" != y ] +if [ "$skip_prompt" != y -a "$Cflag" != y ] +then + if rpm -qa|grep libpsm2-devel >/dev/null 2>&1 && + rpm -qa|grep cuda-cudart-dev >/dev/null 2>&1 then - if rpm -qa|grep libpsm2-devel >/dev/null 2>&1 && - rpm -qa|grep cuda-cudart-dev >/dev/null 2>&1 + echo + get_yes_no "Build for Omnipath HFI PSM2 with Cuda" "y" + if [ "$ans" = 1 ] then - echo - get_yes_no "Build for Omnipath HFI PSM2 with Cuda" "y" - if [ "$ans" = 1 ] - then - Cflag=y - fi + Cflag=y fi - fi + fi fi # if -d (skip_prompt) the only option provided, ./configure will run with # no paramters and build what is auto-detected openmpi_conf_psm='' -if [ "$Vflag" = y ] +# we no longer supports verbs. +openmpi_verbs='--enable-mca-no-build=btl-openib --without-verbs' + +if [ "$Qflag" = y ] then - # The openmpi configure script complains about enable-mca-no-build - # not being a supported option, but then actually executes it correctly. - #openmpi_conf_psm='--enable-mca-no-build=mtl-psm' - openmpi_conf_psm='--with-psm=no --with-psm2=no --with-libfabric=no --enable-mca-no-build=mtl-psm ' - openmpi_path_suffix= - openmpi_rpm_suffix= - interface=verbs -else - if [ "$Qflag" = y ] - then - PREREQ+=('infinipath-psm-devel') - openmpi_conf_psm='--with-psm=/usr ' - # PSM indicated by qlc suffix so user can ID PSM vs verbs or PSM2 MPIs - openmpi_path_suffix="-qlc" - openmpi_rpm_suffix="_qlc" - interface=psm - fi + PREREQ+=('infinipath-psm-devel') + openmpi_conf_psm='--with-psm=/usr ' + # PSM indicated by qlc suffix so user can ID PSM vs OFI or PSM2 MPIs + openmpi_path_suffix="-qlc" + openmpi_rpm_suffix="_qlc" + interface=psm +fi - if [ "$Oflag" = y ] - then - PREREQ+=('libpsm2-devel' 'libfabric-devel') - openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-libfabric=/usr " - # PSM2 indicated by hfi suffix so user can ID from PSM or verbs MPIs - openmpi_path_suffix="-hfi" - openmpi_rpm_suffix="_hfi" - interface=psm - fi +if [ "$Oflag" = y ] +then + PREREQ+=('libpsm2-devel' 'libfabric-devel') + openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-libfabric=/usr " + # PSM2 indicated by hfi suffix so user can ID from PSM or OFI MPIs + openmpi_path_suffix="-hfi" + openmpi_rpm_suffix="_hfi" + interface=psm +fi - if [ "$Cflag" = y ] - then - PREREQ+=('libpsm2-devel' 'cuda-cudart-dev') - openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-cuda=/usr/local/cuda " - # CUDA indicated by -cuda suffix so user can ID from PSM2 without cuda, PSM or verbs MPIs - openmpi_path_suffix="-cuda-hfi" - openmpi_rpm_suffix="_cuda_hfi" - interface=psm - fi +if [ "$Cflag" = y ] +then + PREREQ+=('libpsm2-devel' 'cuda-cudart-dev') + openmpi_conf_psm=" $openmpi_conf_psm --with-psm2=/usr --with-cuda=/usr/local/cuda " + # CUDA indicated by -cuda suffix so user can ID from PSM2 without cuda, PSM or OFI MPIs + openmpi_path_suffix="-cuda-hfi" + openmpi_rpm_suffix="_cuda_hfi" + interface=psm fi CheckPreReqs -if [ "$ARCH" = "PPC64" -a \ - \( ! -f /etc/SuSE-release -o "$dist_rpm_rel_int" -le "1502" \) ] # eg. 15.2 -then - export LDFLAGS="-m64 -g -O2 -L/usr/lib64 -L/usr/X11R6/lib64" - export CFLAGS="-m64 -g -O2" - export CPPFLAGS="-m64 -g -O2" - export CXXFLAGS="-m64 -g -O2" - export FFLAGS="-m64 -g -O2" - export F90FLAGS="-m64 -g -O2" - export LDLIBS="-m64 -g -O2 -L/usr/lib64 -L/usr/X11R6/lib64" -else - # just to be safe - unset LDFLAGS - unset CFLAGS - unset CPPFLAGS - unset CXXFLAGS - unset FFLAGS - unset F90FLAGS - unset LDLIBS -fi +# just to be safe +unset LDFLAGS +unset CFLAGS +unset CPPFLAGS +unset CXXFLAGS +unset FFLAGS +unset F90FLAGS +unset LDLIBS logfile=make.openmpi.$interface.$compiler ( @@ -469,7 +420,7 @@ logfile=make.openmpi.$interface.$compiler echo "Building OpenMPI MPI $openmpi_version Library/Tools..." mkdir -p $BUILD_ROOT $RPM_DIR/BUILD $RPM_DIR/RPMS $RPM_DIR/SOURCES $RPM_DIR/SPECS $RPM_DIR/SRPMS - if [ "$ARCH" = "PPC64" -o "$ARCH" = "X86_64" ] + if [ "$ARCH" = "X86_64" ] then openmpi_lib="lib64" else @@ -482,18 +433,12 @@ logfile=make.openmpi.$interface.$compiler openmpi_wrapper_cxx_flags="" # need to create proper openmpi_comp_env value for OpenMPI builds - if [ "$ARCH" = "PPC64" -a \ - \( -f /etc/SuSE-release -a "$dist_rpm_rel_int" -gt "1502" \) ] # eg. 15.2 - then - openmpi_comp_env='LDFLAGS="-m64 -O2 -L/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"' - else - openmpi_comp_env="" - fi + openmpi_comp_env="" case "$compiler" in gcc) if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then - openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS="-O3 -fPIC"" + openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=\"-O3 -fPIC\"" else openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=-O3" fi @@ -581,21 +526,6 @@ logfile=make.openmpi.$interface.$compiler exit 1;; esac - if [ "$ARCH" = "PPC64" ] - then - openmpi_comp_env="$openmpi_comp_env --disable-mpi-f77 --disable-mpi-f90" - # In the ppc64 case, add -m64 to all the relevant - # flags because it's not the default. Also - # unconditionally add $OMPI_RPATH because even if - # it's blank, it's ok because there are other - # options added into the ldflags so the overall - # string won't be blank. - openmpi_comp_env="$openmpi_comp_env CFLAGS=\"-m64 -O2\" CXXFLAGS=\"-m64 -O2\" FCFLAGS=\"-m64 -O2\" FFLAGS=\"-m64 -O2\"" - openmpi_comp_env="$openmpi_comp_env --with-wrapper-ldflags=\"-g -O2 -m64 -L/usr/lib64\" --with-wrapper-cflags=-m64" - openmpi_comp_env="$openmpi_comp_env --with-wrapper-cxxflags=-m64 --with-wrapper-fflags=-m64 --with-wrapper-fcflags=-m64" - openmpi_wrapper_cxx_flags="$openmpi_wrapper_cxx_flags -m64"; - fi - openmpi_comp_env="$openmpi_comp_env --enable-mpirun-prefix-by-default" if [ x"$openmpi_wrapper_cxx_flags" != x ] then @@ -635,7 +565,7 @@ logfile=make.openmpi.$interface.$compiler --define '_defaultdocdir $MPICH_PREFIX/doc/..' \ --define '_mandir %{_prefix}/share/man' \ --define 'mflags -j 4' \ - --define 'configure_options $CONFIG_OPTIONS $openmpi_ldflags --with-verbs=$STACK_PREFIX --with-verbs-libdir=$STACK_PREFIX/$openmpi_lib $openmpi_comp_env $openmpi_conf_psm --with-devel-headers --disable-oshmem' \ + --define 'configure_options $CONFIG_OPTIONS $openmpi_ldflags $openmpi_comp_env $openmpi_conf_psm --with-devel-headers --disable-oshmem $openmpi_verbs' \ --define 'use_default_rpm_opt_flags $use_default_rpm_opt_flags' \ $disable_auto_requires" cmd="$cmd \ @@ -732,7 +662,7 @@ egrep 'warning:' $logfile.res |sort -u | #egrep 'error:|Error | Stop' $logfile.res| sort -u | # egrep -v 'error: this file was generated for autoconf 2.61.' > $logfile.err egrep 'error:|Error | Stop' $logfile.res| sort -u | - egrep -v 'configure: error: no BPatch.h found; check path for Dyninst package|configure: error: no vtf3.h found; check path for VTF3 package|configure: error: MPI Correctness Checking support cannot be built inside Open MPI|configure: error: no bmi.h found; check path for BMI package first...|configure: error: no ctool/ctool.h found; check path for CTool package first...|configure: error: no cuda.h found; check path for CUDA Toolkit first...|configure: error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...|configure: error: no cupti.h found; check path for CUPTI package first...|configure: error: no f2c.h found; check path for CLAPACK package first...|configure: error: no jvmti.h found; check path for JVMTI package first...|configure: error: no libcpc.h found; check path for CPC package first...|configure: error: no tau_instrumentor found; check path for PDToolkit first...|configure: error: no unimci-config found; check path for UniMCI package first...|"Error code:|"Unknown error:|strerror_r|configure: error: CUPTI API version could not be determined...|asprintf(&msg, "Unexpected sendto() error: errno=%d (%s)",' > $logfile.err + egrep -v 'configure: error: no BPatch.h found; check path for Dyninst package|configure: error: no vtf3.h found; check path for VTF3 package|configure: error: MPI Correctness Checking support cannot be built inside Open MPI|configure: error: no bmi.h found; check path for BMI package first...|configure: error: no ctool/ctool.h found; check path for CTool package first...|configure: error: no cuda.h found; check path for CUDA Toolkit first...|configure: error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...|configure: error: no cupti.h found; check path for CUPTI package first...|configure: error: no f2c.h found; check path for CLAPACK package first...|configure: error: no jvmti.h found; check path for JVMTI package first...|configure: error: no libcpc.h found; check path for CPC package first...|configure: error: no tau_instrumentor found; check path for PDToolkit first...|configure: error: no unimci-config found; check path for UniMCI package first...|"Error code:|"Unknown error:|strerror_r|configure: error: CUPTI API version could not be determined...|asprintf\(&msg, "Unexpected sendto\(\) error: errno=%d \(%s\)",' > $logfile.err if [ -s $logfile.err ] then diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 90f93a0..c32475d 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -44,6 +44,7 @@ my $Build_Debug=0; # should we provide more info for debug my $Build_Temp=""; # temp area to use for build my $Default_Build = 0; # -B option used to select build my $Build_Force = 0;# rebuild option used to force full rebuild +my $To_Show_Comps = 0; # indicate whether we need to show components or not $FirstIPoIBInterface=0; # first device is ib0 @@ -84,6 +85,8 @@ my @Components_rhel76 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel77 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); +my @Components_rhel78 = ( "opa_stack", "mpi_selector", + @OmniPathAllComponents ); my @Components_rhel8 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel81 = ( "opa_stack", "mpi_selector", @@ -292,7 +295,7 @@ $WrapperComponent = "opaconfig"; DefaultInstall => $State_Install, SrcDir => file_glob ("./OFA_MPIS.*"), PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", - Hidden => 0, Disabled => 0, IsOFA => 0, + Hidden => 1, Disabled => 1, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], UserRpms => [ "openmpi_gcc_cuda_hfi", "mpitests_openmpi_gcc_cuda_hfi" ], @@ -501,6 +504,29 @@ $WrapperComponent = "opaconfig"; }, ); +# We can improve ComponentInfo to include the following. But since they are used +# for mpisrc only, extending ComponentInfo doesn't benefit other components. +# We directly define them here where +# Dest => installation location +# SrcRpms => src rpms to install +# BuildScripts => build script to install +# MiscFiles => misc files, such as version file. This field includes 'Dest' +# and 'Src' to define the installed file name and source file +# name. For SrcRpms and BuildScript fields, the installed file +# name will be the same name as source file. +# DirtyFiles => dirty files will be cleared during install/uninstall, such +# as the build generated files. +%ExtraMpisrcInfo = ( + Dest => "/usr/src/opa/MPI", + SrcRpms => ["mvapich2", "openmpi", "mpitests"], + BuildScripts => ["do_build", "do_mvapich2_build", "do_openmpi_build"], + MiscFiles => [{ + Dest => ".version", + Src => "version"}], + DirtyFiles => [ "{mvapich2,openmpi,mpitests}_*.rpm", + "make.*.{res,err,warn}", ".mpiinfo"] +); + # one of these opa_stack comp_info gets appended to ComponentInfo # for RHEL72 my %opa_stack_rhel72_comp_info = ( @@ -1220,6 +1246,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + @Components = ( @Components_rhel78 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @Components = ( @Components_rhel8 ); @SubComponents = ( @SubComponents_newer ); @@ -1691,10 +1725,11 @@ sub process_args Usage; } else { $GPU_Install=1; + $ComponentInfo{"openmpi_gcc_cuda_hfi"}{'Hidden'} = 0; + $ComponentInfo{"openmpi_gcc_cuda_hfi"}{'Disabled'} = 0; } } elsif ( "$arg" eq "-C" ) { - ShowComponents; - exit(0); + $To_Show_Comps = 1; } elsif ( "$arg" eq "-c" ) { # undocumented option to output detailed information on a component $Default_ShowCompInfo=1; @@ -1782,6 +1817,11 @@ sub process_args $last_arg=$arg; } } + + if ($To_Show_Comps == 1) { + ShowComponents; + exit(0); + } if ( $setcomp || $setenabled || $setdisabled || $setosver || $setbuildtemp || $setfwmode || $setanswer) { printf STDERR "Missing argument for option: $last_arg\n"; Usage; diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index 4426c0f..89e8109 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -78,6 +78,10 @@ my @delta_Components_rhel77 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_rhel78 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_rhel8 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -126,6 +130,8 @@ sub overrides() @Components = ( @delta_Components_rhel76 ); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @Components = ( @delta_Components_rhel77 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + @Components = ( @delta_Components_rhel78 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @Components = ( @delta_Components_rhel8 ); } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { diff --git a/CommonInstall/util_components.pl b/CommonInstall/util_components.pl index d0da409..4e6021e 100755 --- a/CommonInstall/util_components.pl +++ b/CommonInstall/util_components.pl @@ -332,6 +332,8 @@ my %StartupComponent = (); # has component been installed since last configured autostart my %ComponentWasInstalled = (); +my %ExtraMpisrcInfo = (); + # constants for autostart functions $configure argument my $Start_Unspecified=0; my $Start_NoStart=1; @@ -364,24 +366,24 @@ sub ShowCompInfo(;$) } else { print $print_param ",\n {\n"; } - print $print_param " \"id\": \"$comp\",\n"; - my $description = $ComponentInfo{$comp}{'Name'}; - print $print_param " \"description\": \"$description\",\n"; + print $print_param " \"ID\": \"$comp\",\n"; + my $name = $ComponentInfo{$comp}{'Name'}; + print $print_param " \"Name\": \"$name\",\n"; if ( $comp eq "delta_debug" ) { print $print_param " \"error\": \"Not apply. We ship debug rpms in meta pkg <component>_debuginfo.\"\n"; print $print_param " },\n"; next; } if (comp_is_available($comp)) { - print $print_param " \"available\": \"yes\",\n"; + print $print_param " \"Available\": \"yes\",\n"; } else { - print $print_param " \"available\": \"no\",\n"; + print $print_param " \"Available\": \"no\",\n"; } my $full_ver = comp_media_version($comp); my ($version, $release) = GetVerRel($full_ver); - print $print_param " \"version\": \"$version\",\n"; - print $print_param " \"release\": \"$release\",\n"; - print $print_param " \"prereqs\": [\n"; + print $print_param " \"Version\": \"$version\",\n"; + print $print_param " \"Release\": \"$release\",\n"; + print $print_param " \"PreReq\": [\n"; $first_item = 1; my @reqs = split(/ /, $ComponentInfo{$comp}{'PreReq'}); foreach my $req (@reqs) { @@ -393,15 +395,15 @@ sub ShowCompInfo(;$) $reqver = "$version-$release"; if ($first_item == 1) { $first_item = 0; - print $print_param " {\"id\": \"$req\", \"version\": \"$reqver\"}"; + print $print_param " {\"ID\": \"$req\", \"Version\": \"$reqver\"}"; } else { - print $print_param ",\n {\"id\": \"$req\", \"version\": \"$reqver\"}"; + print $print_param ",\n {\"ID\": \"$req\", \"Version\": \"$reqver\"}"; } } } print $print_param "\n ],\n"; @reqs = split(/ /, $ComponentInfo{$comp}{'CoReq'}); - print $print_param " \"coreqs\": [\n"; + print $print_param " \"CoReq\": [\n"; $first_item = 1; foreach my $req (@reqs) { # ignore req that is not a component. This is for the case we do not @@ -412,21 +414,22 @@ sub ShowCompInfo(;$) $reqver = "$version-$release"; if ($first_item == 1) { $first_item = 0; - print $print_param " {\"id\": \"$req\", \"version\": \"$reqver\"}"; + print $print_param " {\"ID\": \"$req\", \"Version\": \"$reqver\"}"; } else { - print $print_param ",\n {\"id\": \"$req\", \"version\": \"$reqver\"}"; + print $print_param ",\n {\"ID\": \"$req\", \"Version\": \"$reqver\"}"; } } } print $print_param "\n ],\n"; if ( $comp eq "mpisrc" ) { - print $print_param " \"srcrpms\": {\n"; - print $print_param " \"dest\": \"/usr/src/opa/MPI/\",\n"; + print $print_param " \"SrcRpms\": {\n"; + my $destdir = $ExtraMpisrcInfo{'Dest'}; + print $print_param " \"Dest\": \"$destdir\",\n"; my $srcdir=$ComponentInfo{'mpisrc'}{'SrcDir'}; - print $print_param " \"source\": \"$srcdir\",\n"; - print $print_param " \"resources\": [\n"; + print $print_param " \"Source\": \"$srcdir\",\n"; + print $print_param " \"Resources\": [\n"; $first_item = 1; - foreach my $srpm ( "mvapich2", "openmpi", "mpitests" ) { + foreach my $srpm (@{$ExtraMpisrcInfo{'SrcRpms'}}) { my $srpmfile = file_glob("$srcdir/${srpm}-*.src.rpm"); if ( "$srpmfile" ne "" ) { my $file = my_basename($srpmfile); @@ -440,29 +443,60 @@ sub ShowCompInfo(;$) } print $print_param "\n ]\n"; print $print_param " },\n"; - print $print_param " \"tools\": {\n"; - print $print_param " \"dest\": \"/usr/src/opa/MPI/\",\n"; - print $print_param " \"source\": \"$srcdir\",\n"; - print $print_param " \"resources\": [\n"; - print $print_param " \"do_build\",\n"; - print $print_param " \"do_mvapich2_build\",\n"; - print $print_param " \"do_openmpi_build\"\n"; - print $print_param " ]\n"; + print $print_param " \"BuildScripts\": {\n"; + print $print_param " \"Dest\": \"$destdir\",\n"; + print $print_param " \"Source\": \"$srcdir\",\n"; + print $print_param " \"Resources\": [\n"; + $first_item = 1; + foreach my $script (@{$ExtraMpisrcInfo{'BuildScripts'}}) { + if ($first_item == 1) { + $first_item = 0; + print $print_param " \"$script\""; + } else { + print $print_param ",\n \"$script\""; + } + } + print $print_param "\n ]\n"; print $print_param " },\n"; - print $print_param " \"misc\": [\n"; - print $print_param " {\"dest\": \"/usr/src/opa/MPI/.version\", \"source\": \"$srcdir\", \"resource\": \"version\"}\n"; - print $print_param " ]\n"; + print $print_param " \"MiscFiles\": [\n"; + $first_item = 1; + foreach my $file (@{$ExtraMpisrcInfo{'MiscFiles'}}) { + my $src = ${$file}{'Src'}; + my $dest = ${$file}{'Dest'}; + if ($first_item == 1) { + $first_item = 0; + } else { + print $print_param ",\n"; + } + print $print_param " {\"Dest\": \"$destdir/$dest\", \"Src\": \"$srcdir/$src\"}"; + } + print $print_param "\n ],\n"; + print $print_param " \"DirtyFiles\": {\n"; + print $print_param " \"Dest\": \"$destdir\",\n"; + print $print_param " \"Source\": \"\",\n"; + print $print_param " \"Resources\": [\n"; + $first_item = 1; + foreach my $file (@{$ExtraMpisrcInfo{'DirtyFiles'}}) { + if ($first_item == 1) { + $first_item = 0; + print $print_param " \"$file\""; + } else { + print $print_param ",\n \"$file\""; + } + } + print $print_param "\n ]\n"; + print $print_param " }\n"; } else { - print $print_param " \"userrpms\": [\n"; + print $print_param " \"UserRpms\": [\n"; ShowRpmList($print_param, " ", "user", @{$ComponentInfo{$comp}{'UserRpms'}}); print $print_param "\n ],\n"; - print $print_param " \"kernelrpms\": [\n"; + print $print_param " \"KernelRpms\": [\n"; ShowRpmList($print_param, " ", $CUR_OS_VER, @{$ComponentInfo{$comp}{'KernelRpms'}}); print $print_param "\n ],\n"; - print $print_param " \"firmwarerpms\": [\n"; + print $print_param " \"FirmwareRpms\": [\n"; ShowRpmList($print_param, " ", "firmware", @{$ComponentInfo{$comp}{'FirmwareRpms'}}); print $print_param "\n ],\n"; - print $print_param " \"debugrpms\": [\n"; + print $print_param " \"DebugTpms\": [\n"; ShowRpmList($print_param, " ", "any", @{$ComponentInfo{$comp}{'DebugRpms'}}); print $print_param "\n ]\n"; } @@ -510,9 +544,9 @@ sub ShowRpmList($$$$@) } if ($first_item == 1) { $first_item = 0; - print $print_param "$prefix\{\"id\": \"$rpm\", \"version\": \"$version\"}"; + print $print_param "$prefix\{\"ID\": \"$rpm\", \"Version\": \"$version\"}"; } else { - print $print_param ",\n$prefix\{\"id\": \"$rpm\", \"version\": \"$version\"}"; + print $print_param ",\n$prefix\{\"ID\": \"$rpm\", \"Version\": \"$version\"}"; } } else { DebugPrint "Not found $rpm"; diff --git a/CommonInstall/util_init.pl b/CommonInstall/util_init.pl index 7768ac4..623961e 100755 --- a/CommonInstall/util_init.pl +++ b/CommonInstall/util_init.pl @@ -321,12 +321,14 @@ sub determine_os_version() my %distroVendor = ( "rhel" => "redhat", "centos" => "redhat", - "sles" => "SuSE" + "sles" => "SuSE", + "sle_hpc" => "SuSE" ); my %network_conf_dir = ( "rhel" => $NETWORK_CONF_DIR, "centos" => $NETWORK_CONF_DIR, - "sles" => "/etc/sysconfig/network" + "sles" => "/etc/sysconfig/network", + "sle_hpc" => "/etc/sysconfig/network" ); my $os_id = `cat $os_release_file | grep '^ID=' | cut -d'=' -f2 | tr -d [\\"\\.0] | tr -d ["\n"]`; $CUR_DISTRO_VENDOR = $distroVendor{$os_id}; diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index a14e69c..b26e1d8 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -130,6 +130,12 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES76" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL76.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES77" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL77.pl +endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES78" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL78.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES8" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL8.pl endif diff --git a/Esm/build.env b/Esm/build.env index a6c6f13..4dd7478 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_10_1_0_35 +export RELEASE_TAG=10_10_2_0_44 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 169c846..7f7cfe9 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 12/26/19 23:59 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_1_0_35 +Build of VIEO_HOST 03/18/20 23:55 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_2_0_44 diff --git a/Esm/fm_install.sh b/Esm/fm_install.sh index 2099ac7..93adc3a 100755 --- a/Esm/fm_install.sh +++ b/Esm/fm_install.sh @@ -37,7 +37,7 @@ # exit 1 #fi -fm_mans="opafmcmd.8 opafmcmdall.8" +fm_mans="opafmcmd.8 opafmcmdall.8 opafmconfigpp.8" mkdir -p ${DESTDIR}/usr/sbin mkdir -p ${DESTDIR}/usr/lib/systemd/system diff --git a/Esm/fm_install.sh.base b/Esm/fm_install.sh.base index 2099ac7..93adc3a 100755 --- a/Esm/fm_install.sh.base +++ b/Esm/fm_install.sh.base @@ -37,7 +37,7 @@ # exit 1 #fi -fm_mans="opafmcmd.8 opafmcmdall.8" +fm_mans="opafmcmd.8 opafmcmdall.8 opafmconfigpp.8" mkdir -p ${DESTDIR}/usr/sbin mkdir -p ${DESTDIR}/usr/lib/systemd/system diff --git a/Esm/get_id_and_versionid.sh b/Esm/get_id_and_versionid.sh index fa3a58a..c6073cb 100755 --- a/Esm/get_id_and_versionid.sh +++ b/Esm/get_id_and_versionid.sh @@ -31,6 +31,9 @@ if [ -f /etc/os-release ] then id=$(grep ^ID= /etc/os-release | cut -f2 -d= | cut -f2 -d\") + if [[ "$id" == "sle_hpc" ]]; then + id="sles" + fi versionid=$(grep ^VERSION_ID= /etc/os-release | cut -f2 -d\") else if [ `uname -s` == "Darwin" ] diff --git a/Esm/ib/man/Makefile b/Esm/ib/man/Makefile index b6d7f30..46a676d 100644 --- a/Esm/ib/man/Makefile +++ b/Esm/ib/man/Makefile @@ -39,6 +39,7 @@ INCLUDE_TARGETS = \ MAN_PAGE_8_FILES = \ opafmcmd.8 \ opafmcmdall.8 \ + opafmconfigpp.8 \ # Add more man pages for chapter 8 MISC_FILES= \ $(MAN_PAGE_8_FILES) \ diff --git a/Esm/ib/man/opafmconfigpp.manPage b/Esm/ib/man/opafmconfigpp.manPage new file mode 100644 index 0000000..68ab5cf --- /dev/null +++ b/Esm/ib/man/opafmconfigpp.manPage @@ -0,0 +1,90 @@ +.\" .\" ********************************************************************* +.\" .\" * * +.\" .\" * Copyright 2015-2019, Intel Corporation * +.\" .\" * * +.\" .\" * All Rights Reserved. * +.\" .\" * * +.\" .\" ********************************************************************* + +.TH opafmconfigpp 8 "Intel Corporation" "Copyright(C) 2015\-2019" "IFSFFCLIRG (Man Page)" +.SH NAME +opafmconfigpp + + +.PP +Merges opafm.xml pre-process file with set of VirtualFabric and DeviceGroup XML files. +.SH Syntax +opafmconfigpp [-p \fIppfile\fR] [-o \fIoutput\fR] [-b] [-s] [-f] [-h] +.SH Options + +.TP 10 +-h + +Produces full help text. + +.TP 10 +-p \fIppfile\fR + +Specifies the file to preprocess. Default is /etc/opa-fm/opafm\(ulpp.xml. + +.TP 10 +-o \fIoutput\fR + +Specifies the output XML file. Default is /etc/opa-fm/opafm.xml. + +.TP 10 +-b + +Backs up the old output file if one exists. Default is 0. + +.TP 10 +-s + +Skips running Config Check on output. Default is 0. + +.TP 10 +-f + +Forces overwrite of old output file. Default is 0. + +.SH Notes + +.PP +The output file will contain two comments at the top, along with the local time it was generated. +.PP +The special INCLUDE comments follow this style: +.PP + +.br + <!-- INCLUDE:DG\(ulDIR=$DG\(ulDIR --> +.br + + <!-- INCLUDE:VF\(ulDIR=$VF\(ulDIR --> + +.br + +.PP +Examples: +.PP + +.br + <!-- INCLUDE:VF\(ulDIR=/etc/opa-fm/vfs --> +.br + + <!-- INCLUDE:VF\(ulDIR=/etc/opa-fm/vfs\(ulfm1 --> +.br + + <!-- INCLUDE:DG\(ulDIR=/etc/opa-fm/dgs --> +.br + + <!-- INCLUDE:DG\(ulDIR=/etc/opa-fm/dgs\(ulfm0 --> + +.br + +.PP +INCLUDE comments will be replaced with contents of the given directories. +.SH Example +opafmconfigpp +.br + +opafmconfigpp -b -s diff --git a/MakeTools/funcs-ext.sh b/MakeTools/funcs-ext.sh index 9aa4cd2..f6f6b7b 100755 --- a/MakeTools/funcs-ext.sh +++ b/MakeTools/funcs-ext.sh @@ -719,6 +719,9 @@ function os_vendor() sles) rval=SuSE ;; + sle_hpc) + rval=SuSE + ;; centos) rval=redhat ;; diff --git a/Topology/focus.c b/Topology/focus.c index d992fdd..1206909 100644 --- a/Topology/focus.c +++ b/Topology/focus.c @@ -1704,9 +1704,60 @@ static FSTATUS ParseSmDetailsPatPoint(FabricData_t *fabricp, char *arg, Point *p return FindSmDetailsPatPoint(fabricp, arg, pPoint, find_flag); } +static FSTATUS ParseLinkCRCPoint(FabricData_t *fabricp, char *arg, Point *pPoint, uint8 find_flag, char **pp) +{ + LinkCRCCompare comp = CRC_EQ; + uint16 crc; + char *next; + + ASSERT(! PointValid(pPoint)); + *pp = arg; + if (NULL != (next = ComparePrefix(arg, "NE:"))) { + comp = CRC_NE; // not equal + } else if (NULL != (next = ComparePrefix(arg, ":"))) { + comp = CRC_EQ; // equal + } else { + fprintf(stderr, "%s: Invalid Link CRC format: '%s'\n", + g_Top_cmdname, arg); + return FINVALID_PARAMETER; + } + + *pp = next; + if (NULL != (next = ComparePrefix(*pp, "14b"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_14; + } else if (NULL != (next = ComparePrefix(*pp, "14-bit"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_14; + } else if (NULL != (next = ComparePrefix(*pp, "16b"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_16; + } else if (NULL != (next = ComparePrefix(*pp, "16-bit"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_16; + } else if (NULL != (next = ComparePrefix(*pp, "48b"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_48; + } else if (NULL != (next = ComparePrefix(*pp, "48-bit"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_48; + } else if (NULL != (next = ComparePrefix(*pp, "per_lane"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_12_16_PER_LANE; + } else if (NULL != (next = ComparePrefix(*pp, "12-16/lane"))) { + *pp = next; + crc = STL_PORT_LTP_CRC_MODE_12_16_PER_LANE; + } else { + fprintf(stderr, "%s: Invalid Link CRC format: '%s'\n", g_Top_cmdname, arg); + return FINVALID_PARAMETER; + } + + return FindLinkCRCPoint(fabricp, crc, comp, pPoint, find_flag); +} + static FSTATUS ParseLinkQualityPoint(FabricData_t *fabricp, char *arg, Point *pPoint, uint8 find_flag, char **pp) { - LinkQualityCompare comp; + LinkQualityCompare comp = QUAL_EQ; uint16 quality; char *Quality; @@ -1748,7 +1799,7 @@ static FSTATUS ParseLinkDownReasonPoint(FabricData_t *fabricp, char *arg, Point if (NULL != (ldrp = ComparePrefix(arg, ":"))) { *pp = ldrp; if (FSUCCESS != StringToUint8(&ldr, ldrp, pp, 0, TRUE)) { - fprintf(stderr, "%s: Invalid Link Quality format: '%s'\n", g_Top_cmdname, arg); + fprintf(stderr, "%s: Invalid Link Down Reason format: '%s'\n", g_Top_cmdname, arg); return FINVALID_PARAMETER; } } @@ -1884,6 +1935,8 @@ FSTATUS ParsePoint(FabricData_t *fabricp, char* arg, Point* pPoint, uint8 find_f status = ParseSmDetailsPatPoint(fabricp, param, pPoint, find_flag, pp); } else if (NULL != (param = ComparePrefix(arg, "sm"))) { status = ParseSmPoint(fabricp, param, pPoint, find_flag, pp); + } else if (NULL != (param = ComparePrefix(arg, "linkcrc"))) { + status = ParseLinkCRCPoint(fabricp, param, pPoint, find_flag, pp); } else if (NULL != (param = ComparePrefix(arg, "linkqual"))) { status = ParseLinkQualityPoint(fabricp, param, pPoint, find_flag, pp); } else if (NULL != (param = ComparePrefix(arg, "ldr"))) { diff --git a/Topology/search.c b/Topology/search.c index d0c43dc..1f1cc61 100644 --- a/Topology/search.c +++ b/Topology/search.c @@ -2106,6 +2106,59 @@ ExpectedLink* FindExpectedLinkByOneSide(const FabricData_t *fabricp, EUI64 nodeG } +// FNOT_FOUND - no instances found +// FINVALID_OPERATION - find_flag contains no applicable searches +// other - error allocating memory or initializing structures +FSTATUS FindLinkCRCPoint(FabricData_t *fabricp, uint16 crc, LinkCRCCompare comp, Point *pPoint, uint8 find_flag) +{ + FSTATUS status; + + ASSERT(! PointValid(pPoint)); + if (0 == (find_flag & FIND_FLAG_FABRIC)) + return FINVALID_OPERATION; + if (find_flag & FIND_FLAG_FABRIC) { + LIST_ITEM *p; + for (p=QListHead(&fabricp->AllPorts); p != NULL; p = QListNext(&fabricp->AllPorts, p)) { + PortData *portp = (PortData *)QListObj(p); + + boolean match = FALSE; + /* omit switch port 0, CRC is often odd and N/A */ + if (portp->PortNum == 0) + continue; + switch (comp) { + case CRC_EQ: + match = (portp->PortInfo.PortLTPCRCMode.s.Active == crc ); + break; + case CRC_NE: + match = (portp->PortInfo.PortLTPCRCMode.s.Active != crc ); + break; + default: + break; + } + if (match) { + status = PointListAppend(pPoint, POINT_TYPE_PORT_LIST, portp); + if (FSUCCESS != status) + return status; + } + } + } + + // N/A for FIND_FLAG_ENODE, FIND_FLAG_ESM and FIND_FLAG_ELINK + + if (! PointValid(pPoint)) { + char tempbuf[20]; + fprintf(stderr, "%s: Link CRC Not Found: %s %s\n", + g_Top_cmdname, + (comp == CRC_EQ)? "EQ" + : (comp == CRC_NE) ? "NE" + : "", /* should not happen */ + StlPortLtpCrcModeToText(crc, tempbuf, sizeof(tempbuf))); + return FNOT_FOUND; + } + PointCompress(pPoint); + return FSUCCESS; +} + // FNOT_FOUND - no instances found // FINVALID_OPERATION - find_flag contains no applicable searches // other - error allocating memory or initializing structures @@ -2148,8 +2201,13 @@ FSTATUS FindLinkQualityPoint(FabricData_t *fabricp, uint16 quality, LinkQualityC // N/A for FIND_FLAG_ENODE, FIND_FLAG_ESM and FIND_FLAG_ELINK if (! PointValid(pPoint)) { - fprintf(stderr, "%s: Link Quality Not Found: %d\n", - g_Top_cmdname, quality); + fprintf(stderr, "%s: Link Quality Not Found: %s %d\n", + g_Top_cmdname, + (comp == QUAL_EQ)? "EQ" + : (comp == QUAL_GE) ? "GE" + : (comp == QUAL_LE) ? "LE" + : "", /* should not happen */ + quality); return FNOT_FOUND; } PointCompress(pPoint); diff --git a/Topology/topology.h b/Topology/topology.h index 38d8449..fefa979 100644 --- a/Topology/topology.h +++ b/Topology/topology.h @@ -791,6 +791,11 @@ typedef enum { QUAL_LE } LinkQualityCompare; +typedef enum { + CRC_EQ, + CRC_NE +} LinkCRCCompare; + // simple way to convert time_t to a localtime date string in dest // (from Topology/getdate.c) extern void Top_formattime(char *dest, size_t max, time_t t); @@ -1032,6 +1037,7 @@ extern PortData * FindNodeGuidPort(FabricData_t *fabricp,EUI64 nodeguid, uint8 p extern ExpectedNode* FindExpectedNodeByNodeGuid(const FabricData_t* fabricp, EUI64 nodeGuid); extern ExpectedNode* FindExpectedNodeByNodeDesc(const FabricData_t* fabricp, const char* nodeDesc, uint8 NodeType); extern ExpectedLink* FindExpectedLinkByOneSide(const FabricData_t* fabricp, EUI64 nodeGuid, uint8 portNum, uint8* side); +extern FSTATUS FindLinkCRCPoint(FabricData_t *fabricp, uint16 crc, LinkCRCCompare comp, Point *pPoint, uint8 find_flag); extern FSTATUS FindLinkQualityPoint(FabricData_t *fabricp, uint16 quality, LinkQualityCompare comp, Point *pPoint, uint8 find_flag); extern FSTATUS FindLinkDownReasonPoint(FabricData_t *fabricp, uint8 ldr, Point *pPoint, uint8 find_flag); extern FSTATUS FindExpectedSMByPortGuid(FabricData_t *fabricp, EUI64 portGuid); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 0b28d54..b9b1e1a 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.10.1.0 -Release: 35%{?dist} +Version: 10.10.2.0 +Release: 44%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.10.1.0.35%{?dist} +IFSComponent: FM 10.10.2.0.44%{?dist} %prep %setup -q -c
0
6133b2fe5b39b605c0d695bce37cdfa498a4d477
01org/opa-fm
Update to latest from build 10.11.0.0.574 (IFS 10.11.0.0.577)
commit 6133b2fe5b39b605c0d695bce37cdfa498a4d477 Author: Scott Breyer <[email protected]> Date: Tue Apr 13 11:02:37 2021 -0400 Update to latest from build 10.11.0.0.574 (IFS 10.11.0.0.577) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index 2f11768..e350ec0 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -1,6 +1,7 @@ # BEGIN_ICS_COPYRIGHT8 **************************************** # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -97,11 +98,12 @@ CLEAN_TARGETS_MISC = CLEAN_TARGETS = $(OBJECTS) $(RSCOBJECTS) $(IDL_TARGETS) $(CLEAN_TARGETS_MISC) # other files to remove during clobber phase CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl \ - comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl comp_ff_of_prereq_RHEL82.pl comp_ff_of_prereq_SLES122.pl \ - comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl comp_ff_of_prereq_SLES152.pl \ - comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl \ - comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl comp_fm_prereq_RHEL82.pl comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl \ - comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl comp_fm_prereq_SLES152.pl + comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl comp_ff_of_prereq_RHEL82.pl comp_ff_of_prereq_RHEL83.pl \ + comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl \ + comp_ff_of_prereq_SLES152.pl comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl comp_fm_prereq_RHEL75.pl \ + comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl comp_fm_prereq_RHEL82.pl \ + comp_fm_prereq_RHEL83.pl comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl \ + comp_fm_prereq_SLES151.pl comp_fm_prereq_SLES152.pl # sub-directory to install to within bin BIN_SUBDIR = # sub-directory to install to within include @@ -129,12 +131,12 @@ LOCALDEPLIBS = FF_FILES = comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl \ comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL78.pl \ - comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl comp_ff_of_prereq_RHEL82.pl \ + comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl comp_ff_of_prereq_RHEL82.pl comp_ff_of_prereq_RHEL83.pl \ comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl comp_ff_of_prereq_SLES152.pl FM_FILES = comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl \ comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL78.pl \ - comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl comp_fm_prereq_RHEL82.pl \ + comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl comp_fm_prereq_RHEL82.pl comp_fm_prereq_RHEL83.pl \ comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl comp_fm_prereq_SLES152.pl diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index e549931..efb9ad6 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -2,6 +2,7 @@ # BEGIN_ICS_COPYRIGHT8 # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -86,6 +87,7 @@ my @delta_kernel_srpms_rhel78 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel8 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel81 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel82 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel83 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # This provides information for all kernel srpms @@ -169,6 +171,8 @@ sub init_delta_info($) } else { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74); } + } elsif ( "$CUR_VENDOR_VER" eq "ES83" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel83 ); } elsif ( "$CUR_VENDOR_VER" eq "ES82" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel82 ); } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { @@ -806,6 +810,9 @@ sub installed_delta_opa_stack() return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } + } elsif ( "$CUR_VENDOR_VER" eq "ES83" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES82" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -1151,6 +1158,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES82" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES83" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES123" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); diff --git a/CommonInstall/comp_delta_prereq_RHEL83.pl b/CommonInstall/comp_delta_prereq_RHEL83.pl new file mode 100644 index 0000000..6bd1756 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL83.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python2", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_delta_prereq_SLES124.pl b/CommonInstall/comp_delta_prereq_SLES124.pl index 5d1bcc0..f8e4323 100644 --- a/CommonInstall/comp_delta_prereq_SLES124.pl +++ b/CommonInstall/comp_delta_prereq_SLES124.pl @@ -86,7 +86,6 @@ $comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; my @openmpi_gcc_hfi_prereq = ( "glibc", "bash", - "libpsm_infinipath1", "pkg-config", "libgcc_s1", "libgfortran3", diff --git a/CommonInstall/comp_delta_prereq_SLES125.pl b/CommonInstall/comp_delta_prereq_SLES125.pl index 6d7cec1..b6da6c6 100644 --- a/CommonInstall/comp_delta_prereq_SLES125.pl +++ b/CommonInstall/comp_delta_prereq_SLES125.pl @@ -85,7 +85,6 @@ $comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; my @openmpi_gcc_hfi_prereq = ( "glibc", "bash", - "libpsm_infinipath1", "pkg-config", "libgcc_s1", "libgfortran3", diff --git a/CommonInstall/comp_delta_prereq_SLES151.pl b/CommonInstall/comp_delta_prereq_SLES151.pl index 60aeb98..ed4f1f6 100644 --- a/CommonInstall/comp_delta_prereq_SLES151.pl +++ b/CommonInstall/comp_delta_prereq_SLES151.pl @@ -85,7 +85,6 @@ $comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; my @openmpi_gcc_hfi_prereq = ( "glibc", "bash", - "libpsm_infinipath1", "pkg-config", "libgcc_s1", "libgfortran4", diff --git a/CommonInstall/comp_delta_prereq_SLES152.pl b/CommonInstall/comp_delta_prereq_SLES152.pl index ccac779..4e4383f 100644 --- a/CommonInstall/comp_delta_prereq_SLES152.pl +++ b/CommonInstall/comp_delta_prereq_SLES152.pl @@ -85,7 +85,6 @@ $comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; my @openmpi_gcc_hfi_prereq = ( "glibc", "bash", - "libpsm_infinipath1", "pkg-config", "libgcc_s1", "libgfortran4", diff --git a/CommonInstall/comp_ff_of_prereq_RHEL83.pl b/CommonInstall/comp_ff_of_prereq_RHEL83.pl new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL83.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL83.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL83.pl.base new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL83.pl.base @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL83.pl b/CommonInstall/comp_fm_prereq_RHEL83.pl new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL83.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL83.pl.base b/CommonInstall/comp_fm_prereq_RHEL83.pl.base new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL83.pl.base @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 1b4688d..a38a003 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -2,6 +2,7 @@ # BEGIN_ICS_COPYRIGHT8 **************************************** # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -95,6 +96,8 @@ my @Components_rhel81 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel82 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); +my @Components_rhel83 = ( "opa_stack", "mpi_selector", + @OmniPathAllComponents ); @Components = ( ); @@ -942,6 +945,36 @@ my %intel_hfi_rhel82_comp_info = ( }, ); +my %intel_hfi_rhel83_comp_info = ( + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ #"libhfi1", "libhfi1-static", + "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ #"hfi1_debuginfo", + "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", #"libhfi1-debuginfo" + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); + # For SLES12sp3 that has different name for libpsm2 my %intel_hfi_sles123_comp_info = ( "intel_hfi" => { Name => "Intel HFI Components", @@ -1312,6 +1345,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES83" ) { + @Components = ( @Components_rhel83 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_rhel83_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @Components_sles15 ); @SubComponents = ( @SubComponents_newer ); diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index 7882823..e009fca 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -2,6 +2,7 @@ # BEGIN_ICS_COPYRIGHT8 **************************************** # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -94,6 +95,10 @@ my @delta_Components_rhel82 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_rhel83 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_sles15 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -146,6 +151,8 @@ sub overrides() @Components = ( @delta_Components_rhel81 ); } elsif ( "$CUR_VENDOR_VER" eq "ES82" ) { @Components = ( @delta_Components_rhel82 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES83" ) { + @Components = ( @delta_Components_rhel83 ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @delta_Components_sles15 ); } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index 4ab2ebb..f8b3ea2 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -1,6 +1,7 @@ # BEGIN_ICS_COPYRIGHT8 **************************************** # # Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -145,6 +146,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES82" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL82.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES83" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL83.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES122" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES122.pl endif diff --git a/Esm/build.env b/Esm/build.env index e515431..fec0387 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_10_3_2_2 +export RELEASE_TAG=10_11_0_0_574 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 91793c2..414fb0e 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 11/20/20 00:46 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_3_2_2 +Build of VIEO_HOST 03/29/21 23:41 Tag: VIEO_HOST_LINUX_opa-10_11_10_11_0_0_574 diff --git a/MakeTools/get_comp.sh b/MakeTools/get_comp.sh index fea09df..85062ab 100644 --- a/MakeTools/get_comp.sh +++ b/MakeTools/get_comp.sh @@ -62,10 +62,10 @@ ## instead of an ftp. ## ## SCPSERVER - host to get packages from via SCP. Takes the form: -## "server" or "user@server:. Defaults to "phcvs2@phlsvlogin02" +## "server" or "user@server:. Defaults to "scm@cn-login01" ## ## SCPTOP - root directory to get SCP files from. Takes the form: -## "directory". Defaults to "/nfs/site/proj/stlbuilds". +## "directory". Defaults to "/nfs/shares/stlbuilds". ## ## This is designed for use in higher level scripts and makefiles, as such it ## will only download files which have not already been downloaded. @@ -101,8 +101,8 @@ shift 3 # These variables control where the pre-built packages are pulled from. # See documentation above. export FTPSERVER=${FTPSERVER:-"ftp:ftp@kop-sds-ftp"} -export SCPTOP=${SCPTOP:-"/nfs/site/proj/stlbuilds"} -export SCPSERVER=${SCPSERVER:-"[email protected]"}:$SCPTOP +export SCPTOP=${SCPTOP:-"/nfs/shares/stlbuilds"} +export SCPSERVER=${SCPSERVER:-"[email protected]"}:$SCPTOP # ftp_get_files is defined in newer versions of devtools if ! type ftp_get_files > /dev/null 2>/dev/null diff --git a/Topology/fabricdata.c b/Topology/fabricdata.c index f037d6f..c89d626 100644 --- a/Topology/fabricdata.c +++ b/Topology/fabricdata.c @@ -2549,7 +2549,7 @@ static void* CLFabricDataBuildRouteGraphThread(void *context) srcHcaLstp = QListNext(&fabricp->FIs, srcHcaLstp), l++) { clDeviceData_t *src_hfip = (clDeviceData_t *)QListObj(srcHcaLstp); - if (verbose >= 3) { + if (verbose >= 4) { timeGetCallback(&((clThreadContext_t *)context)->sTime, &g_cl_lock); printf("[%d] START build all routes from %s (SLID 0x%08x)\n", (int)thrdId, src_hfip->nodep->NodeDesc.NodeString, src_hfip->Lid); @@ -2722,7 +2722,7 @@ static void* CLFabricDataBuildRouteGraphThread(void *context) } } - if (verbose >= 3) { + if (verbose >= 4) { timeGetCallback(&((clThreadContext_t *)context)->eTime, &g_cl_lock); printf("[%d] END build all routes from %s (SLID 0x%08x); elapsed time(usec)=%d, (sec)=%d\n", (int)thrdId, src_hfip->nodep->NodeDesc.NodeString, src_hfip->Lid, @@ -3005,7 +3005,7 @@ static int CLDijkstraCheckDistancesAndRoutes(clGraphData_t *graphp, uint32 **dis } } - if (verbose >= 3) + if (verbose >= 4) printf("Check route summary : %d dependency graph routes have errors\n", errors); return errors; @@ -3101,7 +3101,7 @@ NodeData* CLDataAddDevice(FabricData_t *fabricp, NodeData *nodep, STL_LID lid, i else QListInsertTail(&fabricp->Switches, &ccDevicep->AllDeviceTypesEntry); //PYTHON: fabric.switches.append(device) if (verbose >= 4 && !quiet) - ProgressPrint(TRUE, "Add %s %s with GUID 0x%016"PRIx64" and LID 0x%08x", + ProgressPrint(FALSE, "Add %s %s with GUID 0x%016"PRIx64" and LID 0x%08x", StlNodeTypeToText(nodep->NodeInfo.NodeType), (char *)nodep->NodeDesc.NodeString, nodep->NodeInfo.NodeGUID, @@ -3169,7 +3169,7 @@ FSTATUS CLDataAddConnection(FabricData_t *fabricp, PortData *portp1, PortData *p ccConnp->VL = portp1->pQOS->SC2VLMaps[Enum_SCVLt].SCVLMap[sc]; if (verbose >= 4 && !quiet) - ProgressPrint(TRUE, "Add connection 0x%016"PRIx64":%3.3u to 0x%016"PRIx64":%3.3u at rate %s", + ProgressPrint(FALSE, "Add connection 0x%016"PRIx64":%3.3u to 0x%016"PRIx64":%3.3u at rate %s", portp1->nodep->NodeInfo.NodeGUID, portp1->PortNum, portp2->nodep->NodeInfo.NodeGUID, portp2->PortNum, StlStaticRateToText(portp1->rate)); } @@ -3227,7 +3227,7 @@ FSTATUS CLDataAddRoute(FabricData_t *fabricp, STL_LID slid, STL_LID dlid, PortDa //PYTHON: fabric.routes += 1 fabricp->RouteCount++; if (verbose >= 4 && !quiet) - ProgressPrint(TRUE, "Add route SLID 0x%08x to DLID 0x%08x at GUID 0x%016"PRIx64" using port %3.3u", + ProgressPrint(FALSE, "Add route SLID 0x%08x to DLID 0x%08x at GUID 0x%016"PRIx64" port %3.3u", slid, dlid, sportp->nodep->NodeInfo.NodeGUID, sportp->PortNum); } } @@ -3261,6 +3261,7 @@ FSTATUS CLFabricDataBuildRouteGraph(FabricData_t *fabricp, ValidateCLRouteSumma ValidateCreditLoopRoutesContext_t *cp = (ValidateCreditLoopRoutesContext_t *)context; int xmlFmt = (cp->format == 1) ? 1 : 0; int verbose = (xmlFmt) ? 0 : cp->detail; + int singleThreaded = 1; uint32 maxHcaListEntry = QListCount(&fabricp->FIs) / CL_MAX_THREADS; clThreadContext_t *threadContexts; @@ -3278,7 +3279,7 @@ FSTATUS CLFabricDataBuildRouteGraph(FabricData_t *fabricp, ValidateCLRouteSumma return status; } - if (!xmlFmt && verbose >= 3) { + if (!xmlFmt && verbose >= 4) { timeGetCallback(&sTime, &g_cl_lock); printf("START build graphical layout of all the routes\n"); } @@ -3286,7 +3287,7 @@ FSTATUS CLFabricDataBuildRouteGraph(FabricData_t *fabricp, ValidateCLRouteSumma pthread_mutex_init(&g_cl_lock, NULL); //PYTHON: for src_hfi in fabric.hfis : - if (QListCount(&fabricp->FIs) < 100) { + if ((singleThreaded) || (QListCount(&fabricp->FIs) < 100)) { threadContexts[0].srcHcaList = QListHead(&fabricp->FIs); // determine whether to start worker thread @@ -3349,7 +3350,7 @@ FSTATUS CLFabricDataBuildRouteGraph(FabricData_t *fabricp, ValidateCLRouteSumma if (!cp->quiet) ProgressPrint(TRUE, "Done Building Graphical Layout of All Routes"); - if (!xmlFmt && verbose >= 3) { + if (!xmlFmt && verbose >= 4) { timeGetCallback(&eTime, &g_cl_lock); printf("END build graphical layout of all the routes; elapsed time(usec)=%d, (sec)=%d\n", (int)(eTime - sTime), ((int)(eTime - sTime)) / CL_TIME_DIVISOR); @@ -3358,7 +3359,7 @@ FSTATUS CLFabricDataBuildRouteGraph(FabricData_t *fabricp, ValidateCLRouteSumma // // report routes summary if (hops_histogram != NULL) { - if (verbose >= 3) + if (verbose >= 4) routeSummaryCallback(present_routes, missing_routes, hops_histogram_entries, hops_histogram, context); MemoryDeallocate(hops_histogram); } @@ -3408,7 +3409,7 @@ void CLGraphDataPrune(clGraphData_t *graphp, ValidateCLTimeGetCallback_t timeGet uint32 ii, vv, progress = 1, round = 0; uint64_t sTime = 0, eTime = 0; - if (verbose >= 3 && !quiet) { + if (verbose >= 4 && !quiet) { timeGetCallback(&sTime, &g_cl_lock); ProgressPrint(TRUE, "START pruning of graphical layout of all the routes"); } @@ -3430,7 +3431,7 @@ void CLGraphDataPrune(clGraphData_t *graphp, ValidateCLTimeGetCallback_t timeGet for (ii = 0; ii < vertexp->InboundCount; ii++) { if (vertexp->Inbound[ii] >= 0) { if (verbose >= 4 && !quiet) - ProgressPrint(TRUE, "Remove arc id %d since vertex id %d is pure sink", + ProgressPrint(FALSE, "Remove arc id %d since vertex id %d is pure sink", vertexp->Inbound[ii], vertexp->Id); //PYTHON: self.del_arc(arc_id); CLGraphDataDelArc(graphp, vertexp->Inbound[ii]); @@ -3446,7 +3447,7 @@ void CLGraphDataPrune(clGraphData_t *graphp, ValidateCLTimeGetCallback_t timeGet for (ii = 0; ii < vertexp->OutboundCount; ii++) { if (vertexp->Outbound[ii] >= 0) { if (verbose >= 4 && !quiet) - ProgressPrint(TRUE, "Remove arc id %d since vertex id %d is pure source", + ProgressPrint(FALSE, "Remove arc id %d since vertex id %d is pure source", vertexp->Outbound[ii], vertexp->Id); //PYTHON: self.del_arc(arc_id); CLGraphDataDelArc(graphp, vertexp->Outbound[ii]); @@ -3464,7 +3465,7 @@ void CLGraphDataPrune(clGraphData_t *graphp, ValidateCLTimeGetCallback_t timeGet ProgressPrint(TRUE, "Graph pruning round %d : deleted %d arcs", round, progress); } - if (verbose >= 3 && !quiet) { + if (verbose >= 4 && !quiet) { timeGetCallback(&eTime, &g_cl_lock); ProgressPrint(TRUE, "END pruning of graphical layout of all the routes; elapsed time(usec)=%d, (sec)=%d", (int)(eTime - sTime), ((int)(eTime - sTime)) / CL_TIME_DIVISOR); @@ -3512,7 +3513,7 @@ FSTATUS CLDijkstraFindDistancesAndRoutes(clGraphData_t *graphp, clDijkstraDistan //PYTHON: num_vertices = graph.num_vertices numVertices = graphp->NumVertices; - if (verbose >= 3) + if (verbose >= 4) printf("Calculating distances for %d vertices in graph\n", numVertices); //PYTHON: for i in graph.vertices : @@ -3735,7 +3736,7 @@ FSTATUS CLDijkstraFindDistancesAndRoutes(clGraphData_t *graphp, clDijkstraDistan } } - if (verbose >= 3) + if (verbose >= 4) printf("Maximum distance is %d\n", maxDistance); // deallocate temporary buffers @@ -3821,10 +3822,8 @@ void CLDijkstraFindCycles(FabricData_t *fabricp, uint32 step; clVertixData_t *j; - if (dii || verbose >= 3) { + if (dii || verbose >= 4) { (void)linkSummaryCallback(i->Id, ib_connection_source_to_str(fabricp, i->Connection), dii, 1, indent, context); - if (verbose >= 4) - (void)pathSummaryCallback(fabricp, i->Connection, indent + 4, context); } j = i; //PYTHON: j = i @@ -3847,8 +3846,9 @@ void CLDijkstraFindCycles(FabricData_t *fabricp, if (drp->routes) { //PYTHON: for step in range(0, dii) : for (step = 0; step < dii; step++) { - (void)linkStepSummaryCallback(j->Id, ib_connection_source_to_str(fabricp, j->Connection), step, 1, indent + 4, context); - if (verbose >= 4) + if (verbose >= 2) + (void)linkStepSummaryCallback(j->Id, ib_connection_source_to_str(fabricp, j->Connection), step, 1, indent + 4, context); + if (verbose >= 3) (void)pathSummaryCallback(fabricp, j->Connection, indent + 8, context); // insert XML token to indicate the end of link step summary section if (xmlFmt) @@ -3868,8 +3868,9 @@ void CLDijkstraFindCycles(FabricData_t *fabricp, for (step = 0; step < dii; step++) { uint32 jj; - (void)linkStepSummaryCallback(j->Id, ib_connection_source_to_str(fabricp, j->Connection), step, 1, indent + 4, context); - if (verbose >= 4) + if (verbose >= 2) + (void)linkStepSummaryCallback(j->Id, ib_connection_source_to_str(fabricp, j->Connection), step, 1, indent + 4, context); + if (verbose >= 3) (void)pathSummaryCallback(fabricp, j->Connection, indent + 8, context); // insert XML token to indicate the end of link step summary section if (xmlFmt) @@ -3940,7 +3941,7 @@ void CLDijkstraFindCycles(FabricData_t *fabricp, } } - if (verbose >= 3) { + if (verbose >= 4) { if (!cycles) printf("Routes are deadlock free!\n"); else { diff --git a/Topology/route.c b/Topology/route.c index d3b0ffa..bd5b126 100644 --- a/Topology/route.c +++ b/Topology/route.c @@ -1705,7 +1705,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 detail = cp->detail; xmlFmt = (cp->format == 1) ? 1 : 0; - if (!xmlFmt && cp->detail >= 3) { + if (!xmlFmt && cp->detail >= 4) { timeGetCallback(&sTotalTime, &g_cl_lock); timeGetCallback(&sTime, &g_cl_lock); printf("START build all the routes\n"); @@ -1722,7 +1722,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 // collect routing information between all endnodes within the fabric for (n1 = QListHead(&fabricp->AllFIs); n1 != NULL; n1 = QListNext(&fabricp->AllFIs, n1)) { NodeData *nodep1 = (NodeData *)QListObj(n1); - if (!xmlFmt && cp->detail >= 3) { + if (!xmlFmt && cp->detail >= 4) { printf("START build all routes from %s\n", nodep1->NodeDesc.NodeString); } @@ -1756,7 +1756,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 } } } - if (!xmlFmt && cp->detail >= 3) { + if (!xmlFmt && cp->detail >= 4) { printf("END build all routes from %s\n", nodep1->NodeDesc.NodeString); printf("%d of %d HFI nodes completed\n", ++nodeCount, QListCount(&fabricp->AllFIs)); } else { @@ -1766,7 +1766,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 } } - if (!xmlFmt && cp->detail >= 3) { + if (!xmlFmt && cp->detail >= 4) { timeGetCallback(&eTime, &g_cl_lock); printf("END build all the routes; elapsed time(usec)=%d, (sec)=%d\n", (int)(eTime - sTime), ((int)(eTime - sTime)) / CL_TIME_DIVISOR); @@ -1787,7 +1787,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 if (!CLFabricDataBuildRouteGraph(fabricp, routeSummaryCallback, timeGetCallback, cp, usedSLs)) { clGraphData_t *graphp; - if (detail >= 3) { + if (detail >= 4) { //PYTHON: full_graph.summary('Full graph') (void)CLGraphDataSummary(&fabricp->Graph, (xmlFmt) ? "FullGraph" : "Full graph", dataSummaryCallback, cp); } @@ -1796,7 +1796,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 //PYTHON: pruned_graph.prune() (void)CLGraphDataPrune(&fabricp->Graph, timeGetCallback, detail, cp->quiet); - if (detail >= 3) { + if (detail >= 4) { //PYTHON: pruned_graph.summary('Pruned graph') (void)CLGraphDataSummary(&fabricp->Graph, (xmlFmt) ? "PrunedGraph" : "Pruned graph", dataSummaryCallback, cp); } @@ -1817,7 +1817,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 //PYTHON: while split_graph : while (graphp) { - if (detail >= 3) { + if (detail >= 4) { if (xmlFmt) sprintf(title, "SplitGraph%d", count); else @@ -1845,7 +1845,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 count += 1; } - if (detail >= 3 && count > 1) + if (detail >= 4 && count > 1) printf("Dependencies split into %d disconnected graphs\n", count); } @@ -1855,7 +1855,7 @@ FSTATUS ValidateAllCreditLoopRoutes(FabricData_t *fabricp, EUI64 portGuid, uint8 fprintf(stderr, "Warning, failed to deallocate route credit loop data\n"); } - if (!xmlFmt && cp->detail >= 3) { + if (!xmlFmt && cp->detail >= 4) { timeGetCallback(&eTotalTime, &g_cl_lock); printf("END Credit loop validation; elapsed time(usec)=%12"PRIu64", (sec)=%12"PRIu64"\n", (eTotalTime - sTotalTime), ((eTotalTime - sTotalTime)) / CL_TIME_DIVISOR);
0
c7992c2ae66efa67c855a851d3373fbb4c120cea
01org/opa-fm
Fix merge syntax error in spec file
commit c7992c2ae66efa67c855a851d3373fbb4c120cea Author: Scott Breyer <[email protected]> Date: Thu May 5 06:27:52 2016 -0400 Fix merge syntax error in spec file diff --git a/opafm.spec b/opafm.spec index b8e37bd..c094e98 100644 --- a/opafm.spec +++ b/opafm.spec @@ -157,10 +157,7 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* -<<<<<<< HEAD #/opt/opafm/samples/* -======= ->>>>>>> 82600d3632ee0c401c218fc0d9a462347e7ae2fb %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall
0
8f3d0fbdc8fa267feb32ea181cd7321c72c7d278
01org/opa-fm
Fix for nodes dropping off from IPoIB mcast group Check if the old topology port was DOWN when determining if ClientReregister should be sent to handle the case where the FM marked a port DOWN on an error path. This is needed because if the port was marked DOWN, then we will have cleaned up the MC groups. Update version in spec file as well as GitHub url Signed-off-by: John Fleck <[email protected]> Signed-off-by: Michael Brooks <[email protected]>
commit 8f3d0fbdc8fa267feb32ea181cd7321c72c7d278 Author: John Fleck <[email protected]> Date: Sat May 12 14:03:25 2018 -0400 Fix for nodes dropping off from IPoIB mcast group Check if the old topology port was DOWN when determining if ClientReregister should be sent to handle the case where the FM marked a port DOWN on an error path. This is needed because if the port was marked DOWN, then we will have cleaned up the MC groups. Update version in spec file as well as GitHub url Signed-off-by: John Fleck <[email protected]> Signed-off-by: Michael Brooks <[email protected]> diff --git a/Esm/build.env b/Esm/build.env index 33c76fd..d86a259 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_7_0_0_141 +export RELEASE_TAG=10_7_0_0_142 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/smi/sm/sm_activate.c b/Esm/ib/src/smi/sm/sm_activate.c index 2f6d5a3..0201e0b 100644 --- a/Esm/ib/src/smi/sm/sm_activate.c +++ b/Esm/ib/src/smi/sm/sm_activate.c @@ -34,14 +34,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static __inline__ int needs_reregistration(Node_t * nodep, Port_t * portp, pActivationRetry_t retry) { - if (activation_retry_attempts(retry)) { - // on retries, only reregister if pending + // general conditions are only checked on first attempt. + // on retries, only reregister if it remains pending from previous attempts + if (activation_retry_attempts(retry)) return portp->portData->reregisterPending; - } - return topology_passcount < 1 // new sm - || sm_find_guid(&old_topology, nodep->nodeInfo.NodeGUID) == NULL // new node - || portp->portData->reregisterPending; // previous attempts haven't yet succeeded + // reregister if new sm + if (topology_passcount < 1) return TRUE; + + // reregister if previous attempts haven't yet succeeded + if (portp->portData->reregisterPending) return TRUE; + + // reregister if node/port is new this sweep + Node_t * oldnodep = sm_find_guid(&old_topology, nodep->nodeInfo.NodeGUID); + if (!oldnodep) return TRUE; + Port_t * oldportp = sm_find_node_port(&old_topology, oldnodep, portp->index); + if (!oldportp) return TRUE; + + // reregister if old port was DOWN + // (implying we removed its groups/subscriptions) + return oldportp->state <= IB_PORT_DOWN; } static void diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 973b2a0..4d03080 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,11 +30,11 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.7.0.0 -Release: 141%{?dist} +Release: 142%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD -Url: https://github.com/01org/opa-fm +Url: https://github.com/intel/opa-fm # tarball created by: # git clone https://github.com/01org/opa-fm.git # cd opa-fm
0
41f462a6300c505b8f177185467a8cdb685c54e8
01org/opa-fm
Only set switch down on timeout of single port operation
commit 41f462a6300c505b8f177185467a8cdb685c54e8 Author: Scott Breyer <[email protected]> Date: Fri Nov 16 16:49:55 2018 -0500 Only set switch down on timeout of single port operation diff --git a/Esm/build.env b/Esm/build.env index 5d88cbc..dfc82c0 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_8_0_0_202 +export RELEASE_TAG=10_8_0_0_205 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/smi/sm/sm_qos.c b/Esm/ib/src/smi/sm/sm_qos.c index c13dbe4..b7956ea 100644 --- a/Esm/ib/src/smi/sm/sm_qos.c +++ b/Esm/ib/src/smi/sm/sm_qos.c @@ -1090,6 +1090,7 @@ sm_initialize_Switch_SCVLMaps(Topology_t * topop, Node_t * switchp) STL_SCVLMAP scvlmap; int sentSCVLt = 0; int doAll = switchp->uniformVL; + boolean isMultiPort = FALSE; int interleaveEnabled = 0; uint8_t sc; @@ -1265,6 +1266,7 @@ sm_initialize_Switch_SCVLMaps(Topology_t * topop, Node_t * switchp) // initialize the SC2VL_t map of the switch port STL_SCVLMAP * curScvl = &out_portp->portData->scvltMap; + isMultiPort = (doAll && (out_portp->index > 0)); if (!doAll || !sentSCVLt) { status = topop->routingModule->funcs.select_scvl_map(topop, switchp, out_portp, neighborPortp, &scvlmap); @@ -1284,7 +1286,7 @@ sm_initialize_Switch_SCVLMaps(Topology_t * topop, Node_t * switchp) amod = ((out_portp->state == IB_PORT_INIT) || (out_portp->index == 0)) ? 1 << 24 : (1 << 24) | 1 << 12; // 1 block, synch/asynch respectively amod |= (uint32_t)out_portp->index; - if (doAll && (out_portp->index > 0)) + if (isMultiPort) amod |= (1 << 8); SMP_ADDR_SET_LR(&addr, sm_lid, swportp->portData->lid); @@ -1293,11 +1295,17 @@ sm_initialize_Switch_SCVLMaps(Topology_t * topop, Node_t * switchp) out_portp->portData->current.scvlt = (status == VSTATUS_OK); if (status != VSTATUS_OK) { IB_LOG_WARN_FMT(__func__, - "Failed to set SCVL_t Map for node %s nodeGuid " FMT_U64 - " output port %d", sm_nodeDescString(switchp), - switchp->nodeInfo.NodeGUID, out_portp->index); - status = sm_popo_port_error(&sm_popo, sm_topop, swportp, status); - goto fail; + "Failed to set SCVL_t Map for node %s nodeGuid " FMT_U64 + " output port %d (%s)", sm_nodeDescString(switchp), + switchp->nodeInfo.NodeGUID, out_portp->index, isMultiPort ? "multi-port" : "single-port"); + if(status == VSTATUS_TIMEOUT || isMultiPort) { + status = sm_popo_port_error(&sm_popo, sm_topop, swportp, status); + goto fail; + } + else { + sm_mark_link_down(sm_topop, out_portp); + status = VSTATUS_OK; + } } if (out_portp->index > 0) sentSCVLt = 1; diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 32fe348..7f1c728 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.8.0.0 -Release: 204%{?dist} +Release: 205%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
86d2a898652529234a368706e711aaee438b9456
01org/opa-fm
Prevent Get(Portinfo) timeouts due to large trap traffic volume
commit 86d2a898652529234a368706e711aaee438b9456 Author: Scott Breyer <[email protected]> Date: Fri Dec 14 11:46:28 2018 -0500 Prevent Get(Portinfo) timeouts due to large trap traffic volume diff --git a/Esm/build.env b/Esm/build.env index 6482b18..d160693 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_8_0_0_206 +export RELEASE_TAG=10_8_0_0_207 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/smi/sa/sa_Trap.c b/Esm/ib/src/smi/sa/sa_Trap.c index 5fa4b30..45c1f9f 100755 --- a/Esm/ib/src/smi/sa/sa_Trap.c +++ b/Esm/ib/src/smi/sa/sa_Trap.c @@ -407,6 +407,13 @@ int sa_TrapNeedsLogging(Port_t *portp, uint8_t *trap_count) return 0; } +static +void _copy_CapMaskTrap(Port_t **portp, STL_TRAP_CHANGE_CAPABILITY_DATA *ccTrapRef) { + (*portp)->portData->portInfo.CapabilityMask.AsReg32 = ccTrapRef->CapabilityMask.AsReg32; + (*portp)->portData->portInfo.CapabilityMask3.AsReg16 = ccTrapRef->CapabilityMask3.AsReg16; +} + + /* * Used for forwarding traps that came from the outside. * In this case the caller pass the incoming mai packet @@ -552,88 +559,78 @@ sa_Trap(Mai_t *maip) { sm_discovery_needed("Port State Change Trap", notice.IssuerLID); } else if (notice.Attributes.Generic.TrapNumber == MAD_SMT_CAPABILITYMASK_CHANGE) { STL_TRAP_CHANGE_CAPABILITY_DATA ccTrap; + STL_TRAP_CHANGE_CAPABILITY_DATA ccTrapRef; BSWAPCOPY_STL_TRAP_CHANGE_CAPABILITY_DATA((STL_TRAP_CHANGE_CAPABILITY_DATA*)notice.Data, &ccTrap); sm_get_lid_info(desc, notice.IssuerLID); if (ccTrap.u.AsReg16 == 0) { + + memcpy(&ccTrapRef, &ccTrap, sizeof(STL_TRAP_CHANGE_CAPABILITY_DATA)); + /* Change fields are zero so one of the capability bits must * have changed. Compare the new CapabilityMask/Mask3 to the previous * CapabilityMask/Mask3 for this port to determine the appropriate * action to take*/ - (void)vs_wrlock(&old_topology_lock); + vs_wrlock(&old_topology_lock); portp = sm_find_node_and_port_lid(&old_topology, notice.IssuerLID, &nodep); if (nodep && sm_valid_port(portp)){ - STL_PORT_INFO portInfo; - Status_t status; - //determine which bits in Capability Mask/Mask3 changed ccTrap.CapabilityMask.AsReg32 ^= portp->portData->portInfo.CapabilityMask.AsReg32; ccTrap.CapabilityMask3.AsReg16 ^= portp->portData->portInfo.CapabilityMask3.AsReg16; - if (ccTrap.CapabilityMask.s.IsSM){ //node's SM status changed, will need to trigger a sweep - if (!portp->portData->portInfo.CapabilityMask.s.IsSM){ + if (ccTrapRef.CapabilityMask.s.IsSM){ IB_LOG_INFINI_INFO_FMT(__func__, "Received an (IS_SM on) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - ccTrap.CapabilityMask.AsReg32, desc, tid); - sm_discovery_needed("Port CapabilityMask Change isSM on", STL_LID_RESERVED); + ccTrapRef.CapabilityMask.AsReg32, desc, tid); + if (notice.IssuerLID != sm_lid){ + sm_discovery_needed("Port CapabilityMask Change isSM on", STL_LID_RESERVED); + } }else{ IB_LOG_INFINI_INFO_FMT(__func__, "Received an (IS_SM off) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - ccTrap.CapabilityMask.AsReg32, desc, tid); + ccTrapRef.CapabilityMask.AsReg32, desc, tid); if (notice.IssuerLID != sm_lid){ sm_discovery_needed("Port CapabilityMask Change isSM off", STL_LID_RESERVED); } } } - // Get fresh port info - SmpAddr_t addr = SMP_ADDR_CREATE_LR(sm_lid, portp->portData->lid); - status = SM_Get_PortInfo(fd_async_request, (1 << 24) | portp->index, &addr, &portInfo); - if (status != VSTATUS_OK){ - IB_LOG_WARN_FMT(__func__, - "Cannot get PORTINFO for %s, TID="FMT_U64 - " status=%d", desc, tid, status); - }else{ - portp->portData->portInfo = portInfo; - - /****************LOG BITS THAT CHANGED******************/ - //portp->portData->portInfo contains current information - if(ccTrap.CapabilityMask.s.IsAutomaticMigrationSupported){ - IB_LOG_INFINI_INFO_FMT(__func__, - "Received an (IS_AUTOMATIC_MIGRATION_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - (portp->portData->portInfo.CapabilityMask.s.IsAutomaticMigrationSupported?"on":"off"), - ccTrap.CapabilityMask.AsReg32, desc, tid); - } - if(ccTrap.CapabilityMask.s.IsConnectionManagementSupported){ - IB_LOG_INFINI_INFO_FMT(__func__, - "Received an (IS_CONNECTION_MANAGEMENT_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - (portp->portData->portInfo.CapabilityMask.s.IsConnectionManagementSupported?"on":"off"), - ccTrap.CapabilityMask.AsReg32, desc, tid); - } - if (ccTrap.CapabilityMask.s.IsDeviceManagementSupported){ - IB_LOG_INFINI_INFO_FMT(__func__, - "Received an (IS_DEVICE_MANAGEMENT_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - (portp->portData->portInfo.CapabilityMask.s.IsDeviceManagementSupported?"on":"off"), - ccTrap.CapabilityMask.AsReg32, desc, tid); - } - if(ccTrap.CapabilityMask.s.IsVendorClassSupported){ - IB_LOG_INFINI_INFO_FMT(__func__, - "Received an (IS_VENDOR_CLASS_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - (portp->portData->portInfo.CapabilityMask.s.IsVendorClassSupported?"on":"off"), - ccTrap.CapabilityMask.AsReg32, desc, tid); - } - if(ccTrap.CapabilityMask.s.IsCapabilityMaskNoticeSupported){ - IB_LOG_INFINI_INFO_FMT(__func__, - "Received an (IS_CAPABILITY_MASK_NOTICE_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, - (portp->portData->portInfo.CapabilityMask.s.IsCapabilityMaskNoticeSupported?"on":"off"), - ccTrap.CapabilityMask.AsReg32, desc, tid); - } + if(ccTrap.CapabilityMask.s.IsAutomaticMigrationSupported){ + IB_LOG_INFINI_INFO_FMT(__func__, + "Received an (IS_AUTOMATIC_MIGRATION_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, + (ccTrapRef.CapabilityMask.s.IsAutomaticMigrationSupported?"on":"off"), + ccTrapRef.CapabilityMask.AsReg32, desc, tid); + } + if(ccTrap.CapabilityMask.s.IsConnectionManagementSupported){ + IB_LOG_INFINI_INFO_FMT(__func__, + "Received an (IS_CONNECTION_MANAGEMENT_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, + (ccTrapRef.CapabilityMask.s.IsConnectionManagementSupported?"on":"off"), + ccTrapRef.CapabilityMask.AsReg32, desc, tid); } + if (ccTrap.CapabilityMask.s.IsDeviceManagementSupported){ + IB_LOG_INFINI_INFO_FMT(__func__, + "Received an (IS_DEVICE_MANAGEMENT_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, + (ccTrapRef.CapabilityMask.s.IsDeviceManagementSupported?"on":"off"), + ccTrapRef.CapabilityMask.AsReg32, desc, tid); + } + if(ccTrap.CapabilityMask.s.IsVendorClassSupported){ + IB_LOG_INFINI_INFO_FMT(__func__, + "Received an (IS_VENDOR_CLASS_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, + (ccTrapRef.CapabilityMask.s.IsVendorClassSupported?"on":"off"), + ccTrapRef.CapabilityMask.AsReg32, desc, tid); + } + if(ccTrap.CapabilityMask.s.IsCapabilityMaskNoticeSupported){ + IB_LOG_INFINI_INFO_FMT(__func__, + "Received an (IS_CAPABILITY_MASK_NOTICE_SUPPORTED %s) CAPABILITYMASK CHANGE [0x%.8X] trap from %s, TID="FMT_U64, + (ccTrapRef.CapabilityMask.s.IsCapabilityMaskNoticeSupported?"on":"off"), + ccTrapRef.CapabilityMask.AsReg32, desc, tid); + } + _copy_CapMaskTrap(&portp, &ccTrapRef); } - (void)vs_rwunlock(&old_topology_lock); + vs_rwunlock(&old_topology_lock); } else { /* A local change has occurred. */ IB_LOG_INFINI_INFO_FMT( "sa_Trap", diff --git a/opa-fm.spec.in b/opa-fm.spec.in index ff3fbc3..25ea83e 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.8.0.0 -Release: 206%{?dist} +Release: 207%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
5f2944cf6127863d65ab6b15a598c9a7fc25eaa9
01org/opa-fm
Do not set switch down on write failure for SCVL neighbor table
commit 5f2944cf6127863d65ab6b15a598c9a7fc25eaa9 Author: Scott Breyer <[email protected]> Date: Mon Oct 29 15:25:07 2018 -0400 Do not set switch down on write failure for SCVL neighbor table diff --git a/Esm/ib/src/smi/sm/sm_qos.c b/Esm/ib/src/smi/sm/sm_qos.c index 7be8292..c13dbe4 100644 --- a/Esm/ib/src/smi/sm/sm_qos.c +++ b/Esm/ib/src/smi/sm/sm_qos.c @@ -1341,8 +1341,12 @@ sm_initialize_Switch_SCVLMaps(Topology_t * topop, Node_t * switchp) "Failed to set SCVL_nt Map for node %s nodeGuid " FMT_U64 " output port %d", sm_nodeDescString(neighborNodep), neighborNodep->nodeInfo.NodeGUID, neighborPortp->index); + sm_mark_link_down(sm_topop, neighborPortp); status = sm_popo_port_error(&sm_popo, sm_topop, swportp, status); - goto fail; + if (status == VSTATUS_TIMEOUT_LIMIT) + goto fail; + else + status = VSTATUS_OK; //reset status: switch did not fail, only neighbor } } else { IB_LOG_WARN_FMT(__func__, diff --git a/opa-fm.spec.in b/opa-fm.spec.in index d45e193..32fe348 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.8.0.0 -Release: 203%{?dist} +Release: 204%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
a16f3ceb0a7cfa9c8526dd0b4bcb6c78f69da0c0
01org/opa-fm
Update to latest from build 10.10.3.2,2 (IFS 10.10.3.2.2)
commit a16f3ceb0a7cfa9c8526dd0b4bcb6c78f69da0c0 Author: Scott Breyer <[email protected]> Date: Mon Feb 1 11:09:43 2021 -0500 Update to latest from build 10.10.3.2,2 (IFS 10.10.3.2.2) diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 42f84c8..e549931 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -175,7 +175,7 @@ sub init_delta_info($) @delta_kernel_srpms = ( @delta_kernel_srpms_rhel81 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel8 ); - } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + } elsif ( "$CUR_VENDOR_VER" eq "ES78" || "$CUR_VENDOR_VER" eq "ES79" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel78 ); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel77 ); @@ -815,7 +815,7 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); - } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + } elsif ( "$CUR_VENDOR_VER" eq "ES78" || "$CUR_VENDOR_VER" eq "ES79" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @@ -1139,7 +1139,7 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); - } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + } elsif ( "$CUR_VENDOR_VER" eq "ES78" || "$CUR_VENDOR_VER" eq "ES79" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 421ab11..1b4688d 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -1280,7 +1280,7 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); - } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + } elsif ( "$CUR_VENDOR_VER" eq "ES78" || "$CUR_VENDOR_VER" eq "ES79" ) { @Components = ( @Components_rhel78 ); @SubComponents = ( @SubComponents_newer ); %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index dc9ac64..7882823 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -138,7 +138,7 @@ sub overrides() @Components = ( @delta_Components_rhel76 ); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @Components = ( @delta_Components_rhel77 ); - } elsif ( "$CUR_VENDOR_VER" eq "ES78" ) { + } elsif ( "$CUR_VENDOR_VER" eq "ES78" || "$CUR_VENDOR_VER" eq "ES79" ) { @Components = ( @delta_Components_rhel78 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @Components = ( @delta_Components_rhel8 ); diff --git a/CommonInstall/util_init.pl b/CommonInstall/util_init.pl index fb2979d..7cbd342 100755 --- a/CommonInstall/util_init.pl +++ b/CommonInstall/util_init.pl @@ -381,6 +381,11 @@ sub verify_distrib_files Abort "Please contact your support representative...\n"; } + # Make ES79 look like ES78 for installation + if ( "$CUR_VENDOR_VER" eq "ES79" ) { + $CUR_VENDOR_VER="ES78"; + } + my $archname; my $supported_archname; if ( "$supported_arch" ne "$ARCH" diff --git a/Esm/build.env b/Esm/build.env index 6bd9458..e515431 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_10_3_0_11 +export RELEASE_TAG=10_10_3_2_2 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index e4d1492..91793c2 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 06/30/20 23:58 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_3_0_11 +Build of VIEO_HOST 11/20/20 00:46 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_3_2_2 diff --git a/Esm/ib/src/smi/sm/sm_routing.c b/Esm/ib/src/smi/sm/sm_routing.c index dc5e166..72635f4 100644 --- a/Esm/ib/src/smi/sm/sm_routing.c +++ b/Esm/ib/src/smi/sm/sm_routing.c @@ -493,14 +493,14 @@ sm_Node_prune_portgroups(Node_t * switchp) } Port_t * port = &switchp->port[portIdx]; - if (!sm_valid_port(port) || port->state < IB_PORT_INIT) continue; - - if (linkrate_ge(port->portData->rate, maxRate)) { - if (linkrate_gt(port->portData->rate,maxRate)) { - newPm = 0; - maxRate = port->portData->rate; + if (sm_valid_port(port) && port->state >= IB_PORT_INIT) { + if (linkrate_ge(port->portData->rate, maxRate)) { + if (linkrate_gt(port->portData->rate,maxRate)) { + newPm = 0; + maxRate = port->portData->rate; + } + newPm |= ((STL_PORTMASK)1) << (port->index - 1) % STL_PORT_MASK_WIDTH; } - newPm |= ((STL_PORTMASK)1) << (port->index - 1) % STL_PORT_MASK_WIDTH; } portIdx++;
0
d12979a8ed6e508a9c33972561a80c3af9cb6ae8
01org/opa-fm
Revert "Add script for building (S)RPMs" This reverts commit 3117bba5cf249fd9e721d7273b645fa7f49ca076.
commit d12979a8ed6e508a9c33972561a80c3af9cb6ae8 Author: Brendan Cunningham <[email protected]> Date: Thu Sep 24 15:34:41 2015 -0400 Revert "Add script for building (S)RPMs" This reverts commit 3117bba5cf249fd9e721d7273b645fa7f49ca076. diff --git a/build_rpms.bash b/build_rpms.bash deleted file mode 100755 index 1bfc2bf..0000000 --- a/build_rpms.bash +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -mkdir -p $HOME/rpmbuild/{SOURCES,RPMS,SRPMS} -tar czf $HOME/rpmbuild/SOURCES/opa-fm.tar.gz --exclude-vcs . -rpmbuild -ba ./opafm.spec
0
e25b9f1506fa329c731ba00fe9d27002de935520
01org/opa-fm
Updated to latest from build 10.0.1.0.2 (FM 10.0.1.0.2)
commit e25b9f1506fa329c731ba00fe9d27002de935520 Author: Scott Breyer <[email protected]> Date: Fri Feb 26 10:42:20 2016 -0500 Updated to latest from build 10.0.1.0.2 (FM 10.0.1.0.2) diff --git a/CommonInstall/util_init.pl b/CommonInstall/util_init.pl index 9ae9c98..145e050 100755 --- a/CommonInstall/util_init.pl +++ b/CommonInstall/util_init.pl @@ -205,7 +205,7 @@ sub os_vendor_version($) my $rval = ""; my $mn = ""; - if ( -e "/etc/os-release" ) { + if ( -e "/etc/os-release" && -e "/etc/redhat-release" ) { $rval=`cat /etc/os-release | grep VERSION_ID | cut -d'=' -f2 | tr -d [\\"\\.0]`; chop($rval); $rval="ES".$rval; diff --git a/Esm/build.env b/Esm/build.env index 1e89736..12d3725 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=ALL_EMB -export RELEASE_TAG=10_0_0_0_696 +export RELEASE_TAG=10_0_1_0_2 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/pm/pm/paAccess.c b/Esm/ib/src/pm/pm/paAccess.c index 9e375d1..26b558f 100644 --- a/Esm/ib/src/pm/pm/paAccess.c +++ b/Esm/ib/src/pm/pm/paAccess.c @@ -4146,14 +4146,15 @@ FSTATUS putPMSweepImageDataR(uint8_t *p_img_in, uint32_t len_img_in) { PmShortTermHistory_t *sth = &pm->ShortTermHistory; PmImage_t *pmimagep; #ifndef __VXWORKS__ - PmCompositeImage_t *cimg_in = (PmCompositeImage_t *)p_img_in; Status_t status; #endif + PmCompositeImage_t *cimg_in = (PmCompositeImage_t *)p_img_in; PmCompositeImage_t *cimg_out = NULL; unsigned char *p_decompress = NULL; unsigned char *bf_decompress = NULL; static time_t firstImageSweepStart; static uint32 processedSweepNum=0; + uint32 history_version; double isTdelta; boolean skipCompounding = FALSE; uint8 tempInstanceId; @@ -4165,7 +4166,15 @@ FSTATUS putPMSweepImageDataR(uint8_t *p_img_in, uint32_t len_img_in) { return -1; } - BSWAP_PM_FILE_HEADER(&((PmCompositeImage_t *)p_img_in)->header); + // check the version + history_version = cimg_in->header.common.historyVersion; + BSWAP_PM_HISTORY_VERSION(&history_version); + if (history_version != PM_HISTORY_VERSION) { + IB_LOG_INFO0("Received image buffer version does not match current version"); + return FINVALID_PARAMETER; + } + + BSWAP_PM_FILE_HEADER(&cimg_in->header); #ifndef __VXWORKS__ // Decompress image if compressed if (cimg_in->header.common.isCompressed) { diff --git a/Esm/ib/src/pm/pm/pm_sweep.c b/Esm/ib/src/pm/pm/pm_sweep.c index 7189bc4..f1f2381 100644 --- a/Esm/ib/src/pm/pm/pm_sweep.c +++ b/Esm/ib/src/pm/pm/pm_sweep.c @@ -2494,11 +2494,11 @@ PmCompositeImage_t *PmCreateComposite(Pm_t *pm, uint32 imageIndex, uint8 isCompr return NULL; // intialize some of the header fields + cimg->header.common.historyVersion = PM_HISTORY_VERSION; cimg->header.common.isCompressed = isCompressed; cimg->header.common.imagesPerComposite = 1; cimg->header.common.imageSweepInterval = pm_config.sweep_interval; cimg->header.common.imageIDs[0] = buildShortTermHistoryImageId(pm, imageIndex); - cimg->header.historyVersion = PM_HISTORY_VERSION; // initialize the composite vales from the image cimg->sweepStart = (uint64)img->sweepStart; @@ -3288,6 +3288,19 @@ FSTATUS PmLoadComposite(Pm_t *pm, PmHistoryRecord_t *record, PmCompositeImage_t return FERROR; } + // check the version + if (((PmFileHeader_t *)raw_data)->common.historyVersion != PM_HISTORY_VERSION) { +#ifdef __VXWORKS__ + IB_LOG_ERROR0("Loaded PM history image that does not match current version"); +#else + IB_LOG_ERROR_FMT("Loaded PM history image that does not match current version: %s", + record->header.filename); +#endif + free(raw_data); + fclose(fp); + return FERROR; + } + // allocate the img_data buffer img_len = (size_t)((PmFileHeader_t*)raw_data)->flatSize; // checkout the flat size - it needs to be at least enough to hold the image header @@ -3338,16 +3351,6 @@ FSTATUS PmLoadComposite(Pm_t *pm, PmHistoryRecord_t *record, PmCompositeImage_t free(raw_data); } - // check the version - if (((PmFileHeader_t*)img_data)->historyVersion != PM_HISTORY_VERSION) { -#ifdef __VXWORKS__ - IB_LOG_ERROR0("Loaded PM history image that does not match current version"); -#else - IB_LOG_ERROR_FMT("Loaded PM history image that does not match current version: %s", - record->header.filename); -#endif - } - *cimg = calloc(1 , sizeof(PmCompositeImage_t)); if (!(*cimg)) { IB_LOG_ERROR0("Unable to allocate memory for the cached PM Composite Image"); @@ -3938,14 +3941,26 @@ static Status_t PmLoadHistory(Pm_t *pm, boolean master) { ret = VSTATUS_EIO; } else { const size_t readSize = sizeof(PmHistoryHeaderCommon_t); + uint8 bf_header[sizeof(PmHistoryHeaderCommon_t)]; PmHistoryRecord_t *rec = pm->ShortTermHistory.historyRecords[i]; - // read the header of the file into the record entry - if (fread(pm->ShortTermHistory.historyRecords[i], 1, readSize, fp) != readSize) { + // read the header of the file and check the version + if (fread(bf_header, 1, readSize, fp) != readSize) { IB_LOG_WARN0("Encountered a problem while loading a Short-Term History file"); fclose(fp); continue; } + if (((PmHistoryHeaderCommon_t *)bf_header)->historyVersion != PM_HISTORY_VERSION) { + IB_LOG_WARN_FMT(__func__, "Encountered a Short-Term History file that does not match current version (%u): %s is v%u", + PM_HISTORY_VERSION, filename, ((PmHistoryHeaderCommon_t *)bf_header)->historyVersion); + fclose(fp); + continue; + } + // Move header into the record entry + memcpy(pm->ShortTermHistory.historyRecords[i], bf_header, readSize); + + // if this was a failover the record may have the wrong filepath, so overwrite it + strncpy(pm->ShortTermHistory.historyRecords[i]->header.filename, filename, PM_HISTORY_FILENAME_LEN); fclose(fp); // Enforce max disk usage diff --git a/Esm/ib/src/pm/pm/pm_topology.h b/Esm/ib/src/pm/pm/pm_topology.h index 8347285..386f560 100644 --- a/Esm/ib/src/pm/pm/pm_topology.h +++ b/Esm/ib/src/pm/pm/pm_topology.h @@ -755,7 +755,7 @@ typedef struct PmImage_s { #define PM_HISTORY_MAX_IMAGES_PER_COMPOSITE 60 #define PM_HISTORY_MAX_SMS_PER_COMPOSITE 2 #define PM_HISTORY_MAX_LOCATION_LEN 111 -#define PM_HISTORY_VERSION 4 +#define PM_HISTORY_VERSION 5 #define PM_MAX_COMPRESSION_DIVISIONS 32 typedef struct PmCompositePort_s { @@ -891,10 +891,12 @@ typedef struct PmCompositeGroups_s { } PmCompositeGroup_t; typedef struct PmHistoryHeaderCommon_s { + uint32 historyVersion; // Must remain fixed for all versions + uint32 reserved; char filename[PM_HISTORY_FILENAME_LEN]; uint64 timestamp; uint8 isCompressed; - uint8 reserved; + uint8 reserved2; uint16 imagesPerComposite; uint32 imageSweepInterval; uint64 imageIDs[PM_HISTORY_MAX_IMAGES_PER_COMPOSITE]; @@ -903,9 +905,8 @@ typedef struct PmHistoryHeaderCommon_s { typedef struct PmFileHeader_s { PmHistoryHeaderCommon_t common; uint64 flatSize; - uint16 historyVersion; uint8 numDivisions; - uint8 reserved[5]; + uint8 reserved[7]; uint64 divisionSizes[PM_MAX_COMPRESSION_DIVISIONS]; } PmFileHeader_t; @@ -1306,6 +1307,15 @@ BSWAP_PM_COMPOSITE_SM_INFO(struct PmCompositeSmInfo *Dest, uint32 numSMs) #endif } // End of BSWAP_PM_COMPOSITE_SM_INFO +static __inline +void +BSWAP_PM_HISTORY_VERSION(uint32 *Dest) +{ +#if CPU_LE + *Dest = ntoh32(*Dest); +#endif +} // End of BSWAP_PM_HISTORY_VERSION + static __inline void BSWAP_PM_HISTORY_HEADER_COMMON(PmHistoryHeaderCommon_t *Dest) @@ -1313,6 +1323,7 @@ BSWAP_PM_HISTORY_HEADER_COMMON(PmHistoryHeaderCommon_t *Dest) #if CPU_LE uint32 i; + BSWAP_PM_HISTORY_VERSION(&Dest->historyVersion); Dest->timestamp = ntoh64(Dest->timestamp); Dest->imagesPerComposite = ntoh16(Dest->imagesPerComposite); Dest->imageSweepInterval = ntoh32(Dest->imageSweepInterval); @@ -1330,7 +1341,6 @@ BSWAP_PM_FILE_HEADER(PmFileHeader_t *Dest) BSWAP_PM_HISTORY_HEADER_COMMON(&Dest->common); Dest->flatSize = ntoh64(Dest->flatSize); - Dest->historyVersion = ntoh16(Dest->historyVersion); for (i = 0; i < PM_MAX_COMPRESSION_DIVISIONS; i++) Dest->divisionSizes[i] = ntoh64(Dest->divisionSizes[i]); #endif @@ -1369,7 +1379,6 @@ BSWAP_PM_COMPOSITE_IMAGE_FLAT(PmCompositeImage_t *Dest, boolean hton) Dest->numGroups = ntoh32(Dest->numGroups); Dest->numVFs = ntoh32(Dest->numVFs); Dest->numVFsActive = ntoh32(Dest->numVFsActive); - Dest->maxLid = ntoh32(Dest->maxLid); Dest->numPorts = ntoh32(Dest->numPorts); BSWAP_PM_COMPOSITE_SM_INFO(Dest->SMs, PM_HISTORY_MAX_SMS_PER_COMPOSITE); BSWAP_PM_COMPOSITE_GROUP(&Dest->allPortsGroup, 1); diff --git a/Esm/opafm.spec b/Esm/opafm.spec index b2dd440..af47596 100644 --- a/Esm/opafm.spec +++ b/Esm/opafm.spec @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.0.0.0 -Release: 696 +Version: 10.0.1.0 +Release: 2 Summary: Intel Omni-Path Fabric Management Software Group: System Environment/Daemons diff --git a/IbAccess/Common/Inc/ib_helper.h b/IbAccess/Common/Inc/ib_helper.h index f103b77..ed037c3 100644 --- a/IbAccess/Common/Inc/ib_helper.h +++ b/IbAccess/Common/Inc/ib_helper.h @@ -148,9 +148,9 @@ IbPortDownDefaultToText( IN IB_PORT_PHYS_STATE state ) * Convert IB_MTU enumeration to a byte count */ static __inline uint16 -GetBytesFromMtu(IB_MTU mtu) +GetBytesFromMtu(uint8 mtu) { - switch ((int)mtu) + switch (mtu) { default: #if !defined (VXWORKS) @@ -167,18 +167,16 @@ GetBytesFromMtu(IB_MTU mtu) return 2048; case IB_MTU_4096: return 4096; -#if !defined (VXWORKS) case STL_MTU_8192: return 8192; case STL_MTU_10240: return 10240; -#endif } } /* Convert byte count to nearest IB_MTU enumeration (rounds up) * (eg. returns IB MTU required to support packet sizes of "bytes") */ -static __inline IB_MTU +static __inline uint8 GetMtuFromBytes(uint16 bytes) { #if !defined (VXWORKS) @@ -196,12 +194,10 @@ GetMtuFromBytes(uint16 bytes) return IB_MTU_2048; else if (bytes <= 4096) return IB_MTU_4096; -#if !defined (VXWORKS) else if (bytes <= 8192) return STL_MTU_8192; else if (bytes <= 10240) return STL_MTU_10240; -#endif else return IB_MTU_4096; } diff --git a/MakeTools/Test/Err.msg b/MakeTools/Test/Err.msg index ba0e055..ce05178 100755 --- a/MakeTools/Test/Err.msg +++ b/MakeTools/Test/Err.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Err.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Log.msg b/MakeTools/Test/Log.msg index 5371bbf..b0e5866 100755 --- a/MakeTools/Test/Log.msg +++ b/MakeTools/Test/Log.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Log.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Osa.msg b/MakeTools/Test/Osa.msg index bd27230..ae06fb4 100755 --- a/MakeTools/Test/Osa.msg +++ b/MakeTools/Test/Osa.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Osa.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/Test.msg b/MakeTools/Test/Test.msg index 703c052..7350603 100755 --- a/MakeTools/Test/Test.msg +++ b/MakeTools/Test/Test.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/Test.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ # $Revision: 1.4 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/Test/UiUtil.msg b/MakeTools/Test/UiUtil.msg index 34dc459..52a2d0a 100755 --- a/MakeTools/Test/UiUtil.msg +++ b/MakeTools/Test/UiUtil.msg @@ -31,7 +31,7 @@ # # $Source: /cvs/ics/MakeTools/Test/UiUtil.msg,v $ # $Author: mwheinz $ -# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ +# $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ # $Revision: 1.3 $ # $Date: 2015/01/28 20:18:11 $ # diff --git a/MakeTools/patch_version/patch_version.c b/MakeTools/patch_version/patch_version.c index 2754c1c..20cfc86 100755 --- a/MakeTools/patch_version/patch_version.c +++ b/MakeTools/patch_version/patch_version.c @@ -1,7 +1,7 @@ /*! @file $Source: /cvs/ics/MakeTools/patch_version/patch_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ $Revision: 1.14 $ $Date: 2015/01/22 18:03:59 $ @brief Utility to manage version and branding strings in executable code diff --git a/MakeTools/rm_version/rm_version.c b/MakeTools/rm_version/rm_version.c index 5697aa6..d88a5d0 100755 --- a/MakeTools/rm_version/rm_version.c +++ b/MakeTools/rm_version/rm_version.c @@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/MakeTools/rm_version/rm_version.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ $Revision: 1.5 $ $Date: 2015/01/22 18:04:00 $ @brief Program to remove version strings appended at end of file by prep diff --git a/Md5/Md5.c b/Md5/Md5.c index 110f2c7..144ccf8 100644 --- a/Md5/Md5.c +++ b/Md5/Md5.c @@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.c,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ $Revision: 1.3 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API diff --git a/Md5/Md5.h b/Md5/Md5.h index 9566479..1a87293 100644 --- a/Md5/Md5.h +++ b/Md5/Md5.h @@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @file $Source: /cvs/ics/Md5/Md5.h,v $ $Author: mwheinz $ - $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_0_0_696 $ + $Name: ALL_EMB_ATOM_ALL_10_0-BRANCH_10_0_1_0_2 $ $Revision: 1.4 $ $Date: 2015/01/22 18:08:49 $ @brief Md5 API
0
317bb9f137735388b121b5fd6e7be28dde48b0a3
01org/opa-fm
Update to latest from build 10.10.1.0.35 (IFS 10.10.1.0.36)
commit 317bb9f137735388b121b5fd6e7be28dde48b0a3 Author: Scott Breyer <[email protected]> Date: Thu Jan 9 15:02:49 2020 -0500 Update to latest from build 10.10.1.0.35 (IFS 10.10.1.0.36) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index c4c9ddd..31fb1a3 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -97,10 +97,11 @@ CLEAN_TARGETS_MISC = CLEAN_TARGETS = $(OBJECTS) $(RSCOBJECTS) $(IDL_TARGETS) $(CLEAN_TARGETS_MISC) # other files to remove during clobber phase CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl \ - comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl \ + comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl \ comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl \ comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl \ - comp_fm_prereq_RHEL8.pl comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl + comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl comp_fm_prereq_SLES15.pl \ + comp_fm_prereq_SLES151.pl # sub-directory to install to within bin BIN_SUBDIR = # sub-directory to install to within include @@ -127,11 +128,11 @@ INCLUDE_SUBDIR = LOCALDEPLIBS = FF_FILES = comp_ff_of_prereq_RHEL72.pl comp_ff_of_prereq_RHEL73.pl comp_ff_of_prereq_RHEL74.pl \ - comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl \ + comp_ff_of_prereq_RHEL75.pl comp_ff_of_prereq_RHEL76.pl comp_ff_of_prereq_RHEL77.pl comp_ff_of_prereq_RHEL8.pl comp_ff_of_prereq_RHEL81.pl \ comp_ff_of_prereq_SLES122.pl comp_ff_of_prereq_SLES123.pl comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl comp_ff_of_prereq_SLES151.pl FM_FILES = comp_fm_prereq_RHEL72.pl comp_fm_prereq_RHEL73.pl comp_fm_prereq_RHEL74.pl \ - comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL8.pl \ + comp_fm_prereq_RHEL75.pl comp_fm_prereq_RHEL76.pl comp_fm_prereq_RHEL77.pl comp_fm_prereq_RHEL8.pl comp_fm_prereq_RHEL81.pl \ comp_fm_prereq_SLES122.pl comp_fm_prereq_SLES123.pl comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl comp_fm_prereq_SLES151.pl diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 46ef566..5e280e8 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -73,6 +73,7 @@ my @delta_kernel_srpms_rhel74_hfi2 = ( 'hfi2' ); my @delta_kernel_srpms_sles12_sp2 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles12_sp3 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles12_sp4 = ( 'ifs-kernel-updates-kmp-default' ); +my @delta_kernel_srpms_sles12_sp5 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15_sp1 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_rhel73 = ( 'kmod-ifs-kernel-updates' ); @@ -81,6 +82,7 @@ my @delta_kernel_srpms_rhel75 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel76 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel77 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel8 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel81 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # This provides information for all kernel srpms @@ -146,6 +148,9 @@ sub init_delta_info($) } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' && "$CUR_VENDOR_VER" eq 'ES124') { @delta_kernel_srpms = ( @delta_kernel_srpms_sles12_sp4 ); + } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' + && "$CUR_VENDOR_VER" eq 'ES125') { + @delta_kernel_srpms = ( @delta_kernel_srpms_sles12_sp5 ); } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' && "$CUR_VENDOR_VER" eq 'ES15') { @delta_kernel_srpms = ( @delta_kernel_srpms_sles15 ); @@ -158,6 +163,8 @@ sub init_delta_info($) } else { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74); } + } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel81 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel8 ); } elsif ( "$CUR_VENDOR_VER" eq "ES77" ) { @@ -789,6 +796,9 @@ sub installed_delta_opa_stack() return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } + } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -810,6 +820,9 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq 'ES124' ) { return ( has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq 'ES125' ) { + return ( has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq 'ES15' ) { return ( has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); @@ -1110,12 +1123,18 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES123" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES124" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES125" ) { + return (has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); diff --git a/CommonInstall/comp_delta_prereq_RHEL81.pl b/CommonInstall/comp_delta_prereq_RHEL81.pl new file mode 100644 index 0000000..804443d --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL81.pl @@ -0,0 +1,137 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python2", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_delta_prereq_SLES125.pl b/CommonInstall/comp_delta_prereq_SLES125.pl new file mode 100644 index 0000000..2577582 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_SLES125.pl @@ -0,0 +1,139 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kmod", + "rdma-core", + "rdma-ndd", + "systemd", + "coreutils", + "grep", + "libopensm8", + "libibmad5", + "libibumad3", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @intel_hfi_prereq = ( + "glibc", + "libgcc_s1", + "bash", + "udev", + "libudev-devel", + "python-base", + "libedit0", + "libncurses5", + "libnuma1", + "irqbalance", + "libatomic1", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "glibc", + "bash", + "libpsm_infinipath1", + "pkg-config", + "libgcc_s1", + "libgfortran3", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "libopensm8", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs1", + "librdmacm1", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "glibc", + "bash", + "libz1", + "pkg-config", + "libgcc_s1", + "libgfortran3", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "libopensm8", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; diff --git a/CommonInstall/comp_fastfabric.pl b/CommonInstall/comp_fastfabric.pl index 562c676..1838e53 100755 --- a/CommonInstall/comp_fastfabric.pl +++ b/CommonInstall/comp_fastfabric.pl @@ -40,6 +40,13 @@ use strict; my $FF_CONF_FILE = "/usr/lib/opa/tools/opafastfabric.conf"; my $FF_TLS_CONF_FILE = "/etc/opa/opaff.xml"; + +sub get_rpms_dir_fastfabric +{ + my $srcdir=$ComponentInfo{'fastfabric'}{'SrcDir'}; + return "$srcdir/RPMS/*"; +} + sub available_fastfabric { my $srcdir=$ComponentInfo{'fastfabric'}{'SrcDir'}; @@ -104,7 +111,6 @@ 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 $depricated_dir = "/etc/sysconfig/opa"; my $version=media_version_fastfabric(); @@ -112,8 +118,7 @@ sub install_fastfabric 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"; - my $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-fastfabric", "any"); - rpm_run_install($rpmfile, "any", " -U "); + install_comp_rpms('fastfabric', " -U ", $install_list); # TBD - spec file should do this check_dir("/usr/share/opa/samples"); @@ -135,9 +140,6 @@ sub install_fastfabric # TBD - spec file should remove this system("rm -rf $OPA_CONFIG_DIR/iba_stat.conf"); # old config - $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-mpi-apps", "any"); - rpm_run_install($rpmfile, "any", " -U "); - $ComponentWasInstalled{'fastfabric'}=1; } @@ -152,8 +154,7 @@ 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-mpi-apps", "opa-fastfabric") ); + uninstall_comp_rpms('fastfabric', '', $install_list, $uninstalling_list, 'verbose'); NormalPrint("Uninstalling $ComponentInfo{'fastfabric'}{'Name'}...\n"); remove_conf_file("$ComponentInfo{'fastfabric'}{'Name'}", "$FF_CONF_FILE"); @@ -177,6 +178,12 @@ sub uninstall_fastfabric ## ## OPAMGT SDK +sub get_rpms_dir_opamgt_sdk +{ + my $srcdir=$ComponentInfo{'opamgt_sdk'}{'SrcDir'}; + return "$srcdir/RPMS/*"; +} + sub available_opamgt_sdk { my $srcdir = $ComponentInfo{'opamgt_sdk'}{'SrcDir'}; @@ -229,14 +236,12 @@ sub install_opamgt_sdk my $install_list = $_[0]; # total that will be installed when done my $installing_list = $_[1]; # what items are being installed/reinstalled - my $srcdir = $ComponentInfo{'opamgt_sdk'}{'SrcDir'}; my $version=media_version_opamgt_sdk(); chomp $version; printf("Installing $ComponentInfo{'opamgt_sdk'}{'Name'} $version $DBG_FREE...\n"); LogPrint "Installing $ComponentInfo{'opamgt_sdk'}{'Name'} $version $DBG_FREE for $CUR_DISTRO_VENDOR $CUR_VENDOR_VER\n"; - rpm_install("$srcdir/RPMS/*/opa-libopamgt", "any"); - rpm_install("$srcdir/RPMS/*/opa-libopamgt-devel", "any"); + install_comp_rpms('opamgt_sdk', "", $install_list); $ComponentWasInstalled{'opamgt_sdk'}=1; } @@ -248,6 +253,9 @@ sub postinstall_opamgt_sdk sub uninstall_opamgt_sdk { - rpm_uninstall_all_list("any", "verbose", ("opa-libopamgt-devel", "opa-libopamgt") ); + my $install_list = $_[0]; # total that will be left installed when done + my $uninstalling_list = $_[1]; # what items are being uninstalled + + uninstall_comp_rpms('opamgt_sdk', '', $install_list, $uninstalling_list, 'verbose'); $ComponentWasInstalled{'opamgt_sdk'}=0; } diff --git a/CommonInstall/comp_ff_of_prereq_RHEL81.pl b/CommonInstall/comp_ff_of_prereq_RHEL81.pl new file mode 100644 index 0000000..ee2fa78 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL81.pl @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL81.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL81.pl.base new file mode 100644 index 0000000..ee2fa78 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL81.pl.base @@ -0,0 +1,87 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES125.pl b/CommonInstall/comp_ff_of_prereq_SLES125.pl new file mode 100644 index 0000000..0291334 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES125.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses5", + "libopenssl1_0_0", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_0_0", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES125.pl.base b/CommonInstall/comp_ff_of_prereq_SLES125.pl.base new file mode 100644 index 0000000..0291334 --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES125.pl.base @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses5", + "libopenssl1_0_0", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_0_0", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL81.pl b/CommonInstall/comp_fm_prereq_RHEL81.pl new file mode 100644 index 0000000..c16ef21 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL81.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL81.pl.base b/CommonInstall/comp_fm_prereq_RHEL81.pl.base new file mode 100644 index 0000000..c16ef21 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL81.pl.base @@ -0,0 +1,52 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES125.pl b/CommonInstall/comp_fm_prereq_SLES125.pl new file mode 100644 index 0000000..aa0845d --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES125.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_0_0", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES125.pl.base b/CommonInstall/comp_fm_prereq_SLES125.pl.base new file mode 100644 index 0000000..aa0845d --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES125.pl.base @@ -0,0 +1,54 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2018, 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_0_0", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_oftools.pl b/CommonInstall/comp_oftools.pl index f23cf89..5cb5f59 100755 --- a/CommonInstall/comp_oftools.pl +++ b/CommonInstall/comp_oftools.pl @@ -38,6 +38,12 @@ use strict; # ========================================================================== # Fast Fabric Support tools for OFA (oftools) installation +sub get_rpms_dir_oftools +{ + my $srcdir=$ComponentInfo{'oftools'}{'SrcDir'}; + return "$srcdir/RPMS/*"; +} + sub available_oftools { # TBD - could we move the algorithms for many of these functions into @@ -100,8 +106,6 @@ sub install_oftools my $install_list = $_[0]; # total that will be installed when done my $installing_list = $_[1]; # what items are being installed/reinstalled - my $srcdir=$ComponentInfo{'oftools'}{'SrcDir'}; - my $version=media_version_oftools(); chomp $version; printf("Installing $ComponentInfo{'oftools'}{'Name'} $version $DBG_FREE...\n"); @@ -109,13 +113,10 @@ sub install_oftools #LogPrint "Installing $ComponentInfo{'oftools'}{'Name'} $version $DBG_FREE for $CUR_OS_VER\n"; LogPrint "Installing $ComponentInfo{'oftools'}{'Name'} $version $DBG_FREE for $CUR_DISTRO_VENDOR $CUR_VENDOR_VER\n"; - # RHEL7.4 and older in-distro IFS defines opa-address-resolution depends on opa-basic-tools with exact version match - # that will fail our installation because of dependency check. We need to use '-nodeps' to force the installation - my $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-basic-tools", "any"); - rpm_run_install($rpmfile, "any", " -U --nodeps "); + # RHEL7.4 and older in-distro IFS defines opa-address-resolution depends on opa-basic-tools with exact version match + # that will fail our installation because of dependency check. We need to use '-nodeps' to force the installation + install_comp_rpms('oftools', " -U --nodeps ", $install_list); - $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-address-resolution", "any"); - rpm_run_install($rpmfile, "any", " -U --nodeps "); # TBD - could we figure out the list of config files from a query of rpm # and then simply iterate on each config file? check_rpm_config_file("/etc/rdma/dsap.conf"); @@ -136,7 +137,7 @@ sub uninstall_oftools NormalPrint("Uninstalling $ComponentInfo{'oftools'}{'Name'}...\n"); - rpm_uninstall_list("any", "verbose", ("opa-basic-tools", "opa-address-resolution") ); + uninstall_comp_rpms('oftools', '', $install_list, $uninstalling_list, 'verbose'); # remove LSF and Moab related files system("rm -rf /usr/lib/opa/LSF_scripts"); diff --git a/CommonInstall/comp_omnipath.pl b/CommonInstall/comp_omnipath.pl index a36a0c2..3f137c3 100644 --- a/CommonInstall/comp_omnipath.pl +++ b/CommonInstall/comp_omnipath.pl @@ -57,8 +57,7 @@ sub install_generic_mpi printf ("Installing $ComponentInfo{$mpifullname}{'Name'} $version...\n"); LogPrint ("Installing $ComponentInfo{$mpifullname}{'Name'} $version for $CUR_OS_VER\n"); # make sure any old potentially custom built versions of mpi are uninstalled - my @list = ( "$mpifullname", "mpitests_$mpifullname" ); - rpm_uninstall_list2("any", "--nodeps", 'silent', @list); + uninstall_comp_rpms($mpifullname, ' --nodeps ', $install_list, $installing_list, 'silent'); # cleanup from older installs just in case system ("rm -rf /usr/lib/opa/.comp_$mpifullname.pl"); @@ -79,7 +78,7 @@ sub install_generic_mpi # enable this code if mpitests is missing for some compilers or MPIs #my $mpitests_rpmfile = rpm_resolve("$srcdir/OtherMPIs/mpitests_$mpifullname", "any"); #if ( "$mpitests_rpmfile" ne "" && -e "$mpitests_rpmfile" ) { - rpm_install_list_with_options ("$srcdir", "user", " -U --nodeps ", @list); + install_comp_rpms($mpifullname, " -U --nodeps ", $install_list); #} else { # rpm_install("$srcdir/OtherMPIs/$mpifullname", "user"); #} @@ -129,8 +128,7 @@ sub uninstall_generic_mpi } # uninstall tests in case built by do_build - $rc = rpm_uninstall ("mpitests_$mpifullname", "user", "", "verbose"); - $rc = rpm_uninstall ($mpifullname, "user", "", "verbose"); + uninstall_comp_rpms($mpifullname, '', $install_list, $installing_list, 'verbose'); # unfortunately mpi and mpitests can leave empty directories on uninstall # this can confuse IFS MPI tools because correct MPI to use @@ -159,6 +157,11 @@ sub uninstall_generic_mpi # 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) +sub get_rpms_dir_openmpi_gcc +{ + return $ComponentInfo{'openmpi_gcc'}{'SrcDir'}; +} + sub available_openmpi_gcc { my $srcdir = $ComponentInfo{'openmpi_gcc'}{'SrcDir'}; @@ -267,6 +270,12 @@ sub uninstall_openmpi_gcc # 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) + +sub get_rpms_dir_mvapich2_gcc +{ + return $ComponentInfo{'mvapich2_gcc'}{'SrcDir'}; +} + sub available_mvapich2_gcc { my $srcdir = $ComponentInfo{'mvapich2_gcc'}{'SrcDir'}; @@ -375,6 +384,12 @@ sub uninstall_mvapich2_gcc # 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) + +sub get_rpms_dir_openmpi_gcc_hfi +{ + return $ComponentInfo{'openmpi_gcc_hfi'}{'SrcDir'}; +} + sub available_openmpi_gcc_hfi { my $srcdir = $ComponentInfo{'openmpi_gcc_hfi'}{'SrcDir'}; @@ -483,6 +498,12 @@ sub uninstall_openmpi_gcc_hfi # 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) + +sub get_rpms_dir_openmpi_intel_hfi +{ + return $ComponentInfo{'openmpi_intel_hfi'}{'SrcDir'}; +} + sub available_openmpi_intel_hfi { my $srcdir = $ComponentInfo{'openmpi_intel_hfi'}{'SrcDir'}; @@ -591,6 +612,12 @@ sub uninstall_openmpi_intel_hfi # 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) + +sub get_rpms_dir_openmpi_pgi_hfi +{ + return $ComponentInfo{'openmpi_pgi_hfi'}{'SrcDir'}; +} + sub available_openmpi_pgi_hfi { my $srcdir = $ComponentInfo{'openmpi_pgi_hfi'}{'SrcDir'}; @@ -699,6 +726,12 @@ sub uninstall_openmpi_pgi_hfi # 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) + +sub get_rpms_dir_mvapich2_gcc_hfi +{ + return $ComponentInfo{'mvapich2_gcc_hfi'}{'SrcDir'}; +} + sub available_mvapich2_gcc_hfi { my $srcdir = $ComponentInfo{'mvapich2_gcc_hfi'}{'SrcDir'}; @@ -807,6 +840,12 @@ sub uninstall_mvapich2_gcc_hfi # 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) + +sub get_rpms_dir_mvapich2_intel_hfi +{ + return $ComponentInfo{'mvapich2_intel_hfi'}{'SrcDir'}; +} + sub available_mvapich2_intel_hfi { my $srcdir = $ComponentInfo{'mvapich2_intel_hfi'}{'SrcDir'}; @@ -916,6 +955,12 @@ sub uninstall_mvapich2_intel_hfi # 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) + +sub get_rpms_dir_mvapich2_pgi_hfi +{ + return $ComponentInfo{'mvapich2_pgi_hfi'}{'SrcDir'}; +} + sub available_mvapich2_pgi_hfi { my $srcdir = $ComponentInfo{'mvapich2_pgi_hfi'}{'SrcDir'}; @@ -1028,6 +1073,12 @@ sub uninstall_mvapich2_pgi_hfi # 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) + +sub get_rpms_dir_openmpi_gcc_cuda_hfi +{ + return $ComponentInfo{'openmpi_gcc_cuda_hfi'}{'SrcDir'}; +} + sub available_openmpi_gcc_cuda_hfi { my $srcdir = $ComponentInfo{'openmpi_gcc_cuda_hfi'}{'SrcDir'}; @@ -1249,23 +1300,30 @@ sub uninstall_mpisrc($$) my $install_list = shift(); # total that will be left installed when done my $uninstalling_list = shift(); # what items are being uninstalled - NormalPrint ("Uninstalling $ComponentInfo{'mpisrc'}{'Name'}...\n"); - - # remove old versions (.src.rpm and built .rpm files too) - system "rm -rf /usr/src/opa/MPI/.version 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mvapich2[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/openmpi[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/mpitests[-_]*.rpm 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.res 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.err 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/make.*.warn 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_mvapich2_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/do_openmpi_build 2>/dev/null"; - system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; + NormalPrint ("Uninstalling $ComponentInfo{'mpisrc'}{'Name'}...\n"); + + # try to uninstall meta pkg if it exists + if (rpm_is_installed("opameta_mpisrc", "any") || + rpm_is_installed("opameta_mpisrc_userspace", "any")) { + rpm_uninstall_matches("opameta_mpisrc", "opameta_mpisrc", "", ""); + } else { + # remove old versions (.src.rpm and built .rpm files too) + system "rm -rf /usr/src/opa/MPI/.version 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/mvapich2[-_]*.rpm 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/openmpi[-_]*.rpm 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/mpitests[-_]*.rpm 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/make.*.res 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/make.*.err 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/make.*.warn 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/do_build 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/do_mvapich2_build 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/do_openmpi_build 2>/dev/null"; + system "rm -rf /usr/src/opa/MPI/.mpiinfo 2>/dev/null"; + + system "rmdir /usr/src/opa/MPI 2>/dev/null"; # remove only if empty + system "rmdir /usr/src/opa 2>/dev/null"; # remove only if empty + } - system "rmdir /usr/src/opa/MPI 2>/dev/null"; # remove only if empty - system "rmdir /usr/src/opa 2>/dev/null"; # remove only if empty $ComponentWasInstalled{'mpisrc'}=0; } diff --git a/CommonInstall/comp_qlgc_fm.pl b/CommonInstall/comp_qlgc_fm.pl index 8155063..c7473ab 100755 --- a/CommonInstall/comp_qlgc_fm.pl +++ b/CommonInstall/comp_qlgc_fm.pl @@ -59,6 +59,12 @@ sub disable_autostart2_opafm() disable_autostart("opafm"); } +sub get_rpms_dir_opafm +{ + my $srcdir=$ComponentInfo{'opafm'}{'SrcDir'}; + return "$srcdir/RPMS/*"; +} + sub available_opafm { my $srcdir=$ComponentInfo{'opafm'}{'SrcDir'}; @@ -120,11 +126,6 @@ sub install_opafm my $install_list = $_[0]; # total that will be installed when done my $installing_list = $_[1]; # what items are being installed/reinstalled - my $srcdir=$ComponentInfo{'opafm'}{'SrcDir'}; - my $rc; - my $keep; - my $diff_src_dest; - my $version=media_version_opafm(); chomp $version; @@ -136,12 +137,7 @@ sub install_opafm my $fm_start = IsAutostart2_opafm(); # Install the rpm - my $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-fm", "user"); - rpm_run_install($rpmfile, "user", " -U "); - $rpmfile = rpm_resolve("$srcdir/RPMS/*/opa-fm-debuginfo", "user"); - if ($rpmfile) { - rpm_run_install($rpmfile, "user", " -U "); - } + install_comp_rpms('opafm', " -U ", $install_list); check_rpm_config_file("$CONFIG_DIR/opa-fm/opafm.xml", "/etc/sysconfig"); check_rpm_config_file("$CONFIG_DIR/opa-fm/opafm_pp.xml"); @@ -169,7 +165,7 @@ sub uninstall_opafm NormalPrint("Uninstalling $ComponentInfo{'opafm'}{'Name'}...\n"); - rpm_uninstall_list("any", "verbose", ( "opa-fm", "opa-fm-debuginfo") ); + uninstall_comp_rpms('opafm', '', $install_list, $uninstalling_list, 'verbose'); # just in case, newer rpms should clean these up system("rm -rf /usr/lib/opa/.comp_opafm.pl"); system("rmdir -p /opt/iba/fm_tools 2>/dev/null"); # remove only if empty diff --git a/CommonInstall/do_mvapich2_build.sh b/CommonInstall/do_mvapich2_build.sh index ddc5dce..4cc34b1 100755 --- a/CommonInstall/do_mvapich2_build.sh +++ b/CommonInstall/do_mvapich2_build.sh @@ -511,7 +511,7 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="gfortran -m64" FC="gfortran -m64"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=gfortran FC=gfortran' - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" fi fi @@ -521,7 +521,7 @@ logfile=make.mvapich2.$interface.$compiler mvapich2_comp_env='CC="gcc -m64" CXX="g++ -m64" F77="g77 -m64" FC="/bin/false"' else mvapich2_comp_env='CC=gcc CXX=g++ F77=g77 FC=/bin/false' - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then mvapich2_comp_env="$mvapich2_comp_env CFLAGS='-fPIC'" fi fi diff --git a/CommonInstall/do_openmpi_build.sh b/CommonInstall/do_openmpi_build.sh index 9563d12..fad9e14 100755 --- a/CommonInstall/do_openmpi_build.sh +++ b/CommonInstall/do_openmpi_build.sh @@ -492,7 +492,7 @@ logfile=make.openmpi.$interface.$compiler case "$compiler" in gcc) - if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID == 8.0" | bc -l) == 1 ) ]]; then + if [[ ( "$ID" == "rhel" && $(echo "$VERSION_ID >= 8.0" | bc -l) == 1 ) ]]; then openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS="-O3 -fPIC"" else openmpi_comp_env="$openmpi_comp_env CC=gcc CFLAGS=-O3" @@ -684,6 +684,7 @@ logfile=make.openmpi.$interface.$compiler --define 'root_path /' \ --define '_usr $STACK_PREFIX' \ --define 'path_to_mpihome $MPICH_PREFIX' \ + --define 'enable_cuda $Cflag' \ $disable_auto_requires \ $mpitests_srpm" echo "Executing: $cmd" diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 94c7840..90f93a0 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -70,6 +70,8 @@ my @Components_sles12_sp3 = ( "opa_stack", @OmniPathAllComponents ); my @Components_sles12_sp4 = ( "opa_stack", @OmniPathAllComponents ); +my @Components_sles12_sp5 = ( "opa_stack", + @OmniPathAllComponents ); my @Components_sles15 = ( "opa_stack", @OmniPathAllComponents ); my @Components_sles15_sp1 = ( "opa_stack", @@ -84,6 +86,8 @@ my @Components_rhel77 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel8 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); +my @Components_rhel81 = ( "opa_stack", "mpi_selector", + @OmniPathAllComponents ); @Components = ( ); @@ -200,7 +204,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "opa-basic-tools", "opa-address-resolution" ], DebugRpms => [ ], HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", # TBD @@ -230,7 +234,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "opa-fastfabric", "opa-mpi-apps" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", @@ -261,7 +265,7 @@ $WrapperComponent = "opaconfig"; Hidden => 1, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "mvapich2_gcc", "mpitests_mvapich2_gcc" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -276,7 +280,7 @@ $WrapperComponent = "opaconfig"; Hidden => 1, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "openmpi_gcc", "mpitests_openmpi_gcc" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -291,7 +295,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "openmpi_gcc_cuda_hfi", "mpitests_openmpi_gcc_cuda_hfi" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -306,7 +310,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "mvapich2_gcc_hfi", "mpitests_mvapich2_gcc_hfi" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -321,7 +325,7 @@ $WrapperComponent = "opaconfig"; Hidden => 1, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "mvapich2_intel_hfi", "mpitests_mvapich2_intel_hfi" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -336,7 +340,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "openmpi_gcc_hfi", "mpitests_openmpi_gcc_hfi" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -351,7 +355,7 @@ $WrapperComponent = "opaconfig"; Hidden => 1, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "openmpi_intel_hfi", "mpitests_openmpi_intel_hfi" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => "", @@ -426,7 +430,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "opa-fm", "opa-fm-debuginfo" ], DebugRpms => [ ], HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", @@ -442,7 +446,7 @@ $WrapperComponent = "opaconfig"; Hidden => 0, Disabled => 0, IsOFA => 0, KernelRpms => [ ], FirmwareRpms => [ ], - UserRpms => [ ], + UserRpms => [ "opa-libopamgt", "opa-libopamgt-devel" ], DebugRpms => [ ], HasStart => 0, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", @@ -671,6 +675,26 @@ my %opa_stack_sles12_sp4_comp_info = ( }, ); +# for SLES12sp5 +my %opa_stack_sles12_sp5_comp_info = ( + "opa_stack" => { Name => "OFA OPA Stack", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFA_DELTA.*"), + PreReq => "", CoReq => " oftools ", + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ "ifs-kernel-updates-kmp-default" ], + FirmwareRpms => [ ], + UserRpms => [ "opa-scripts", + ], + DebugRpms => [ ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => "", + StartComponents => [ "opa_stack", "ibacm", "rdma_ndd", "delta_srp", "delta_srpt" ], + StartupScript => "opa", + StartupParams => [ "ARPTABLE_TUNING" ] + }, +); + # for SLES15.x my %opa_stack_sles15_comp_info = ( "opa_stack" => { Name => "OFA OPA Stack", @@ -828,6 +852,36 @@ my %intel_hfi_rhel8_comp_info = ( }, ); +my %intel_hfi_rhel81_comp_info = ( + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ #"libhfi1", "libhfi1-static", + "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ #"hfi1_debuginfo", + "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", #"libhfi1-debuginfo" + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); + # For SLES12sp3 that has different name for libpsm2 my %intel_hfi_sles123_comp_info = ( "intel_hfi" => { Name => "Intel HFI Components", @@ -888,6 +942,34 @@ my %intel_hfi_sles124_comp_info = ( }, ); +my %intel_hfi_sles125_comp_info = ( + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ "libpsm2-2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); + # For SLES15.x that has different name for libpsm2 my %intel_hfi_sles15_comp_info = ( "intel_hfi" => { Name => "Intel HFI Components", @@ -1090,6 +1172,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_sles12_sp4_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES125" ) { + @Components = ( @Components_sles12_sp5 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_sles125_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_sles12_sp5_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES74" ) { @SubComponents = ( @SubComponents_newer ); @Components = ( @Components_rhel74 ); @@ -1138,6 +1228,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { + @Components = ( @Components_rhel81 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_rhel81_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @Components_sles15 ); @SubComponents = ( @SubComponents_newer ); @@ -1231,6 +1329,9 @@ sub install_opaconfig my $srcdir=$ComponentInfo{'opaconfig'}{'SrcDir'}; NormalPrint("Installing $ComponentInfo{'opaconfig'}{'Name'}...\n"); + # all meta pkgs depend on opaconfig. We may directly upgrade opaconfig, so we remove them first. + rpm_uninstall_matches("opameta_", "opameta_", "", ""); + # New Install Code my $rpmfile = rpm_resolve("$srcdir/RPMS/*/opaconfig", "any"); rpm_run_install($rpmfile, "any", " -U "); @@ -1263,6 +1364,9 @@ sub uninstall_opaconfig NormalPrint("Uninstalling $ComponentInfo{'opaconfig'}{'Name'}...\n"); + # all meta pkgs depend on opaconfig. Remove them first. + rpm_uninstall_matches("opameta_", "opameta_", "", ""); + # New Uninstall Code rpm_uninstall_list("any", "verbose", ("opaconfig") ); # New Uninstall Code @@ -1354,6 +1458,8 @@ sub Usage printf STDERR " -v - verbose logging\n"; printf STDERR " -vv - very verbose debug logging\n"; printf STDERR " -C - output list of supported components\n"; +# Hidden feature for internal use +# printf STDERR " -c comp - output component information in JSON format\n"; printf STDERR " -V - output Version\n"; printf STDERR " --user_queries - permit non-root users to query the fabric. (default)\n"; @@ -1589,6 +1695,10 @@ sub process_args } elsif ( "$arg" eq "-C" ) { ShowComponents; exit(0); + } elsif ( "$arg" eq "-c" ) { + # undocumented option to output detailed information on a component + $Default_ShowCompInfo=1; + $setcomp=1; } elsif ( "$arg" eq "-V" ) { printf "$VERSION\n"; exit(0); @@ -1777,6 +1887,11 @@ overrides; process_args; check_root_user; +if ( $Default_ShowCompInfo ) +{ + ShowCompInfo(); + exit(0); +} if ( ! $Default_Build ) { open_log(""); } else { diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index e7c6ceb..4426c0f 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -58,6 +58,10 @@ my @delta_Components_sles12_sp4 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_sles12_sp5 = ( "opa_stack", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_rhel74 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -78,6 +82,10 @@ my @delta_Components_rhel8 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_rhel81 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_sles15 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -108,6 +116,8 @@ sub overrides() @Components = ( @delta_Components_sles12_sp3 ); } elsif ( "$CUR_VENDOR_VER" eq "ES124" ) { @Components = ( @delta_Components_sles12_sp4 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES125" ) { + @Components = ( @delta_Components_sles12_sp5 ); } elsif ( "$CUR_VENDOR_VER" eq "ES74" ) { @Components = ( @delta_Components_rhel74 ); } elsif ( "$CUR_VENDOR_VER" eq "ES75" ) { @@ -118,6 +128,8 @@ sub overrides() @Components = ( @delta_Components_rhel77 ); } elsif ( "$CUR_VENDOR_VER" eq "ES8" ) { @Components = ( @delta_Components_rhel8 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES81" ) { + @Components = ( @delta_Components_rhel81 ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @delta_Components_sles15 ); } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { diff --git a/CommonInstall/util_components.pl b/CommonInstall/util_components.pl index f19e822..d0da409 100755 --- a/CommonInstall/util_components.pl +++ b/CommonInstall/util_components.pl @@ -231,6 +231,7 @@ my $Default_DisableAutostart=0; # -D option used to select default disabling of my %Default_DisabledComponents = (); # components selected by -D my $Default_EnableAutostart=0; # -E option used to select default enabling of autostart for Default_EnabledComponents my %Default_EnabledComponents = (); # components selected by -E +my $Default_ShowCompInfo=0; # -c option used to select default component information display of Default_Components # Names of supported install components # must be listed in depdency order such that prereqs appear 1st @@ -345,7 +346,178 @@ sub ShowComponents(;$) print $print_param " $comp"; } } - print "\n"; + print $print_param "\n"; +} + +sub ShowCompInfo(;$) +{ + my $print_param = shift || \*STDOUT; #STDOUT as default parameter + print $print_param "[\n"; + my $first_comp = 1; + my $first_item = 1; + foreach my $comp ( @Components ) + { + if ( $Default_Components{$comp} ) { + if ($first_comp == 1) { + $first_comp = 0; + print $print_param " {\n"; + } else { + print $print_param ",\n {\n"; + } + print $print_param " \"id\": \"$comp\",\n"; + my $description = $ComponentInfo{$comp}{'Name'}; + print $print_param " \"description\": \"$description\",\n"; + if ( $comp eq "delta_debug" ) { + print $print_param " \"error\": \"Not apply. We ship debug rpms in meta pkg <component>_debuginfo.\"\n"; + print $print_param " },\n"; + next; + } + if (comp_is_available($comp)) { + print $print_param " \"available\": \"yes\",\n"; + } else { + print $print_param " \"available\": \"no\",\n"; + } + my $full_ver = comp_media_version($comp); + my ($version, $release) = GetVerRel($full_ver); + print $print_param " \"version\": \"$version\",\n"; + print $print_param " \"release\": \"$release\",\n"; + print $print_param " \"prereqs\": [\n"; + $first_item = 1; + my @reqs = split(/ /, $ComponentInfo{$comp}{'PreReq'}); + foreach my $req (@reqs) { + # ignore req that is not a component. This is for the case we do not + # have mpi_selector for SLES + if ( $req ne '' && grep( /^$req$/, @Components) ) { + my $reqver = comp_media_version($req); + my ($version, $release) = GetVerRel($reqver); + $reqver = "$version-$release"; + if ($first_item == 1) { + $first_item = 0; + print $print_param " {\"id\": \"$req\", \"version\": \"$reqver\"}"; + } else { + print $print_param ",\n {\"id\": \"$req\", \"version\": \"$reqver\"}"; + } + } + } + print $print_param "\n ],\n"; + @reqs = split(/ /, $ComponentInfo{$comp}{'CoReq'}); + print $print_param " \"coreqs\": [\n"; + $first_item = 1; + foreach my $req (@reqs) { + # ignore req that is not a component. This is for the case we do not + # have mpi_selector for SLES + if ( $req ne '' && grep( /^$req$/, @Components) ) { + my $reqver = comp_media_version($req); + my ($version, $release) = GetVerRel($reqver); + $reqver = "$version-$release"; + if ($first_item == 1) { + $first_item = 0; + print $print_param " {\"id\": \"$req\", \"version\": \"$reqver\"}"; + } else { + print $print_param ",\n {\"id\": \"$req\", \"version\": \"$reqver\"}"; + } + } + } + print $print_param "\n ],\n"; + if ( $comp eq "mpisrc" ) { + print $print_param " \"srcrpms\": {\n"; + print $print_param " \"dest\": \"/usr/src/opa/MPI/\",\n"; + my $srcdir=$ComponentInfo{'mpisrc'}{'SrcDir'}; + print $print_param " \"source\": \"$srcdir\",\n"; + print $print_param " \"resources\": [\n"; + $first_item = 1; + foreach my $srpm ( "mvapich2", "openmpi", "mpitests" ) { + my $srpmfile = file_glob("$srcdir/${srpm}-*.src.rpm"); + if ( "$srpmfile" ne "" ) { + my $file = my_basename($srpmfile); + if ($first_item == 1) { + $first_item = 0; + print $print_param " \"$file\""; + } else { + print $print_param ",\n \"$file\""; + } + } + } + print $print_param "\n ]\n"; + print $print_param " },\n"; + print $print_param " \"tools\": {\n"; + print $print_param " \"dest\": \"/usr/src/opa/MPI/\",\n"; + print $print_param " \"source\": \"$srcdir\",\n"; + print $print_param " \"resources\": [\n"; + print $print_param " \"do_build\",\n"; + print $print_param " \"do_mvapich2_build\",\n"; + print $print_param " \"do_openmpi_build\"\n"; + print $print_param " ]\n"; + print $print_param " },\n"; + print $print_param " \"misc\": [\n"; + print $print_param " {\"dest\": \"/usr/src/opa/MPI/.version\", \"source\": \"$srcdir\", \"resource\": \"version\"}\n"; + print $print_param " ]\n"; + } else { + print $print_param " \"userrpms\": [\n"; + ShowRpmList($print_param, " ", "user", @{$ComponentInfo{$comp}{'UserRpms'}}); + print $print_param "\n ],\n"; + print $print_param " \"kernelrpms\": [\n"; + ShowRpmList($print_param, " ", $CUR_OS_VER, @{$ComponentInfo{$comp}{'KernelRpms'}}); + print $print_param "\n ],\n"; + print $print_param " \"firmwarerpms\": [\n"; + ShowRpmList($print_param, " ", "firmware", @{$ComponentInfo{$comp}{'FirmwareRpms'}}); + print $print_param "\n ],\n"; + print $print_param " \"debugrpms\": [\n"; + ShowRpmList($print_param, " ", "any", @{$ComponentInfo{$comp}{'DebugRpms'}}); + print $print_param "\n ]\n"; + } + + print $print_param " }"; + } + } + print $print_param "\n]\n"; +} + +sub GetVerRel($) +{ + my $full_ver = shift(); + my ($version, $release) = split('-', $full_ver, 2); + if ("$release" eq "") { + # assume the version is in expected format, and it shall be. + my @segs = split('\.', $version); + my $last = scalar(@segs)-1; + $version = join('.', @segs[0..3]); + $release = join('.', @segs[4..$last]); + } + return ($version, $release); +} + +sub ShowRpmList($$$$@) +{ + my $print_param = shift(); + my $prefix = shift(); + my $mode = shift(); + my @rpms = @_; + my $rpmsdir = ""; + my $first_item = 1; + foreach my $rpm (@rpms) { + if ( $GPU_Install && -d file_glob("./repos/OPA_PKGS_CUDA") ) { + $rpmsdir=file_glob("./repos/OPA_PKGS_CUDA/RPMS"); + } else { + $rpmsdir=file_glob("./repos/OPA_PKGS/RPMS"); + } + my $rpm_file = rpm_resolve("$rpmsdir/$rpm", $mode); + if ( $rpm_file ne '' ) { + my $version = rpm_query_version_release($rpm_file); + my $epoch = rpm_query_attr($rpm_file, "EPOCH"); + if ("$epoch" ne "") { + $version = "$epoch:$version"; + } + if ($first_item == 1) { + $first_item = 0; + print $print_param "$prefix\{\"id\": \"$rpm\", \"version\": \"$version\"}"; + } else { + print $print_param ",\n$prefix\{\"id\": \"$rpm\", \"version\": \"$version\"}"; + } + } else { + DebugPrint "Not found $rpm"; + } + } } # return 1 if $comp has a prereq of $prereq, 0 otherwise @@ -823,6 +995,10 @@ sub uninstall_comp_rpms($$$$$) my $uninstalling_list = shift(); my $verbosity = shift(); + # try to uninstall meta pkg if it exists + my $metapkg = "opameta_$comp"; + rpm_uninstall_matches($metapkg, $metapkg, '', ""); + rpm_uninstall_list2("any", "$option", $verbosity, @{ $ComponentInfo{$comp}{'DebugRpms'}}); rpm_uninstall_list2("any", "$option", $verbosity, @@ -1359,6 +1535,9 @@ sub show_install_menu($) } } + # remove any alias pkgs if it exists. Meta pkgs will be handled in comp uninstall. + rpm_uninstall_matches("opanode_", "opanode_", "", ""); + # first uninstall what will be removed, do this in reverse order # so dependency issues are avoided foreach $comp ( reverse(@Components) ) { @@ -1784,6 +1963,9 @@ sub show_uninstall_menu($) } } + # remove any alias pkgs if it exists. Meta pkgs will be handled in comp uninstall. + rpm_uninstall_matches("opanode_", "opanode_", "", ""); + # perform the uninstall, work backwards through list foreach $comp ( reverse(@Components) ) { diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index 05d5746..9851bd4 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -727,7 +727,7 @@ sub rpm_resolve($$) } else { my $osver = rpm_tr_os_version("$mode"); # OS version # we expect 1 match, ignore all other filenames returned - if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES15' || "$CUR_VENDOR_VER" eq 'ES151') { + if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES125' ||"$CUR_VENDOR_VER" eq 'ES15' || "$CUR_VENDOR_VER" eq 'ES151') { DebugPrint("Checking for Kernel Rpm: ${rpmpath}-${osver}_k*.${cpu}.rpm\n"); $rpmfile = file_glob("${rpmpath}-${osver}_k*.${cpu}.rpm"); } else { @@ -1000,6 +1000,17 @@ sub check_rpmbuild_dependencies($) NormalPrint("rpm-build ($last_checked) is required to build $srpm\n"); $err++; } + # RHEL 8 and later + if (substr("$CUR_VENDOR_VER", 0, 3) eq "ES8") { + if (! rpm_is_installed("kernel-rpm-macros", "any") ) { + NormalPrint("kernel-rpm-macros ($last_checked) is required to build $srpm\n"); + $err++; + } + if (! rpm_is_installed("kernel-abi-whitelists", "any") ) { + NormalPrint("kernel-abi-whitelist ($last_checked) is required to build $srpm\n"); + $err++; + } + } } if ( "$CUR_DISTRO_VENDOR" ne "SuSE" && rpm_will_build_debuginfo()) { if (! rpm_is_installed("redhat-rpm-config", "any")) { diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index adaa9df..a14e69c 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -133,6 +133,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES8" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL8.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES81" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL81.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES122" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES122.pl endif @@ -142,6 +145,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES124" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES124.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES125" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES125.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES15" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES15.pl endif diff --git a/Esm/build.env b/Esm/build.env index 8fa7440..a6c6f13 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_10_0_0_444 +export RELEASE_TAG=10_10_1_0_35 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 3f99503..169c846 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 10/16/19 23:59 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_0_0_444 +Build of VIEO_HOST 12/26/19 23:59 Tag: VIEO_HOST_LINUX_opa-10_10_10_10_1_0_35 diff --git a/Esm/ib/include/ib_sm.h b/Esm/ib/include/ib_sm.h index e84b630..f86491c 100644 --- a/Esm/ib/include/ib_sm.h +++ b/Esm/ib/include/ib_sm.h @@ -280,7 +280,8 @@ typedef SMDBSync_t *SMDBSyncp; /* SM DBSYNC pointer type */ // version 10 - 10.8 release // version 11 - 10.9 release // version 12 - 10.9.3 release -#define FM_PROTOCOL_VERSION 12 +// version 13 - 10.10.1 release +#define FM_PROTOCOL_VERSION 13 typedef struct { diff --git a/Esm/ib/src/linux/startup/opafm_src.xml b/Esm/ib/src/linux/startup/opafm_src.xml index 4b2ea66..e9bf1d8 100644 --- a/Esm/ib/src/linux/startup/opafm_src.xml +++ b/Esm/ib/src/linux/startup/opafm_src.xml @@ -1674,9 +1674,6 @@ <!-- When using PSM, the CC settings for a given job --> <!-- can be overridden with the following environment variables --> <!-- PSM_DISABLE_CCA 0 --> - <!-- PSM_CCTI_INCREMENT 1 --> - <!-- PSM_CCTI_TIMER 1 --> - <!-- PSM_CCTI_TABLE_SIZE 128 --> <Fi> <!-- OPA CC FICongestionEntry:CCTI Increase --> <!-- The number to be added to the CCTI on the receipt of a BECN--> diff --git a/Esm/ib/src/linux/startup/opafm_src.xml.base b/Esm/ib/src/linux/startup/opafm_src.xml.base index 4b2ea66..e9bf1d8 100644 --- a/Esm/ib/src/linux/startup/opafm_src.xml.base +++ b/Esm/ib/src/linux/startup/opafm_src.xml.base @@ -1674,9 +1674,6 @@ <!-- When using PSM, the CC settings for a given job --> <!-- can be overridden with the following environment variables --> <!-- PSM_DISABLE_CCA 0 --> - <!-- PSM_CCTI_INCREMENT 1 --> - <!-- PSM_CCTI_TIMER 1 --> - <!-- PSM_CCTI_TABLE_SIZE 128 --> <Fi> <!-- OPA CC FICongestionEntry:CCTI Increase --> <!-- The number to be added to the CCTI on the receipt of a BECN--> diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 50dba4a..0b28d54 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.10.0.0 -Release: 444%{?dist} +Version: 10.10.1.0 +Release: 35%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.10.0.0.444%{?dist} +IFSComponent: FM 10.10.1.0.35%{?dist} %prep %setup -q -c
0
1a257f708ed6548e09f41cc26b6600b3c28466b4
01org/opa-fm
Advance release number for latest change
commit 1a257f708ed6548e09f41cc26b6600b3c28466b4 Author: Scott Breyer <[email protected]> Date: Tue Jun 5 11:42:27 2018 -0400 Advance release number for latest change diff --git a/Esm/build.env b/Esm/build.env index 7e4d2b8..cec6a88 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_7_0_0_143 +export RELEASE_TAG=10_7_0_0_144 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/opa-fm.spec.in b/opa-fm.spec.in index b684635..eab77b9 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.7.0.0 -Release: 143%{?dist} +Release: 144%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
e34556a4a7af29834ea689f74959fceed2a068b2
01org/opa-fm
Touch up for builds - added file missed
commit e34556a4a7af29834ea689f74959fceed2a068b2 Author: Scott Breyer <[email protected]> Date: Thu Nov 5 15:01:02 2015 -0500 Touch up for builds - added file missed diff --git a/Esm/ib/src/smi/sa/sa_FabricInfoRecord.c b/Esm/ib/src/smi/sa/sa_FabricInfoRecord.c new file mode 100755 index 0000000..0e009ef --- /dev/null +++ b/Esm/ib/src/smi/sa/sa_FabricInfoRecord.c @@ -0,0 +1,200 @@ +/* BEGIN_ICS_COPYRIGHT5 **************************************** + +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_COPYRIGHT5 ****************************************/ + +/* [ICS VERSION STRING: unknown] */ + +//===========================================================================// +// // +// FILE NAME // +// sa_FabricInfoRecord.c // +// // +// DESCRIPTION // +// This file contains the routines to process the SA requests for // +// records of the FabricInfoRecord type. // +// // +// DATA STRUCTURES // +// None // +// // +// FUNCTIONS // +// sa_FabricInfoRecord // +// // +// DEPENDENCIES // +// ib_mad.h // +// ib_status.h // +// // +//===========================================================================// + + +#include "os_g.h" +#include "ib_mad.h" +#include "ib_sa.h" +#include "ib_status.h" +#include "cs_g.h" +#include "mai_g.h" +#include "sm_counters.h" +#include "sm_l.h" +#include "sa_l.h" + +Status_t +sa_FabricInfoRecord(Mai_t *maip, sa_cntxt_t* sa_cntxt) { + STL_FABRICINFO_RECORD myFI = { 0 }; + uint16_t attribOffset; + + IB_ENTER("sa_FabricInfoRecord", maip, 0, 0, 0); + +// +// Check the method. For FabricInfoRecord, you can only do a Get(). +// + if (maip->base.method == SA_CM_GET) { + Node_t *nodep; + INCREMENT_COUNTER(smCounterSaRxGetFabricInfoRecord); + + (void) vs_rdlock(&old_topology_lock); + myFI.NumHFIs = old_topology.num_nodes - old_topology.num_sws; + myFI.NumSwitches = old_topology.num_sws; + for_all_nodes(&old_topology, nodep) { + Port_t *portp; + for_all_physical_ports(nodep, portp) { + Node_t *neighborNodep = NULL; + int isl = 0; + int internal = 0; + int degraded = 0; + int omitted = 0; + if (! sm_valid_port(portp) || portp->state <= IB_PORT_DOWN) + continue; + + if (portp->portData->neighborQuarantined) { + // quarantined neighbors will just have the trusted port + // in topology and QuaratinedNode_t will have only the + // NodeInfo reported by the untrusted SMA, but no PortInfo + neighborNodep = sm_find_quarantined_guid(&old_topology, portp->portData->portInfo.NeighborNodeGUID); + // use only trusted information where possible + if (nodep->nodeInfo.NodeType == NI_TYPE_SWITCH + && portp->portData->portInfo.PortNeighborMode.NeighborNodeType == 1) + isl = 1; + // this could be a lie from the untrusted node but its the + // best we can do + if (neighborNodep && nodep->nodeInfo.SystemImageGUID == + neighborNodep->nodeInfo.SystemImageGUID) + internal = 1; + // for ports which are omitted, don't report degraded + // In this case we also lack details for other side of link + omitted = 1; + } else { + Port_t *neighborPortp; + uint16 lwe; // best link width possible based on enabled + uint16 lse; // best link speed possible based on enabled + + neighborPortp = sm_find_neighbor_node_and_port(&old_topology, portp, &neighborNodep); + if (! neighborPortp || ! neighborNodep) + continue; + // to avoid double counting, we only process when we have + // nodep/portp as the lower NodeGuid and portNum of the link + if (nodep->nodeInfo.NodeGUID > neighborNodep->nodeInfo.NodeGUID) + continue; + if (nodep->nodeInfo.NodeGUID == neighborNodep->nodeInfo.NodeGUID + && portp->index >= neighborPortp->index) + continue; + + if (nodep->nodeInfo.NodeType == NI_TYPE_SWITCH + && neighborNodep->nodeInfo.NodeType == NI_TYPE_SWITCH) + isl = 1; + if (nodep->nodeInfo.SystemImageGUID == + neighborNodep->nodeInfo.SystemImageGUID) + internal = 1; + + // Note Enabled checks could race if opaportconfig changes + // width or speed but has not yet bounced the link + // + // Best width link could come up at + lwe = StlBestLinkWidth(portp->portData->portInfo.LinkWidth.Enabled + & neighborPortp->portData->portInfo.LinkWidth.Enabled); + // Best speed link could come up at + lse = StlBestLinkSpeed(portp->portData->portInfo.LinkSpeed.Enabled + & neighborPortp->portData->portInfo.LinkSpeed.Enabled); + + // Active on both sides of link should match but + // to be safe we check both sides of link + if (portp->portData->portInfo.LinkWidthDowngrade.RxActive != lwe + || portp->portData->portInfo.LinkWidthDowngrade.TxActive != lwe + || neighborPortp->portData->portInfo.LinkWidthDowngrade.RxActive != lwe + || neighborPortp->portData->portInfo.LinkWidthDowngrade.TxActive != lwe + || portp->portData->portInfo.LinkSpeed.Active != lse + || neighborPortp->portData->portInfo.LinkSpeed.Active != lse) { + degraded = 1; + } + + if (portp->portData->portInfo.PortStates.s.PortState == IB_PORT_INIT) { + omitted = 1; + degraded = 0; // don't report degraded for omitted ports + } + } + if (isl) { + if (internal) + myFI.NumInternalISLs++; + else + myFI.NumExternalISLs++; + } else { + if (internal) + myFI.NumInternalHFILinks++; + else + myFI.NumExternalHFILinks++; + } + if (degraded) { + if (isl) + myFI.NumDegradedISLs++; + else + myFI.NumDegradedHFILinks++; + } + if (omitted) { + if (isl) + myFI.NumOmittedISLs++; + else + myFI.NumOmittedHFILinks++; + } + } // for_all_physical_ports + } // for_all_nodes + (void) vs_rwunlock(&old_topology_lock); + + BSWAP_STL_FABRICINFO_RECORD(&myFI); + + attribOffset = sizeof(STL_FABRICINFO_RECORD) + + Calculate_Padding(sizeof(STL_FABRICINFO_RECORD)); + + sa_cntxt_data( sa_cntxt, &myFI, attribOffset); + sa_cntxt->attribLen = attribOffset; + maip->base.status = MAD_STATUS_OK; + } else { + maip->base.status = MAD_STATUS_BAD_METHOD; + } + (void)sa_send_reply(maip, sa_cntxt); + + IB_EXIT("sa_FabricInfoRecord", VSTATUS_OK); + return(VSTATUS_OK); +}
0
5808d336ea5b46d8117ca85cb6bb7828f79430fc
01org/opa-fm
Fix for SwitchCascadeActiveEnable not zero, change default to disabled
commit 5808d336ea5b46d8117ca85cb6bb7828f79430fc Author: Scott Breyer <[email protected]> Date: Fri Mar 11 12:00:25 2016 -0500 Fix for SwitchCascadeActiveEnable not zero, change default to disabled diff --git a/Esm/ib/src/linux/startup/opafm_src.xml b/Esm/ib/src/linux/startup/opafm_src.xml index 1a9582b..c816d9b 100644 --- a/Esm/ib/src/linux/startup/opafm_src.xml +++ b/Esm/ib/src/linux/startup/opafm_src.xml @@ -1720,7 +1720,7 @@ <!-- Enables fabric activation optimization to reduce packet counts --> <!-- during fabric bring up. 0-Disable, 1-Switches only, 2-All devices --> - <SwitchCascadeActivateEnable>2</SwitchCascadeActivateEnable> + <SwitchCascadeActivateEnable>0</SwitchCascadeActivateEnable> <!-- Number of times to retry activation upon detecting an armed port --> <!-- with a non-armed/active neighbor. --> diff --git a/Esm/ib/src/smi/sm/sm_topology.c b/Esm/ib/src/smi/sm/sm_topology.c index c70e6fa..556a891 100755 --- a/Esm/ib/src/smi/sm/sm_topology.c +++ b/Esm/ib/src/smi/sm/sm_topology.c @@ -3351,6 +3351,7 @@ topology_activate(void) if(portStateInfo != NULL) { vs_pool_free(&sm_pool, portStateInfo); + portStateInfo = NULL; } psiFailed = 1; @@ -3381,7 +3382,10 @@ topology_activate(void) } } - vs_pool_free(&sm_pool, portStateInfo); + if(portStateInfo != NULL) { + vs_pool_free(&sm_pool, portStateInfo); + portStateInfo = NULL; + } } }
0
931e02b6e05042fa051d077ae15ae13ad808857a
01org/opa-fm
Remove .comp_opafm.pl from opa-fm package Reviewed-by: Todd Rimmer <[email protected]> Reviewed-by: John Fleck <[email protected]> Signed-off-by: Scott Breyer <[email protected]>
commit 931e02b6e05042fa051d077ae15ae13ad808857a Author: Scott Breyer <[email protected]> Date: Fri Jun 1 14:52:39 2018 -0400 Remove .comp_opafm.pl from opa-fm package Reviewed-by: Todd Rimmer <[email protected]> Reviewed-by: John Fleck <[email protected]> Signed-off-by: Scott Breyer <[email protected]> diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index 0cbfe60..8c2d64b 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -213,7 +213,6 @@ INSTALL.pl: $(INSTALL_SOURCES) comp.pl: $(COMP_SOURCES) cat $(PREREQ_SOURCE) $(COMP_SOURCES) > comp.pl chmod +x comp.pl - cp comp.pl $(TL_DIR)/Esm/.comp_opafm.pl # install for includes, libs and cmds phases include $(TL_DIR)/Makerules/Maketargets.install @@ -248,7 +247,6 @@ endif dir=`dirname $(GLOBAL_BIN_DIR)`; \ mkdir $$dir/stage.rpm; \ cp -r -L $(GLOBAL_BIN_DIR)/* $$dir/stage.rpm/ ; \ - cp $(TL_DIR)/Esm/.comp_opafm.pl $$dir/stage.rpm/; \ cd $$dir/stage.rpm ; \ find . -print| $(PREP); \ $(PATCH_VERSION) $(RELEASE_TAG) sm fe; \ diff --git a/Esm/fm_install.sh b/Esm/fm_install.sh index c927011..1c38341 100755 --- a/Esm/fm_install.sh +++ b/Esm/fm_install.sh @@ -77,8 +77,6 @@ cp -t ${DESTDIR}/usr/lib/opa-fm/bin opafm cp -t ${DESTDIR}/usr/lib/opa-fm/bin opaxmlextract cp -t ${DESTDIR}/usr/lib/opa-fm/bin opaxmlfilter -cp -t ${DESTDIR}/usr/lib/opa .comp_opafm.pl - cp -t ${DESTDIR}/usr/share/opa-fm opafm_src.xml cp -t ${DESTDIR}/usr/share/opa-fm opafm.xml diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 8855b95..b684635 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -96,7 +96,6 @@ __RPM_SYSCONF /usr/lib/opa-fm/bin/* /usr/lib/opa-fm/runtime/* /usr/share/opa-fm/* -/usr/lib/opa/.comp_opafm.pl %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall %{_mandir}/man8/*
0
a9ef2f062b045b3643245317a82bb72f76aa60b9
01org/opa-fm
HPE FT, add a converge option to fat tree. Passthru/converge works well with compute traffic, fall back to original algorithm for route last device group. Reviewed-by: Aruna Ramanan <[email protected]> Signed-off-by: John Fleck <[email protected]> Signed-off-by: Renae Weber <[email protected]>
commit a9ef2f062b045b3643245317a82bb72f76aa60b9 Author: John Fleck <[email protected]> Date: Wed May 16 15:47:22 2018 -0400 HPE FT, add a converge option to fat tree. Passthru/converge works well with compute traffic, fall back to original algorithm for route last device group. Reviewed-by: Aruna Ramanan <[email protected]> Signed-off-by: John Fleck <[email protected]> Signed-off-by: Renae Weber <[email protected]> diff --git a/Esm/build.env b/Esm/build.env index d86a259..7e4d2b8 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_7_0_0_142 +export RELEASE_TAG=10_7_0_0_143 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/include/fm_xml.h b/Esm/ib/include/fm_xml.h index d303203..a9fe82d 100644 --- a/Esm/ib/include/fm_xml.h +++ b/Esm/ib/include/fm_xml.h @@ -747,6 +747,7 @@ typedef struct _SmAdaptiveRoutingXmlConfig { typedef struct _SmFtreeRouting_t { uint8_t debug; uint8_t passthru; + uint8_t converge; uint8_t tierCount; // height of the fat tree. edges are rank 0. uint8_t fis_on_same_tier; // indicates that all end nodes are at the bottom of the tree. XMLMember_t coreSwitches; // device group indicating core switches diff --git a/Esm/ib/src/config/fm_xml.c b/Esm/ib/src/config/fm_xml.c index 93e6366..865a0c7 100644 --- a/Esm/ib/src/config/fm_xml.c +++ b/Esm/ib/src/config/fm_xml.c @@ -1897,6 +1897,7 @@ boolean smInitConfig(SMXmlConfig_t *smp, SMDPLXmlConfig_t *dplp, SMMcastConfig_t } DEFAULT_AND_CKSUM_INT(smp->ftreeRouting.passthru, 0, CKSUM_OVERALL_DISRUPT_CONSIST); + DEFAULT_AND_CKSUM_INT(smp->ftreeRouting.converge, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_INT(smp->ftreeRouting.debug, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_INT(smp->ftreeRouting.tierCount, 0, CKSUM_OVERALL_DISRUPT_CONSIST); DEFAULT_AND_CKSUM_INT(smp->ftreeRouting.fis_on_same_tier, 0, CKSUM_OVERALL_DISRUPT_CONSIST); @@ -2283,6 +2284,7 @@ void smShowConfig(SMXmlConfig_t *smp, SMDPLXmlConfig_t *dplp, SMMcastConfig_t *m printf("XML - adaptiveRouting.threshold %u\n", (unsigned int)smp->adaptiveRouting.threshold); printf("XML - ftreeRouting.passthru %u\n", (unsigned int)smp->ftreeRouting.passthru); + printf("XML - ftreeRouting.converge %u\n", (unsigned int)smp->ftreeRouting.converge); printf("XML - ftreeRouting.debug %u\n", (unsigned int)smp->ftreeRouting.debug); printf("XML - ftreeRouting.tierCount %u\n", (unsigned int)smp->ftreeRouting.tierCount); printf("XML - ftreeRouting.fis_on_same_tier %u\n", (unsigned int)smp->ftreeRouting.fis_on_same_tier); @@ -6062,6 +6064,7 @@ static void SmFtreeRoutingXmlParserEnd(IXmlParserState_t *state, const IXML_FIEL static IXML_FIELD SmFtreeRoutingFields[] = { { tag:"Debug", format:'u', IXML_FIELD_INFO(SmFtreeRouting_t, debug) }, { tag:"PassThrough", format:'u', IXML_FIELD_INFO(SmFtreeRouting_t, passthru) }, + { tag:"Converge", format:'u', IXML_FIELD_INFO(SmFtreeRouting_t, converge) }, { tag:"FIsOnSameTier", format:'u', IXML_FIELD_INFO(SmFtreeRouting_t, fis_on_same_tier) }, { tag:"TierCount", format:'u', IXML_FIELD_INFO(SmFtreeRouting_t, tierCount) }, { tag:"CoreSwitches", format:'k', end_func:SmFtreeCoreSwitchEnd }, diff --git a/Esm/ib/src/smi/include/sm_l.h b/Esm/ib/src/smi/include/sm_l.h index 2c4ebd5..d8fee56 100755 --- a/Esm/ib/src/smi/include/sm_l.h +++ b/Esm/ib/src/smi/include/sm_l.h @@ -1412,7 +1412,7 @@ void activation_retry_inc_failures(pActivationRetry_t); } -void Switch_Enqueue_Type(Topology_t *, Node_t *, int, int); +void Switch_Enqueue_Type(Topology_t *, Node_t *, int, int, int); // // Macros for allocating Nodes and Ports. diff --git a/Esm/ib/src/smi/sm/sm_fattree.c b/Esm/ib/src/smi/sm/sm_fattree.c index 7b88217..dca5997 100644 --- a/Esm/ib/src/smi/sm/sm_fattree.c +++ b/Esm/ib/src/smi/sm/sm_fattree.c @@ -177,7 +177,7 @@ _post_process_discovery(Topology_t *topop, Status_t discoveryStatus, void *conte swportp->portData->downlink = 1; if (bitset_test(&processedSwitches, switchp->swIdx)) continue; - Switch_Enqueue_Type(topop, switchp, 0, 1); + Switch_Enqueue_Type(topop, switchp, 0, 1, sm_config.ftreeRouting.converge); bitset_set(&processedSwitches, switchp->swIdx); } } @@ -208,7 +208,7 @@ _post_process_discovery(Topology_t *topop, Status_t discoveryStatus, void *conte if (bitset_test(&processedSwitches, nodep->swIdx)) continue; - Switch_Enqueue_Type(topop, nodep, t, 1); + Switch_Enqueue_Type(topop, nodep, t, 1, 0); bitset_set(&processedSwitches, nodep->swIdx); } @@ -223,7 +223,7 @@ _post_process_discovery(Topology_t *topop, Status_t discoveryStatus, void *conte // Determine core switches from config information. for_all_switch_nodes(topop, switchp) { if (_is_core(switchp)) { - Switch_Enqueue_Type(topop, switchp, sm_config.ftreeRouting.tierCount-1, 0); + Switch_Enqueue_Type(topop, switchp, sm_config.ftreeRouting.tierCount-1, 0, 0); bitset_set(&processedSwitches, switchp->swIdx); } } @@ -260,7 +260,7 @@ _post_process_discovery(Topology_t *topop, Status_t discoveryStatus, void *conte if (bitset_test(&processedSwitches, nodep->swIdx)) continue; - Switch_Enqueue_Type(topop, nodep, t-1, 1); + Switch_Enqueue_Type(topop, nodep, t-1, 1, sm_config.ftreeRouting.converge); bitset_set(&processedSwitches, nodep->swIdx); } @@ -297,6 +297,9 @@ _post_process_discovery(Topology_t *topop, Status_t discoveryStatus, void *conte for_all_tier_switches(topop, switchp, t) { switchp->tierIndex = i++; + // IB_LOG_INFINI_INFO_FMT(__func__, "Switch %s tier %d, tierIndex %d", + // sm_nodeDescString(switchp), switchp->tier, switchp->tierIndex); + // Debug dump of fat tree info if (sm_config.ftreeRouting.debug) { for_all_physical_ports(switchp, swportp) { @@ -363,8 +366,69 @@ incr_lids_routed(Topology_t *topop, Node_t *switchp, int port) } } +static int +_compare_sysguids_then_guids(const void * arg1, const void * arg2) +{ + SwitchportToNextGuid_t * sport1 = (SwitchportToNextGuid_t *)arg1; + SwitchportToNextGuid_t * sport2 = (SwitchportToNextGuid_t *)arg2; + + if (sport1->sysGuid < sport2->sysGuid) + return -1; + else if (sport1->sysGuid > sport2->sysGuid) + return 1; + else if (sport1->guid < sport2->guid) + return -1; + else if (sport1->guid > sport2->guid) + return 1; + else + return 0; +} + +static int +_get_port_group(Topology_t *topop, Node_t *switchp, Node_t *nodep, uint8_t *portnos) +{ + int i, j; + int end_port = 0; + SwitchportToNextGuid_t *ordered_ports = (SwitchportToNextGuid_t *)topop->pad; + + IB_ENTER(__func__, switchp, nodep, 0, 0); + + memset((void*)portnos, 0xff, sizeof(uint8_t)*128); + + if (nodep->nodeInfo.NodeType != NI_TYPE_SWITCH) { + IB_EXIT(__func__, VSTATUS_OK); + return 0; + } + + i = switchp->swIdx; + j = nodep->swIdx; + + if (j == i) { + IB_EXIT(__func__, VSTATUS_OK); + return 0; + } + + memset(ordered_ports, 0, sizeof(SwitchportToNextGuid_t) * switchp->nodeInfo.NumPorts); + + end_port = topop->routingModule->funcs.select_ports(topop, switchp, j, ordered_ports, 0); + + qsort(ordered_ports, end_port, sizeof(SwitchportToNextGuid_t), _compare_sysguids_then_guids); + + for (i=0; i<end_port; i++) { + portnos[i] = ordered_ports[i].portp->index; + } + + if (portnos[0] == 0xff && smDebugPerf) { + IB_LOG_INFINI_INFO_FMT(__func__, "Failed to get portGroup from switch %s to switch %s", + sm_nodeDescString(switchp), sm_nodeDescString(nodep)); + } + + IB_EXIT(__func__, VSTATUS_OK); + return end_port; +} + static Status_t -_calculate_balanced_lfts_systematic(Topology_t *topop) +_calculate_balanced_lfts(Topology_t *topop) { Node_t *nodep, *switchp, *toSwitchp; Port_t *portp, *swPortp, *toSwitchPortp; @@ -382,7 +446,7 @@ _calculate_balanced_lfts_systematic(Topology_t *topop) if (smDebugPerf) { vs_time_get(&sTime); if (sm_config.ftreeRouting.debug) { - IB_LOG_INFINI_INFO0("entry"); + IB_LOG_INFINI_INFO0("_calculate_balanced_lfts:entry"); } } @@ -433,7 +497,9 @@ _calculate_balanced_lfts_systematic(Topology_t *topop) numPorts = 0; } else { // get a list of valid egress parts from switchp to toSwitchp. + // sort by system guid, then guid numPorts = topop->routingModule->funcs.get_port_group(topop, switchp, toSwitchp, portGroup); + if (!numPorts) continue; // portGroup will all be up or down per spine first routing. @@ -474,11 +540,21 @@ _calculate_balanced_lfts_systematic(Topology_t *topop) continue; } - if (sm_config.ftreeRouting.passthru) { - // try passthru + if (sm_config.ftreeRouting.converge && + sm_config.ftreeRouting.tierCount == 3 && t == 1 && isUp && r == 0) { + // Converge at top of tree - gives better dispersion down routing + // for 3 tier fat tree for pairwise traffic. + // Passthru/converge work well with compute traffic, fall back to + // original fat tree algorithm for route last device group. + switchp->lft[currentLid] = portGroup[toSwitchp->tierIndex % numPorts]; + + } else if (sm_config.ftreeRouting.passthru && r == 0) { + // Use passthru switchp->lft[currentLid] = portGroup[(i+pi+(t*toSwitchp->tierIndex)) % numPorts]; + } else if (isUp) { switchp->lft[currentLid] = portGroup[(i+upDestCount + switchp->tierIndex*switchp->uplinkTrunkCnt) % numPorts]; + } else { switchp->lft[currentLid] = portGroup[(i+downDestCount + switchp->tierIndex) % numPorts]; } @@ -550,7 +626,7 @@ _calculate_balanced_lfts_systematic(Topology_t *topop) vs_time_get(&eTime); IB_LOG_INFINI_INFO("END; elapsed time(usecs)=", (int)(eTime-sTime)); } else if (sm_config.ftreeRouting.debug) { - IB_LOG_INFINI_INFO0("_systematic:exit"); + IB_LOG_INFINI_INFO0("_calculate_balanced_lfts:exit"); } return VSTATUS_OK; @@ -736,7 +812,8 @@ _init_switch_lfts(Topology_t * topop, int * routing_needed, int * rebalance) if (topology_cost_path_changes || *rebalance || rebalanceGoodSweep) { // A topology change was indicated. Re-calculate lfts with big hammer (rebalance). - s = _calculate_balanced_lfts_systematic(topop); + s = _calculate_balanced_lfts(topop); + *rebalance = 1; *routing_needed = 1; routing_recalculated = 1; @@ -867,12 +944,22 @@ _calculate_balanced_lft(Topology_t *topop, Node_t *switchp) continue; } - if (sm_config.ftreeRouting.passthru) { - // try passthru + if (sm_config.ftreeRouting.converge && + sm_config.ftreeRouting.tierCount == 3 && switchp->tier == 2 && isUp && r == 0) { + // Converge at top of tree - gives better dispersion down routing + // for 3 tier fat tree for pairwise traffic. + // Passthru/converge work well with compute traffic, fall back to + // original fat tree algorithm for route last device group. + switchp->lft[currentLid] = portGroup[toSwitchp->tierIndex % numPorts]; + + } else if (sm_config.ftreeRouting.passthru && r == 0) { + // use passthru int tierAdjust = switchp->tier ? switchp->tier-1 : 0; switchp->lft[currentLid] = portGroup[(i+pi+(tierAdjust*toSwitchp->tierIndex)) % numPorts]; + } else if (isUp) { switchp->lft[currentLid] = portGroup[(i+upDestCount + switchp->tierIndex*switchp->uplinkTrunkCnt) % numPorts]; + } else { switchp->lft[currentLid] = portGroup[(i+downDestCount + switchp->tierIndex) % numPorts]; } @@ -939,6 +1026,7 @@ _make_fattree(RoutingModule_t * rm) rm->funcs.can_send_partial_routes = sm_routing_func_can_send_partial_routes_true; rm->funcs.init_switch_routing = _init_switch_lfts; rm->funcs.calculate_routes = _calculate_balanced_lft; + rm->funcs.get_port_group = _get_port_group; rm->funcs.post_process_discovery = _post_process_discovery; rm->funcs.do_spine_check = _do_spine_check; diff --git a/Esm/ib/src/smi/sm/sm_routing_funcs.c b/Esm/ib/src/smi/sm/sm_routing_funcs.c index eee629d..b090675 100644 --- a/Esm/ib/src/smi/sm/sm_routing_funcs.c +++ b/Esm/ib/src/smi/sm/sm_routing_funcs.c @@ -1162,6 +1162,7 @@ sm_routing_func_select_ports(Topology_t *topop, Node_t *switchp, int endIndex, S best_switchLidsRouted = next_nodep->numLidsRouted; ordered_ports[0].portp = portp; ordered_ports[0].guid = next_nodep->nodeInfo.NodeGUID; + ordered_ports[0].sysGuid = next_nodep->nodeInfo.SystemImageGUID; ordered_ports[0].nextSwp = next_nodep; end_port = 1; continue; @@ -1205,6 +1206,7 @@ sm_routing_func_select_ports(Topology_t *topop, Node_t *switchp, int endIndex, S ordered_ports[end_port].portp = portp; ordered_ports[end_port].guid = next_nodep->nodeInfo.NodeGUID; + ordered_ports[end_port].sysGuid = next_nodep->nodeInfo.SystemImageGUID; ordered_ports[end_port].nextSwp = next_nodep; ++end_port; } diff --git a/Esm/ib/src/smi/sm/sm_utility.c b/Esm/ib/src/smi/sm/sm_utility.c index ed930a8..7c3c391 100755 --- a/Esm/ib/src/smi/sm/sm_utility.c +++ b/Esm/ib/src/smi/sm/sm_utility.c @@ -9024,7 +9024,7 @@ sm_getLogConfigSettings(uint32_t * logLevel, uint32_t * logMode, #endif void -Switch_Enqueue_Type(Topology_t * topop, Node_t * nodep, int tier, int checkName) +Switch_Enqueue_Type(Topology_t * topop, Node_t * nodep, int tier, int checkName, int discoveryOrder) { Node_t *prevNodep = NULL; @@ -9051,6 +9051,15 @@ Switch_Enqueue_Type(Topology_t * topop, Node_t * nodep, int tier, int checkName) return; } + if (discoveryOrder) { + // tail[tier] + nodep->sw_next = NULL; + nodep->sw_prev = topop->tier_tail[tier]; + topop->tier_tail[tier]->sw_next = nodep; + topop->tier_tail[tier] = nodep; + return; + } + if (checkName) { for (c = 0; c < strlen(nodeDesc); c++) { if ((nodeDesc[c] >= '0') && (nodeDesc[c] <= '9')) { diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 4d03080..8855b95 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.7.0.0 -Release: 142%{?dist} +Release: 143%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
1b544275f8cbc9c97c6f6688615f5c6a8e35e161
01org/opa-fm
Update to latest from build 10.9.0.2.1
commit 1b544275f8cbc9c97c6f6688615f5c6a8e35e161 Author: Scott Breyer <[email protected]> Date: Tue Feb 5 13:11:30 2019 -0500 Update to latest from build 10.9.0.2.1 diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index ebb1c46..d325bcd 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -1220,10 +1220,6 @@ sub preinstall_intel_hfi($$) return preinstall_delta("intel_hfi", $install_list, $installing_list); } -my $irq_perm_string = "Set IrqBalance to Exact?"; -AddAnswerHelp("IrqBalance", "$irq_perm_string"); -my $Default_IrqBalance = 1; - sub install_intel_hfi($$) { my $install_list = shift(); # total that will be installed when done @@ -1232,27 +1228,6 @@ sub install_intel_hfi($$) print_comp_install_banner('intel_hfi'); setup_env("OPA_INSTALL_CALLER", 1); - # Adjust irqbalance - if ( -e "/etc/sysconfig/irqbalance" ) { - print "Intel strongly recommends that the irqbalance service be enabled\n"; - print "and run using the --hintpolicy=exact option.\n"; - $Default_IrqBalance = GetYesNoWithMemory("IrqBalance", 1, "$irq_perm_string", "y"); - if ( $Default_IrqBalance == 1 ) { - #set env variable so that RPM can do post install configuration of IRQBALANCE - # if opasystemconfig already exists, set it manually - if ( -f "/sbin/opasystemconfig" ) { - system("/sbin/opasystemconfig --enable Irq_Balance"); - } else { - setup_env("OPA_IRQBALANCE", 1); - } - } else { - if ( -f "/sbin/opasystemconfig" ) { - system("/sbin/opasystemconfig --disable Irq_Balance"); - } else { - setup_env("OPA_IRQBALANCE", 0); - } - } - } install_comp_rpms('intel_hfi', " -U --nodeps ", $install_list); need_reboot(); diff --git a/CommonInstall/util_linuxconfig.pl b/CommonInstall/util_linuxconfig.pl index 8a26d30..35a8e07 100755 --- a/CommonInstall/util_linuxconfig.pl +++ b/CommonInstall/util_linuxconfig.pl @@ -295,67 +295,4 @@ sub enable_mod_force_load($) } } -my $OPA_IRQBALANCE_FILE = "/etc/sysconfig/irqbalance"; -my $OPA_IRQBALANCE_BAK = "/etc/sysconfig/irqbalance.bak"; -sub set_opairqbalance() -{ - print "Updating $ROOT$OPA_IRQBALANCE_FILE\n"; - - # Look up the current arguments. Note that this may be an empty string. - my ($original_line) = `egrep -e '^IRQBALANCE_ARGS=' $ROOT$OPA_IRQBALANCE_FILE`; - chomp($original_line); - if ($original_line =~ /--hintpolicy=exact/ || $original_line =~ /-h exact/) { - # Already set to exact. No action is needed. - } else { - # Make a backup. - copy_data_file("$ROOT$OPA_IRQBALANCE_FILE", "$ROOT/$OPA_IRQBALANCE_BAK"); - - # Replace the existing hint policy with the new one. - my ($original_args) = $original_line; - $original_args =~ s/IRQBALANCE_ARGS=//; - $original_args =~ s/["']//g; - my ($new_args) = $original_args; - $new_args =~ s/--hintpolicy=[a-z]*//; - $new_args =~ s/-h [a-z]*//; - - $new_args = "$new_args --hintpolicy=exact"; - - if ($original_line eq "") { - # If there were no arguments in the existing file, just append. - open (OUTPUT, ">>$ROOT$OPA_IRQBALANCE_FILE"); - select (OUTPUT); - print "IRQBALANCE_ARGS=$new_args\n"; - select(STDOUT); - close(OUTPUT); - } else { - # Otherwise, rewrite the existing line. - open (INPUT, "$ROOT$OPA_IRQBALANCE_BAK"); - open (OUTPUT, ">$ROOT$OPA_IRQBALANCE_FILE"); - select (OUTPUT); - - while (($_=<INPUT>)) { - if (/^$original_line/) { - print "# $_"; - print "IRQBALANCE_ARGS=$new_args\n"; - } else { - print $_; - } - } - select(STDOUT); - - close (INPUT); - close (OUTPUT); - unlink("$ROOT$OPA_IRQBALANCE_BAK"); - } - } - - # Make sure irqbalance is enabled and started. - if (substr($CUR_OS_VER,0,3) eq "2.6") { - `/sbin/chkconfig irqbalance on; service irqbalance restart` - } - else { - `systemctl enable irqbalance; systemctl restart irqbalance` - } - -} diff --git a/Esm/build.env b/Esm/build.env index f987c4e..11695ce 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_0_0_204 +export RELEASE_TAG=10_9_0_2_1 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/build_label b/Esm/build_label index f3584fa..240fc66 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 11/13/18 00:29 Tag: VIEO_HOST_LINUX_opa-10_9_10_9_0_0_204 +Build of VIEO_HOST 02/05/19 11:43 Tag: VIEO_HOST_LINUX_opa-10_9_0_2_10_9_0_2_1 diff --git a/Esm/ib/src/smi/sm/sm_routing.c b/Esm/ib/src/smi/sm/sm_routing.c index 63869c3..652918a 100644 --- a/Esm/ib/src/smi/sm/sm_routing.c +++ b/Esm/ib/src/smi/sm/sm_routing.c @@ -343,7 +343,7 @@ sm_routing_route_old_switch(Topology_t *src_topop, Topology_t *dst_topop, Node_t if ((new_endnodesInUse.nset_m || src_topop->num_endports != dst_topop->num_endports) && dst_topop->routingModule->funcs.can_send_partial_routes() && - !dst_topop->routingModule->funcs.needs_routing_recalc) { + !dst_topop->routingModule->funcs.needs_routing_recalc(dst_topop, nodep)) { if (sm_config.sm_debug_routing) IB_LOG_INFINI_INFO_FMT(__func__, "Partial LFT send - switch %s", sm_nodeDescString(nodep)); sm_send_partial_lft(sm_topop, nodep, &sm_topop->deltaLidBlocks); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 021c5ce..9016299 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.0.0 -Release: 204%{?dist} +Version: 10.9.0.2 +Release: 1%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.0.0.204%{?dist} +IFSComponent: FM 10.9.0.2.1%{?dist} %prep %setup -q -c
0
ec1b6bfbfef7e4f8124437e7be41ce858616456a
01org/opa-fm
Update to latest from build 10.3.0.0.81 (FM 10.3.0.0.67)
commit ec1b6bfbfef7e4f8124437e7be41ce858616456a Author: Scott Breyer <[email protected]> Date: Wed Nov 16 17:16:34 2016 -0500 Update to latest from build 10.3.0.0.81 (FM 10.3.0.0.67) diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 8818af4..d1893aa 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -110,6 +110,54 @@ my @delta_components_rhel70 = ( my @delta_components_sles = ( @delta_components_other ); +my @delta_components_rhel70 = ( + "opa_stack", # Kernel drivers. + "ibacm", # OFA IB communication manager assistant. + "intel_hfi", # HFI drivers + "delta_ipoib", # ipoib module. + "mpi_selector", + "mvapich2", + "openmpi", + "gasnet", + "openshmem", + "opa_stack_dev", # dev libraries. + "delta_mpisrc", # Source bundle for MPIs. + "mpiRest", # PGI, Intel mpi variants. + "delta_debug", # must be last real component +); + +my @delta_components_sles12_sp2 = ( + "opa_stack", # Kernel drivers. + "intel_hfi", # HFI drivers + "delta_ipoib", # ipoib module. + "mpi_selector", + "mvapich2", + "openmpi", + "gasnet", + "openshmem", + "opa_stack_dev", # dev libraries. + "delta_mpisrc", # Source bundle for MPIs. + "mpiRest", # PGI, Intel mpi variants. + "hfi1_uefi", + "delta_debug", # must be last real component +); + +my @delta_components_rhel73 = ( + "opa_stack", # Kernel drivers. + "intel_hfi", # HFI drivers + "delta_ipoib", # ipoib module. + "mpi_selector", + "mvapich2", + "openmpi", + "gasnet", + "openshmem", + "opa_stack_dev", # dev libraries. + "delta_mpisrc", # Source bundle for MPIs. + "mpiRest", # PGI, Intel mpi variants. + "hfi1_uefi", + "delta_debug", # must be last real component +); + my @delta_components = ( ); @@ -166,6 +214,40 @@ my %intel_hfi_comp_info = ( }, ); +my %intel_hfi_sles12_sp2_comp_info = ( + 'intel_hfi' => { + KernelRpms => [ ], + UserRpms => [ "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "hfi1-diagtools-sw", "hfidiags", + "hfi1-firmware", "hfi1-firmware_debug" + ], + DebugRpms => [ "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo" + ], + Drivers => "", + StartupScript => "", + StartupParams => [ ], + }, +); + +my %intel_hfi_rhel73_comp_info = ( + 'intel_hfi' => { + KernelRpms => [ ], + UserRpms => [ "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "hfi1-diagtools-sw", "hfidiags", + "hfi1-firmware", "hfi1-firmware_debug" + ], + DebugRpms => [ "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo" + ], + Drivers => "", + StartupScript => "", + StartupParams => [ ], + }, +); + my %ib_wfr_lite_comp_info = ( 'ib_wfr_lite' => { KernelRpms => [ ], @@ -274,8 +356,30 @@ my %opa_stack_dev_rhel70_comp_info = ( my %opa_stack_dev_rhel72_comp_info = ( 'opa_stack_dev' => { - KernelRpms => [ "ifs-kernel-updates-devel" ], - UserRpms => [ "ibacm-devel" ], + KernelRpms => [ ], + UserRpms => [ "ifs-kernel-updates-devel", "ibacm-devel" ], + DebugRpms => [ ], + Drivers => "", # none + StartupScript => "", + StartupParams => [ ], + }, +); + +my %opa_stack_dev_sles12_sp2_comp_info = ( + 'opa_stack_dev' => { + KernelRpms => [ ], + UserRpms => [ "ifs-kernel-updates-devel" ], + DebugRpms => [ ], + Drivers => "", # none + StartupScript => "", + StartupParams => [ ], + }, +); + +my %opa_stack_dev_rhel73_comp_info = ( + 'opa_stack_dev' => { + KernelRpms => [ ], + UserRpms => [ ], DebugRpms => [ ], Drivers => "", # none StartupScript => "", @@ -359,7 +463,7 @@ my %opa_stack_other_comp_info = ( my %opa_stack_rhel72_comp_info = ( 'opa_stack' => { - KernelRpms => [ "ifs-kernel-updates" ], # special case + KernelRpms => [ "kmod-ifs-kernel-updates" ], # special case UserRpms => [ "opa-scripts", "srptools", ], @@ -405,6 +509,28 @@ my %opa_stack_sles_comp_info = ( }, ); +my %opa_stack_sles12_sp2_comp_info = ( + 'opa_stack' => { + KernelRpms => [ "ifs-kernel-updates-kmp-default" ], # special case + UserRpms => [ "opa-scripts" ], + DebugRpms => [ ], + Drivers => "", + StartupScript => "opa", + StartupParams => [ "ARPTABLE_TUNING" ], + }, +); + +my %opa_stack_rhel73_comp_info = ( + 'opa_stack' => { + KernelRpms => [ "kmod-ifs-kernel-updates" ], # special case + UserRpms => [ "opa-scripts" ], + DebugRpms => [ ], + Drivers => "", + StartupScript => "opa", + StartupParams => [ "ARPTABLE_TUNING" ], + }, +); + my %delta_comp_info_other = ( %opa_stack_other_comp_info, %ibacm_comp_info, @@ -476,6 +602,39 @@ my %delta_comp_info_sles = ( %delta_debug_comp_info, ); +my %delta_comp_info_sles12_sp2 = ( + %opa_stack_sles12_sp2_comp_info, + %intel_hfi_sles12_sp2_comp_info, + %ib_wfr_lite_comp_info, + %delta_ipoib_comp_info, + %mpi_selector_comp_info, + %mvapich2_comp_info, + %openmpi_comp_info, + %gasnet_comp_info, + %openshmem_comp_info, + %opa_stack_dev_sles12_sp2_comp_info, + %delta_mpisrc_comp_info, + %mpiRest_comp_info, + %hfi1_uefi_comp_info, + %delta_debug_comp_info, +); + +my %delta_comp_info_rhel73 = ( + %opa_stack_rhel73_comp_info, + %intel_hfi_rhel73_comp_info, + %ib_wfr_lite_comp_info, + %delta_ipoib_comp_info, + %mpi_selector_comp_info, + %mvapich2_comp_info, + %openmpi_comp_info, + %gasnet_comp_info, + %openshmem_comp_info, + %delta_mpisrc_comp_info, + %mpiRest_comp_info, + %hfi1_uefi_comp_info, + %delta_debug_comp_info, +); + my %delta_comp_info = ( ); # options for building compat-rdma srpm and what platforms they @@ -490,9 +649,11 @@ my %delta_kernel_ib_options = ( # all kernel srpms # these are in the order we must build/process them to meet basic dependencies my @delta_kernel_srpms_other = ( 'compat-rdma' ); -my @delta_kernel_srpms_rhel72 = ( 'ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel72 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel70 = ( 'compat-rdma' ); my @delta_kernel_srpms_sles = ( 'compat-rdma' ); +my @delta_kernel_srpms_sles12_sp2 = ( 'ifs-kernel-updates-kmp-default' ); +my @delta_kernel_srpms_rhel73 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # all user space srpms @@ -521,6 +682,18 @@ my @delta_user_srpms_sles = ( "mvapich2", "openmpi", "gasnet", "openshmem", "openshmem-test-suite", "shmem-benchmarks", "srptools", "libibmad5", "infiniband-diags", "hfi1_uefi" ); +my @delta_user_srpms_sles12_sp2 = ( + "opa-scripts", "mpi-selector", + "libpsm2", "hfi1-diagtools-sw", "hfidiags", "hfi1-firmware", "hfi1-firmware_debug", + "mvapich2", "openmpi", "gasnet", "openshmem", "openshmem-test-suite", + "shmem-benchmarks", "hfi1_uefi" +); +my @delta_user_srpms_rhel73 = ( + "opa-scripts", "mpi-selector", + "libpsm2", "hfi1-diagtools-sw", "hfidiags", "hfi1-firmware", "hfi1-firmware_debug", + "mvapich2", "openmpi", "gasnet", "openshmem", "openshmem-test-suite", + "shmem-benchmarks", "hfi1_uefi" +); my @delta_user_srpms = ( ); # rpms not presently automatically built @@ -773,9 +946,18 @@ my %hfi1_uefi_srpm_info = ( }, ); -my %ifs_kernel_updates_rhel72_srpm_info = ( - "ifs-kernel-updates" => { Available => "", - Builds => "ifs-kernel-updates ifs-kernel-updates-devel", +my %kmp_ifs_kernel_updates_srpm_info = ( + "ifs-kernel-updates-kmp-default" => { Available => "", + Builds => "ifs-kernel-updates-kmp-default ifs-kernel-updates-devel", + PostReq => "ifs-kernel-updates-devel", + PartOf => "", # filled in at runtime + BuildPrereq => [], + }, +); + +my %kmod_ifs_kernel_updates_srpm_info = ( + "kmod-ifs-kernel-updates" => { Available => "", + Builds => "kmod-ifs-kernel-updates ifs-kernel-updates-devel", PostReq => "ifs-kernel-updates-devel", PartOf => "", # filled in at runtime BuildPrereq => [], @@ -808,7 +990,7 @@ my %delta_srpm_info_other = ( ); my %delta_srpm_info_rhel72 = ( - %ifs_kernel_updates_rhel72_srpm_info, + %kmod_ifs_kernel_updates_srpm_info, %hfi1_psm_srpm_info, %libhfi1_srpm_info, %hfi1_diagtools_sw_srpm_info, @@ -881,6 +1063,43 @@ my %delta_srpm_info_sles = ( %hfi1_uefi_srpm_info, ); +my %delta_srpm_info_sles12_sp2 = ( + %kmp_ifs_kernel_updates_srpm_info, + %hfi1_psm_srpm_info, + %hfi1_diagtools_sw_srpm_info, + %hfidiags_srpm_info, + %hfi1_firmware_srpm_info, + %hfi1_firmware_debug_srpm_info, + %opa_scripts_srpm_info, + %mpi_selector_srpm_info, + %mvapich2_srpm_info, + %openmpi_srpm_info, + %gasnet_srpm_info, + %openshmem_srpm_info, + %openshmem_test_suite_srpm_info, + %shmem_benchmarks_srpm_info, + %infiniband_diags_srpm_info, + %hfi1_uefi_srpm_info, +); + +my %delta_srpm_info_rhel73 = ( + %kmod_ifs_kernel_updates_srpm_info, + %hfi1_psm_srpm_info, + %hfi1_diagtools_sw_srpm_info, + %hfidiags_srpm_info, + %hfi1_firmware_srpm_info, + %hfi1_firmware_debug_srpm_info, + %opa_scripts_srpm_info, + %mpi_selector_srpm_info, + %mvapich2_srpm_info, + %openmpi_srpm_info, + %gasnet_srpm_info, + %openshmem_srpm_info, + %openshmem_test_suite_srpm_info, + %shmem_benchmarks_srpm_info, + %infiniband_diags_srpm_info, + %hfi1_uefi_srpm_info, +); my %delta_srpm_info = ( ); @@ -931,6 +1150,19 @@ sub init_delta_rpm_info($) @delta_kernel_srpms = ( @delta_kernel_srpms_sles ); @delta_user_srpms = ( @delta_user_srpms_sles ); %delta_srpm_info = ( %delta_srpm_info_sles ); + } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' + && "$CUR_VENDOR_VER" eq 'ES122') { + @delta_components = ( @delta_components_sles12_sp2 ); + %delta_comp_info = ( %delta_comp_info_sles12_sp2 ); + @delta_kernel_srpms = ( @delta_kernel_srpms_sles12_sp2 ); + @delta_user_srpms = ( @delta_user_srpms_sles12_sp2 ); + %delta_srpm_info = ( %delta_srpm_info_sles12_sp2 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES73" ) { + @delta_components = ( @delta_components_rhel73 ); + %delta_comp_info = ( %delta_comp_info_rhel73 ); + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel73 ); + @delta_user_srpms = ( @delta_user_srpms_rhel73 ); + %delta_srpm_info = ( %delta_srpm_info_rhel73 ); } elsif ( "$CUR_VENDOR_VER" eq "ES72" ) { @delta_components = ( @delta_components_rhel72 ); %delta_comp_info = ( %delta_comp_info_rhel72 ); @@ -1090,8 +1322,8 @@ sub delta_rpm_install_list($$$@) { if ($delta_rpm_info{$package}{'Available'} ) { if ( "$delta_rpm_info{$package}{'Mode'}" eq "kernel" ) { - if ( "$CUR_VENDOR_VER" eq "ES72" ) { - if ( " $package " =~ / ifs-kernel-updates / ) { + if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" || "$CUR_VENDOR_VER" eq "ES122" ) { + if ( $package =~ /ifs-kernel-updates/ ) { next if ( $skip_kernelib); $ret = 1; } @@ -1420,6 +1652,10 @@ sub build_srpm($$$$$) $SRC_RPM = delta_srpm_file($srcdir, "libibmad-*.src.rpm"); } elsif ("$srpm" eq "openshmem") { $SRC_RPM = delta_srpm_file($srcdir, "${srpm}_*.src.rpm"); + } elsif ("$srpm" eq "kmod-ifs-kernel-updates") { + $SRC_RPM = delta_srpm_file($srcdir, "ifs-kernel-updates*.src.rpm"); + } elsif ("$srpm" eq "ifs-kernel-updates-kmp-default") { + $SRC_RPM = delta_srpm_file($srcdir, "ifs-kernel-updates*.src.rpm"); } # convert a few variables into the names used in OFED's build_rpm @@ -2363,9 +2599,12 @@ sub available_opa_stack() sub installed_delta_opa_stack() { my $driver_subdir=$ComponentInfo{'opa_stack'}{'DriverSubdir'}; - if ( "$CUR_VENDOR_VER" eq "ES72" ) { + if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" ) { + return ( -e "$ROOT$BASE_DIR/version_delta" + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq 'ES122' ) { return ( -e "$ROOT$BASE_DIR/version_delta" - && rpm_is_installed("ifs-kernel-updates", $CUR_OS_VER)); + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq 'ES12' || "$CUR_VENDOR_VER" eq 'ES121' ) { return (rpm_is_installed("libibumad3", "user") && -e "$ROOT$BASE_DIR/version_delta" @@ -2628,10 +2867,14 @@ sub available_intel_hfi() sub installed_intel_hfi() { my $driver_subdir=$ComponentInfo{'intel_hfi'}{'DriverSubdir'}; - if ( "$CUR_VENDOR_VER" eq "ES72" ) { + if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" ) { return (rpm_is_installed("libhfi1", "user") && -e "$ROOT$BASE_DIR/version_delta" - && rpm_is_installed("ifs-kernel-updates", $CUR_OS_VER)); + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES122" ) { + return (rpm_is_installed("libhfi1verbs-rdmav2", "user") + && -e "$ROOT$BASE_DIR/version_delta" + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } else { return (rpm_is_installed("libhfi1", "user") && -e "$ROOT$BASE_DIR/version_delta" @@ -2985,9 +3228,12 @@ sub available_delta_ipoib() sub installed_delta_ipoib() { my $driver_subdir=$ComponentInfo{'delta_ipoib'}{'DriverSubdir'}; - if ( "$CUR_VENDOR_VER" eq "ES72" ) { + if ( "$CUR_VENDOR_VER" eq "ES72" || "$CUR_VENDOR_VER" eq "ES73" ) { + return ((-e "$ROOT$BASE_DIR/version_delta" + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER))); + } elsif ( "$CUR_VENDOR_VER" eq "ES122" ) { return ((-e "$ROOT$BASE_DIR/version_delta" - && rpm_is_installed("ifs-kernel-updates", $CUR_OS_VER))); + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER))); } else { return ((-e "$ROOT$BASE_DIR/version_delta" && rpm_is_installed("compat-rdma", $CUR_OS_VER))); diff --git a/CommonInstall/limits.conf.SuSE.ES122 b/CommonInstall/limits.conf.SuSE.ES122 new file mode 100644 index 0000000..97ec4a3 --- /dev/null +++ b/CommonInstall/limits.conf.SuSE.ES122 @@ -0,0 +1,9 @@ +# -- All OPA Settings Start here -- +# [ICS VERSION STRING: unknown] +# User space Infiniband verbs require memlock permissions +# if desired you can limit these permissions to the users permitted to use OPA +# and/or reduce the limits. Keep in mind this limit is per user +# (not per process) +* hard memlock unlimited +* soft memlock unlimited +# -- All OPA Settings End here -- diff --git a/CommonInstall/limits.conf.redhat.ES73 b/CommonInstall/limits.conf.redhat.ES73 new file mode 100644 index 0000000..97ec4a3 --- /dev/null +++ b/CommonInstall/limits.conf.redhat.ES73 @@ -0,0 +1,9 @@ +# -- All OPA Settings Start here -- +# [ICS VERSION STRING: unknown] +# User space Infiniband verbs require memlock permissions +# if desired you can limit these permissions to the users permitted to use OPA +# and/or reduce the limits. Keep in mind this limit is per user +# (not per process) +* hard memlock unlimited +* soft memlock unlimited +# -- All OPA Settings End here -- diff --git a/CommonInstall/main_delta.pl b/CommonInstall/main_delta.pl index ca0a91e..65f7bd9 100755 --- a/CommonInstall/main_delta.pl +++ b/CommonInstall/main_delta.pl @@ -69,6 +69,14 @@ my @Components_rhel72 = ( "opa_stack", "ibacm", "intel_hfi", "mpi_selector", "delta_mpisrc", "hfi1_uefi", "delta_debug", ); +my @Components_sles12_sp2 = ( "opa_stack", "intel_hfi", "mpi_selector", + "delta_ipoib", + "opa_stack_dev", + "gasnet", "openshmem", + "mvapich2", "openmpi", + "delta_mpisrc", + "hfi1_uefi", + "delta_debug", ); @Components = ( ); # delta_debug must be last @@ -390,6 +398,130 @@ my %ComponentInfo_rhel72 = ( }, ); +my %ComponentInfo_sles12_sp2 = ( + # our special WrapperComponent, limited use + "opa_config_delta" => { Name => "opa_config_delta", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => "", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opa_stack" => { Name => "OFA OPA Stack", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "updates", + PreReq => "", CoReq => "", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => "", + StartComponents => [ "opa_stack" ], + }, + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => "", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + }, + "mpi_selector" => { Name => "MPI selector", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 1, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "delta_ipoib" => { Name => "OFA IP over IB", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "delta_ipoib" ], + }, + "mvapich2" => { Name => "MVAPICH2 (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => ".", DriverSubdir => "", + PreReq => " intel_hfi opa_stack mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi" => { Name => "OpenMPI (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => ".", DriverSubdir => "", + PreReq => " intel_hfi opa_stack mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "gasnet" => { Name => "Gasnet HFI (gcc)", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " intel_hfi opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openshmem" => { Name => "OpenSHMEM HFI (gcc)", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " intel_hfi opa_stack gasnet", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opa_stack_dev" => { Name => "OFA OPA Development", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "delta_mpisrc" =>{ Name => "MPI Source", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack opa_stack_dev mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "delta_debug" =>{ Name => "OFA Debug Info", + DefaultInstall => $State_DoNotInstall, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "hfi1_uefi" => { Name => "Pre-Boot Components", + DefaultInstall => $State_DoNotInstall, + SrcDir => ".", DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + ); + + %ComponentInfo = ( ); # translate from startup script name to component/subcomponent name @@ -419,6 +551,9 @@ sub init_components if ( "$CUR_VENDOR_VER" eq "ES72" ) { @Components = ( @Components_rhel72 ); %ComponentInfo = ( %ComponentInfo_rhel72 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES122" ) { + @Components = ( @Components_sles12_sp2 ); + %ComponentInfo = ( %ComponentInfo_sles12_sp2 ); } else { @Components = ( @Components_other ); %ComponentInfo = ( %ComponentInfo_other ); diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 1a20d95..9f8d9c8 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -74,6 +74,20 @@ my @Components_rhel72 = ( "opa_stack", "ibacm", "mpi_selector", "intel_hfi", "gasnet", "openshmem", "mvapich2", "openmpi", "delta_mpisrc", "hfi1_uefi", "delta_debug", ); +my @Components_sles12_sp2 = ( "opa_stack", "mpi_selector", "intel_hfi", + "oftools", "opa_stack_dev", "fastfabric", + "delta_ipoib", "opafm", + @OmniPathAllComponents, + "gasnet", "openshmem", + "mvapich2", "openmpi", + "delta_mpisrc", "hfi1_uefi", "delta_debug", ); +my @Components_rhel73 = ( "opa_stack", "mpi_selector", "intel_hfi", + "oftools", "opa_stack_dev", "fastfabric", + "delta_ipoib", "opafm", + @OmniPathAllComponents, + "gasnet", "openshmem", + "mvapich2", "openmpi", + "delta_mpisrc", "hfi1_uefi", "delta_debug", ); @Components = ( ); # delta_debug must be last @@ -571,6 +585,425 @@ my %ComponentInfo_rhel72 = ( }, ); +my %ComponentInfo_sles12_sp2 = ( + # our special WrapperComponent, limited use + "opaconfig" => { Name => "opaconfig", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => "", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, + StartPreReq => "", + StartComponents => [ ], + }, + # "ofed" is only used for source_comp + "ofed_delta" => { Name => "OFA_DELTA", + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + }, + "opa_stack" => { Name => "OFA OPA Stack", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => "", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => "", + StartComponents => [ "opa_stack" ], + }, + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + }, + "oftools" => { Name => "OPA Tools", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-Tools*.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => " opa_stack ", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", # TBD + StartComponents => [ ], + }, + "mpi_selector" => { Name => "MPI selector", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 1, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opa_stack_dev" => { Name => "OFA OPA Development", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "fastfabric" => { Name => "FastFabric", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-Tools*.*"), + DriverSubdir => "", + PreReq => " opa_stack oftools ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + StartComponents => [ ], + }, + "delta_ipoib" => { Name => "OFA IP over IB", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "delta_ipoib" ], + }, + "mvapich2" => { Name => "MVAPICH2 (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack mpi_selector intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi" => { Name => "OpenMPI (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack mpi_selector intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "gasnet" => { Name => "GASNet (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openshmem" => { Name => "OpenSHMEM (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack gasnet intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "mvapich2_gcc_hfi" => { Name => "MVAPICH2 (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "mvapich2_intel_hfi" => { Name => "MVAPICH2 (hfi,Intel)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi_gcc_hfi" => { Name => "OpenMPI (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi_intel_hfi" => { Name => "OpenMPI (hfi,Intel)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "delta_mpisrc" =>{ Name => "MPI Source", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack opa_stack_dev mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opafm" => { Name => "OPA FM", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-FM.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + #StartComponents => [ "qlgc_fm", "qlgc_fm_snmp"], + StartComponents => [ "opafm" ], + }, + "delta_debug" => { Name => "OFA Debug Info", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "hfi1_uefi" => { Name => "Pre-Boot Components", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + ); +my %ComponentInfo_rhel73 = ( + # our special WrapperComponent, limited use + "opaconfig" => { Name => "opaconfig", + DefaultInstall => $State_Install, + SrcDir => ".", DriverSubdir => "", + PreReq => "", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, + StartPreReq => "", + StartComponents => [ ], + }, + # "ofed" is only used for source_comp + "ofed_delta" => { Name => "OFA_DELTA", + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + }, + "opa_stack" => { Name => "OFA OPA Stack", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => "", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => "", + StartComponents => [ "opa_stack" ], + }, + "intel_hfi" => { Name => "Intel HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + }, + "oftools" => { Name => "OPA Tools", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-Tools*.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => " opa_stack ", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", # TBD + StartComponents => [ ], + }, + "mpi_selector" => { Name => "MPI selector", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 1, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opa_stack_dev" => { Name => "OFA OPA Development", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "fastfabric" => { Name => "FastFabric", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-Tools*.*"), + DriverSubdir => "", + PreReq => " opa_stack oftools ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + StartComponents => [ ], + }, + "delta_ipoib" => { Name => "OFA IP over IB", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "updates", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "delta_ipoib" ], + }, + "mvapich2" => { Name => "MVAPICH2 (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack mpi_selector intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi" => { Name => "OpenMPI (verbs,gcc)", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack mpi_selector intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "gasnet" => { Name => "GASNet (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openshmem" => { Name => "OpenSHMEM (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack gasnet intel_hfi ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "mvapich2_gcc_hfi" => { Name => "MVAPICH2 (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "mvapich2_intel_hfi" => { Name => "MVAPICH2 (hfi,Intel)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi_gcc_hfi" => { Name => "OpenMPI (hfi,gcc)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "openmpi_intel_hfi" => { Name => "OpenMPI (hfi,Intel)", + DefaultInstall => $State_Install, + SrcDir => file_glob ("./OFED_MPIS.*"), + DriverSubdir => "", + PreReq => " opa_stack intel_hfi mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "delta_mpisrc" =>{ Name => "MPI Source", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack opa_stack_dev mpi_selector ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "opafm" => { Name => "OPA FM", + DefaultInstall => $State_Install, + SrcDir => file_glob("./IntelOPA-FM.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 1, HasFirmware => 0, DefaultStart => 0, + StartPreReq => " opa_stack ", + #StartComponents => [ "qlgc_fm", "qlgc_fm_snmp"], + StartComponents => [ "opafm" ], + }, + "delta_debug" => { Name => "OFA Debug Info", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + "hfi1_uefi" => { Name => "Pre-Boot Components", + DefaultInstall => $State_DoNotInstall, + SrcDir => file_glob("./IntelOPA-OFED_DELTA.*"), + DriverSubdir => "", + PreReq => " opa_stack ", CoReq => "", + Hidden => 0, Disabled => 0, + HasStart => 0, HasFirmware => 0, DefaultStart => 0, + StartPreReq => "", + StartComponents => [ ], + }, + ); + %ComponentInfo = ( ); # translate from startup script name to component/subcomponent name @@ -604,6 +1037,12 @@ sub init_components if ( "$CUR_VENDOR_VER" eq "ES72" ) { @Components = ( @Components_rhel72 ); %ComponentInfo = ( %ComponentInfo_rhel72 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES122" ) { + @Components = ( @Components_sles12_sp2 ); + %ComponentInfo = ( %ComponentInfo_sles12_sp2 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES73" ) { + @Components = ( @Components_rhel73 ); + %ComponentInfo = ( %ComponentInfo_rhel73 ); } else { @Components = ( @Components_other ); %ComponentInfo = ( %ComponentInfo_other ); diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index 2ea9fdc..e42cf03 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -320,7 +320,7 @@ sub rpm_check_os_prereqs_internal($$@) # TBD - openSUSE has libstdc++42 # TBD - openSUSE11.2 has libstdc++44 } elsif ("$package" eq "libstdc++" && "$CUR_DISTRO_VENDOR" eq 'SuSE' - && ("$CUR_VENDOR_VER" eq 'ES12' || "$CUR_VENDOR_VER" eq 'ES121')) { + && ("$CUR_VENDOR_VER" eq 'ES12' || "$CUR_VENDOR_VER" eq 'ES121' || "$CUR_VENDOR_VER" eq 'ES122')) { $package="libstdc++6"; } elsif ("$package" eq "libstdc++-devel" && "$CUR_DISTRO_VENDOR" eq 'SuSE' && "$CUR_VENDOR_VER" eq 'ES11') { @@ -720,8 +720,13 @@ sub rpm_resolve($$$) } else { my $osver = rpm_tr_os_version("$mode"); # OS version # we expect 1 match, ignore all other filenames returned - DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm\n"); - $rpmfile = file_glob("$rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm"); + if ( "$CUR_VENDOR_VER" eq 'ES122' ) { + DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-${osver}_k*.${cpu}.rpm\n"); + $rpmfile = file_glob("$rpmdir/${package}-${osver}_k*.${cpu}.rpm"); + } else { + DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm\n"); + $rpmfile = file_glob("$rpmdir/${package}-[0-9]*.[0-9][0-9].${osver}-[0-9]*.${cpu}.rpm"); + } if ( "$rpmfile" eq "" || ! -e "$rpmfile" ) { DebugPrint("Checking for Kernel Rpm: $rpmdir/${package}-${osver}-[0-9]*.${cpu}.rpm\n"); $rpmfile = file_glob("$rpmdir/${package}-${osver}-[0-9]*.${cpu}.rpm"); diff --git a/Esm/build.env b/Esm/build.env index 37551f7..8e9a739 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_3_0_0_56 +export RELEASE_TAG=10_3_0_0_67 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/build_label b/Esm/build_label index da4696e..27f63cd 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 09/22/16 00:24 Tag: VIEO_HOST_LINUX_stl1-branch_10_3_0_0_56 +Build of VIEO_HOST 11/01/16 10:04 Tag: VIEO_HOST_LINUX_opa-10_3_10_3_0_0_67 diff --git a/Esm/ib/src/linux/startup/opafmd.c b/Esm/ib/src/linux/startup/opafmd.c index 6f9b11f..d7e7910 100644 --- a/Esm/ib/src/linux/startup/opafmd.c +++ b/Esm/ib/src/linux/startup/opafmd.c @@ -329,7 +329,7 @@ int parseInput(char *buf){ } thread->instance = i; thread->component = c; - pthread_create(&thread_id[c], NULL, &kill_thread, thread); + pthread_create(&thread_id[i*FM_NUM_COMPONENTS+c], NULL, &kill_thread, thread); } } for(i = 0; i < FM_MAX_INSTANCES; ++i){ diff --git a/Esm/ib/src/pm/pm/pm_dispatch.c b/Esm/ib/src/pm/pm/pm_dispatch.c index d6834ec..39c490d 100644 --- a/Esm/ib/src/pm/pm/pm_dispatch.c +++ b/Esm/ib/src/pm/pm/pm_dispatch.c @@ -1287,37 +1287,30 @@ nomerge: size_t CalculatePortInPacket(PmDispatcherNode_t *dispnode, PmDispatcherPacket_t *disppacket) { - uint8 NumVLs = 0; + uint8 NumVLs = 0; switch (dispnode->info.state) { case PM_DISP_NODE_NONE: return(-1); case PM_DISP_NODE_CLASS_INFO: return(-1); case PM_DISP_NODE_GET_DATACOUNTERS: - if (pm_config.process_vl_counters){ - if (disppacket->numPorts){ - NumVLs = disppacket->DispPorts[0].dispNodeSwPort->NumVLs; - } - else { - NumVLs = dispnode->info.nextPort->NumVLs; - } - } - if (dispnode->info.pmnodep->nodeType == STL_NODE_SW) - return( sizeof(struct _port_dpctrs)+(NumVLs-1)*sizeof(struct _vls_dpctrs) ); + if (pm_config.process_vl_counters) { + if (!disppacket->numVLs) + disppacket->numVLs = dispnode->info.nextPort->NumVLs; + NumVLs = disppacket->numVLs; + } + if (dispnode->info.pmnodep->nodeType == STL_NODE_SW) + return(sizeof(struct _port_dpctrs) + (NumVLs - 1) * sizeof(struct _vls_dpctrs)); else - return( sizeof(STL_PORT_STATUS_RSP)+(NumVLs-1)*sizeof(struct _vls_pctrs) ); + return(sizeof(STL_PORT_STATUS_RSP) + (NumVLs - 1) * sizeof(struct _vls_pctrs)); case PM_DISP_NODE_GET_ERRORCOUNTERS: - if (pm_config.process_vl_counters){ - if (disppacket->numPorts){ - NumVLs = disppacket->DispPorts[0].dispNodeSwPort->NumVLs; - } - else { - NumVLs = dispnode->info.nextPort->NumVLs; - } - } - return( sizeof(struct _port_epctrs)+(NumVLs-1)*sizeof(struct _vls_epctrs) ); + if (pm_config.process_vl_counters) { + if (!disppacket->numVLs) + disppacket->numVLs = dispnode->info.nextPort->NumVLs; + NumVLs = disppacket->numVLs; + } + return(sizeof(struct _port_epctrs) + (NumVLs - 1) * sizeof(struct _vls_epctrs)); case PM_DISP_NODE_CLR_PORT_STATUS: return(0); case PM_DISP_NODE_DONE: return(-1); - } return(-1); } diff --git a/Esm/ib/src/pm/pm/pm_topology.h b/Esm/ib/src/pm/pm/pm_topology.h index 42ae7f3..cdd9f3e 100644 --- a/Esm/ib/src/pm/pm/pm_topology.h +++ b/Esm/ib/src/pm/pm/pm_topology.h @@ -649,7 +649,8 @@ typedef struct PmDispatcherPort_s { typedef struct PmDispatcherPacket_s { uint64 PortSelectMask[4]; // Ports in Packet uint32 VLSelectMask; - uint8 numPorts; + uint8 numPorts; + uint8 numVLs; struct PmDispatcherNode_s *dispnode; // setup once at boot PmDispatcherPort_t *DispPorts; } PmDispatcherPacket_t; diff --git a/Esm/ib/src/smi/sm/sm_topology.c b/Esm/ib/src/smi/sm/sm_topology.c index a65ab39..2620fa4 100644 --- a/Esm/ib/src/smi/sm/sm_topology.c +++ b/Esm/ib/src/smi/sm/sm_topology.c @@ -1636,40 +1636,61 @@ unlock_bail: return(VSTATUS_BAD); } - // is the SM bit set? If not, our port went away, reinitialize. - // If we are an HFI, our neighbor is a switch, and MgmtAllowed is not set, reinitialize. - if (!(portp->portData->portInfo.CapabilityMask.AsReg32 & PI_CM_IS_SM) || - (nodep->nodeInfo.NodeType == NI_TYPE_CA && - portp->portData->portInfo.PortNeighborMode.NeighborNodeType == STL_NEIGH_NODE_TYPE_SW && - !portp->portData->portInfo.PortNeighborMode.MgmtAllowed)) { - - if (!(portp->portData->portInfo.CapabilityMask.AsReg32 & PI_CM_IS_SM)) { - IB_LOG_ERROR0("SM bit not set in capability mask"); - } else { - IB_LOG_ERROR0("MgmtAllowed bit not set in neighbor node."); - } + (void)memset((void *)portp->path, 0, 64); - do { - if (topology_main_exit == 1) { + // Make sure we still have permission to send SMAs. + do { + STL_PARTITION_TABLE pkeyTable = {{{0}}}; + + if(topology_main_exit) { #ifdef __VXWORKS__ - ESM_LOG_ESMINFO("topology_discovery: SM has been stopped", 0); - IB_EXIT(__func__, VSTATUS_OK); + ESM_LOG_ESMINFO("Topology Task exiting OK.", 0); #endif - return VSTATUS_OK; + return(VSTATUS_BAD); + } + + // Don't check the pkey table till we are in at least INIT state, + // because the pkeys might change during LNI. + status = SM_Get_PortInfo(fd_topology, (1<<24) | STL_SM_CONF_START_ATTR_MOD, portp->path, &(portp->portData->portInfo)); + + if (status != VSTATUS_OK) { + IB_LOG_ERRORRC("Can't get local PortInfo, status:", status); + vs_thread_sleep(5 * VTIMER_1S); + continue; + } else if (portp->portData->portInfo.PortStates.s.PortState < IB_PORT_INIT) { + IB_LOG_WARN_FMT(__func__, "Local port is not yet in INIT."); + status = VSTATUS_BAD; + vs_thread_sleep(5 * VTIMER_1S); + continue; + } + + status = SM_Get_PKeyTable(fd_topology, 1<<24, portp->path, &pkeyTable, 0); + + if ((status != VSTATUS_OK) || + (pkeyTable.PartitionTableBlock[STL_DEFAULT_FM_PKEY_IDX].AsReg16 != + STL_DEFAULT_FM_PKEY)) { + + if (status != VSTATUS_OK) { + IB_LOG_ERRORRC("Could not retrieve local PKey table. Status: ", status); + vs_thread_sleep(5 * VTIMER_1S); + continue; } - status = vs_wrlock(&old_topology_lock); - if (status != VSTATUS_OK) continue; - status = topology_initialize(); - (void)vs_rwunlock(&old_topology_lock); - } while (status != VSTATUS_OK); - sm_topop->routingModule->funcs.post_process_discovery(sm_topop, VSTATUS_BAD, routingContext); - if (portp->portData->portInfo.PortStates.s.PortState == IB_PORT_DOWN) { - IB_LOG_ERROR0("SM port state is down"); + + // Force the pkey. + IB_LOG_ERROR_FMT(__func__, + "FM Pkey 0x%x not present in the local Pkey table.", + STL_DEFAULT_FM_PKEY); + + // For 10.3 only. For 10.4 we need to rework how + // re-initialization of the local port is handled. + IB_LOG_WARN_FMT(__func__, + "Setting FM Pkey 0x%x in the local Pkey table.", + STL_DEFAULT_FM_PKEY); + status = sm_set_local_port_pkey(&nodep->nodeInfo); } - return VSTATUS_BAD; - } + } while (status != VSTATUS_OK); - (void)memset((void *)portp->path, 0, 64); + IB_LOG_INFO_FMT(__func__, "Local Port and PKey are okay."); /* * add ourselves to the SM list during first sweep diff --git a/IbaTools/FastFabric/opafastfabric.pl b/IbaTools/FastFabric/opafastfabric.pl index ac4b8e1..d3ae0f4 100755 --- a/IbaTools/FastFabric/opafastfabric.pl +++ b/IbaTools/FastFabric/opafastfabric.pl @@ -2456,7 +2456,7 @@ QUERY: if ( $query ) { goto QUERY; } - $FabricChassisPackages="$all_packages"; + $FabricChassisPackages="$packages"; $parallel=1; print "After push, the firmware may be optionally selected or booted\n"; if (GetYesNo("Would you like to run the firmware now?", "n") ) { @@ -2490,7 +2490,7 @@ QUERY: } } until (GetYesNo("Are you sure you want to proceed?", "n") ); if ( "$action" ne "skip" ) { - my $pathnames=expand_pathnames($FabricChassisPackages); + my $pathnames=expand_pathnames($all_packages); if ( $parallel ) { return run_fabric_cmd("$BIN_DIR/opachassisadmin $Sopt -F $FabricChassisFile -P '$pathnames' -a $action upgrade"); } else { @@ -3103,7 +3103,7 @@ sub ext_mgmt_sw_fwpush print "The following firmware files will be used:\n"; $all_packages =~ s/^/ /mg; print "$all_packages"; - $FabricExtMgmtSwPackages="$all_packages"; + $FabricExtMgmtSwPackages="$packages"; $parallel=1; print "After upgrade, the switch may be optionally rebooted\n"; if (GetYesNo("Would you like to reboot the switch after the update?", "n") ) { @@ -3142,7 +3142,7 @@ sub ext_mgmt_sw_fwpush } } until (GetYesNo("Are you sure you want to proceed?", "n") ); if ( "$action" ne "skip" ) { - my $pathnames=expand_pathnames($FabricExtMgmtSwPackages); + my $pathnames=expand_pathnames($all_packages); if ( $parallel ) { return run_fabric_cmd("$BIN_DIR/opaswitchadmin $Oopt -L $FabricExtMgmtSwFile -P '$pathnames' -a $action upgrade"); } else { diff --git a/opa-fm.spec b/opa-fm.spec index 4e552b6..1702b09 100644 --- a/opa-fm.spec +++ b/opa-fm.spec @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.3.0.0 -Release: 56%{?dist} +Release: 67%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
536c98a5d7c6c96509c8c8334d4ab1fbb21dfd0e
01org/opa-fm
Correct version in spec file
commit 536c98a5d7c6c96509c8c8334d4ab1fbb21dfd0e Author: Scott Breyer <[email protected]> Date: Thu Apr 22 11:35:24 2021 -0400 Correct version in spec file diff --git a/opa-fm.spec.in b/opa-fm.spec.in index a6b041c..d63f18f 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.10.3.0 -Release: 11%{?dist} +Version: 10.11.0.0 +Release: 574%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
5c42875b9e217127bc6fb537e258f386aed2a23a
01org/opa-fm
Fix well-known tempfile issue in script.
commit 5c42875b9e217127bc6fb537e258f386aed2a23a Author: Brendan Cunningham <[email protected]> Date: Thu Sep 24 11:10:45 2015 -0400 Fix well-known tempfile issue in script. diff --git a/Esm/ib/src/linux/startup/sm_capture.sh b/Esm/ib/src/linux/startup/sm_capture.sh index cf1e133..e3fbf4b 100755 --- a/Esm/ib/src/linux/startup/sm_capture.sh +++ b/Esm/ib/src/linux/startup/sm_capture.sh @@ -46,8 +46,10 @@ fi PROGNAME="$0" -dirName="smdump-"`date '+%d%b%y%H%M%S'` -dumpLocation="/tmp/$dirName" +# Hedge against bash vs. sh +dateStr=`date '+%d%b%y%H%M%S'` +dumpLocation="`mktemp -d /tmp/smdump-${dateStr}-XXXXXX`" +dirName=`basename $dumpLocation` usage() { echo "Usage:"
0
3bee63ead16ac385e00c671636ebd787d35e7358
01org/opa-fm
Update to latest from build 10.11.2.0.3 (OPXS 10.11.2.0.3)
commit 3bee63ead16ac385e00c671636ebd787d35e7358 Author: Greg Kresge <[email protected]> Date: Fri Sep 9 14:28:49 2022 -0400 Update to latest from build 10.11.2.0.3 (OPXS 10.11.2.0.3) diff --git a/CommonInstall/Makefile b/CommonInstall/Makefile index b2d8d85..9412fb2 100644 --- a/CommonInstall/Makefile +++ b/CommonInstall/Makefile @@ -105,12 +105,14 @@ CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL77.pl \ comp_ff_of_prereq_RHEL83.pl \ comp_ff_of_prereq_RHEL84.pl \ comp_ff_of_prereq_RHEL85.pl \ + comp_ff_of_prereq_RHEL86.pl \ comp_ff_of_prereq_SLES123.pl \ comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl \ comp_ff_of_prereq_SLES151.pl \ comp_ff_of_prereq_SLES152.pl \ comp_ff_of_prereq_SLES153.pl \ + comp_ff_of_prereq_SLES154.pl \ comp_fm_prereq_RHEL77.pl \ comp_fm_prereq_RHEL8.pl \ comp_fm_prereq_RHEL81.pl \ @@ -118,12 +120,14 @@ CLOBBER_TARGETS_MISC= comp_ff_of_prereq_RHEL77.pl \ comp_fm_prereq_RHEL83.pl \ comp_fm_prereq_RHEL84.pl \ comp_fm_prereq_RHEL85.pl \ + comp_fm_prereq_RHEL86.pl \ comp_fm_prereq_SLES123.pl \ comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl \ comp_fm_prereq_SLES151.pl \ comp_fm_prereq_SLES152.pl \ - comp_fm_prereq_SLES153.pl + comp_fm_prereq_SLES153.pl \ + comp_fm_prereq_SLES154.pl # sub-directory to install to within bin BIN_SUBDIR = # sub-directory to install to within include @@ -157,12 +161,14 @@ FF_FILES = comp_ff_of_prereq_RHEL77.pl \ comp_ff_of_prereq_RHEL83.pl \ comp_ff_of_prereq_RHEL84.pl \ comp_ff_of_prereq_RHEL85.pl \ + comp_ff_of_prereq_RHEL86.pl \ comp_ff_of_prereq_SLES123.pl \ comp_ff_of_prereq_SLES124.pl \ comp_ff_of_prereq_SLES15.pl \ comp_ff_of_prereq_SLES151.pl \ comp_ff_of_prereq_SLES152.pl \ - comp_ff_of_prereq_SLES153.pl + comp_ff_of_prereq_SLES153.pl \ + comp_ff_of_prereq_SLES154.pl FM_FILES = comp_fm_prereq_RHEL77.pl \ comp_fm_prereq_RHEL78.pl \ comp_fm_prereq_RHEL8.pl \ @@ -171,12 +177,14 @@ FM_FILES = comp_fm_prereq_RHEL77.pl \ comp_fm_prereq_RHEL83.pl \ comp_fm_prereq_RHEL84.pl \ comp_fm_prereq_RHEL85.pl \ + comp_fm_prereq_RHEL86.pl \ comp_fm_prereq_SLES123.pl \ comp_fm_prereq_SLES124.pl \ comp_fm_prereq_SLES15.pl \ comp_fm_prereq_SLES151.pl \ comp_fm_prereq_SLES152.pl \ - comp_fm_prereq_SLES153.pl + comp_fm_prereq_SLES153.pl \ + comp_fm_prereq_SLES154.pl # Include Make Rules definitions and rules include $(TL_DIR)/$(PROJ_FILE_DIR)/Makerules.project diff --git a/CommonInstall/comp_delta.pl b/CommonInstall/comp_delta.pl index 6f747ea..10119ea 100755 --- a/CommonInstall/comp_delta.pl +++ b/CommonInstall/comp_delta.pl @@ -79,6 +79,7 @@ my @delta_kernel_srpms_sles15 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15_sp1 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15_sp2 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_sles15_sp3 = ( 'ifs-kernel-updates-kmp-default' ); +my @delta_kernel_srpms_sles15_sp4 = ( 'ifs-kernel-updates-kmp-default' ); my @delta_kernel_srpms_rhel73 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel74 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel75 = ( 'kmod-ifs-kernel-updates' ); @@ -91,6 +92,7 @@ my @delta_kernel_srpms_rhel82 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel83 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel84 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms_rhel85 = ( 'kmod-ifs-kernel-updates' ); +my @delta_kernel_srpms_rhel86 = ( 'kmod-ifs-kernel-updates' ); my @delta_kernel_srpms = ( ); # This provides information for all kernel srpms @@ -171,12 +173,17 @@ sub init_delta_info($) } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' && "$CUR_VENDOR_VER" eq 'ES153') { @delta_kernel_srpms = ( @delta_kernel_srpms_sles15_sp3 ); + } elsif ("$CUR_DISTRO_VENDOR" eq 'SuSE' + && "$CUR_VENDOR_VER" eq 'ES154') { + @delta_kernel_srpms = ( @delta_kernel_srpms_sles15_sp4 ); } elsif ( "$CUR_VENDOR_VER" eq "ES74" ) { if ($HFI2_INSTALL) { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74_hfi2); } else { @delta_kernel_srpms = (@delta_kernel_srpms_rhel74); } + } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { + @delta_kernel_srpms = ( @delta_kernel_srpms_rhel86 ); } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { @delta_kernel_srpms = ( @delta_kernel_srpms_rhel85 ); } elsif ( "$CUR_VENDOR_VER" eq "ES84" ) { @@ -820,6 +827,9 @@ sub installed_delta_opa_stack() return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } + } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { + return ( has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { return ( has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); @@ -874,6 +884,9 @@ sub installed_delta_opa_stack() } elsif ( "$CUR_VENDOR_VER" eq 'ES153' ) { return ( has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq 'ES154' ) { + return ( has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } else { return 0; } @@ -1186,6 +1199,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { return (has_version_delta() && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { + return (has_version_delta() + && rpm_is_installed("kmod-ifs-kernel-updates", $CUR_OS_VER)); } elsif ( "$CUR_VENDOR_VER" eq "ES123" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); @@ -1207,6 +1223,9 @@ sub installed_intel_hfi() } elsif ( "$CUR_VENDOR_VER" eq "ES153" ) { return (has_version_delta() && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); + } elsif ( "$CUR_VENDOR_VER" eq "ES154" ) { + return (has_version_delta() + && rpm_is_installed("ifs-kernel-updates-kmp-default", $CUR_OS_VER)); } else { return 0; } diff --git a/CommonInstall/comp_delta_prereq_RHEL86.pl b/CommonInstall/comp_delta_prereq_RHEL86.pl new file mode 100644 index 0000000..6bd1756 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_RHEL86.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kernel", + "kmod", + "rdma-core", + "systemd", + "glibc", + "pciutils", + "opensm-libs", + "libibumad", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @mpi_selector_prereq = ( + "bash", + "coreutils", + "perl", + "perl-Getopt-Long", + "tcsh", +); +$comp_prereq_hash{'mpi_selector_prereq'} = \@mpi_selector_prereq; + +my @intel_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "python2", + "systemd", + "numactl-libs", + "irqbalance", + "libatomic", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs", + "librdmacm", + "glibc", + "zlib", + "sysfsutils", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "zlib", + "glibc", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "bash", + "glibc", + "libgcc", + "libgfortran", + "gcc-gfortran", + "libgomp", + "libibverbs", + "libquadmath", + "librdmacm", + "libstdc++", + "libstdc++-devel", + "opensm-libs", + "pkgconf", + "zlib", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; diff --git a/CommonInstall/comp_delta_prereq_SLES154.pl b/CommonInstall/comp_delta_prereq_SLES154.pl new file mode 100644 index 0000000..db10421 --- /dev/null +++ b/CommonInstall/comp_delta_prereq_SLES154.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020-2021, Cornelis Networks +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for delta components +my @opa_stack_prereq = ( + "bash", + "kmod", + "rdma-core", + "rdma-ndd", + "systemd", + "coreutils", + "grep", + "libosmcomp5", + "libibmad5", + "libibumad3", + "rdma-core-devel", +); +$comp_prereq_hash{'opa_stack_prereq'} = \@opa_stack_prereq; + +my @intel_hfi_prereq = ( + "glibc", + "libgcc_s1", + "bash", + "udev", + "systemd-devel", + "python3-base", + "libedit0", + "libncurses6", + "libnuma1", + "irqbalance", + "libatomic1", +); +$comp_prereq_hash{'intel_hfi_prereq'} = \@intel_hfi_prereq; + +my @mvapich2_gcc_hfi_prereq = ( + "bash", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_gcc_hfi_prereq'} = \@mvapich2_gcc_hfi_prereq; + +my @mvapich2_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_intel_hfi_prereq'} = \@mvapich2_intel_hfi_prereq; + +my @openmpi_gcc_hfi_prereq = ( + "glibc", + "bash", + "pkg-config", + "libgcc_s1", + "libgfortran4", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_gcc_hfi_prereq'} = \@openmpi_gcc_hfi_prereq; + +my @openmpi_intel_hfi_prereq = ( + "bash", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_intel_hfi_prereq'} = \@openmpi_intel_hfi_prereq; + +my @mvapich2_prereq = ( + "bash", + "libibverbs1", + "librdmacm1", + "glibc", + "libz1", + "mpi-selector", +); +$comp_prereq_hash{'mvapich2_prereq'} = \@mvapich2_prereq; + +my @openmpi_prereq = ( + "glibc", + "bash", + "libz1", + "pkg-config", + "libgcc_s1", + "libgfortran3", + "gcc-fortran", + "libgomp1", + "libibverbs1", + "libquadmath0", + "librdmacm1", + "libstdc++6", + "libz1", + "opensm-libs3", + "opensm-devel", + "mpi-selector", +); +$comp_prereq_hash{'openmpi_prereq'} = \@openmpi_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL86.pl b/CommonInstall/comp_ff_of_prereq_RHEL86.pl new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL86.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_RHEL86.pl.base b/CommonInstall/comp_ff_of_prereq_RHEL86.pl.base new file mode 100644 index 0000000..b7dc68f --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_RHEL86.pl.base @@ -0,0 +1,88 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component +my @oftools_prereq = ( + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ibacm", + "rdma-core", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "atlas", + "bash", + "bc", + "expat", + "expect", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "ncurses-libs", + "openssl-libs", + "perl", + "perl-Getopt-Long", + "perl-Socket", + "rdma-core", + "tcl", + "zlib", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc", + "libibumad", + "libibverbs", + "libstdc++", + "openssl", + "openssl-devel", + "openssl-libs", + "rdma-core-devel", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES154.pl b/CommonInstall/comp_ff_of_prereq_SLES154.pl new file mode 100644 index 0000000..114fb4d --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES154.pl @@ -0,0 +1,91 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020-2021, Cornelis Networks +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses6", + "libopenssl1_1", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", + "qperf", + "perftest", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_1", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_ff_of_prereq_SLES154.pl.base b/CommonInstall/comp_ff_of_prereq_SLES154.pl.base new file mode 100644 index 0000000..114fb4d --- /dev/null +++ b/CommonInstall/comp_ff_of_prereq_SLES154.pl.base @@ -0,0 +1,91 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020-2021, Cornelis Networks +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for fast fabric +#and of tools component + +my @oftools_prereq = ( + "glibc", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libstdc++6", + "ibacm", +); +$comp_prereq_hash{'oftools_prereq'} = \@oftools_prereq; + +my @fastfabric_prereq = ( + "glibc", + "bash", + "expect", + "perl-base", + "tcl", + "libexpat1", + "libgcc_s1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libncurses6", + "libopenssl1_1", + "libstdc++6", + "libz1", + "bc", + "rdma-core", + "rdma-ndd", + "qperf", + "perftest", +); +$comp_prereq_hash{'fastfabric_prereq'} = \@fastfabric_prereq; + +my @opamgt_sdk_prereq = ( + "bash", + "glibc", + "libgcc_s1", + "libibumad3", + "libibverbs1", + "libopenssl-devel", + "libopenssl1_1", + "libstdc++6", + "openssl", + "rdma-core-devel", + "rdma-ndd", +); +$comp_prereq_hash{'opamgt_sdk_prereq'} = \@opamgt_sdk_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL86.pl b/CommonInstall/comp_fm_prereq_RHEL86.pl new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL86.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_RHEL86.pl.base b/CommonInstall/comp_fm_prereq_RHEL86.pl.base new file mode 100644 index 0000000..02e12bb --- /dev/null +++ b/CommonInstall/comp_fm_prereq_RHEL86.pl.base @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020, Cornelis Networks, Inc. +# +# 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; +# +## ========================================================================== +# +#Installation Prequisites array for opafm +my @opafm_prereq = ( + "bash", + "expat", + "glibc", + "libibumad", + "libibverbs", + "openssl-libs", + "rdma-core", + "systemd", + "zlib", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES154.pl b/CommonInstall/comp_fm_prereq_SLES154.pl new file mode 100644 index 0000000..7f0a687 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES154.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020-2021, Cornelis Networks +# +# 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_1", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/comp_fm_prereq_SLES154.pl.base b/CommonInstall/comp_fm_prereq_SLES154.pl.base new file mode 100644 index 0000000..7f0a687 --- /dev/null +++ b/CommonInstall/comp_fm_prereq_SLES154.pl.base @@ -0,0 +1,55 @@ +#!/usr/bin/perl +## BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2020, Intel Corporation +# Copyright (c) 2020-2021, Cornelis Networks +# +# 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; +# +## ========================================================================== +# +##Installation Prequisites array for opafm +my @opafm_prereq = ( + "glibc", + "bash", + "rdma-core", + "rdma-ndd", + "systemd", + "libexpat1", + "libibmad5", + "libibumad3", + "libibverbs1", + "libopenssl1_1", + "libz1", +); +$comp_prereq_hash{'opafm_prereq'} = \@opafm_prereq; diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index 932a42c..2f80c07 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -82,6 +82,8 @@ my @Components_sles15_sp2 = ( "opa_stack", @OmniPathAllComponents ); my @Components_sles15_sp3 = ( "opa_stack", @OmniPathAllComponents ); +my @Components_sles15_sp4 = ( "opa_stack", + @OmniPathAllComponents ); my @Components_rhel74 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel75 = ( "opa_stack", "mpi_selector", @@ -104,6 +106,8 @@ my @Components_rhel84 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); my @Components_rhel85 = ( "opa_stack", "mpi_selector", @OmniPathAllComponents ); +my @Components_rhel86 = ( "opa_stack", "mpi_selector", + @OmniPathAllComponents ); @Components = ( ); @@ -1041,6 +1045,36 @@ my %intel_hfi_rhel85_comp_info = ( }, ); +my %intel_hfi_rhel86_comp_info = ( + "intel_hfi" => { Name => "Cornelis HFI Components", + DefaultInstall => $State_Install, + SrcDir => file_glob("./CornelisOPX-OFA_DELTA.*"), + PreReq => " opa_stack ", CoReq => " oftools ", + # TBD - HasFirmware - FW update + Hidden => 0, Disabled => 0, IsOFA => 1, + KernelRpms => [ ], + FirmwareRpms => [ + "hfi1-firmware", "hfi1-firmware_debug" + ], + UserRpms => [ #"libhfi1", "libhfi1-static", + "libpsm2", + "libpsm2-devel", "libpsm2-compat", + "libfabric", "libfabric-devel", + "libfabric-psm2", "libfabric-verbs", + "hfi1-diagtools-sw", "hfidiags", + ], + DebugRpms => [ #"hfi1_debuginfo", + "hfi1-diagtools-sw-debuginfo", + "libpsm2-debuginfo", #"libhfi1-debuginfo" + ], + HasStart => 1, HasFirmware => 0, DefaultStart => 1, + StartPreReq => " opa_stack ", + StartComponents => [ "intel_hfi" ], + StartupScript => "", + StartupParams => [ ] + }, +); + # For SLES12sp3 that has different name for libpsm2 my %intel_hfi_sles123_comp_info = ( "intel_hfi" => { Name => "Cornelis HFI Components", @@ -1435,6 +1469,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_rhel_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { + @Components = ( @Components_rhel86 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_rhel86_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_rhel_comp_info, + ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @Components_sles15 ); @SubComponents = ( @SubComponents_newer ); @@ -1467,6 +1509,14 @@ sub init_components %opa_stack_dev_comp_info, %opa_stack_sles15_comp_info, ); + } elsif ( "$CUR_VENDOR_VER" eq "ES154" ) { + @Components = ( @Components_sles15_sp4 ); + @SubComponents = ( @SubComponents_newer ); + %ComponentInfo = ( %ComponentInfo, %ibacm_comp_info, + %intel_hfi_sles15_comp_info, + %opa_stack_dev_comp_info, + %opa_stack_sles15_comp_info, + ); } else { # unknown or unsupported distro, leave lists empty # verify_distrib_files will catch unsupported distro diff --git a/CommonInstall/overrides_delta.pl b/CommonInstall/overrides_delta.pl index e142ba5..d6ecdb2 100644 --- a/CommonInstall/overrides_delta.pl +++ b/CommonInstall/overrides_delta.pl @@ -107,6 +107,10 @@ my @delta_Components_rhel85 = ( "opa_stack", "mpi_selector", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_rhel86 = ( "opa_stack", "mpi_selector", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); my @delta_Components_sles15 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", @@ -123,6 +127,10 @@ my @delta_Components_sles15_sp3 = ( "opa_stack", "intel_hfi", "opa_stack_dev", "delta_ipoib", "delta_debug", ); +my @delta_Components_sles15_sp4 = ( "opa_stack", "intel_hfi", + "opa_stack_dev", + "delta_ipoib", + "delta_debug", ); @Components = ( ); # RHEL7.2, ibacm is a full component with rpms to install @@ -169,6 +177,8 @@ sub overrides() @Components = ( @delta_Components_rhel84 ); } elsif ( "$CUR_VENDOR_VER" eq "ES85" ) { @Components = ( @delta_Components_rhel85 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES86" ) { + @Components = ( @delta_Components_rhel86 ); } elsif ( "$CUR_VENDOR_VER" eq "ES15" ) { @Components = ( @delta_Components_sles15 ); } elsif ( "$CUR_VENDOR_VER" eq "ES151" ) { @@ -177,6 +187,8 @@ sub overrides() @Components = ( @delta_Components_sles15_sp2 ); } elsif ( "$CUR_VENDOR_VER" eq "ES153" ) { @Components = ( @delta_Components_sles15_sp3 ); + } elsif ( "$CUR_VENDOR_VER" eq "ES154" ) { + @Components = ( @delta_Components_sles15_sp4 ); } else { # unsupported OS @Components = ( ); diff --git a/CommonInstall/util_rpm.pl b/CommonInstall/util_rpm.pl index 0701616..f460820 100755 --- a/CommonInstall/util_rpm.pl +++ b/CommonInstall/util_rpm.pl @@ -727,7 +727,7 @@ sub rpm_resolve($$) } else { my $osver = rpm_tr_os_version("$mode"); # OS version # we expect 1 match, ignore all other filenames returned - if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES125' ||"$CUR_VENDOR_VER" eq 'ES15' || "$CUR_VENDOR_VER" eq 'ES151' || "$CUR_VENDOR_VER" eq 'ES152' || "$CUR_VENDOR_VER" eq 'ES153' ) { + if ( "$CUR_VENDOR_VER" eq 'ES122' || "$CUR_VENDOR_VER" eq 'ES123' || "$CUR_VENDOR_VER" eq 'ES124' || "$CUR_VENDOR_VER" eq 'ES125' ||"$CUR_VENDOR_VER" eq 'ES15' || "$CUR_VENDOR_VER" eq 'ES151' || "$CUR_VENDOR_VER" eq 'ES152' || "$CUR_VENDOR_VER" eq 'ES153' || "$CUR_VENDOR_VER" eq 'ES154' ) { DebugPrint("Checking for Kernel Rpm: ${rpmpath}-${osver}_k*.${cpu}.rpm\n"); $rpmfile = file_glob("${rpmpath}-${osver}_k*.${cpu}.rpm"); } else { diff --git a/Esm/Makefile.linux b/Esm/Makefile.linux index 966b8a1..c5bd12d 100644 --- a/Esm/Makefile.linux +++ b/Esm/Makefile.linux @@ -140,6 +140,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES85" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL85.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES86" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_RHEL86.pl +endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES123" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES123.pl endif @@ -161,6 +164,9 @@ endif ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES153" PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES153.pl endif +ifeq "$(BUILD_TARGET_OS_VENDOR_VERSION)" "ES154" + PREREQ_SOURCE= $(TL_DIR)/CommonInstall/comp_fm_prereq_SLES154.pl +endif # Source files to include in DSP File diff --git a/Esm/build.env b/Esm/build.env index 3e0c330..8438d4a 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_11_1_3_1 +export RELEASE_TAG=10_11_2_0_3 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 34cd7c2..091b593 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 02/28/22 15:25 Tag: VIEO_HOST_LINUX_opa-10_11_10_11_1_3_1 +Build of VIEO_HOST 08/29/22 12:13 Tag: VIEO_HOST_LINUX_opa-10_11_10_11_2_0_3 diff --git a/Esm/ib/src/smi/sm/sm_qos.c b/Esm/ib/src/smi/sm/sm_qos.c index 1a499bb..075e971 100644 --- a/Esm/ib/src/smi/sm/sm_qos.c +++ b/Esm/ib/src/smi/sm/sm_qos.c @@ -1615,7 +1615,7 @@ _initialize_Switch_SCVLMaps(ParallelSweepContext_t *psc, SmMaiHandle_t *fd, " output port %d", sm_nodeDescString(neighborNodep), neighborNodep->nodeInfo.NodeGUID, neighborPortp->index); sm_mark_link_down(sm_topop, neighborPortp); - status = sm_popo_port_error(&sm_popo, sm_topop, swportp, status); + status = sm_popo_port_error(&sm_popo, sm_topop, neighborPortp, status); if (status == VSTATUS_TIMEOUT_LIMIT) goto fail; else diff --git a/opa-fm.spec.in b/opa-fm.spec.in index ffdc3ba..45b34fe 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.11.1.3 -Release: 1%{?dist} +Version: 10.11.2.0 +Release: 3%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -62,7 +62,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.11.1.3.1%{?dist} +IFSComponent: FM 10.11.2.0.3%{?dist} %prep %setup -q -c
0
856ab8c6311ac41cab4bd82affbe195d52605f10
01org/opa-fm
Update to latest from build 10.9.2.1.1
commit 856ab8c6311ac41cab4bd82affbe195d52605f10 Author: Scott Breyer <[email protected]> Date: Tue May 14 13:58:37 2019 -0400 Update to latest from build 10.9.2.1.1 diff --git a/Esm/build.env b/Esm/build.env index 4248b06..c97431e 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_2_0_7 +export RELEASE_TAG=10_9_2_1_1 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 38d339f..22a3a0b 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 03/07/19 00:03 Tag: VIEO_HOST_LINUX_opa-10_9_10_9_2_0_7 +Build of VIEO_HOST 05/14/19 13:04 Tag: VIEO_HOST_LINUX_opa-10_9_2_1_10_9_2_1_1 diff --git a/MakeTools/format_releasetag.py b/MakeTools/format_releasetag.py index 66517f3..396c888 100755 --- a/MakeTools/format_releasetag.py +++ b/MakeTools/format_releasetag.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # coding=utf-8 # # BEGIN_ICS_COPYRIGHT9 diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 80aadf4..d39a21a 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.2.0 -Release: 7%{?dist} +Version: 10.9.2.1 +Release: 1%{?dist} %if 0%{?rhel} Epoch: 1 %endif @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.2.0.7%{?dist} +IFSComponent: FM 10.9.2.1.1%{?dist} %prep %setup -q -c
0
b5eaf8d7a4170fcd25dcf939ac7fca7cfcab3e41
01org/opa-fm
Update to latest from build 10.5.1.0.1 (IFS 10.5.1.0.2)
commit b5eaf8d7a4170fcd25dcf939ac7fca7cfcab3e41 Author: Scott Breyer <[email protected]> Date: Mon Sep 18 14:57:58 2017 -0400 Update to latest from build 10.5.1.0.1 (IFS 10.5.1.0.2) diff --git a/CommonInstall/main_omnipathwrap_delta.pl b/CommonInstall/main_omnipathwrap_delta.pl index fcd0fbc..6b00a7c 100644 --- a/CommonInstall/main_omnipathwrap_delta.pl +++ b/CommonInstall/main_omnipathwrap_delta.pl @@ -436,7 +436,7 @@ my %ComponentInfo_rhel72 = ( DefaultInstall => $State_Install, SrcDir => file_glob("./IntelOPA-Tools*.*"), DriverSubdir => "", - PreReq => " opa_stack ", CoReq => " opa_stack ", + PreReq => " opa_stack ibacm ", CoReq => " opa_stack ", Hidden => 0, Disabled => 0, HasStart => 1, HasFirmware => 0, DefaultStart => 0, StartPreReq => " opa_stack ", # TBD diff --git a/Esm/ib/src/smi/sm/sm_qos.c b/Esm/ib/src/smi/sm/sm_qos.c index 539f450..8fef69a 100644 --- a/Esm/ib/src/smi/sm/sm_qos.c +++ b/Esm/ib/src/smi/sm/sm_qos.c @@ -2276,11 +2276,11 @@ sm_aggregateToBfrctrl(Node_t * nodep, STL_AGGREGATE * aggr) do { Port_t *portp = sm_get_port(nodep, startPort + i); - if (!sm_valid_port(portp)) continue; - - portp->portData->bufCtrlTable = *((STL_BUFFER_CONTROL_TABLE*)data); - portp->portData->current.bfrctrl = 1; - BSWAP_STL_BUFFER_CONTROL_TABLE(&(portp->portData->bufCtrlTable)); + if (sm_valid_port(portp)) { + portp->portData->bufCtrlTable = *((STL_BUFFER_CONTROL_TABLE*)data); + portp->portData->current.bfrctrl = 1; + BSWAP_STL_BUFFER_CONTROL_TABLE(&(portp->portData->bufCtrlTable)); + } data += STL_BFRCTRLTAB_PAD_SIZE; } while (++i < count); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 11404e2..f409549 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.5.0.0 -Release: 136%{?dist} +Version: 10.5.1.0 +Release: 1%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
d435129bef2eb1d9aaec0b68c7c36032d746dfef
01org/opa-fm
Fix compile errors for CFLAG "-Werror=format-security" Reviewed-by: Rimmer, Todd <[email protected]> Reviewed-by: Michael Heinz <[email protected]> Reviewed-by: Yates, Brandon <[email protected]> Signed-off-by: Breyer, Scott J <[email protected]>
commit d435129bef2eb1d9aaec0b68c7c36032d746dfef Author: Scott Breyer <[email protected]> Date: Wed Jun 13 15:46:50 2018 -0400 Fix compile errors for CFLAG "-Werror=format-security" Reviewed-by: Rimmer, Todd <[email protected]> Reviewed-by: Michael Heinz <[email protected]> Reviewed-by: Yates, Brandon <[email protected]> Signed-off-by: Breyer, Scott J <[email protected]> diff --git a/Esm/build.env b/Esm/build.env index cec6a88..6d09130 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_7_0_0_144 +export RELEASE_TAG=10_7_0_0_145 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/linux/startup/fm_config/config_convert.c b/Esm/ib/src/linux/startup/fm_config/config_convert.c index bb0c4b2..5b36d52 100644 --- a/Esm/ib/src/linux/startup/fm_config/config_convert.c +++ b/Esm/ib/src/linux/startup/fm_config/config_convert.c @@ -541,7 +541,7 @@ char *formatOldValue(Ag_Man_t *sp, OldFormat_t format) case FORMAT_MTU: if (FALSE == getOldUllValue(sp, &value)) return (char*)sp->value; - snprintf(buf, 50, IbMTUToText((IB_MTU)value)); + snprintf(buf, 50, "%s", IbMTUToText((IB_MTU)value)); return buf; case FORMAT_RATE: if (FALSE == getOldUllValue(sp, &value)) diff --git a/Esm/ib/src/pm/pm/pm_calc.c b/Esm/ib/src/pm/pm/pm_calc.c index 6ee825a..243ed94 100644 --- a/Esm/ib/src/pm/pm/pm_calc.c +++ b/Esm/ib/src/pm/pm/pm_calc.c @@ -380,7 +380,7 @@ void PmPrintExceededPortDetailsIntegrity(PmPort_t *pmportp, PmPort_t *pmportneig logMessage += strlen(logMessage); } - IB_LOG_WARN_FMT(NULL, message); + IB_LOG_WARN_FMT(NULL, "%s", message); } void PmPrintExceededPortDetailsCongestion(PmPort_t *pmportp, PmPort_t *pmportneighborp, uint32 imageIndex, uint32 lastImageIndex) { @@ -459,7 +459,7 @@ void PmPrintExceededPortDetailsCongestion(PmPort_t *pmportp, PmPort_t *pmportnei logMessage += strlen(logMessage); } - IB_LOG_WARN_FMT(NULL, message); + IB_LOG_WARN_FMT(NULL, "%s", message); } void PmPrintExceededPortDetailsSmaCongestion(PmPort_t *pmportp, PmPort_t *pmportneighborp, uint32 imageIndex, uint32 lastImageIndex) { @@ -538,7 +538,7 @@ void PmPrintExceededPortDetailsSmaCongestion(PmPort_t *pmportp, PmPort_t *pmport logMessage += strlen(logMessage); } - IB_LOG_WARN_FMT(NULL, message); + IB_LOG_WARN_FMT(NULL, "%s", message); } void PmPrintExceededPortDetailsBubble(PmPort_t *pmportp, PmPort_t *pmportneighborp, uint32 imageIndex, uint32 lastImageIndex) { diff --git a/Esm/ib/src/pm/pm/pm_sweep.c b/Esm/ib/src/pm/pm/pm_sweep.c index 97c4cd6..89e0495 100644 --- a/Esm/ib/src/pm/pm/pm_sweep.c +++ b/Esm/ib/src/pm/pm/pm_sweep.c @@ -4010,7 +4010,7 @@ store_file: // Update the record. Only fill in the filename. Leave the images // per composite as zero. This is all the Standby cares about. // If/When we become Master, we'll reread the history. - snprintf(rec->header.filename, sizeof(rec->header.filename), newfilename); + snprintf(rec->header.filename, sizeof(rec->header.filename), "%s", newfilename); for (i = 0; i < PM_HISTORY_MAX_IMAGES_PER_COMPOSITE; i++) { rec->historyImageEntries[i].inx = INDEX_NOT_IN_USE; } diff --git a/Esm/ib/src/smi/sm/sm_utility.c b/Esm/ib/src/smi/sm/sm_utility.c index 7c3c391..7276a06 100755 --- a/Esm/ib/src/smi/sm/sm_utility.c +++ b/Esm/ib/src/smi/sm/sm_utility.c @@ -710,7 +710,7 @@ skip_send: } if(rc < 256) snprintf(msgbuf + rc, 256 - rc, " TID: 0x%"CS64"x", out_mad.base.tid); - IB_LOG_INFO_FMT(__func__, msgbuf); + IB_LOG_INFO_FMT(__func__, "%s", msgbuf); } } } diff --git a/Esm/ib/test/smi/Makefile b/Esm/ib/test/smi/Makefile index a811ede..cb575d4 100755 --- a/Esm/ib/test/smi/Makefile +++ b/Esm/ib/test/smi/Makefile @@ -43,7 +43,7 @@ EXECUTABLE = # Sm$(EXE_SUFFIX) ifeq "$(BUILD_TARGET_OS)" "VXWORKS" DIRS = else -DIRS = sm jmtest +DIRS = sm endif # C files (.c) CFILES = \ diff --git a/Esm/ib/test/smi/jmtest/jmtest.c b/Esm/ib/test/smi/jmtest/jmtest.c index 2a66b8c..157b17f 100644 --- a/Esm/ib/test/smi/jmtest/jmtest.c +++ b/Esm/ib/test/smi/jmtest/jmtest.c @@ -83,7 +83,7 @@ dump_mad(uint8_t *buf, int len, char *prefix) { int i; for (i = 0; i < len; ++i) { - if (i % 16 == 0) printf(prefix); + if (i % 16 == 0) printf("%s", prefix); printf("%02x", *(buf + i)); if (i % 4 == 3) printf(" "); if (i % 16 == 15) printf("\n"); diff --git a/Makerules/Target.LINUX.GNU.X86_64 b/Makerules/Target.LINUX.GNU.X86_64 index b15f5f2..2d9ccd2 100755 --- a/Makerules/Target.LINUX.GNU.X86_64 +++ b/Makerules/Target.LINUX.GNU.X86_64 @@ -77,7 +77,7 @@ SHLIB_SONAME=$(notdir $(CMD_TARGETS_SHLIB)) # ---------------------------- # -fcheck-new does the opposite of what the manual implies. # -fcheck-new DISABLES the run-time test of return value from new -CMACH = -pipe -DTARGET_CPU_FAMILY_X86 -Wall -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector +CMACH = -pipe -DTARGET_CPU_FAMILY_X86 -Wall -Werror=format-security -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector CCMACH = $(CMACH) -fcheck-new -Wno-ctor-dtor-privacy CSYS = -DLINUX -Dlinux -D__LINUX__ CCSYS = $(CSYS) diff --git a/opa-fm.spec.in b/opa-fm.spec.in index eab77b9..2ea6d72 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.7.0.0 -Release: 144%{?dist} +Release: 145%{?dist} Summary: Intel Omni-Path Fabric Management Software License: GPLv2 or BSD
0
7bb1ce10bea2ce232f0a75ec53f446853b09fe93
01org/opa-fm
Update spec file to 10.0.1.0.2
commit 7bb1ce10bea2ce232f0a75ec53f446853b09fe93 Author: Scott Breyer <[email protected]> Date: Tue Mar 1 16:18:14 2016 -0500 Update spec file to 10.0.1.0.2 diff --git a/opafm.spec b/opafm.spec index 627b605..af47596 100644 --- a/opafm.spec +++ b/opafm.spec @@ -29,8 +29,8 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.0.0.0 -Release: 696 +Version: 10.0.1.0 +Release: 2 Summary: Intel Omni-Path Fabric Management Software Group: System Environment/Daemons @@ -116,6 +116,9 @@ install -D stage.rpm/opafm.xml $RPM_BUILD_ROOT/opt/opafm/etc/opafm.xml install -D stage.rpm/opaxmlextract $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlextract install -D stage.rpm/opaxmlfilter $RPM_BUILD_ROOT/opt/opafm/etc/opaxmlfilter +install -D stage.rpm/opa_ca_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_ca_openssl.cnf-sample +install -D stage.rpm/opa_comp_openssl.cnf-sample $RPM_BUILD_ROOT/opt/opafm/samples/opa_comp_openssl.cnf-sample + mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s /opt/opafm/bin/fm_cmd $RPM_BUILD_ROOT%{_sbindir}/opafmcmd ln -s /opt/opafm/bin/fm_cmdall $RPM_BUILD_ROOT%{_sbindir}/opafmcmdall @@ -154,6 +157,7 @@ fi /opt/opafm/bin/* /opt/opafm/etc/* /opt/opafm/runtime/* +/opt/opafm/samples/* %{_sbindir}/opafmcmd %{_sbindir}/opafmcmdall
0
18110638b7a54e66b1b5ad702db6aad1f536fa55
01org/opa-fm
Update to latest from build 10.9.2.2.1
commit 18110638b7a54e66b1b5ad702db6aad1f536fa55 Author: Scott Breyer <[email protected]> Date: Mon Jun 10 11:03:46 2019 -0400 Update to latest from build 10.9.2.2.1 diff --git a/Esm/build.env b/Esm/build.env index c97431e..f0e0499 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,6 +1,6 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_9_2_1_1 +export RELEASE_TAG=10_9_2_2_1 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB export LDENVFS= diff --git a/Esm/build_label b/Esm/build_label index 22a3a0b..3647992 100644 --- a/Esm/build_label +++ b/Esm/build_label @@ -1 +1 @@ -Build of VIEO_HOST 05/14/19 13:04 Tag: VIEO_HOST_LINUX_opa-10_9_2_1_10_9_2_1_1 +Build of VIEO_HOST 06/07/19 16:21 Tag: VIEO_HOST_LINUX_opa-10_9_2_1_10_9_2_2_1 diff --git a/Esm/runmake b/Esm/runmake index a8d46e7..d80b94d 100755 --- a/Esm/runmake +++ b/Esm/runmake @@ -235,8 +235,8 @@ then exit 1 fi -MODULEVERSION=`$TL_DIR/MakeTools/format_releasetag.py $RELEASE_TAG` -RPMVERSION=`$TL_DIR/MakeTools/format_releasetag.py $RELEASE_TAG --format rpm` +MODULEVERSION=`$TL_DIR/MakeTools/format_releasetag.sh $RELEASE_TAG` +RPMVERSION=`$TL_DIR/MakeTools/format_releasetag.sh -f rpm $RELEASE_TAG` RPM_VER=`echo $RPMVERSION|cut -d"-" -f1` RPM_REL=`echo $RPMVERSION-999|cut -d"-" -f2` export MKRPM_VER=$RPM_VER diff --git a/MakeTools/Makefile b/MakeTools/Makefile index 6a704b0..2ba8f32 100644 --- a/MakeTools/Makefile +++ b/MakeTools/Makefile @@ -87,10 +87,6 @@ convert_releasetag: convert_releasetag.pl cp $< $@ chmod 755 $@ -format_releasetag: format_releasetag.py - cp $< $@ - chmod 755 $@ - include $(TL_DIR)/Makerules/Maketargets.stage include $(TL_DIR)/Makerules/Maketargets.install diff --git a/MakeTools/format_releasetag.py b/MakeTools/format_releasetag.py deleted file mode 100755 index 396c888..0000000 --- a/MakeTools/format_releasetag.py +++ /dev/null @@ -1,365 +0,0 @@ -#!/usr/bin/env python2 -# coding=utf-8 -# -# BEGIN_ICS_COPYRIGHT9 -# -# INTEL CONFIDENTIAL -# Copyright 2018 Intel Corporation All Rights Reserved. -# -# The source code contained or described herein and all documents related to the -# source code ("Material") are owned by Intel Corporation or its suppliers or -# licensors. Title to the Material remains with Intel Corporation or its -# suppliers and licensors. The Material may contain trade secrets and -# proprietary and confidential information of Intel Corporation and its -# suppliers and licensors, and is protected by worldwide copyright and trade -# secret laws and treaty provisions. No part of the Material may be used, -# copied, reproduced, modified, published, uploaded, posted, transmitted, -# distributed, or disclosed in any way without Intel's prior express written -# permission. -# -# No license under any patent, copyright, trade secret or other intellectual -# property right is granted to or conferred upon you by disclosure or delivery -# of the Materials, either expressly, by implication, inducement, estoppel or -# otherwise. Any license under such intellectual property rights must be -# express and approved by Intel in writing. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# Unless otherwise agreed by Intel in writing, you may not remove or alter this -# notice or any other notice embedded in Materials by Intel or Intel's suppliers -# or licensors in any way. -# -# END_ICS_COPYRIGHT9 -# -# Author: Peter Littlefield ([email protected]) - -import re -import sys -#import string -import argparse -from operator import attrgetter - -def print_err(*args, **kwargs): - """Print to stderr.""" - sys.stderr.write(*args, **kwargs) - sys.stderr.write("\n") - sys.stderr.flush() - -class ReleaseTag(dict): - """Generic class used to store and convert release tags to different formats.""" - -# GroupRegex = re.compile(r"^[_\.]?(?P<Field>[MPIABRC]*)(?P<Version>[0-9a-z]+)(?P<Remainder>.*)") - GroupRegex = re.compile(r"^[_\.]?(?P<Alphas>[A-Z]*)(?P<Numerals>[0-9]+)(?P<Remainder>.*)") -# FieldKeys = ["X", "Y", "M", "P", "I"] -# RpmTrans = string.maketrans("ABRC", "abrc") - - # Dicts defining the format for binary/hex-encoded release tags. - # FieldName: (Mask, Shift) - HexFieldInfo32bit = { "Major": (0xF, 28), "Minor": (0xFF, 20), "Maintenance": (0xFF, 16), "EncodedQuality32bit": (0xF, 12), "BuildNumber": (0xFFF, 0) } - HexFieldInfo64bit = { "Major": (0xFF, 56), "Minor": (0xFF, 48), "Maintenance": (0xFF, 40), "EncodedQuality64bit": (0xF, 36), "Patch": (0xF, 32), "BuildNumber": (0xFFFFFFFF, 0) } - - def __init__(self, **kwargs): - # Call "dict" constructor with default value of zero for all FieldKeys. - super(ReleaseTag, self).__init__([(FieldKey, 0) for FieldKey in self.FieldKeys]) - # Update with values passed in via kwargs. - self.update(kwargs) - - @classmethod - def FromTagString(cls, TagString): - """Factory method to construct a ReleaseTag object based on the supplied TagString. - - This will construct the appropriate subclass based on the input format. If the supplied TagString does not match - a valid format, returns None.""" - - # Exclude any characters before the first numeral. - RawTag = TagString[re.search("[0-9]", TagString).start():] - - if re.search(r"[^ABPRC0-9_\.]", RawTag): - # Check for any characters that are not supported in the new Alphanumeric tag format (e.g. lowercase letters, uppercase letters other than A, B, P, RC.) - # TODO: This could probably be handled more cleanly in the main "GroupRegex". - return ReleaseTagLegacy(RawTag) - - # Break the input TagString into pairs consisting of zero or more alpha characters, followed by 1 or more numerals. - Remainder = RawTag - AlphaNumeralPairs = [] - while Remainder: - try: - Alphas,Numerals,Remainder = cls.GroupRegex.match(Remainder).group("Alphas", "Numerals", "Remainder") - except AttributeError: - raise(ValueError("Invalid Tag Format: " + TagString + " Cannot match: " + Remainder)) - AlphaNumeralPairs.append( (Alphas,Numerals) ) - - #print(cls.__subclasses__()) - # Pass the list of Alpha-Numeral pairs to each subclass's "FromAlphaNumeralPairs" factory method. - ConstructedReleaseTags = [subclass.FromAlphaNumeralPairs(AlphaNumeralPairs) for subclass in cls.__subclasses__()] - #print("ReleaseTag.FromTagString(): ConstructedReleaseTags: " + str(ConstructedReleaseTags)) - ConstructedReleaseTags = [ConstructedReleaseTag for ConstructedReleaseTag in ConstructedReleaseTags if ConstructedReleaseTag] - if len(ConstructedReleaseTags) > 1: - print_err("Warning: Multiple objects constructed for Release Tag: " + TagString) - - try: - return ConstructedReleaseTags.pop(0) - except IndexError: - print_err("Fatal: No matching format found for release tag: " + TagString) - raise(ValueError("Fatal: No matching format found for release tag: " + TagString)) - - def Get32BitHex(self): - Hex = 0x00000000 - for FieldKey, (Mask, Shift) in self.HexFieldInfo32bit.iteritems(): - if self[FieldKey] > Mask: - print_err("Warning: \"" + FieldKey + "\": " + str(self[FieldKey]) + ": Out of range for binary format. Clamping to: " + str(Mask)) - Hex |= (min(self[FieldKey], Mask) & Mask) << Shift - #return Hex - return "0x%08X"%Hex - - def Get64BitHex(self): - Hex = 0x0000000000000000 - for FieldKey, (Mask, Shift) in self.HexFieldInfo64bit.iteritems(): - if self[FieldKey] > Mask: - print_err("Warning: \"" + FieldKey + "\": " + str(self[FieldKey]) + ": Out of range for binary format. Clamping to: " + str(Mask)) - Hex |= (min(self[FieldKey], Mask) & Mask) << Shift - - #return Hex - return "0x%016X"%Hex - -class ReleaseTagLegacy(object): - """Class used to represent release tags containing lower-case letters or other otherwise-unsupported characters. - - This allows support for developer-level build release tags which often contain a username, such as those produced by "MakeTools/patch_engineer_version.sh". - e.g. "0rootopa0" in FM_SMOKE_TEST.""" - # TODO: We could reimplement the parsing algorithm in "patch_version"/"convert_releasetag.pl" (with special handling of "P", "M", and "I" characters). - # In this case we'd probably want to make an actual subclass of ReleaseTag and correctly populate the fields. - def __init__(self, RawTag): - """Constructor. Simply replaces underscores with dots.""" - self.VersionString = RawTag.replace("_", ".") - - def GetText(self): - return self.VersionString - - def GetRpmName(self): - return self.GetText() - - def GetBriefRpmName(self): - return self.GetRpmName() - - def Get32BitHex(self): - # No way to map unsupported characters into hex format, so default to all zeros. - return "0x00000000" - - def Get64BitHex(self): - # No way to map unsupported characters into hex format, so default to all zeros. - return "0x0000000000000000" - - def GetDebianName(self): - return self.GetText() - -class ReleaseTagPV(ReleaseTag): - """Class to represent a PV-quality release tag. Contains no letters, and "Patch" field is 0 (e.g. "10.8.0.0.100).""" - - FieldKeys = ["Major", "Minor", "Maintenance", "Patch", "BuildNumber"] - - def __init__(self, **kwargs): - super(ReleaseTagPV, self).__init__(**kwargs) - self["EncodedQuality32bit"] = 14 - self["EncodedQuality64bit"] = 14 - - @classmethod - def FromAlphaNumeralPairs(cls, AlphaNumeralPairs): - FieldKeys = list(cls.FieldKeys) # Copy FieldKeys so we can pop elements without side effects. - Fields = {} - - for Alphas,Numerals in AlphaNumeralPairs: - # Iterate through pairs of Alpha and Numeral strings - try: - FieldKey = FieldKeys.pop(0) - #print("ReleaseTagQuality.FromAlphaNumeralPairs(): Alphas: " + Alphas + " Numerals: " + Numerals + " FieldKey: " + FieldKey) - except IndexError: - # Too many fields in Release Tag for this type. - return None - if Alphas: - # No alphas allowed in this format type. - return None - - Fields[FieldKey] = int(Numerals) - - if "Patch" in Fields and Fields["Patch"] != 0: - # If "Patch" field is nonzero, construct a "ReleaseTagPatch" object instead of "ReleaseTagPV". - return ReleaseTagPatch(**Fields) - else: - return cls(**Fields) - - def GetText(self): - return ".".join([str(self["Major"]), str(self["Minor"]), str(self["Maintenance"]), str(self["Patch"]), str(self["BuildNumber"])]) - - def GetRpmName(self): - RpmName = ".".join([str(self["Major"]), str(self["Minor"]), str(self["Maintenance"]), str(self["Patch"])]) - RpmName += "-" + str(self["BuildNumber"]) - return RpmName - - def GetBriefRpmName(self): - if self["Patch"] != 0: - return self.GetRpmName() - BriefRpmName = ".".join([str(self["Major"]), str(self["Minor"])]) - if self["Maintenance"] != 0: - BriefRpmName += "." + str(self["Maintenance"]) - BriefRpmName += "-" + str(self["BuildNumber"]) - return BriefRpmName - - def GetDebianName(self): - # Debian string is the same as Text for formats with no "Quality" field. - return self.GetText() - - -class ReleaseTagPatch(ReleaseTagPV): - """Represents a release tag with nonzero "Patch" field "(e.g. 10.8.0.1.1")""" - - # Override 32-bit hex encoding to include "Patch" field. - HexFieldInfo32bit = { "Major": (0xF, 28), "Minor": (0xFF, 20), "Maintenance": (0xFF, 16), "EncodedQuality32bit": (0xF, 12), "Patch": (0xF, 8), "BuildNumber": (0xFF, 0) } - - def __init__(self, **kwargs): - super(ReleaseTagPatch, self).__init__(**kwargs) - # Override 32-bit encoding of Quality field. - self["EncodedQuality32bit"] = 15 - - -class ReleaseTagQuality(ReleaseTag): - """A generic release tag type that contains a "quality" code for Alpha/Beta/Poweron/ReleaseCandidate (e.g. 10.8.0RC1.100, 10.9.1A2.10).""" - - FieldKeys = ["Major", "Minor", "Maintenance", "QualityLevel", "BuildNumber"] - - def __init__(self, **kwargs): - super(ReleaseTagQuality, self).__init__(**kwargs) - self["Patch"] = 0 - EncodedQuality = self.QualityEncodeMin + self["QualityLevel"] - if EncodedQuality > self.QualityEncodeMax: - print_err("Warning: Encoded Quality out of range: " + str(EncodedQuality) + " Clamping to: " + str(self.QualityEncodeMax)) - # Clamp to max allowed values - EncodedQuality = self.QualityEncodeMax - self["EncodedQuality32bit"] = EncodedQuality - self["EncodedQuality64bit"] = EncodedQuality - - @classmethod - def FromAlphaNumeralPairs(cls, AlphaNumeralPairs): - FieldKeys = list(cls.FieldKeys) # Copy FieldKeys so we can pop elements without side effects. - Fields = {} - subclass = None - - #print("ReleaseTagQuality.FromAlphaNumeralPairs(): AlphaNumeralPairs: " + str(AlphaNumeralPairs)) - - for Alphas,Numerals in AlphaNumeralPairs: - # Iterate through pairs of Alpha and Numeral strings - try: - FieldKey = FieldKeys.pop(0) - #print("ReleaseTagQuality.FromAlphaNumeralPairs(): Alphas: " + Alphas + " Numerals: " + Numerals + " FieldKey: " + FieldKey) - except IndexError: - # Too many fields in Release Tag for this type. - return None - - if Alphas: - # Skip to "QualityLevel" field when alpha characters are encountered. - while "QualityLevel" in FieldKeys: - FieldKey = FieldKeys.pop(0) - - if "QualityLevel" in Fields: - # Only allow 1 alpha field in Release Tag - print_err("ReleaseTagQuality.FromAlphaNumeralPairs(): Too many alpha fields in release tag.") - return None - # Find subclass matching alpha characters. - MatchingSubclasses = [subclass for subclass in cls.__subclasses__() if subclass.QualityPrefix == Alphas] - if len(MatchingSubclasses) > 1: - print_err("Warning: Multiple matching subclasses found for field: " + Alphas) - try: - subclass = MatchingSubclasses.pop(0) - except IndexError: - # No matching subclass found for this Release Tag format. - print_err("ReleaseTagQuality.FromAlphaNumeralPairs(): Error: No matching subclass for Quality: " + Alphas) - return None - elif FieldKey == "QualityLevel": - # If no numeric characters in this position, format is invalid for this type of Release Tag. - #print("ReleaseTagQuality.FromAlphaNumeralPairs(): No alpha characters found") - return None - - Fields[FieldKey] = int(Numerals) - #print("ReleaseTagQuality.FromAlphaNumeralPairs(): Fields: " + str(Fields)) - if "QualityLevel" in Fields: - return subclass(**Fields) - else: - # No alpha field found in supplied Release Tag, so format is invalid for this type. - return None - - def GetText(self): - Text = ".".join([str(self["Major"]), str(self["Minor"]), str(self["Maintenance"])]) - Text += self.QualityPrefix + str(self["QualityLevel"]) + "." + str(self["BuildNumber"]) - return Text - - def GetRpmName(self): - RpmName = ".".join([str(self["Major"]), str(self["Minor"]), str(self["Maintenance"]), "0"]) - RpmName += "-" + self.RpmQualityPrefix + str(self["QualityLevel"]) + "." + str(self["BuildNumber"]) - return RpmName - - def GetBriefRpmName(self): - BriefRpmName = ".".join([str(self["Major"]), str(self["Minor"])]) - if self["Maintenance"] != 0: - BriefRpmName += "." + str(self["Maintenance"]) - BriefRpmName += "-" + self.RpmQualityPrefix + str(self["QualityLevel"]) + "." + str(self["BuildNumber"]) - return BriefRpmName - - def GetDebianName(self): - DebianName = ".".join([str(self["Major"]), str(self["Minor"]), str(self["Maintenance"]), "0"]) - DebianName += self.RpmQualityPrefix + str(self["QualityLevel"]) + "." + str(self["BuildNumber"]) - return DebianName - -class ReleaseTagPoweron(ReleaseTagQuality): - QualityPrefix = "P" - RpmQualityPrefix = "P" - QualityEncodeMin = 0 - QualityEncodeMax = 2 - -class ReleaseTagAlpha(ReleaseTagQuality): - QualityPrefix = "A" - RpmQualityPrefix = "a" - QualityEncodeMin = 3 - QualityEncodeMax = 5 - -class ReleaseTagBeta(ReleaseTagQuality): - QualityPrefix = "B" - RpmQualityPrefix = "b" - QualityEncodeMin = 6 - QualityEncodeMax = 8 - -class ReleaseTagRC(ReleaseTagQuality): - QualityPrefix = "RC" - RpmQualityPrefix = "rc" - QualityEncodeMin = 9 - QualityEncodeMax = 13 - - -def main(): - ArgParser = argparse.ArgumentParser(description="Parse a release tag and output it in one of several formats.") - - Formats = {"text": attrgetter("GetText"), "rpm": attrgetter("GetRpmName"), "briefrpm": attrgetter("GetBriefRpmName"), "debian": attrgetter("GetDebianName"), "32bit": attrgetter("Get32BitHex"), "64bit": attrgetter("Get64BitHex")} - - # TODO: Add help text for each command-line argument. - ArgParser.add_argument('--format', action='store', choices=sorted(Formats.keys(), reverse=True), default="text", help="Output format. Default: text") - ArgParser.add_argument('TagString', help="Release Tag to format e.g. 10_8_0RC2_100") - # TODO: Debug/loglevel option(s) - - args = ArgParser.parse_args() - #print("TagString: " + str(args.TagString)) - #print("format: " + str(args.format)) - ReleaseTagObject = ReleaseTag.FromTagString(args.TagString) - - OutputFormat = Formats[args.format](ReleaseTagObject)() - print(OutputFormat) - - -# Sentinel to run the main function if this file is directly executed (rather than imported). -if __name__ == "__main__": - main() diff --git a/MakeTools/format_releasetag.sh b/MakeTools/format_releasetag.sh new file mode 100755 index 0000000..3f978d0 --- /dev/null +++ b/MakeTools/format_releasetag.sh @@ -0,0 +1,496 @@ +#!/bin/bash +# BEGIN_ICS_COPYRIGHT8 **************************************** +# +# Copyright (c) 2015-2019, 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] + + +# Parse release tags to create version strings +# - X.Y.m.p.b - a build on the way to final +# - X.Y.mAn.b – Alpha “n” build (sometimes called release candidate in redhat terminology) +# - X.Y.mBn.b – Beta “n” build (sometimes called release candidate in redhat terminology) +# - X.Y.mRCn.b – final release candidate “n” build +# - X.Y.m.0.b – a final PV release +# - X.Y.m.p.b – a patch of a PV release +# +# 32-bit hex (UEFI) +# - X – 4 bits +# - Y - 8 bits +# - m – 4 bits +# quality – 4 bits (0-2=power on, 3-5 = Alpha, 6-8=Beta, 9-13=release candidates, 14=PRQ/PV, 15=patch) +# for quality=0-14: b – 12 bits +# when quality==15: p-4 bits, b - 8 bits [unlikely to be used, but covers in case we need it] +# +# 64-bit hex (switch firmware) +# - X – 8 bits +# - Y - 8 bits +# - m – 8 bits +# - quality – 4 bit (0-2=power on, 3-5 = Alpha, 6-8=Beta, 9-13=release candidates, 14=PRQ/PV or patch) +# - patch – 4 bits +# - build – 32 bits +# +# Also allow for user-named version of format 0<username> + + + +checkAlpha() +{ + if [ $user_ver -eq 1 ] + then + return 0 + fi + + pos=$1 + ver=$2 + + if [ "$ver" = "" ] + then + return 0 + fi + + if echo $ver | grep -qe [[:alpha:]] + then + if echo $ver | grep -qv I + then + echo Error: invalid alpha character in $pos: $ver + return 1 + fi + fi + return 0 +} + +parseOutI() +{ + ver=$1 + + iP=$(echo $ver | grep -bo I | head -n 1 | cut -d: -f1) + v1=${ver:0:iP} + echo $v1 +} + +parseBldI() +{ + ver=$1 + + iP=$(echo $ver | grep -bo I | head -n 1 | cut -d: -f1) + bld=${ver:$((iP + 1))} + echo $bld +} + +getQual() +{ + qual=$1 + pat=$2 + n=$3 + + if [ $pat -ne 0 ] + then + echo 15 + else + case $qual in + poweron) + if [ $n -gt 2 ] + then + (>&2 echo "Warning: Encoded Quality out of range: $n Clamping to: 2") + n=2 + fi + echo $n + ;; + alpha) + n=$((3 + n)) + if [ $n -gt 5 ] + then + (>&2 echo "Warning: Encoded Quality out of range: $n Clamping to: 5") + n=5 + fi + echo $n + ;; + beta) + n=$((6 + n)) + if [ $n -gt 8 ] + then + (>&2 echo "Warning: Encoded Quality out of range: $n Clamping to: 8") + n=8 + fi + echo $n + ;; + rc) + n=$((9 + n)) + if [ $n -gt 13 ] + then + (>&2 echo "Warning: Encoded Quality out of range: $n Clamping to: 13") + n=13 + fi + echo $n + ;; + pv) + echo 14 + ;; + esac + fi + return +} + +if [ "$#" -eq 0 ] +then + echo Error: too few arguments + echo Usage: format_releasetag.sh [-f format] version-string + exit 1 +fi + +if [ "$1" = "" ] +then + echo Error: invalid version string argument + echo Usage: format_releasetag.sh [-f format] version-string + exit 1 +fi + +fmt= +ver= + +while getopts "f:" opt +do + case "$opt" in + f) + fmt=$OPTARG + ;; + ?) + echo Error: unsupported option $opt + echo Usage: format_releasetag.sh [-f format] version-string + exit 1 + ;; + esac +done + +shift $((OPTIND-1)) + +ver=$1 + +# check for user-named release tag - leading 0 followed by alpha + +user_ver=0 +if echo ${ver:0:1} | grep -q 0 +then + if echo ${ver:1:1} | grep -q '[[:alpha:]]' + then + user_ver=1 + fi +fi + +if [ "$2" != "" ] +then + echo Error: extra arguments + echo Usage: format_releasetag.sh [-f format] version-string + exit 1 +fi + +if [ "$fmt" = "" ] +then + fmt=text +fi + +if echo $ver | grep -q '[^ A-Za-z0-9_.]' +then + echo Error: bad format of version $ver + exit 1 +fi + +# strip off leading 'R' + +if echo ${ver:0:1} | grep -q R +then + ver=${ver:1} +fi + +# get to all underscores and parse + +newver=$(echo $ver | sed 's/\./_/g') +numseparators=$(echo $newver | grep -bo '_'|wc -l) +maj=$(echo $newver | cut -d_ -f1) +if [ $numseparators -gt 0 ] +then + min=$(echo $newver | cut -d_ -f2) +else + min=0 +fi +if [ $numseparators -gt 1 ] +then + mai=$(echo $newver | cut -d_ -f3) +else + mai=0 +fi +if [ $numseparators -gt 2 ] +then + pat=$(echo $newver | cut -d_ -f4) +else + pat=0 +fi +if [ $numseparators -gt 3 ] +then + bld=$(echo $newver | cut -d_ -f5) +else + bld=0 +fi + +# alpha only allowed in $mai +checkAlpha major "$maj" || exit 1 +checkAlpha minor "$min" || exit 1 +checkAlpha patch "$pat" || exit 1 +checkAlpha build "$bld" || exit 1 + +# Handle no mai/pat/bld + +if [ "$mai" = "" ] +then + mai=0 +fi +if [ "$pat" = "" ] +then + pat=0 +fi +if [ "$bld" = "" ] +then + bld=0 +fi + +# handle I format + +if echo $maj | grep -q I +then + bld=$(parseBldI $maj) + maj=$(parseOutI $maj) +fi +if echo $min | grep -q I +then + bld=$(parseBldI $min) + min=$(parseOutI $min) +fi +if echo $mai | grep -q I +then + bld=$(parseBldI $mai) + mai=$(parseOutI $mai) +fi +if echo $pat | grep -q I +then + bld=$(parseBldI $pat) + pat=$(parseOutI $pat) +fi + +# parse maintenance in the form m<alpha>n + +mai_alpha=0 + +m= +n= +alpha=PV +if echo $mai | grep -q [[:alpha:]] +then + mai_alpha=1 + pat=0 + alphaP=$(echo $mai | grep -bo '[[:alpha:]]'|head -n 1|cut -d: -f1) + nP1=$(echo ${mai:$alphaP} | grep -bo '[[:digit:]]'|head -n 1|cut -d: -f1) + nP=$((alphaP + nP1)) + m=${mai:0:alphaP} + alpha=${mai:alphaP:$((dP-alphaP))} + n=${mai:$nP} + bld=$(echo $newver | cut -d_ -f4) + if echo $alpha | grep -q I + then + iformat=1 + else + iformat=0 + fi + if echo $alpha | grep -q P + then + qual=poweron + elif echo $alpha | grep -q A + then + qual=alpha + alpha=$(echo $alpha | tr '[:upper:]' '[:lower:]') + elif echo $alpha | grep -q B + then + qual=beta + alpha=$(echo $alpha | tr '[:upper:]' '[:lower:]') + elif echo $alpha | grep -q RC + then + qual=rc + alpha=$(echo $alpha | tr '[:upper:]' '[:lower:]') + elif echo $alpha | grep -q PV + then + qual=pv + elif [ $user_ver -eq 1 ] + then + qual=pv + elif [ $iformat -eq 0 ] + then + echo Error: Unknown release tag quality: $alpha + exit 1 + fi + if [ $iformat -eq 1 ] + then + iP=$(echo $mai | grep -bo I |head -n 1|cut -d: -f1) + bld=${mai:$((iP+1))} + else + bld=$(echo $newver | cut -d_ -f4) + fi +else + qual=pv +fi + + +case $fmt in + text) + if [ $user_ver -eq 1 ] + then + echo $ver + exit 0 + fi + q=$(getQual $qual $pat $n) + if [ $mai_alpha -eq 1 ] + then + echo ${maj}.${min}.${mai}.${bld} + else + echo ${maj}.${min}.${mai}.${pat}.${bld} + fi + ;; + rpm) + if [ $user_ver -eq 1 ] + then + echo $ver + exit 0 + fi + q=$(getQual $qual $pat $n) + if [ $mai_alpha -eq 1 ] + then + echo ${maj}.${min}.${m}.0-${alpha}${n}.${bld} + else + echo ${maj}.${min}.${mai}.${pat}-${bld} + fi + ;; + briefrpm) + if [ $user_ver -eq 1 ] + then + echo $ver + exit 0 + fi + if [ $mai_alpha -eq 1 ] + then + m1=$m + else + m1=$mai + fi + if [ $pat -gt 0 ] + then + maint=".${m1}.${pat}" + elif [ $m1 -gt 0 ] + then + maint=".${m1}" + else + maint= + fi + q=$(getQual $qual $pat $n) + if [ $mai_alpha -eq 1 ] + then + echo ${maj}.${min}${maint}-${alpha}${n}.${bld} + else + echo ${maj}.${min}${maint}-${bld} + fi + ;; + debian) + if [ $user_ver -eq 1 ] + then + echo $ver + exit 0 + fi + q=$(getQual $qual $pat $n) + if [ $mai_alpha -eq 1 ] + then + echo ${maj}.${min}.${m}.0${alpha}${n}.${bld} + else + echo ${maj}.${min}.${mai}.${pat}.${bld} + fi + ;; + 32bit) + if [ $user_ver -eq 1 ] + then + echo 0x00000000 + exit 0 + fi + if [ $mai_alpha -eq 1 ] + then + m1=$m + else + m1=$mai + fi + byte1=$((maj<<4 | min&0xf0)) + byte2=$(((min & 0x0f)<<4 | (m1 & 0x0f))) + q=$(getQual $qual $pat $n) + if [ $pat -gt 0 ] + then + byte3=$((q<<4 | (pat & 0xff))) + else + bldHiBits=$(((bld & 0xf00) >> 8)) + byte3=$((q<<4 | bldHiBits)) + fi + byte4=$((bld & 0xff)) + printf "0x%02X%02X%02X%02X\n" $byte1 $byte2 $byte3 $byte4 + ;; + 64bit) + if [ $user_ver -eq 1 ] + then + echo 0x0000000000000000 + exit 0 + fi + byte1=${maj} + byte2=${min} + if [ $mai_alpha -eq 1 ] + then + m1=$m + else + m1=$mai + fi + byte3=${m1} + if [ $pat -gt 0 ] + then + q=14 + else + q=$(getQual $qual $pat $n) + fi + byte4=$((q<<4 | (pat & 0xff))) + bytes5to8=$bld + printf "0x%02X%02X%02X%02X%08X\n" $byte1 $byte2 $byte3 $byte4 $bytes5to8 + ;; + ?) + echo Error: bad format: $fmt + exit 1 + ;; +esac + + +exit 0 diff --git a/Makerules/Defs.Common b/Makerules/Defs.Common index 29c4a49..d7745c2 100755 --- a/Makerules/Defs.Common +++ b/Makerules/Defs.Common @@ -68,14 +68,14 @@ PREP = prep PATCH_VERSION = patch_version PATCH_ENG_VERSION = $(MAKETOOLS_DIR)/patch_engineer_version.sh PATCH_BRAND = patch_brand -CONVERT_RELEASETAG = $(MAKETOOLS_DIR)/format_releasetag.py +CONVERT_RELEASETAG = $(MAKETOOLS_DIR)/format_releasetag.sh else # the prefered setting, use tools in source itself PREP = $(MAKETOOLS_DIR)/prep.sh PATCH_VERSION = $(MAKETOOLS_DIR)/patch_version/patch_version PATCH_ENG_VERSION = $(MAKETOOLS_DIR)/patch_engineer_version.sh PATCH_BRAND = $(MAKETOOLS_DIR)/patch_version/patch_brand -CONVERT_RELEASETAG = $(MAKETOOLS_DIR)/format_releasetag.py +CONVERT_RELEASETAG = $(MAKETOOLS_DIR)/format_releasetag.sh endif # CD Generation diff --git a/opa-fm.spec.in b/opa-fm.spec.in index d39a21a..8a66f22 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -29,7 +29,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm -Version: 10.9.2.1 +Version: 10.9.2.2 Release: 1%{?dist} %if 0%{?rhel} Epoch: 1 @@ -60,7 +60,7 @@ __RPM_DEBUG The %{name} contains Intel Omni-Path fabric management applications. This includes: the Subnet Manager, Baseboard Manager, Performance Manager, Fabric Executive, and some fabric management tools. -IFSComponent: FM 10.9.2.1.1%{?dist} +IFSComponent: FM 10.9.2.2.1%{?dist} %prep %setup -q -c
0
78e4916cc1928689d74f5da9c3047c6cafe24218
01org/opa-fm
Clean up and clarification of .spec file, renamed to opa-fm.spec
commit 78e4916cc1928689d74f5da9c3047c6cafe24218 Author: Erik E. Kahn <[email protected]> Date: Thu Jun 16 07:51:53 2016 -0400 Clean up and clarification of .spec file, renamed to opa-fm.spec diff --git a/README b/README index 8f96e99..7d55fc6 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ OPA Fabric Manager 1. mkdir -p $HOME/rpmbuild/{SOURCES,RPMS,SRPMS} 2. tar czf $HOME/rpmbuild/SOURCES/opa-fm.tar.gz --exclude-vcs . - 3. rpmbuild -ba ./opafm.spec + 3. rpmbuild -ba ./opa-fm.spec This will build the opa-fm RPM in $HOME/rpmbuild/RPMS(architecture)/ diff --git a/opafm.spec b/opa-fm.spec similarity index 85% rename from opafm.spec rename to opa-fm.spec index fedfdb5..62cc75e 100644 --- a/opafm.spec +++ b/opa-fm.spec @@ -30,40 +30,27 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.1.0.0 -Release: 145 +Release: 145%{?dist} Summary: Intel Omni-Path Fabric Management Software -Group: System Environment/Daemons -License: BSD -Url: http://www.intel.com/ +License: GPLv2 or BSD +Url: https://github.com/01org/opa-fm +# tarball created by: +# git clone https://github.com/01org/opa-fm.git +# cd opa-fm +# tar czf opa-fm.tar.gz --exclude-vcs . Source0: %{name}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: x86_64 +# The Intel(R) OPA product line is only available on x86_64 platforms at this time. -Requires: rdma +Requires: rdma openssl -#BuildRequires: libibverbs-devel >= 1.1-1, libibumad-devel, libibmad-devel -AutoReq: no -%if 0%{?rhel} || 0%{?fedora} BuildRequires: expat-devel, libibumad-devel, libibverbs-devel, libibmad-devel, openssl-devel -Requires: expat, libibmad, libibumad, libibverbs, openssl -%else -Requires: libexpat1, libibmad5, libibumad, libibverbs1, openssl -BuildRequires: libexpat-devel, libibumad-devel, libibverbs-devel, libibmad5-devel, libopenssl-devel -%endif -%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7 || 0%{?fedora} -BuildRequires: systemd %{?systemd_requires} %{?BuildRequires} -Requires: systemd %{?systemd_requires} -%else +%if 0%{?rhel} && 0%{?rhel} < 7 Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig %endif -ExcludeArch: s390, s390x - -%if 0%{?suse_version} >= 1110 -%debug_package -%endif %description The %{name} contains Intel Omni-Path fabric management applications. This @@ -129,9 +116,6 @@ ln -s /opt/opafm/bin/fm_cmdall $RPM_BUILD_ROOT%{_sbindir}/opafmcmdall cd stage.rpm cp -t $RPM_BUILD_ROOT%{_mandir}/man8 %fm_mans -%clean -rm -rf $RPM_BUILD_ROOT - %post if [ $1 = 1 ]; then if [ $(command -v systemctl) ]; then @@ -150,7 +134,6 @@ if [ $1 = 1 ] || [ $1 = 0 ]; then fi %files -%defattr(-,root,root,-) %doc Esm/README %if 0%{?rhel} && 0%{?rhel} < 7 @@ -169,7 +152,6 @@ fi %{_mandir}/man8/* %changelog -* Thu Oct 09 2014 Kaike Wan <[email protected]> - 10.0.0.0-177 -- Initial version - +* Thu Jun 2 2016 Scott Breyer <[email protected]> - 10.1.0.0-145 +- Update to latest from build 10.1.0.0.145 (FM 10.1.0.0.145)
0
3a8d876ee20d3c4931955a41bdc8a02b84330767
01org/opa-fm
For fat tree, only return when routing calculation is not needed.
commit 3a8d876ee20d3c4931955a41bdc8a02b84330767 Author: Scott Breyer <[email protected]> Date: Thu Dec 6 10:49:28 2018 -0500 For fat tree, only return when routing calculation is not needed. diff --git a/Esm/build.env b/Esm/build.env index dfc82c0..6482b18 100644 --- a/Esm/build.env +++ b/Esm/build.env @@ -1,5 +1,5 @@ # Adjust the environment variables if necessary export PRODUCT=VIEO_HOST -export RELEASE_TAG=10_8_0_0_205 +export RELEASE_TAG=10_8_0_0_206 export BUILD_CONFIG=${BUILD_CONFIG:-"release"} export BUILD_WITH_STACK=OPENIB diff --git a/Esm/ib/src/smi/sm/sm_routing.c b/Esm/ib/src/smi/sm/sm_routing.c index 0838e15..05d22bf 100644 --- a/Esm/ib/src/smi/sm/sm_routing.c +++ b/Esm/ib/src/smi/sm/sm_routing.c @@ -342,7 +342,8 @@ sm_routing_route_old_switch(Topology_t *src_topop, Topology_t *dst_topop, Node_t if ((new_endnodesInUse.nset_m || src_topop->num_endports != dst_topop->num_endports) && - dst_topop->routingModule->funcs.can_send_partial_routes()) { + dst_topop->routingModule->funcs.can_send_partial_routes() && + !dst_topop->routingModule->funcs.needs_routing_recalc) { if (sm_config.sm_debug_routing) IB_LOG_INFINI_INFO_FMT(__func__, "Partial LFT send - switch %s", sm_nodeDescString(nodep)); sm_send_partial_lft(sm_topop, nodep, &sm_topop->deltaLidBlocks); diff --git a/opa-fm.spec.in b/opa-fm.spec.in index 7f1c728..ff3fbc3 100644 --- a/opa-fm.spec.in +++ b/opa-fm.spec.in @@ -30,7 +30,7 @@ #[ICS VERSION STRING: unknown] Name: opa-fm Version: 10.8.0.0 -Release: 205%{?dist} +Release: 206%{?dist} %if 0%{?rhel} Epoch: 1 %endif
0
b794ddf65f1fdb2140988e5b1786cd9eb0fb5685
1up-lab/OneupUploaderBundle
Test against PHP 7.2 (#344)
commit b794ddf65f1fdb2140988e5b1786cd9eb0fb5685 Author: Andrey Bolonin <[email protected]> Date: Mon Jul 16 12:58:39 2018 +0300 Test against PHP 7.2 (#344) diff --git a/.travis.yml b/.travis.yml index 8a47f8b..6c5d8bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ language: php php: - 7.0 - 7.1 + - 7.2 env: - - SYMFONY_VERSION=^3.3 + - SYMFONY_VERSION=^3.4 - SYMFONY_VERSION=^4.0 - SYMFONY_VERSION=dev-master diff --git a/Tests/App/config/config.yml b/Tests/App/config/config.yml index dd084cd..5ac5e52 100644 --- a/Tests/App/config/config.yml +++ b/Tests/App/config/config.yml @@ -7,7 +7,9 @@ framework: templating: engines: ['php'] default_locale: en - session: ~ + session: + storage_id: session.storage.native + handler_id: ~ test: ~ security:
0
794f71ee56642fa3f09312cfb86977aa5ff7bd53
1up-lab/OneupUploaderBundle
Symfony4 support (#300) * Symfony 4 support * Add KERNEL_CLASS env in phpunit.xml.dist * Upgrade flysystem-bundle to 3.0 * Require phpunit ^6.5 * Fixed constraints * Also allow phpunit ^4.4 * Removed support for Symfony 2.x, adaptions for Symfony 4
commit 794f71ee56642fa3f09312cfb86977aa5ff7bd53 Author: David Greminger <[email protected]> Date: Mon Dec 4 09:43:43 2017 +0100 Symfony4 support (#300) * Symfony 4 support * Add KERNEL_CLASS env in phpunit.xml.dist * Upgrade flysystem-bundle to 3.0 * Require phpunit ^6.5 * Fixed constraints * Also allow phpunit ^4.4 * Removed support for Symfony 2.x, adaptions for Symfony 4 diff --git a/.travis.yml b/.travis.yml index 15534ea..8a47f8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,8 @@ php: - 7.1 env: - - SYMFONY_VERSION=2.7.* - - SYMFONY_VERSION=2.8.* - - SYMFONY_VERSION=3.3.* + - SYMFONY_VERSION=^3.3 + - SYMFONY_VERSION=^4.0 - SYMFONY_VERSION=dev-master cache: @@ -17,9 +16,14 @@ cache: matrix: allow_failures: - env: SYMFONY_VERSION=dev-master + exclude: + - php: 7.0 + env: SYMFONY_VERSION=^4.0 + - php: 7.0 + env: SYMFONY_VERSION=dev-master before_install: - - composer selfupdate + - travis_retry composer selfupdate before_script: - travis_wait composer require symfony/framework-bundle:${SYMFONY_VERSION} --prefer-source diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index 487a972..d8a6e1c 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -209,12 +209,10 @@ abstract class AbstractController */ protected function getRequest() { - if (version_compare(Kernel::VERSION, '2.4', '<=')) { return $this->container->get('request'); } return $this->container->get('request_stack')->getMasterRequest(); } - } diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 61dc35f..af8af94 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -2,6 +2,7 @@ namespace Oneup\UploaderBundle\DependencyInjection; +use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; @@ -103,15 +104,16 @@ class OneupUploaderExtension extends Extension $controllerName = sprintf('oneup_uploader.controller.%s', $customFrontend['name']); $controllerType = $customFrontend['class']; - if(empty($controllerName) || empty($controllerType)) + if (empty($controllerName) || empty($controllerType)) { throw new ServiceNotFoundException('Empty controller class or name. If you really want to use a custom frontend implementation, be sure to provide a class and a name.'); + } } $errorHandler = $this->createErrorHandler($config); // create controllers based on mapping $this->container - ->register($controllerName, $controllerType) + ->setDefinition($controllerName, (new Definition($controllerType))->setPublic(true)) ->addArgument(new Reference('service_container')) ->addArgument($storageService) @@ -147,7 +149,7 @@ class OneupUploaderExtension extends Extension $storageClass = sprintf('%%oneup_uploader.chunks_storage.%s.class%%', $config['type']); - switch($config['type']) { + switch ($config['type']) { case 'filesystem': $config['directory'] = is_null($config['directory']) ? sprintf('%s/uploader/chunks', $this->container->getParameter('kernel.cache_dir')) : @@ -164,7 +166,8 @@ class OneupUploaderExtension extends Extension $this->registerFilesystem( $config['type'], 'oneup_uploader.chunks_storage', - $storageClass, $config['filesystem'], + $storageClass, + $config['filesystem'], $config['sync_buffer_size'], $config['stream_wrapper'], $config['prefix'] @@ -183,7 +186,6 @@ class OneupUploaderExtension extends Extension throw new \InvalidArgumentException(sprintf('Filesystem "%s" is invalid', $config['type'])); break; } - } protected function createStorageService(&$config, $key, $orphanage = false) @@ -268,8 +270,9 @@ class OneupUploaderExtension extends Extension break; } - if (strlen($filesystem) <= 0) + if (strlen($filesystem) <= 0) { throw new ServiceNotFoundException('Empty service name'); + } $streamWrapper = $this->normalizeStreamWrapper($streamWrapper); @@ -299,7 +302,9 @@ class OneupUploaderExtension extends Extension switch ($last) { case 'g': $numericInput *= 1024; + // no break case 'm': $numericInput *= 1024; + // no break case 'k': $numericInput *= 1024; return $numericInput; diff --git a/Resources/config/templating.xml b/Resources/config/templating.xml index a53e1f8..8a80df7 100644 --- a/Resources/config/templating.xml +++ b/Resources/config/templating.xml @@ -6,7 +6,7 @@ <services> - <service id="oneup_uploader.templating.uploader_helper" class="Oneup\UploaderBundle\Templating\Helper\UploaderHelper"> + <service id="oneup_uploader.templating.uploader_helper" class="Oneup\UploaderBundle\Templating\Helper\UploaderHelper" public="true"> <argument type="service" id="router" /> <argument>%oneup_uploader.maxsize%</argument> <tag name="templating.helper" alias="oneup_uploader" /> diff --git a/Resources/config/uploader.xml b/Resources/config/uploader.xml index 4389640..1ab7116 100644 --- a/Resources/config/uploader.xml +++ b/Resources/config/uploader.xml @@ -29,22 +29,22 @@ <services> <!-- managers --> - <service id="oneup_uploader.chunk_manager" class="%oneup_uploader.chunks.manager.class%"> + <service id="oneup_uploader.chunk_manager" class="%oneup_uploader.chunks.manager.class%" public="true"> <argument>%oneup_uploader.chunks%</argument> <argument type="service" id="oneup_uploader.chunks_storage" /> </service> - <service id="oneup_uploader.orphanage_manager" class="%oneup_uploader.orphanage.manager.class%"> + <service id="oneup_uploader.orphanage_manager" class="%oneup_uploader.orphanage.manager.class%" public="true"> <argument type="service" id="service_container" /> <argument>%oneup_uploader.orphanage%</argument> </service> <!-- namer --> - <service id="oneup_uploader.namer.uniqid" class="%oneup_uploader.namer.uniqid.class%" /> + <service id="oneup_uploader.namer.uniqid" class="%oneup_uploader.namer.uniqid.class%" public="true"/> <service id="oneup_uploader.namer.urlsafe" class="%oneup_uploader.namer.urlsafename.class%" /> <!-- routing --> - <service id="oneup_uploader.routing.loader" class="%oneup_uploader.routing.loader.class%"> + <service id="oneup_uploader.routing.loader" class="%oneup_uploader.routing.loader.class%" public="true"> <argument>%oneup_uploader.controllers%</argument> <tag name="routing.loader" /> </service> diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index 6dbdc4a..9e076cb 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -25,7 +25,6 @@ class RouteLoader extends Loader $routes = new RouteCollection(); foreach ($this->controllers as $type => $controllerArray) { - $service = $controllerArray[0]; $options = $controllerArray[1]; diff --git a/Tests/App/AppKernel.php b/Tests/App/AppKernel.php index f1aa6f0..4b82ab1 100644 --- a/Tests/App/AppKernel.php +++ b/Tests/App/AppKernel.php @@ -1,5 +1,9 @@ <?php +use Oneup\UploaderBundle\OneupUploaderBundle; +use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle; +use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\SecurityBundle\SecurityBundle; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; @@ -8,12 +12,12 @@ class AppKernel extends Kernel public function registerBundles() { $bundles = array( - new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), - new Symfony\Bundle\SecurityBundle\SecurityBundle(), - new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), + new FrameworkBundle(), + new SecurityBundle(), + new SensioFrameworkExtraBundle(), // bundle to test - new Oneup\UploaderBundle\OneupUploaderBundle(), + new OneupUploaderBundle(), ); return $bundles; diff --git a/Tests/App/config/config.yml b/Tests/App/config/config.yml index 382b566..1db4696 100644 --- a/Tests/App/config/config.yml +++ b/Tests/App/config/config.yml @@ -3,7 +3,7 @@ framework: secret: secret router: resource: "%kernel.root_dir%/config/routing.yml" - strict_requirements: %kernel.debug% + strict_requirements: "%kernel.debug%" templating: engines: ['php'] default_locale: en @@ -16,13 +16,13 @@ oneup_uploader: fineuploader: frontend: fineuploader storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" fineuploader_validation: frontend: fineuploader max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -33,13 +33,13 @@ oneup_uploader: fancyupload: frontend: fancyupload storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" fancyupload_validation: frontend: fancyupload max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -49,13 +49,13 @@ oneup_uploader: dropzone: frontend: dropzone storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" dropzone_validation: frontend: dropzone max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -65,13 +65,13 @@ oneup_uploader: yui3: frontend: yui3 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" yui3_validation: frontend: yui3 max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -81,13 +81,13 @@ oneup_uploader: plupload: frontend: plupload storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" plupload_validation: frontend: plupload max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -97,13 +97,13 @@ oneup_uploader: uploadify: frontend: uploadify storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" uploadify_validation: frontend: uploadify max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" allowed_mimetypes: image/jpeg : ['jpg', 'jpeg', 'jpe'] @@ -113,14 +113,14 @@ oneup_uploader: blueimp: frontend: blueimp storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" error_handler: oneup_uploader.error_handler.blueimp blueimp_validation: frontend: blueimp max_size: 256 storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" error_handler: oneup_uploader.error_handler.blueimp allowed_mimetypes: @@ -131,4 +131,4 @@ oneup_uploader: mooupload: frontend: mooupload storage: - directory: %kernel.root_dir%/cache/%kernel.environment%/upload + directory: "%kernel.root_dir%/cache/%kernel.environment%/upload" diff --git a/Tests/Controller/AbstractChunkedUploadTest.php b/Tests/Controller/AbstractChunkedUploadTest.php index e3566d6..7409acb 100644 --- a/Tests/Controller/AbstractChunkedUploadTest.php +++ b/Tests/Controller/AbstractChunkedUploadTest.php @@ -34,7 +34,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $client = static::createClient(); $dispatcher = $client->getContainer()->get('event_dispatcher'); - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function(PreUploadEvent $event) use (&$me, $basename) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$me, $basename) { $file = $event->getFile(); $me->assertNotNull($file->getClientSize()); @@ -42,7 +42,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $me->assertEquals($file->getBasename(), $basename); }); - $dispatcher->addListener(UploadEvents::VALIDATION, function(ValidationEvent $event) use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount) { ++ $validationCount; }); @@ -77,7 +77,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $client = static::createClient(); $dispatcher = $client->getContainer()->get('event_dispatcher'); - $dispatcher->addListener(UploadEvents::POST_CHUNK_UPLOAD, function(PostChunkUploadEvent $event) use (&$chunkCount, $chunkSize, &$me) { + $dispatcher->addListener(UploadEvents::POST_CHUNK_UPLOAD, function (PostChunkUploadEvent $event) use (&$chunkCount, $chunkSize, &$me) { ++ $chunkCount; $chunk = $event->getChunk(); @@ -85,7 +85,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $me->assertEquals($chunkSize, $chunk->getSize()); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function(Event $event) use (&$uploadCount) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (Event $event) use (&$uploadCount) { ++ $uploadCount; }); diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index 2b0abf7..654642f 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -2,16 +2,27 @@ namespace Oneup\UploaderBundle\Tests\Controller; +use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; +use Symfony\Bundle\FrameworkBundle\Client; use Symfony\Component\Finder\Finder; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; abstract class AbstractControllerTest extends WebTestCase { protected $createdFiles; + + /** + * @var Client + */ protected $client; protected $container; protected $requestHeaders; + /** + * @var UploaderHelper + */ + protected $helper; + public function setUp() { $this->client = static::createClient(); diff --git a/Tests/Controller/AbstractUploadTest.php b/Tests/Controller/AbstractUploadTest.php index dd98b5e..4908c34 100644 --- a/Tests/Controller/AbstractUploadTest.php +++ b/Tests/Controller/AbstractUploadTest.php @@ -50,7 +50,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest $uploadCount = 0; $preValidation = 1; - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function(PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { $preValidation -= 2; $file = $event->getFile(); @@ -62,7 +62,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest $me->assertInstanceOf('Symfony\Component\HttpFoundation\File\UploadedFile', $file); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function(PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { ++ $uploadCount; $preValidation *= -1; diff --git a/Tests/Controller/AbstractValidationTest.php b/Tests/Controller/AbstractValidationTest.php index fee2f35..58b7bc7 100644 --- a/Tests/Controller/AbstractValidationTest.php +++ b/Tests/Controller/AbstractValidationTest.php @@ -35,7 +35,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest // event data $validationCount = 0; - $dispatcher->addListener(UploadEvents::VALIDATION, function() use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount) { ++ $validationCount; }); @@ -54,7 +54,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $validationCount = 0; $me = $this; - $dispatcher->addListener(UploadEvents::VALIDATION, function(ValidationEvent $event) use (&$validationCount, &$me) { + $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount, &$me) { $me->assertInstanceOf('Symfony\Component\HttpFoundation\Request', $event->getRequest()); // to be sure this listener is called diff --git a/Tests/Controller/BlueimpTest.php b/Tests/Controller/BlueimpTest.php index b9c3f82..9573836 100644 --- a/Tests/Controller/BlueimpTest.php +++ b/Tests/Controller/BlueimpTest.php @@ -3,7 +3,6 @@ namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; -use Oneup\UploaderBundle\Tests\Controller\AbstractUploadTest; use Oneup\UploaderBundle\UploadEvents; use Oneup\UploaderBundle\Event\PreUploadEvent; use Oneup\UploaderBundle\Event\PostUploadEvent; @@ -54,7 +53,7 @@ class BlueimpTest extends AbstractUploadTest $uploadCount = 0; $preValidation = 1; - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function(PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { $preValidation -= 2; $file = $event->getFile(); @@ -66,7 +65,7 @@ class BlueimpTest extends AbstractUploadTest $me->assertInstanceOf('Symfony\Component\HttpFoundation\File\UploadedFile', $file); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function(PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { ++ $uploadCount; $preValidation *= -1; diff --git a/Tests/Controller/BlueimpValidationTest.php b/Tests/Controller/BlueimpValidationTest.php index ca8c8bd..c2e95eb 100644 --- a/Tests/Controller/BlueimpValidationTest.php +++ b/Tests/Controller/BlueimpValidationTest.php @@ -34,7 +34,7 @@ class BlueimpValidationTest extends AbstractValidationTest // event data $validationCount = 0; - $dispatcher->addListener(UploadEvents::VALIDATION, function() use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount) { ++ $validationCount; }); diff --git a/Tests/Controller/FileBagExtractorTest.php b/Tests/Controller/FileBagExtractorTest.php index e757ebb..b50f16e 100644 --- a/Tests/Controller/FileBagExtractorTest.php +++ b/Tests/Controller/FileBagExtractorTest.php @@ -2,10 +2,11 @@ namespace Oneup\UploaderBundle\Tests\Controller; +use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\FileBag; -class FileBagExtractorText extends \PHPUnit_Framework_TestCase +class FileBagExtractorText extends TestCase { protected $method; protected $mock; diff --git a/Tests/DependencyInjection/OneupUploaderExtensionTest.php b/Tests/DependencyInjection/OneupUploaderExtensionTest.php index 85ac094..a7f8a1d 100644 --- a/Tests/DependencyInjection/OneupUploaderExtensionTest.php +++ b/Tests/DependencyInjection/OneupUploaderExtensionTest.php @@ -2,7 +2,9 @@ namespace Oneup\UploaderBundle\Tests\DependencyInjection; -class OneupUploaderExtensionTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class OneupUploaderExtensionTest extends TestCase { public function testValueToByteTransformer() { diff --git a/Tests/Routing/RouteLoaderTest.php b/Tests/Routing/RouteLoaderTest.php index d462101..115334a 100644 --- a/Tests/Routing/RouteLoaderTest.php +++ b/Tests/Routing/RouteLoaderTest.php @@ -3,8 +3,9 @@ namespace Oneup\UploaderBundle\Tests\Routing; use Oneup\UploaderBundle\Routing\RouteLoader; +use PHPUnit\Framework\TestCase; -class RouteLoaderTest extends \PHPUnit_Framework_TestCase +class RouteLoaderTest extends TestCase { public function testRouteLoader() { diff --git a/Tests/Templating/TemplateHelperTest.php b/Tests/Templating/TemplateHelperTest.php index eda82e9..9ec74b1 100644 --- a/Tests/Templating/TemplateHelperTest.php +++ b/Tests/Templating/TemplateHelperTest.php @@ -19,7 +19,7 @@ class TemplateHelperTest extends WebTestCase public function testNonExistentMappingForMaxSize() { - $this->setExpectedException('\InvalidArgumentException'); + $this->expectException('\InvalidArgumentException'); $client = static::createClient(); $container = $client->getContainer(); diff --git a/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php b/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php index ca14e11..23d8b2d 100644 --- a/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php @@ -3,10 +3,11 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; use Oneup\UploaderBundle\Uploader\Chunk\Storage\ChunkStorageInterface; +use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; -abstract class ChunkStorageTest extends \PHPUnit_Framework_TestCase +abstract class ChunkStorageTest extends TestCase { protected $tmpDir; /** diff --git a/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php b/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php index 375d450..6ade0b7 100644 --- a/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php @@ -31,7 +31,6 @@ class GaufretteStorageTest extends ChunkStorageTest $this->tmpDir = $this->parentDir.'/'.$this->chunkKey; $system->mkdir($this->tmpDir); - } public function tearDown() @@ -39,5 +38,4 @@ class GaufretteStorageTest extends ChunkStorageTest $system = new Filesystem(); $system->remove($this->parentDir); } - } diff --git a/Tests/Uploader/File/FileTest.php b/Tests/Uploader/File/FileTest.php index 2753089..bb7f573 100644 --- a/Tests/Uploader/File/FileTest.php +++ b/Tests/Uploader/File/FileTest.php @@ -1,7 +1,9 @@ <?php namespace Oneup\UploaderBundle\Tests\Uploader\File; -abstract class FileTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +abstract class FileTest extends TestCase { protected $file; protected $pathname; diff --git a/Tests/Uploader/Naming/UniqidNamerTest.php b/Tests/Uploader/Naming/UniqidNamerTest.php index 38c9b75..a389b2d 100644 --- a/Tests/Uploader/Naming/UniqidNamerTest.php +++ b/Tests/Uploader/Naming/UniqidNamerTest.php @@ -3,8 +3,9 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Naming; use Oneup\UploaderBundle\Uploader\Naming\UniqidNamer; +use PHPUnit\Framework\TestCase; -class UniqidNamerTest extends \PHPUnit_Framework_TestCase +class UniqidNamerTest extends TestCase { public function testNamerReturnsName() { diff --git a/Tests/Uploader/Naming/UrlSafeNamerTest.php b/Tests/Uploader/Naming/UrlSafeNamerTest.php index 1707940..fa7aa89 100644 --- a/Tests/Uploader/Naming/UrlSafeNamerTest.php +++ b/Tests/Uploader/Naming/UrlSafeNamerTest.php @@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class UrlSafeNamerTest extends FileTest { - public function setUp() { $this->path = sys_get_temp_dir(). '/oneup_namer_test'; @@ -36,12 +35,11 @@ class UrlSafeNamerTest extends FileTest { $namer = new UrlSafeNamer(); // Trying 200 times just to be sure - for($i = 0; $i < 200; $i++) { + for ($i = 0; $i < 200; $i++) { $name1 = $namer->name($this->file); $name2 = $namer->name($this->file); $this->assertNotEquals($name1, $name2); } - } public function tearDown() @@ -49,5 +47,4 @@ class UrlSafeNamerTest extends FileTest unlink($this->pathname); rmdir($this->path); } - } diff --git a/Tests/Uploader/Orphanage/OrphanageManagerTest.php b/Tests/Uploader/Orphanage/OrphanageManagerTest.php index c81cb88..6ed9c97 100644 --- a/Tests/Uploader/Orphanage/OrphanageManagerTest.php +++ b/Tests/Uploader/Orphanage/OrphanageManagerTest.php @@ -2,11 +2,12 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Orphanage; +use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; use Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager; -class OrphanageManagerTest extends \PHPUnit_Framework_TestCase +class OrphanageManagerTest extends TestCase { protected $numberOfOrphans; protected $orphanagePath; @@ -89,7 +90,7 @@ class OrphanageManagerTest extends \PHPUnit_Framework_TestCase protected function getContainerMock() { - $mock = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $mock = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $mock ->expects($this->any()) ->method('get') diff --git a/Tests/Uploader/Response/EmptyResponseTest.php b/Tests/Uploader/Response/EmptyResponseTest.php index 6bbef6f..be2c959 100644 --- a/Tests/Uploader/Response/EmptyResponseTest.php +++ b/Tests/Uploader/Response/EmptyResponseTest.php @@ -3,8 +3,9 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; +use PHPUnit\Framework\TestCase; -class TestEmptyResponse extends \PHPUnit_Framework_TestCase +class TestEmptyResponse extends TestCase { public function testEmpty() { diff --git a/Tests/Uploader/Response/FineUploaderResponseTest.php b/Tests/Uploader/Response/FineUploaderResponseTest.php index 1190669..463bf44 100644 --- a/Tests/Uploader/Response/FineUploaderResponseTest.php +++ b/Tests/Uploader/Response/FineUploaderResponseTest.php @@ -3,8 +3,9 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\FineUploaderResponse; +use PHPUnit\Framework\TestCase; -class TestFineUploaderResponse extends \PHPUnit_Framework_TestCase +class TestFineUploaderResponse extends TestCase { public function testCreationOfResponse() { diff --git a/Tests/Uploader/Response/MooUploadResponseTest.php b/Tests/Uploader/Response/MooUploadResponseTest.php index 41295bb..059991f 100644 --- a/Tests/Uploader/Response/MooUploadResponseTest.php +++ b/Tests/Uploader/Response/MooUploadResponseTest.php @@ -3,8 +3,9 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\MooUploadResponse; +use PHPUnit\Framework\TestCase; -class MooUploadResponseTest extends \PHPUnit_Framework_TestCase +class MooUploadResponseTest extends TestCase { public function testCreationOfResponse() { @@ -61,7 +62,6 @@ class MooUploadResponseTest extends \PHPUnit_Framework_TestCase public function testAssemble() { - $response = new MooUploadResponse(); $response->setId(3); $response->setName('grumpy_cat.jpg'); diff --git a/Tests/Uploader/Storage/FilesystemStorageTest.php b/Tests/Uploader/Storage/FilesystemStorageTest.php index 1ae9964..82ec674 100644 --- a/Tests/Uploader/Storage/FilesystemStorageTest.php +++ b/Tests/Uploader/Storage/FilesystemStorageTest.php @@ -3,12 +3,13 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; +use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\UploadedFile; use Oneup\UploaderBundle\Uploader\Storage\FilesystemStorage; -class FilesystemStorageTest extends \PHPUnit_Framework_TestCase +class FilesystemStorageTest extends TestCase { protected $directory; protected $file; diff --git a/Tests/Uploader/Storage/FlysystemStorageTest.php b/Tests/Uploader/Storage/FlysystemStorageTest.php index 121a7ec..0105dbf 100644 --- a/Tests/Uploader/Storage/FlysystemStorageTest.php +++ b/Tests/Uploader/Storage/FlysystemStorageTest.php @@ -6,11 +6,12 @@ use League\Flysystem\Adapter\Local as Adapter; use League\Flysystem\Filesystem as FSAdapter; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; use Oneup\UploaderBundle\Uploader\Storage\FlysystemStorage as Storage; +use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\UploadedFile; -class FlysystemStorageTest extends \PHPUnit_Framework_TestCase +class FlysystemStorageTest extends TestCase { protected $directory; diff --git a/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php b/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php index e915501..e1b970d 100644 --- a/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php +++ b/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php @@ -3,20 +3,21 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use \AmazonS3 as AmazonClient; +use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\UploadedFile; use Gaufrette\Filesystem as GaufretteFilesystem; use Gaufrette\Adapter\AmazonS3 as S3Adapter; use Oneup\UploaderBundle\Uploader\Storage\GaufretteStorage; -class GaufretteAmazonS3StorageTest extends \PHPUnit_Framework_TestCase +class GaufretteAmazonS3StorageTest extends TestCase { protected $directory; protected $storage; public function setUp() { - if( + if ( "" == getenv('AWS_ACCESS_KEY_ID') || "" == getenv('AWS_SECRET_ACCESS_KEY') || "" == getenv('AWS_BUCKET') @@ -58,12 +59,12 @@ class GaufretteAmazonS3StorageTest extends \PHPUnit_Framework_TestCase $this->assertCount(2, $files['keys']); foreach ($files['keys'] as $filename) { - if ($filename === $this->prefix) { - // ignore the prefix directory - continue; - } - $this->assertEquals($this->prefix. '/notsogrumpyanymore.jpeg', $filename); - $this->assertEquals(1024, strlen($this->filesystem->read($filename))); + if ($filename === $this->prefix) { + // ignore the prefix directory + continue; + } + $this->assertEquals($this->prefix. '/notsogrumpyanymore.jpeg', $filename); + $this->assertEquals(1024, strlen($this->filesystem->read($filename))); } } @@ -71,9 +72,9 @@ class GaufretteAmazonS3StorageTest extends \PHPUnit_Framework_TestCase { $files = $this->filesystem->listKeys($this->prefix); foreach ($files['keys'] as $filename) { - if ($this->filesystem->has($filename)) { - $this->filesystem->delete($filename); - } + if ($this->filesystem->has($filename)) { + $this->filesystem->delete($filename); + } } } } diff --git a/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php b/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php index a9e55cb..92e2d70 100644 --- a/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php +++ b/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php @@ -1,6 +1,7 @@ <?php namespace Oneup\UploaderBundle\Tests\Uploader\Storage; + use Gaufrette\File; use Gaufrette\Filesystem as GaufretteFilesystem; diff --git a/Tests/Uploader/Storage/GaufretteStorageTest.php b/Tests/Uploader/Storage/GaufretteStorageTest.php index 008e618..742f5c5 100644 --- a/Tests/Uploader/Storage/GaufretteStorageTest.php +++ b/Tests/Uploader/Storage/GaufretteStorageTest.php @@ -3,6 +3,7 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; +use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -10,7 +11,7 @@ use Gaufrette\Filesystem as GaufretteFilesystem; use Gaufrette\Adapter\Local as Adapter; use Oneup\UploaderBundle\Uploader\Storage\GaufretteStorage; -class GaufretteStorageTest extends \PHPUnit_Framework_TestCase +class GaufretteStorageTest extends TestCase { protected $directory; protected $storage; diff --git a/Tests/Uploader/Storage/OrphanageTest.php b/Tests/Uploader/Storage/OrphanageTest.php index c539e7f..adfe7f8 100644 --- a/Tests/Uploader/Storage/OrphanageTest.php +++ b/Tests/Uploader/Storage/OrphanageTest.php @@ -3,10 +3,11 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Oneup\UploaderBundle\Uploader\Storage\FlysystemOrphanageStorage; +use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; -abstract class OrphanageTest extends \PHPUnit_Framework_TestCase +abstract class OrphanageTest extends TestCase { protected $tempDirectory; protected $realDirectory; diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index a1756af..d00c03f 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -1,24 +1,13 @@ <?php -$loader = @include __DIR__ . '/../vendor/autoload.php'; -if (!$loader) { - die(<<<'EOT' -You must set up the project dependencies, run the following commands: -wget http://getcomposer.org/composer.phar -php composer.phar install -EOT - ); +if (!($loader = @include __DIR__.'/../vendor/autoload.php')) { + echo <<<'EOT' +You need to install the project dependencies using Composer: +$ wget http://getcomposer.org/composer.phar +OR +$ curl -s https://getcomposer.org/installer | php +$ php composer.phar install --dev +$ phpunit +EOT; + exit(1); } - -passthru(sprintf('rm -rf %s/App/cache', __DIR__)); -spl_autoload_register(function($class) { - if (0 === strpos($class, 'Oneup\\UploaderBundle\\')) { - $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; - if (!stream_resolve_include_path($path)) { - return false; - } - require_once $path; - - return true; - } -}); diff --git a/Uploader/Chunk/Storage/FilesystemStorage.php b/Uploader/Chunk/Storage/FilesystemStorage.php index acc98d7..e91e258 100644 --- a/Uploader/Chunk/Storage/FilesystemStorage.php +++ b/Uploader/Chunk/Storage/FilesystemStorage.php @@ -44,8 +44,9 @@ class FilesystemStorage implements ChunkStorageInterface $name = sprintf('%s_%s', $index, $original); // create directory if it does not yet exist - if(!$filesystem->exists($path)) + if (!$filesystem->exists($path)) { $filesystem->mkdir(sprintf('%s/%s', $this->directory, $uuid)); + } return $chunk->move($path, $name); } @@ -62,7 +63,6 @@ class FilesystemStorage implements ChunkStorageInterface $iterator->next(); while ($iterator->valid()) { - $file = $iterator->current(); if (false === file_put_contents($base->getPathname(), file_get_contents($file->getPathname()), \FILE_APPEND | \LOCK_EX)) { @@ -109,7 +109,7 @@ class FilesystemStorage implements ChunkStorageInterface { $finder = new Finder(); $finder - ->in(sprintf('%s/%s', $this->directory, $uuid))->files()->sort(function(\SplFileInfo $a, \SplFileInfo $b) { + ->in(sprintf('%s/%s', $this->directory, $uuid))->files()->sort(function (\SplFileInfo $a, \SplFileInfo $b) { $t = explode('_', $a->getBasename()); $s = explode('_', $b->getBasename()); $t = (int) $t[0]; diff --git a/Uploader/ErrorHandler/DropzoneErrorHandler.php b/Uploader/ErrorHandler/DropzoneErrorHandler.php index 5b0ad44..e07ddc3 100755 --- a/Uploader/ErrorHandler/DropzoneErrorHandler.php +++ b/Uploader/ErrorHandler/DropzoneErrorHandler.php @@ -8,12 +8,12 @@ use Oneup\UploaderBundle\Uploader\Response\AbstractResponse; class DropzoneErrorHandler implements ErrorHandlerInterface { - public function addException(AbstractResponse $response, Exception $exception) - { - $errors[] = $exception; - $message = $exception->getMessage(); - // Dropzone wants JSON with error message put into 'error' field. - // This overwrites the previous error message, so we're only displaying the last one. - $response['error'] = $message; - } + public function addException(AbstractResponse $response, Exception $exception) + { + $errors[] = $exception; + $message = $exception->getMessage(); + // Dropzone wants JSON with error message put into 'error' field. + // This overwrites the previous error message, so we're only displaying the last one. + $response['error'] = $message; + } } diff --git a/Uploader/File/FilesystemFile.php b/Uploader/File/FilesystemFile.php index 539df73..3d6d21e 100644 --- a/Uploader/File/FilesystemFile.php +++ b/Uploader/File/FilesystemFile.php @@ -14,7 +14,6 @@ class FilesystemFile extends UploadedFile implements FileInterface } else { parent::__construct($file->getPathname(), $file->getBasename(), $file->getMimeType(), $file->getSize(), 0, true); } - } public function getExtension() diff --git a/Uploader/File/FlysystemFile.php b/Uploader/File/FlysystemFile.php index dc36e69..0b287d8 100644 --- a/Uploader/File/FlysystemFile.php +++ b/Uploader/File/FlysystemFile.php @@ -6,7 +6,6 @@ use League\Flysystem\Filesystem; class FlysystemFile extends File implements FileInterface { - protected $streamWrapperPrefix; protected $mimeType; diff --git a/Uploader/File/GaufretteFile.php b/Uploader/File/GaufretteFile.php index 1d38ab8..0965be2 100644 --- a/Uploader/File/GaufretteFile.php +++ b/Uploader/File/GaufretteFile.php @@ -118,5 +118,4 @@ class GaufretteFile extends File implements FileInterface { return $this->filesystem; } - } diff --git a/Uploader/Gaufrette/StreamManager.php b/Uploader/Gaufrette/StreamManager.php index e745eef..073c6f1 100644 --- a/Uploader/Gaufrette/StreamManager.php +++ b/Uploader/Gaufrette/StreamManager.php @@ -25,7 +25,7 @@ class StreamManager protected function ensureRemotePathExists($path) { - if(!$this->filesystem->has($path)) { + if (!$this->filesystem->has($path)) { $this->filesystem->write($path, '', true); } } @@ -53,5 +53,4 @@ class StreamManager $dst->close(); $src->close(); } - } diff --git a/Uploader/Response/FineUploaderResponse.php b/Uploader/Response/FineUploaderResponse.php index 52c8570..df29edf 100644 --- a/Uploader/Response/FineUploaderResponse.php +++ b/Uploader/Response/FineUploaderResponse.php @@ -25,11 +25,13 @@ class FineUploaderResponse extends AbstractResponse $data = $this->data; $data['success'] = $this->success; - if($this->success) + if ($this->success) { unset($data['error']); + } - if(!$this->success) + if (!$this->success) { $data['error'] = $this->error; + } return $data; } diff --git a/Uploader/Storage/FilesystemOrphanageStorage.php b/Uploader/Storage/FilesystemOrphanageStorage.php index 8888e16..7290869 100644 --- a/Uploader/Storage/FilesystemOrphanageStorage.php +++ b/Uploader/Storage/FilesystemOrphanageStorage.php @@ -33,8 +33,9 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS public function upload(FileInterface $file, $name, $path = null) { - if(!$this->session->isStarted()) + if (!$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); + } return parent::upload($file, $name, $this->getPath()); } diff --git a/Uploader/Storage/FlysystemOrphanageStorage.php b/Uploader/Storage/FlysystemOrphanageStorage.php index 6cc00ab..021a1f6 100644 --- a/Uploader/Storage/FlysystemOrphanageStorage.php +++ b/Uploader/Storage/FlysystemOrphanageStorage.php @@ -96,5 +96,4 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto // should be relative. return sprintf('%s/%s/%s', $this->config['directory'], $this->session->getId(), $this->type); } - } diff --git a/Uploader/Storage/GaufretteOrphanageStorage.php b/Uploader/Storage/GaufretteOrphanageStorage.php index b003236..aea9922 100644 --- a/Uploader/Storage/GaufretteOrphanageStorage.php +++ b/Uploader/Storage/GaufretteOrphanageStorage.php @@ -40,8 +40,9 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto public function upload(FileInterface $file, $name, $path = null) { - if(!$this->session->isStarted()) + if (!$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); + } return parent::upload($file, $name, $this->getPath()); } @@ -89,5 +90,4 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto // should be relative. return sprintf('%s/%s/%s', $this->config['directory'], $this->session->getId(), $this->type); } - } diff --git a/Uploader/Storage/GaufretteStorage.php b/Uploader/Storage/GaufretteStorage.php index d83687e..84c5602 100644 --- a/Uploader/Storage/GaufretteStorage.php +++ b/Uploader/Storage/GaufretteStorage.php @@ -65,5 +65,4 @@ class GaufretteStorage extends StreamManager implements StorageInterface return new GaufretteFile($this->filesystem->get($path), $this->filesystem, $this->streamWrapperPrefix); } - } diff --git a/composer.json b/composer.json index d68b779..25b7e00 100644 --- a/composer.json +++ b/composer.json @@ -15,36 +15,41 @@ ], "require": { - "php":">=5.4", - "symfony/framework-bundle": "^2.4|^3.0", - "symfony/finder": "^2.4|^3.0", - "symfony/translation": "^2.4|^3.0", - "symfony/asset": "^2.4|^3.0", - "symfony/templating": "^2.4|^3.0", - "paragonie/random_compat": "^1.1|^2.0" + "php": ">=5.4", + "paragonie/random_compat": "^1.1|^2.0", + "symfony/asset": "^3.0|^4.0", + "symfony/finder": "^3.0|^4.0", + "symfony/framework-bundle": "^3.0|4.0", + "symfony/templating": "^3.0|^4.0", + "symfony/translation": "^3.0|^4.0", + "symfony/yaml": "^3.0|^4.0" }, "require-dev": { "amazonwebservices/aws-sdk-for-php": "1.5.*", "knplabs/gaufrette": "0.2.*@dev", - "oneup/flysystem-bundle": "^1.2", - "phpunit/phpunit": "^4.4", - "sensio/framework-extra-bundle": "2.*|^3.0", - "symfony/browser-kit": "2.*|^3.0", - "symfony/class-loader": "2.*|^3.0", - "symfony/security-bundle": "2.*|^3.0", + "oneup/flysystem-bundle": "^1.2|^2.0|^3.0", + "phpunit/phpunit": "^6.5", + "sensio/framework-extra-bundle": "^5.0", + "symfony/browser-kit": "^3.0|^4.0", + "symfony/class-loader": "^3.0|^4.0", + "symfony/security-bundle": "^3.0|^4.0", + "symfony/var-dumper": "^3.0|^4.0", "twistor/flysystem-stream-wrapper": "^1.0" }, - + "config": { + "sort-packages": true + }, "suggest": { "knplabs/knp-gaufrette-bundle": "0.1.*", - "oneup/flysystem-bundle": "^1.2", + "oneup/flysystem-bundle": "^3.0", "twistor/flysystem-stream-wrapper": "^1.0 (Required when using Flysystem)" }, "autoload": { - "psr-0": { "Oneup\\UploaderBundle": "" } - }, - - "target-dir": "Oneup/UploaderBundle" + "psr-4": { + "Oneup\\UploaderBundle\\": "" + }, + "classmap": [ "Tests/App/AppKernel.php"] + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7caffb4..6f2e1c0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,6 +3,7 @@ <phpunit bootstrap="./Tests/bootstrap.php" colors="true"> <php> <server name="KERNEL_DIR" value="Tests/App" /> + <server name="KERNEL_CLASS" value="AppKernel" /> </php> <testsuites>
0
1f6fa09ab087d125bbb62204d0ccc00da5369f5d
1up-lab/OneupUploaderBundle
Merge pull request #286 from Lctrs/composer-constraints Allow versions >=2.0 of paragonie/random_compat
commit 1f6fa09ab087d125bbb62204d0ccc00da5369f5d (from bdef0e2c77ffc20516b012956b2dfeed68b9bbf4) Merge: bdef0e2 79faf20 Author: David Greminger <[email protected]> Date: Mon Sep 18 15:31:47 2017 +0200 Merge pull request #286 from Lctrs/composer-constraints Allow versions >=2.0 of paragonie/random_compat diff --git a/composer.json b/composer.json index a5cea42..497d403 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php":">=5.4", "symfony/framework-bundle": "^2.4.0|~3.0", "symfony/finder": "^2.4.0|~3.0", - "paragonie/random_compat": "^1.1" + "paragonie/random_compat": "^1.1|^2.0" }, "require-dev": {
0
da546beef7587cceefa93504cd6b90e3553e614f
1up-lab/OneupUploaderBundle
Merge pull request #30 from albenik/di-fix Replace direct params usage with %param.name%.
commit da546beef7587cceefa93504cd6b90e3553e614f (from e6f99c59d9b613fd35e0c1cb9cfc663dc53705c3) Merge: e6f99c5 41ac1d8 Author: Jim Schmid <[email protected]> Date: Thu Jul 18 04:13:04 2013 -0700 Merge pull request #30 from albenik/di-fix Replace direct params usage with %param.name%. diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 108394c..a7cdbba 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -66,7 +66,7 @@ class OneupUploaderExtension extends Extension ; $container - ->register($storageName, $container->getParameter(sprintf('oneup_uploader.storage.%s.class', $mapping['storage']['type']))) + ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $mapping['storage']['type'])) ->addArgument($mapping['storage']['directory']) ; } @@ -79,7 +79,7 @@ class OneupUploaderExtension extends Extension throw new ServiceNotFoundException('Empty service name'); $container - ->register($storageName, $container->getParameter(sprintf('oneup_uploader.storage.%s.class', $mapping['storage']['type']))) + ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $mapping['storage']['type'])) ->addArgument(new Reference($mapping['storage']['filesystem'])) ; } @@ -92,7 +92,7 @@ class OneupUploaderExtension extends Extension // this mapping wants to use the orphanage, so create // a masked filesystem for the controller $container - ->register($orphanageName, $container->getParameter('oneup_uploader.orphanage.class')) + ->register($orphanageName, '%oneup_uploader.orphanage.class%') ->addArgument($storageService) ->addArgument(new Reference('session')) ->addArgument($config['orphanage'])
0
34c38d9b2face8c39a1244c9f471d5d38918e754
1up-lab/OneupUploaderBundle
catch non-existing directory exception. This happens if getFiles is called and no file has yet been uploaded. IMO, this fixes #110
commit 34c38d9b2face8c39a1244c9f471d5d38918e754 Author: Miha Vrhovnik <[email protected]> Date: Thu Jun 19 10:43:53 2014 +0200 catch non-existing directory exception. This happens if getFiles is called and no file has yet been uploaded. IMO, this fixes #110 diff --git a/Uploader/Storage/FilesystemOrphanageStorage.php b/Uploader/Storage/FilesystemOrphanageStorage.php index e0026cc..8a2e0e4 100644 --- a/Uploader/Storage/FilesystemOrphanageStorage.php +++ b/Uploader/Storage/FilesystemOrphanageStorage.php @@ -58,7 +58,15 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS public function getFiles() { $finder = new Finder(); - $finder->in($this->getFindPath())->files(); + try { + $finder->in($this->getFindPath())->files(); + } catch (\InvalidArgumentException $e) { + //catch non-existing directory exception. + //This can happen if getFiles is called and no file has yet been uploaded + + //push empty array into the finder so we can emulate no files found + $finder->append(array()); + } return $finder; }
0
8aaf201af2e6be88a91d293170b96a5106ce87e2
1up-lab/OneupUploaderBundle
Changed handlechuckedupload to use the getrequest
commit 8aaf201af2e6be88a91d293170b96a5106ce87e2 Author: Martin Aarhof <[email protected]> Date: Wed Dec 9 10:29:54 2015 +0100 Changed handlechuckedupload to use the getrequest diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index 4cd14c2..4cf0f13 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -45,7 +45,7 @@ abstract class AbstractChunkedController extends AbstractController protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request) { // get basic container stuff - $request = $this->container->get('request_stack')->getMasterRequest(); + $request = $this->getRequest(); $chunkManager = $this->container->get('oneup_uploader.chunk_manager'); // get information about this chunked request
0
d44dcb8959bb1a7c69da5876e910b724022901f7
1up-lab/OneupUploaderBundle
Run php-cs-fixer (#372) * Run php-cs-fixer * Fix global vars * Skip before_script for lowest deps test * Fix lowest deps
commit d44dcb8959bb1a7c69da5876e910b724022901f7 Author: David Greminger <[email protected]> Date: Fri Feb 14 13:58:20 2020 +0100 Run php-cs-fixer (#372) * Run php-cs-fixer * Fix global vars * Skip before_script for lowest deps test * Fix lowest deps diff --git a/.gitignore b/.gitignore index 6b0fe35..88ffa08 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ composer.lock phpunit.xml vendor log +var Tests/App/cache Tests/App/logs -.idea \ No newline at end of file +.idea diff --git a/.php_cs.dist b/.php_cs.dist index 26cb4c5..5b92c22 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -2,6 +2,8 @@ $finder = PhpCsFixer\Finder::create() ->exclude('Tests/App/cache') + ->exclude('vendor') + ->exclude('var') ->in([__DIR__]) ; @@ -9,11 +11,14 @@ return PhpCsFixer\Config::create() ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, - '@PHP71Migration' => false, - '@PHP71Migration:risky' => false, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, '@PHPUnit60Migration:risky' => true, 'align_multiline_comment' => true, 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => [ + 'spacing' => 'one', + ], 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'general_phpdoc_annotation_remove' => [ @@ -39,7 +44,7 @@ return PhpCsFixer\Config::create() ], 'strict_comparison' => true, 'strict_param' => true, - 'void_return' => false, + 'void_return' => true, ]) ->setFinder($finder) ->setRiskyAllowed(true) diff --git a/.travis.yml b/.travis.yml index dda0dda..bc82ef5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,17 @@ cache: matrix: allow_failures: - env: SYMFONY_VERSION=dev-master - exclude: - - php: 7.0 - env: SYMFONY_VERSION=^4.0 - - php: 7.0 - env: SYMFONY_VERSION=dev-master + +jobs: + include: + - stage: test + name: 'Test installing lowest dependencies' + php: 7.3 + install: + - travis_wait composer update --prefer-lowest --prefer-stable --no-interaction --no-suggest + before_script: skip + script: + - ./vendor/bin/phpunit before_install: - travis_retry composer selfupdate diff --git a/Command/ClearChunkCommand.php b/Command/ClearChunkCommand.php index df59977..99d2e1b 100644 --- a/Command/ClearChunkCommand.php +++ b/Command/ClearChunkCommand.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Command; use Oneup\UploaderBundle\Uploader\Chunk\ChunkManager; @@ -20,7 +22,7 @@ class ClearChunkCommand extends Command $this->manager = $manager; } - protected function configure() + protected function configure(): void { $this ->setName(self::$defaultName) // BC with 2.7 @@ -28,7 +30,7 @@ class ClearChunkCommand extends Command ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->manager->clear(); } diff --git a/Command/ClearOrphansCommand.php b/Command/ClearOrphansCommand.php index af4a87c..e56fa05 100644 --- a/Command/ClearOrphansCommand.php +++ b/Command/ClearOrphansCommand.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Command; use Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager; @@ -20,7 +22,7 @@ class ClearOrphansCommand extends Command $this->manager = $manager; } - protected function configure() + protected function configure(): void { $this ->setName(self::$defaultName) // BC with 2.7 @@ -28,7 +30,7 @@ class ClearOrphansCommand extends Command ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->manager->clear(); } diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index d36e384..7075afe 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Event\PostChunkUploadEvent; @@ -41,7 +43,7 @@ abstract class AbstractChunkedController extends AbstractController * @param responseInterface $response - A response object * @param Request $request - The request object */ - protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request) + protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request): void { // get basic container stuff $chunkManager = $this->container->get('oneup_uploader.chunk_manager'); @@ -88,7 +90,7 @@ abstract class AbstractChunkedController extends AbstractController * @param Request $request - The request object * @param bool $isLast - True if this is the last chunk, false otherwise */ - protected function dispatchChunkEvents($uploaded, ResponseInterface $response, Request $request, $isLast) + protected function dispatchChunkEvents($uploaded, ResponseInterface $response, Request $request, $isLast): void { // dispatch post upload event (both the specific and the general) $postUploadEvent = new PostChunkUploadEvent($uploaded, $response, $request, $isLast, $this->type, $this->config); diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index fc6bd8c..f04627d 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Event\PostPersistEvent; @@ -85,7 +87,7 @@ abstract class AbstractController $fileIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($fileBag), \RecursiveIteratorIterator::SELF_FIRST); foreach ($fileIterator as $file) { - if (is_array($file) || null === $file) { + if (\is_array($file) || null === $file) { continue; } @@ -106,7 +108,7 @@ abstract class AbstractController * @param ResponseInterface $response a response object * @param Request $request the request object */ - protected function handleUpload($file, ResponseInterface $response, Request $request) + protected function handleUpload($file, ResponseInterface $response, Request $request): void { // wrap the file if it is not done yet which can only happen // if it wasn't a chunked upload, in which case it is definitely @@ -135,7 +137,7 @@ abstract class AbstractController * @param ResponseInterface $response a response object * @param Request $request the request object */ - protected function dispatchPreUploadEvent(FileInterface $uploaded, ResponseInterface $response, Request $request) + protected function dispatchPreUploadEvent(FileInterface $uploaded, ResponseInterface $response, Request $request): void { // dispatch pre upload event (both the specific and the general) $preUploadEvent = new PreUploadEvent($uploaded, $response, $request, $this->type, $this->config); @@ -150,7 +152,7 @@ abstract class AbstractController * @param ResponseInterface $response a response object * @param Request $request the request object */ - protected function dispatchPostEvents($uploaded, ResponseInterface $response, Request $request) + protected function dispatchPostEvents($uploaded, ResponseInterface $response, Request $request): void { // dispatch post upload event (both the specific and the general) $postUploadEvent = new PostUploadEvent($uploaded, $response, $request, $this->type, $this->config); @@ -163,7 +165,7 @@ abstract class AbstractController } } - protected function validate(FileInterface $file, Request $request, ResponseInterface $response = null) + protected function validate(FileInterface $file, Request $request, ResponseInterface $response = null): void { $event = new ValidationEvent($file, $request, $this->config, $this->type, $response); @@ -187,7 +189,7 @@ abstract class AbstractController $response = new JsonResponse($data, $statusCode); $response->headers->set('Vary', 'Accept'); - if (!in_array('application/json', $request->getAcceptableContentTypes(), true)) { + if (!\in_array('application/json', $request->getAcceptableContentTypes(), true)) { $response->headers->set('Content-type', 'text/plain'); } @@ -212,9 +214,8 @@ abstract class AbstractController * Event dispatch proxy that avoids using deprecated interfaces. * * @param $event - * @param string $eventName */ - protected function dispatchEvent($event, string $eventName) + protected function dispatchEvent($event, string $eventName): void { $dispatcher = $this->container->get('event_dispatcher'); diff --git a/Controller/BlueimpController.php b/Controller/BlueimpController.php index 434dc27..80311a1 100644 --- a/Controller/BlueimpController.php +++ b/Controller/BlueimpController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/Controller/DropzoneController.php b/Controller/DropzoneController.php index 18709b9..f0f0bc1 100644 --- a/Controller/DropzoneController.php +++ b/Controller/DropzoneController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/Controller/FancyUploadController.php b/Controller/FancyUploadController.php index eebe851..860ece2 100644 --- a/Controller/FancyUploadController.php +++ b/Controller/FancyUploadController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/Controller/FineUploaderController.php b/Controller/FineUploaderController.php index 64fec95..b8459d6 100644 --- a/Controller/FineUploaderController.php +++ b/Controller/FineUploaderController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\FineUploaderResponse; diff --git a/Controller/MooUploadController.php b/Controller/MooUploadController.php index 5de4e19..3791a74 100644 --- a/Controller/MooUploadController.php +++ b/Controller/MooUploadController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\MooUploadResponse; @@ -91,7 +93,7 @@ class MooUploadController extends AbstractChunkedController // loop through every char and convert it to an integer // we need this for sorting foreach (str_split($id) as $char) { - $ints += ord($char); + $ints += \ord($char); } return $ints; diff --git a/Controller/PluploadController.php b/Controller/PluploadController.php index aa43885..9fb0eca 100644 --- a/Controller/PluploadController.php +++ b/Controller/PluploadController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/Controller/UploadifyController.php b/Controller/UploadifyController.php index 32bd758..1cbf81e 100644 --- a/Controller/UploadifyController.php +++ b/Controller/UploadifyController.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/Controller/YUI3Controller.php b/Controller/YUI3Controller.php index 66aae07..fd9edad 100644 --- a/Controller/YUI3Controller.php +++ b/Controller/YUI3Controller.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; diff --git a/DependencyInjection/Compiler/ControllerPass.php b/DependencyInjection/Compiler/ControllerPass.php index 347cb4a..f9f36db 100644 --- a/DependencyInjection/Compiler/ControllerPass.php +++ b/DependencyInjection/Compiler/ControllerPass.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index cb39ca1..3975b77 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; @@ -90,9 +92,9 @@ class Configuration implements ConfigurationInterface } return [ - 'upload' => $v.'upload', - 'progress' => $v.'progress', - 'cancel' => $v.'cancel', + 'upload' => $v . 'upload', + 'progress' => $v . 'progress', + 'cancel' => $v . 'cancel', ]; }) ->end() diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 6ae8f8f..34af81a 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; @@ -21,13 +23,13 @@ class OneupUploaderExtension extends Extension protected $container; protected $config; - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); $this->config = $this->processConfiguration($configuration, $configs); $this->container = $container; - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('uploader.xml'); $loader->load('templating.xml'); $loader->load('validators.xml'); @@ -59,7 +61,7 @@ class OneupUploaderExtension extends Extension $container->setParameter('oneup_uploader.maxsize', $maxsize); } - protected function processOrphanageConfig() + protected function processOrphanageConfig(): void { if ('filesystem' === $this->config['chunks']['storage']['type']) { $defaultDir = sprintf('%s/uploader/orphanage', $this->container->getParameter('kernel.cache_dir')); @@ -74,7 +76,7 @@ class OneupUploaderExtension extends Extension protected function processMapping($key, &$mapping) { - $mapping['max_size'] = $mapping['max_size'] < 0 || is_string($mapping['max_size']) ? + $mapping['max_size'] = $mapping['max_size'] < 0 || \is_string($mapping['max_size']) ? $this->getMaxUploadSize($mapping['max_size']) : $mapping['max_size'] ; @@ -131,11 +133,11 @@ class OneupUploaderExtension extends Extension protected function createErrorHandler($config) { return null === $config['error_handler'] ? - new Reference('oneup_uploader.error_handler.'.$config['frontend']) : + new Reference('oneup_uploader.error_handler.' . $config['frontend']) : new Reference($config['error_handler']); } - protected function verifyPhpVersion($config) + protected function verifyPhpVersion($config): void { if ($config['enable_progress'] || $config['enable_cancelation']) { if (strnatcmp(PHP_VERSION, '5.4.0') < 0) { @@ -144,7 +146,7 @@ class OneupUploaderExtension extends Extension } } - protected function createChunkStorageService() + protected function createChunkStorageService(): void { $config = &$this->config['chunks']['storage']; @@ -208,7 +210,7 @@ class OneupUploaderExtension extends Extension $folder = $this->config['mappings'][$key]['root_folder'] ? '' : $key; $config['directory'] = null === $config['directory'] ? - \sprintf('%s/uploads/%s', $this->getTargetDir(), $folder) : + sprintf('%s/uploads/%s', $this->getTargetDir(), $folder) : $this->normalizePath($config['directory']) ; @@ -257,7 +259,7 @@ class OneupUploaderExtension extends Extension return $storageService; } - protected function registerFilesystem($type, $key, $class, $filesystem, $buffer, $streamWrapper = null, $prefix = '') + protected function registerFilesystem($type, $key, $class, $filesystem, $buffer, $streamWrapper = null, $prefix = ''): void { switch ($type) { case 'gaufrette': @@ -272,7 +274,7 @@ class OneupUploaderExtension extends Extension break; } - if (strlen($filesystem) <= 0) { + if (\strlen($filesystem) <= 0) { throw new ServiceNotFoundException('Empty service name'); } @@ -302,8 +304,8 @@ class OneupUploaderExtension extends Extension protected function getValueInBytes($input) { // see: http://www.php.net/manual/en/function.ini-get.php - $input = trim($input); - $last = strtolower($input[strlen($input) - 1]); + $input = trim((string) $input); + $last = strtolower($input[\strlen($input) - 1]); $numericInput = (float) substr($input, 0, -1); switch ($last) { @@ -330,18 +332,18 @@ class OneupUploaderExtension extends Extension return null; } - return rtrim($input, '/').'/'; + return rtrim($input, '/') . '/'; } protected function getTargetDir() { $projectDir = $this->container->hasParameter('kernel.project_dir') ? $this->container->getParameter('kernel.project_dir') : - $this->container->getParameter('kernel.root_dir').'/..'; - $publicDir = \sprintf('%s/public', $projectDir); + $this->container->getParameter('kernel.root_dir') . '/..'; + $publicDir = sprintf('%s/public', $projectDir); if (!is_dir($publicDir)) { - $publicDir = \sprintf('%s/web', $projectDir); + $publicDir = sprintf('%s/web', $projectDir); } return $publicDir; diff --git a/Event/PostChunkUploadEvent.php b/Event/PostChunkUploadEvent.php index a5c9a0b..d291b90 100644 --- a/Event/PostChunkUploadEvent.php +++ b/Event/PostChunkUploadEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Event; use Oneup\UploaderBundle\Uploader\Response\ResponseInterface; diff --git a/Event/PostPersistEvent.php b/Event/PostPersistEvent.php index 877a917..02ee101 100644 --- a/Event/PostPersistEvent.php +++ b/Event/PostPersistEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Event; use Oneup\UploaderBundle\Uploader\Response\ResponseInterface; diff --git a/Event/PostUploadEvent.php b/Event/PostUploadEvent.php index bcadc7d..6ab4908 100644 --- a/Event/PostUploadEvent.php +++ b/Event/PostUploadEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Event; use Oneup\UploaderBundle\Uploader\Response\ResponseInterface; diff --git a/Event/PreUploadEvent.php b/Event/PreUploadEvent.php index 210401d..4bfae5d 100644 --- a/Event/PreUploadEvent.php +++ b/Event/PreUploadEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Event; use Oneup\UploaderBundle\Uploader\Response\ResponseInterface; diff --git a/Event/ValidationEvent.php b/Event/ValidationEvent.php index baf917f..a13fbc5 100644 --- a/Event/ValidationEvent.php +++ b/Event/ValidationEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Event; use Oneup\UploaderBundle\Uploader\File\FileInterface; diff --git a/EventListener/AllowedMimetypeAndExtensionValidationListener.php b/EventListener/AllowedMimetypeAndExtensionValidationListener.php index 46dfdc2..95c558d 100644 --- a/EventListener/AllowedMimetypeAndExtensionValidationListener.php +++ b/EventListener/AllowedMimetypeAndExtensionValidationListener.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\EventListener; use Oneup\UploaderBundle\Event\ValidationEvent; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\Uploader\Exception\ValidationException; class AllowedMimetypeAndExtensionValidationListener { - public function onValidate(ValidationEvent $event) + public function onValidate(ValidationEvent $event): void { $config = $event->getConfig(); $file = $event->getFile(); @@ -24,7 +26,7 @@ class AllowedMimetypeAndExtensionValidationListener } if (empty($config['allowed_mimetypes'][$mimetype]) - || in_array($extension, $config['allowed_mimetypes'][$mimetype], true) + || \in_array($extension, $config['allowed_mimetypes'][$mimetype], true) ) { return; } diff --git a/EventListener/DisallowedMimetypeValidationListener.php b/EventListener/DisallowedMimetypeValidationListener.php index 9044042..7421f3e 100644 --- a/EventListener/DisallowedMimetypeValidationListener.php +++ b/EventListener/DisallowedMimetypeValidationListener.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\EventListener; use Oneup\UploaderBundle\Event\ValidationEvent; @@ -7,18 +9,18 @@ use Oneup\UploaderBundle\Uploader\Exception\ValidationException; class DisallowedMimetypeValidationListener { - public function onValidate(ValidationEvent $event) + public function onValidate(ValidationEvent $event): void { $config = $event->getConfig(); $file = $event->getFile(); - if (0 === count($config['disallowed_mimetypes'])) { + if (0 === \count($config['disallowed_mimetypes'])) { return; } $mimetype = $file->getExtension(); - if (in_array($mimetype, $config['disallowed_mimetypes'], true)) { + if (\in_array($mimetype, $config['disallowed_mimetypes'], true)) { throw new ValidationException('error.blacklist'); } } diff --git a/EventListener/MaxSizeValidationListener.php b/EventListener/MaxSizeValidationListener.php index a1cd72b..4216c21 100644 --- a/EventListener/MaxSizeValidationListener.php +++ b/EventListener/MaxSizeValidationListener.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\EventListener; use Oneup\UploaderBundle\Event\ValidationEvent; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\Uploader\Exception\ValidationException; class MaxSizeValidationListener { - public function onValidate(ValidationEvent $event) + public function onValidate(ValidationEvent $event): void { $config = $event->getConfig(); $file = $event->getFile(); diff --git a/OneupUploaderBundle.php b/OneupUploaderBundle.php index 2d3f0c3..6a00a12 100644 --- a/OneupUploaderBundle.php +++ b/OneupUploaderBundle.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle; use Oneup\UploaderBundle\DependencyInjection\Compiler\ControllerPass; @@ -8,7 +10,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class OneupUploaderBundle extends Bundle { - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { parent::build($container); $container->addCompilerPass(new ControllerPass()); diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index c242fc2..74c615d 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Routing; use Symfony\Component\Config\Loader\Loader; @@ -37,7 +39,7 @@ class RouteLoader extends Loader $upload = new Route( $options['endpoints']['upload'] ?: sprintf('%s/_uploader/%s/upload', $options['route_prefix'], $type), - ['_controller' => $service.$separator.'upload', '_format' => 'json'], + ['_controller' => $service . $separator . 'upload', '_format' => 'json'], [], [], '', @@ -48,7 +50,7 @@ class RouteLoader extends Loader if (true === $options['enable_progress']) { $progress = new Route( $options['endpoints']['progress'] ?: sprintf('%s/_uploader/%s/progress', $options['route_prefix'], $type), - ['_controller' => $service.$separator.'progress', '_format' => 'json'], + ['_controller' => $service . $separator . 'progress', '_format' => 'json'], [], [], '', @@ -62,7 +64,7 @@ class RouteLoader extends Loader if (true === $options['enable_cancelation']) { $progress = new Route( $options['endpoints']['cancel'] ?: sprintf('%s/_uploader/%s/cancel', $options['route_prefix'], $type), - ['_controller' => $service.$separator.'cancel', '_format' => 'json'], + ['_controller' => $service . $separator . 'cancel', '_format' => 'json'], [], [], '', diff --git a/Templating/Helper/UploaderHelper.php b/Templating/Helper/UploaderHelper.php index 4b5765d..2d4893e 100644 --- a/Templating/Helper/UploaderHelper.php +++ b/Templating/Helper/UploaderHelper.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Templating\Helper; use Symfony\Component\Routing\RouterInterface; @@ -43,7 +45,7 @@ class UploaderHelper extends Helper public function maxSize($key) { - if (!array_key_exists($key, $this->maxsize)) { + if (!\array_key_exists($key, $this->maxsize)) { throw new \InvalidArgumentException('No such mapping found to get maxsize for.'); } diff --git a/Tests/App/AppKernel.php b/Tests/App/AppKernel.php index b1e3cb3..d42c3ff 100644 --- a/Tests/App/AppKernel.php +++ b/Tests/App/AppKernel.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + use Oneup\UploaderBundle\OneupUploaderBundle; use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; @@ -23,8 +25,8 @@ class AppKernel extends Kernel return $bundles; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { - $loader->load(__DIR__.'/config/config.yml'); + $loader->load(__DIR__ . '/config/config.yml'); } } diff --git a/Tests/Controller/AbstractChunkedUploadTest.php b/Tests/Controller/AbstractChunkedUploadTest.php index 40a9f25..0653fe5 100644 --- a/Tests/Controller/AbstractChunkedUploadTest.php +++ b/Tests/Controller/AbstractChunkedUploadTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Event\PostChunkUploadEvent; @@ -12,7 +14,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest { protected $total = 6; - public function testChunkedUpload() + public function testChunkedUpload(): void { // assemble a request $me = $this; @@ -30,7 +32,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $client = static::createClient(); $dispatcher = $client->getContainer()->get('event_dispatcher'); - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$me, $basename) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$me, $basename): void { $file = $event->getFile(); $me->assertNotNull($file->getClientSize()); @@ -38,7 +40,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $me->assertEquals($file->getBasename(), $basename); }); - $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount): void { ++$validationCount; }); @@ -58,7 +60,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest } } - public function testEvents() + public function testEvents(): void { $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -73,7 +75,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $client = static::createClient(); $dispatcher = $client->getContainer()->get('event_dispatcher'); - $dispatcher->addListener(UploadEvents::POST_CHUNK_UPLOAD, function (PostChunkUploadEvent $event) use (&$chunkCount, $chunkSize, &$me) { + $dispatcher->addListener(UploadEvents::POST_CHUNK_UPLOAD, function (PostChunkUploadEvent $event) use (&$chunkCount, $chunkSize, &$me): void { ++$chunkCount; $chunk = $event->getChunk(); @@ -81,7 +83,7 @@ abstract class AbstractChunkedUploadTest extends AbstractUploadTest $me->assertEquals($chunkSize, $chunk->getSize()); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (Event $event) use (&$uploadCount) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (Event $event) use (&$uploadCount): void { ++$uploadCount; }); diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index 81772b6..410a364 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; @@ -24,7 +26,7 @@ abstract class AbstractControllerTest extends WebTestCase */ protected $helper; - public function setUp() + public function setUp(): void { $this->client = static::createClient(); $this->client->catchExceptions(false); @@ -39,20 +41,21 @@ abstract class AbstractControllerTest extends WebTestCase self::$container->get('router')->getRouteCollection()->all(); } - public function tearDown() + public function tearDown(): void { foreach ($this->createdFiles as $file) { @unlink($file); } foreach ($this->getUploadedFiles() as $file) { - @unlink($file); + /* @var \SplFileInfo $file */ + @unlink($file->getPathname()); } unset($this->client, $this->controller); } - public function testRoute() + public function testRoute(): void { $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -60,32 +63,32 @@ abstract class AbstractControllerTest extends WebTestCase $this->assertSame(0, strpos($endpoint, '/_uploader')); } - public function testCallByGet() + public function testCallByGet(): void { $this->implTestCallBy('GET', 405, 'text/html'); } - public function testCallByDelete() + public function testCallByDelete(): void { $this->implTestCallBy('DELETE', 405, 'text/html'); } - public function testCallByPatch() + public function testCallByPatch(): void { $this->implTestCallBy('PATCH'); } - public function testCallByPost() + public function testCallByPost(): void { $this->implTestCallBy('POST'); } - public function testCallByPut() + public function testCallByPut(): void { $this->implTestCallBy('PUT'); } - public function testEmptyHttpAcceptHeader() + public function testEmptyHttpAcceptHeader(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -100,7 +103,7 @@ abstract class AbstractControllerTest extends WebTestCase abstract protected function getConfigKey(); - protected function implTestCallBy($method, $expectedStatusCode = 200, $expectedContentType = 'application/json') + protected function implTestCallBy($method, $expectedStatusCode = 200, $expectedContentType = 'application/json'): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); diff --git a/Tests/Controller/AbstractUploadTest.php b/Tests/Controller/AbstractUploadTest.php index 8d69bd8..f2ee9ce 100644 --- a/Tests/Controller/AbstractUploadTest.php +++ b/Tests/Controller/AbstractUploadTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Event\PostUploadEvent; @@ -8,14 +10,14 @@ use Oneup\UploaderBundle\UploadEvents; abstract class AbstractUploadTest extends AbstractControllerTest { - public function setUp() + public function setUp(): void { parent::setUp(); $this->createdFiles = []; } - public function testSingleUpload() + public function testSingleUpload(): void { // assemble a request $client = $this->client; @@ -35,7 +37,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest } } - public function testEvents() + public function testEvents(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -46,7 +48,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest $uploadCount = 0; $preValidation = 1; - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation): void { $preValidation -= 2; $file = $event->getFile(); @@ -58,7 +60,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest $me->assertInstanceOf('Symfony\Component\HttpFoundation\File\UploadedFile', $file); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation): void { ++$uploadCount; $preValidation *= -1; @@ -73,7 +75,7 @@ abstract class AbstractUploadTest extends AbstractControllerTest $client->request('POST', $endpoint, $this->getRequestParameters(), [$this->getRequestFile()]); $this->assertCount(1, $this->getUploadedFiles()); - $this->assertSame($uploadCount, count($this->getUploadedFiles())); + $this->assertSame($uploadCount, \count($this->getUploadedFiles())); $this->assertSame(1, $preValidation); } diff --git a/Tests/Controller/AbstractValidationTest.php b/Tests/Controller/AbstractValidationTest.php index 35cf66f..d6939d9 100644 --- a/Tests/Controller/AbstractValidationTest.php +++ b/Tests/Controller/AbstractValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Event\ValidationEvent; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\UploadEvents; abstract class AbstractValidationTest extends AbstractControllerTest { - public function testAgainstMaxSize() + public function testAgainstMaxSize(): void { // assemble a request $client = $this->client; @@ -21,7 +23,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $this->assertCount(0, $this->getUploadedFiles()); } - public function testEvents() + public function testEvents(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -30,7 +32,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest // event data $validationCount = 0; - $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount): void { ++$validationCount; }); @@ -39,7 +41,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $this->assertSame(1, $validationCount); } - public function testIfRequestIsAvailableInEvent() + public function testIfRequestIsAvailableInEvent(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -49,7 +51,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $validationCount = 0; $me = $this; - $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount, &$me) { + $dispatcher->addListener(UploadEvents::VALIDATION, function (ValidationEvent $event) use (&$validationCount, &$me): void { $me->assertInstanceOf('Symfony\Component\HttpFoundation\Request', $event->getRequest()); // to be sure this listener is called @@ -61,7 +63,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $this->assertSame(1, $validationCount); } - public function testAgainstCorrectMimeType() + public function testAgainstCorrectMimeType(): void { // assemble a request $client = $this->client; @@ -81,7 +83,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest } } - public function testAgainstCorrectMimeTypeAndIncorrectExtension() + public function testAgainstCorrectMimeTypeAndIncorrectExtension(): void { // assemble a request $client = $this->client; @@ -94,7 +96,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest $this->assertCount(0, $this->getUploadedFiles()); } - public function testAgainstIncorrectMimeType() + public function testAgainstIncorrectMimeType(): void { $this->markTestSkipped('Mock mime type getter.'); diff --git a/Tests/Controller/BlueimpTest.php b/Tests/Controller/BlueimpTest.php index 6f3a0b8..e7659cf 100644 --- a/Tests/Controller/BlueimpTest.php +++ b/Tests/Controller/BlueimpTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\Event\PostUploadEvent; @@ -9,7 +11,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class BlueimpTest extends AbstractUploadTest { - public function testSingleUpload() + public function testSingleUpload(): void { // assemble a request $client = $this->client; @@ -29,7 +31,7 @@ class BlueimpTest extends AbstractUploadTest } } - public function testResponseForOldBrowsers() + public function testResponseForOldBrowsers(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -42,7 +44,7 @@ class BlueimpTest extends AbstractUploadTest $this->assertCount(1, $this->getUploadedFiles()); } - public function testEvents() + public function testEvents(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -53,7 +55,7 @@ class BlueimpTest extends AbstractUploadTest $uploadCount = 0; $preValidation = 1; - $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::PRE_UPLOAD, function (PreUploadEvent $event) use (&$uploadCount, &$me, &$preValidation): void { $preValidation -= 2; $file = $event->getFile(); @@ -65,7 +67,7 @@ class BlueimpTest extends AbstractUploadTest $me->assertInstanceOf('Symfony\Component\HttpFoundation\File\UploadedFile', $file); }); - $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation) { + $dispatcher->addListener(UploadEvents::POST_UPLOAD, function (PostUploadEvent $event) use (&$uploadCount, &$me, &$preValidation): void { ++$uploadCount; $preValidation *= -1; @@ -80,7 +82,7 @@ class BlueimpTest extends AbstractUploadTest $client->request('POST', $endpoint, $this->getRequestParameters(), $this->getRequestFile(), $this->requestHeaders); $this->assertCount(1, $this->getUploadedFiles()); - $this->assertSame($uploadCount, count($this->getUploadedFiles())); + $this->assertSame($uploadCount, \count($this->getUploadedFiles())); $this->assertSame(1, $preValidation); } diff --git a/Tests/Controller/BlueimpValidationTest.php b/Tests/Controller/BlueimpValidationTest.php index 5519211..5642329 100644 --- a/Tests/Controller/BlueimpValidationTest.php +++ b/Tests/Controller/BlueimpValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Oneup\UploaderBundle\UploadEvents; @@ -8,7 +10,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class BlueimpValidationTest extends AbstractValidationTest { - public function testAgainstMaxSize() + public function testAgainstMaxSize(): void { // assemble a request /** @var Client $client */ @@ -24,7 +26,7 @@ class BlueimpValidationTest extends AbstractValidationTest $this->assertFalse(strpos($response->getContent(), 'error.maxsize'), 'Failed to translate error id into lang'); } - public function testEvents() + public function testEvents(): void { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); @@ -33,7 +35,7 @@ class BlueimpValidationTest extends AbstractValidationTest // event data $validationCount = 0; - $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount) { + $dispatcher->addListener(UploadEvents::VALIDATION, function () use (&$validationCount): void { ++$validationCount; }); @@ -42,7 +44,7 @@ class BlueimpValidationTest extends AbstractValidationTest $this->assertSame(1, $validationCount); } - public function testAgainstCorrectMimeType() + public function testAgainstCorrectMimeType(): void { // assemble a request $client = $this->client; @@ -62,7 +64,7 @@ class BlueimpValidationTest extends AbstractValidationTest } } - public function testAgainstIncorrectMimeType() + public function testAgainstIncorrectMimeType(): void { $this->markTestSkipped('Mock mime type getter.'); diff --git a/Tests/Controller/DropzoneTest.php b/Tests/Controller/DropzoneTest.php index 97750bf..57b8e78 100644 --- a/Tests/Controller/DropzoneTest.php +++ b/Tests/Controller/DropzoneTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/DropzoneValidationTest.php b/Tests/Controller/DropzoneValidationTest.php index af1af57..ebaf831 100644 --- a/Tests/Controller/DropzoneValidationTest.php +++ b/Tests/Controller/DropzoneValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/FancyUploadTest.php b/Tests/Controller/FancyUploadTest.php index d4465a8..2dc2aaa 100644 --- a/Tests/Controller/FancyUploadTest.php +++ b/Tests/Controller/FancyUploadTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/FancyUploadValidationTest.php b/Tests/Controller/FancyUploadValidationTest.php index adeaa48..89a4bc3 100644 --- a/Tests/Controller/FancyUploadValidationTest.php +++ b/Tests/Controller/FancyUploadValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/FileBagExtractorTest.php b/Tests/Controller/FileBagExtractorTest.php index 43ff791..64cc92f 100644 --- a/Tests/Controller/FileBagExtractorTest.php +++ b/Tests/Controller/FileBagExtractorTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use PHPUnit\Framework\TestCase; @@ -11,7 +13,7 @@ class FileBagExtractorTest extends TestCase protected $method; protected $mock; - public function setUp() + public function setUp(): void { $controller = 'Oneup\UploaderBundle\Controller\AbstractController'; $mock = $this->getMockBuilder($controller) @@ -26,7 +28,7 @@ class FileBagExtractorTest extends TestCase $this->mock = $mock; } - public function testEmpty() + public function testEmpty(): void { $result = $this->invoke(new FileBag()); @@ -34,7 +36,7 @@ class FileBagExtractorTest extends TestCase $this->assertEmpty($result); } - public function testWithNullArrayValue() + public function testWithNullArrayValue(): void { $bag = new FileBag([ [null], @@ -46,7 +48,7 @@ class FileBagExtractorTest extends TestCase $this->assertEmpty($result); } - public function testWithSingleFile() + public function testWithSingleFile(): void { $bag = new FileBag([ new UploadedFile(__FILE__, 'name'), @@ -59,7 +61,7 @@ class FileBagExtractorTest extends TestCase $this->assertCount(1, $result); } - public function testWithMultipleFiles() + public function testWithMultipleFiles(): void { $bag = new FileBag([ new UploadedFile(__FILE__, 'name1'), @@ -74,7 +76,7 @@ class FileBagExtractorTest extends TestCase $this->assertCount(3, $result); } - public function testWithMultipleFilesContainingNullValues() + public function testWithMultipleFilesContainingNullValues(): void { $bag = new FileBag([ // we need to inject an array, diff --git a/Tests/Controller/FineUploaderTest.php b/Tests/Controller/FineUploaderTest.php index 71329fe..d9b8cc6 100644 --- a/Tests/Controller/FineUploaderTest.php +++ b/Tests/Controller/FineUploaderTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/FineUploaderValidationTest.php b/Tests/Controller/FineUploaderValidationTest.php index dbe4cc7..059b877 100644 --- a/Tests/Controller/FineUploaderValidationTest.php +++ b/Tests/Controller/FineUploaderValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/MooUploadTest.php b/Tests/Controller/MooUploadTest.php index f782a05..51a9f60 100644 --- a/Tests/Controller/MooUploadTest.php +++ b/Tests/Controller/MooUploadTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; class MooUploadTest extends AbstractControllerTest diff --git a/Tests/Controller/PluploadTest.php b/Tests/Controller/PluploadTest.php index a6bd09d..0313fb3 100644 --- a/Tests/Controller/PluploadTest.php +++ b/Tests/Controller/PluploadTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/PluploadValidationTest.php b/Tests/Controller/PluploadValidationTest.php index a4f71a0..ba29857 100644 --- a/Tests/Controller/PluploadValidationTest.php +++ b/Tests/Controller/PluploadValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/UploadifyTest.php b/Tests/Controller/UploadifyTest.php index 4be68e1..9502c97 100644 --- a/Tests/Controller/UploadifyTest.php +++ b/Tests/Controller/UploadifyTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/UploadifyValidationTest.php b/Tests/Controller/UploadifyValidationTest.php index dc2da01..8888ae5 100644 --- a/Tests/Controller/UploadifyValidationTest.php +++ b/Tests/Controller/UploadifyValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/YUI3Test.php b/Tests/Controller/YUI3Test.php index 746261f..c931918 100644 --- a/Tests/Controller/YUI3Test.php +++ b/Tests/Controller/YUI3Test.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/Controller/YUI3ValidationTest.php b/Tests/Controller/YUI3ValidationTest.php index 76007a6..5034d2f 100644 --- a/Tests/Controller/YUI3ValidationTest.php +++ b/Tests/Controller/YUI3ValidationTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Tests/DependencyInjection/OneupUploaderExtensionTest.php b/Tests/DependencyInjection/OneupUploaderExtensionTest.php index 31966da..2b8a0b0 100644 --- a/Tests/DependencyInjection/OneupUploaderExtensionTest.php +++ b/Tests/DependencyInjection/OneupUploaderExtensionTest.php @@ -1,12 +1,14 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; class OneupUploaderExtensionTest extends TestCase { - public function testValueToByteTransformer() + public function testValueToByteTransformer(): void { $mock = $this->getMockBuilder('Oneup\UploaderBundle\DependencyInjection\OneupUploaderExtension') ->disableOriginalConstructor() @@ -17,6 +19,7 @@ class OneupUploaderExtensionTest extends TestCase 'Oneup\UploaderBundle\DependencyInjection\OneupUploaderExtension', 'getValueInBytes' ); + $method->setAccessible(true); $this->assertSame(15, $method->invoke($mock, ' 15')); @@ -30,7 +33,7 @@ class OneupUploaderExtensionTest extends TestCase $this->assertSame(2147483648, $method->invoke($mock, '2G')); } - public function testNormalizationOfStreamWrapper() + public function testNormalizationOfStreamWrapper(): void { $mock = $this->getMockBuilder('Oneup\UploaderBundle\DependencyInjection\OneupUploaderExtension') ->disableOriginalConstructor() @@ -52,7 +55,7 @@ class OneupUploaderExtensionTest extends TestCase $this->assertNull($output3); } - public function testGetMaxUploadSize() + public function testGetMaxUploadSize(): void { $mock = $this->getMockBuilder('Oneup\UploaderBundle\DependencyInjection\OneupUploaderExtension') ->disableOriginalConstructor() diff --git a/Tests/Routing/RouteLoaderTest.php b/Tests/Routing/RouteLoaderTest.php index 1e1e3fe..ecdbc11 100644 --- a/Tests/Routing/RouteLoaderTest.php +++ b/Tests/Routing/RouteLoaderTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Routing; use Oneup\UploaderBundle\Routing\RouteLoader; @@ -7,7 +9,7 @@ use PHPUnit\Framework\TestCase; class RouteLoaderTest extends TestCase { - public function testRouteLoader() + public function testRouteLoader(): void { $cat = 'GrumpyCatController'; $dog = 'HelloThisIsDogController'; @@ -49,7 +51,7 @@ class RouteLoaderTest extends TestCase } } - public function testPrefixedRoutes() + public function testPrefixedRoutes(): void { $prefix = '/admin'; $cat = 'GrumpyCatController'; @@ -78,7 +80,7 @@ class RouteLoaderTest extends TestCase } } - public function testCustomEndpointRoutes() + public function testCustomEndpointRoutes(): void { $customEndpointUpload = '/grumpy/cats/upload'; $cat = 'GrumpyCatController'; diff --git a/Tests/Templating/TemplateHelperTest.php b/Tests/Templating/TemplateHelperTest.php index cc4499c..f471216 100644 --- a/Tests/Templating/TemplateHelperTest.php +++ b/Tests/Templating/TemplateHelperTest.php @@ -1,12 +1,14 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Chunk; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class TemplateHelperTest extends WebTestCase { - public function testName() + public function testName(): void { $client = static::createClient(); $container = $client->getContainer(); @@ -17,7 +19,7 @@ class TemplateHelperTest extends WebTestCase $this->assertSame($helper->getName(), 'oneup_uploader'); } - public function testNonExistentMappingForMaxSize() + public function testNonExistentMappingForMaxSize(): void { $this->expectException('\InvalidArgumentException'); diff --git a/Tests/UploadEventsTest.php b/Tests/UploadEventsTest.php index 2aba512..3591cff 100644 --- a/Tests/UploadEventsTest.php +++ b/Tests/UploadEventsTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests; use Oneup\UploaderBundle\UploadEvents; @@ -7,38 +9,38 @@ use PHPUnit\Framework\TestCase; class UploadEventsTest extends TestCase { - public function testPreUploadCanBePassedAMapping() + public function testPreUploadCanBePassedAMapping(): void { $event = UploadEvents::preUpload('gallery'); - $this->assertEquals(UploadEvents::PRE_UPLOAD . '.gallery', $event); + $this->assertSame(UploadEvents::PRE_UPLOAD . '.gallery', $event); } - public function testPostUploadCanBePassedAMapping() + public function testPostUploadCanBePassedAMapping(): void { $event = UploadEvents::postUpload('gallery'); - $this->assertEquals(UploadEvents::POST_UPLOAD . '.gallery', $event); + $this->assertSame(UploadEvents::POST_UPLOAD . '.gallery', $event); } - public function testPostPersistCanBePassedAMapping() + public function testPostPersistCanBePassedAMapping(): void { $event = UploadEvents::postPersist('gallery'); - $this->assertEquals(UploadEvents::POST_PERSIST . '.gallery', $event); + $this->assertSame(UploadEvents::POST_PERSIST . '.gallery', $event); } - public function testPostChunkUploadCanBePassedAMapping() + public function testPostChunkUploadCanBePassedAMapping(): void { $event = UploadEvents::postChunkUpload('gallery'); - $this->assertEquals(UploadEvents::POST_CHUNK_UPLOAD . '.gallery', $event); + $this->assertSame(UploadEvents::POST_CHUNK_UPLOAD . '.gallery', $event); } - public function testValidationCanBePassedAMapping() + public function testValidationCanBePassedAMapping(): void { $event = UploadEvents::validation('gallery'); - $this->assertEquals(UploadEvents::VALIDATION . '.gallery', $event); + $this->assertSame(UploadEvents::VALIDATION . '.gallery', $event); } } diff --git a/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php b/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php index 7bf37d8..d64e791 100644 --- a/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/ChunkStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; use Oneup\UploaderBundle\Uploader\Chunk\Storage\ChunkStorageInterface; @@ -15,13 +17,13 @@ abstract class ChunkStorageTest extends TestCase */ protected $storage; - public function testExistanceOfTmpDir() + public function testExistanceOfTmpDir(): void { $this->assertDirectoryExists($this->tmpDir); $this->assertIsWritable($this->tmpDir); } - public function testFillOfTmpDir() + public function testFillOfTmpDir(): void { $finder = new Finder(); $finder->in($this->tmpDir); @@ -32,7 +34,7 @@ abstract class ChunkStorageTest extends TestCase $this->assertCount($numberOfFiles, $finder); } - public function testChunkCleanup() + public function testChunkCleanup(): void { // get a manager configured with a max-age of 5 minutes $maxage = 5 * 60; @@ -52,11 +54,12 @@ abstract class ChunkStorageTest extends TestCase $this->assertCount(5, $finder); foreach ($finder as $file) { - $this->assertGreaterThanOrEqual(time() - $maxage, filemtime($file)); + /* @var \SplFileInfo $file */ + $this->assertGreaterThanOrEqual(time() - $maxage, $file->getMTime()); } } - public function testClearIfDirectoryDoesNotExist() + public function testClearIfDirectoryDoesNotExist(): void { $filesystem = new Filesystem(); $filesystem->remove($this->tmpDir); @@ -67,7 +70,7 @@ abstract class ChunkStorageTest extends TestCase $this->assertTrue(true); } - protected function fillDirectory($number) + protected function fillDirectory($number): void { $system = new Filesystem(); diff --git a/Tests/Uploader/Chunk/Storage/FilesystemStorageTest.php b/Tests/Uploader/Chunk/Storage/FilesystemStorageTest.php index 5d73cff..cf14094 100644 --- a/Tests/Uploader/Chunk/Storage/FilesystemStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/FilesystemStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; use Oneup\UploaderBundle\Uploader\Chunk\Storage\FilesystemStorage; @@ -9,7 +11,7 @@ class FilesystemStorageTest extends ChunkStorageTest { protected $tmpDir; - public function setUp() + public function setUp(): void { // create a cache dir $tmpDir = sprintf('/tmp/%s', uniqid()); @@ -23,7 +25,7 @@ class FilesystemStorageTest extends ChunkStorageTest ]); } - public function tearDown() + public function tearDown(): void { $system = new Filesystem(); $system->remove($this->tmpDir); diff --git a/Tests/Uploader/Chunk/Storage/FlysystemStorageTest.php b/Tests/Uploader/Chunk/Storage/FlysystemStorageTest.php index 8d553a1..f64d37b 100644 --- a/Tests/Uploader/Chunk/Storage/FlysystemStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/FlysystemStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; use League\Flysystem\Adapter\Local as Adapter; @@ -15,7 +17,7 @@ class FlysystemStorageTest extends ChunkStorageTest protected $chunkKey = 'chunks'; protected $chunkDir; - public function setUp() + public function setUp(): void { // create a cache dir $parentDir = sprintf('/tmp/%s', uniqid('', true)); @@ -33,12 +35,12 @@ class FlysystemStorageTest extends ChunkStorageTest FlysystemStreamWrapper::register('tests', $filesystem); $this->storage = new FlysystemStorage($filesystem, 100000, 'tests:/', $this->chunkKey); - $this->tmpDir = $this->parentDir.'/'.$this->chunkKey; + $this->tmpDir = $this->parentDir . '/' . $this->chunkKey; $system->mkdir($this->tmpDir); } - public function tearDown() + public function tearDown(): void { $system = new Filesystem(); $system->remove($this->parentDir); diff --git a/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php b/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php index 02a89c2..5b7ad7f 100644 --- a/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php +++ b/Tests/Uploader/Chunk/Storage/GaufretteStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; use Gaufrette\Adapter\Local as Adapter; @@ -13,7 +15,7 @@ class GaufretteStorageTest extends ChunkStorageTest protected $chunkKey = 'chunks'; protected $chunkDir; - public function setUp() + public function setUp(): void { // create a cache dir $parentDir = sprintf('/tmp/%s', uniqid()); @@ -28,12 +30,12 @@ class GaufretteStorageTest extends ChunkStorageTest $filesystem = new GaufretteFilesystem($adapter); $this->storage = new GaufretteStorage($filesystem, 100000, null, $this->chunkKey); - $this->tmpDir = $this->parentDir.'/'.$this->chunkKey; + $this->tmpDir = $this->parentDir . '/' . $this->chunkKey; $system->mkdir($this->tmpDir); } - public function tearDown() + public function tearDown(): void { $system = new Filesystem(); $system->remove($this->parentDir); diff --git a/Tests/Uploader/File/FileTest.php b/Tests/Uploader/File/FileTest.php index 150b2db..d8d88a3 100644 --- a/Tests/Uploader/File/FileTest.php +++ b/Tests/Uploader/File/FileTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\File; use PHPUnit\Framework\TestCase; @@ -14,32 +16,32 @@ abstract class FileTest extends TestCase protected $size; protected $mimeType; - public function testGetPathName() + public function testGetPathName(): void { $this->assertSame($this->pathname, $this->file->getPathname()); } - public function testGetPath() + public function testGetPath(): void { $this->assertSame($this->path, $this->file->getPath()); } - public function testGetBasename() + public function testGetBasename(): void { $this->assertSame($this->basename, $this->file->getBasename()); } - public function testGetExtension() + public function testGetExtension(): void { $this->assertSame($this->extension, $this->file->getExtension()); } - public function testGetSize() + public function testGetSize(): void { $this->assertSame($this->size, $this->file->getSize()); } - public function testGetMimeType() + public function testGetMimeType(): void { $this->assertSame($this->mimeType, $this->file->getMimeType()); } diff --git a/Tests/Uploader/File/FilesystemFileTest.php b/Tests/Uploader/File/FilesystemFileTest.php index b5ac32f..51a9255 100644 --- a/Tests/Uploader/File/FilesystemFileTest.php +++ b/Tests/Uploader/File/FilesystemFileTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\File; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; @@ -7,16 +9,16 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class FilesystemFileTest extends FileTest { - public function setUp() + public function setUp(): void { - $this->path = sys_get_temp_dir().'/oneup_test_tmp'; + $this->path = sys_get_temp_dir() . '/oneup_test_tmp'; if (!file_exists($this->path)) { mkdir($this->path); } $this->basename = 'test_file.txt'; - $this->pathname = $this->path.'/'.$this->basename; + $this->pathname = $this->path . '/' . $this->basename; $this->extension = 'txt'; $this->size = 9; //something = 9 bytes $this->mimeType = 'text/plain'; @@ -26,7 +28,7 @@ class FilesystemFileTest extends FileTest $this->file = new FilesystemFile(new UploadedFile($this->pathname, 'test_file.txt', null, null, null, true)); } - public function tearDown() + public function tearDown(): void { unlink($this->pathname); rmdir($this->path); diff --git a/Tests/Uploader/File/GaufretteFileTest.php b/Tests/Uploader/File/GaufretteFileTest.php index 1dc5966..95b96c8 100644 --- a/Tests/Uploader/File/GaufretteFileTest.php +++ b/Tests/Uploader/File/GaufretteFileTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\File; use Gaufrette\Adapter\Local as Adapter; @@ -11,7 +13,7 @@ use Oneup\UploaderBundle\Uploader\Storage\GaufretteStorage; class GaufretteFileTest extends FileTest { - public function setUp() + public function setUp(): void { $adapter = new Adapter(sys_get_temp_dir(), true); $filesystem = new GaufretteFilesystem($adapter); @@ -24,22 +26,22 @@ class GaufretteFileTest extends FileTest $this->storage = new GaufretteStorage($filesystem, 100000); $this->path = 'oneup_test_tmp'; - mkdir(sys_get_temp_dir().'/'.$this->path); + mkdir(sys_get_temp_dir() . '/' . $this->path); $this->basename = 'test_file.txt'; - $this->pathname = $this->path.'/'.$this->basename; + $this->pathname = $this->path . '/' . $this->basename; $this->extension = 'txt'; $this->size = 9; //something = 9 bytes $this->mimeType = 'text/plain'; - file_put_contents(sys_get_temp_dir().'/'.$this->pathname, 'something'); + file_put_contents(sys_get_temp_dir() . '/' . $this->pathname, 'something'); $this->file = new GaufretteFile(new File($this->pathname, $filesystem), $filesystem, 'gaufrette://oneup/'); } - public function tearDown() + public function tearDown(): void { - unlink(sys_get_temp_dir().'/'.$this->pathname); - rmdir(sys_get_temp_dir().'/'.$this->path); + unlink(sys_get_temp_dir() . '/' . $this->pathname); + rmdir(sys_get_temp_dir() . '/' . $this->path); } } diff --git a/Tests/Uploader/Naming/UniqidNamerTest.php b/Tests/Uploader/Naming/UniqidNamerTest.php index 4922f6d..a885365 100644 --- a/Tests/Uploader/Naming/UniqidNamerTest.php +++ b/Tests/Uploader/Naming/UniqidNamerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Naming; use Oneup\UploaderBundle\Uploader\Naming\UniqidNamer; @@ -7,7 +9,7 @@ use PHPUnit\Framework\TestCase; class UniqidNamerTest extends TestCase { - public function testNamerReturnsName() + public function testNamerReturnsName(): void { // TODO Reenable this test. $this->markTestSkipped('Details: https://github.com/Ocramius/Instantiator/pull/8#issuecomment-47446963'); @@ -20,14 +22,14 @@ class UniqidNamerTest extends TestCase $file ->expects($this->any()) ->method('getExtension') - ->will($this->returnValue('jpeg')) + ->willReturn('jpeg') ; $namer = new UniqidNamer(); $this->assertRegExp('/[a-z0-9]{13}.jpeg/', $namer->name($file)); } - public function testNamerReturnsUniqueName() + public function testNamerReturnsUniqueName(): void { // TODO Reenable this test. $this->markTestSkipped('Details: https://github.com/Ocramius/Instantiator/pull/8#issuecomment-47446963'); @@ -40,7 +42,7 @@ class UniqidNamerTest extends TestCase $file ->expects($this->any()) ->method('getExtension') - ->will($this->returnValue('jpeg')) + ->willReturn('jpeg') ; $namer = new UniqidNamer(); diff --git a/Tests/Uploader/Naming/UrlSafeNamerTest.php b/Tests/Uploader/Naming/UrlSafeNamerTest.php index 028a967..14ffa41 100644 --- a/Tests/Uploader/Naming/UrlSafeNamerTest.php +++ b/Tests/Uploader/Naming/UrlSafeNamerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Naming; use Oneup\UploaderBundle\Tests\Uploader\File\FileTest; @@ -9,16 +11,16 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class UrlSafeNamerTest extends FileTest { - public function setUp() + public function setUp(): void { - $this->path = sys_get_temp_dir().'/oneup_namer_test'; + $this->path = sys_get_temp_dir() . '/oneup_namer_test'; if (!file_exists($this->path)) { mkdir($this->path); } $this->basename = 'test_file.txt'; - $this->pathname = $this->path.'/'.$this->basename; + $this->pathname = $this->path . '/' . $this->basename; $this->extension = 'txt'; $this->size = 9; //something = 9 bytes $this->mimeType = 'text/plain'; @@ -28,20 +30,20 @@ class UrlSafeNamerTest extends FileTest $this->file = new FilesystemFile(new UploadedFile($this->pathname, 'test_file.txt', null, null, null, true)); } - public function tearDown() + public function tearDown(): void { unlink($this->pathname); rmdir($this->path); } - public function testCanGetString() + public function testCanGetString(): void { $namer = new UrlSafeNamer(); $this->assertInternalType('string', $namer->name($this->file)); $this->assertStringEndsWith($this->extension, $namer->name($this->file)); } - public function test_two_file_names_not_equal() + public function test_two_file_names_not_equal(): void { $namer = new UrlSafeNamer(); // Trying 200 times just to be sure diff --git a/Tests/Uploader/Orphanage/OrphanageManagerTest.php b/Tests/Uploader/Orphanage/OrphanageManagerTest.php index 928df09..da84295 100644 --- a/Tests/Uploader/Orphanage/OrphanageManagerTest.php +++ b/Tests/Uploader/Orphanage/OrphanageManagerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Orphanage; use Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager; @@ -14,17 +16,17 @@ class OrphanageManagerTest extends TestCase protected $mockContainer; protected $mockConfig; - public function setUp() + public function setUp(): void { $this->numberOfOrphans = 10; - $this->orphanagePath = sys_get_temp_dir().'/orphanage'; + $this->orphanagePath = sys_get_temp_dir() . '/orphanage'; $filesystem = new Filesystem(); $filesystem->mkdir($this->orphanagePath); // create n orphans with a filemtime in the past for ($i = 0; $i < $this->numberOfOrphans; ++$i) { - touch($this->orphanagePath.'/'.uniqid(), time() - 1000); + touch($this->orphanagePath . '/' . uniqid(), time() - 1000); } $this->mockConfig = [ @@ -35,13 +37,13 @@ class OrphanageManagerTest extends TestCase $this->mockContainer = $this->getContainerMock(); } - public function tearDown() + public function tearDown(): void { $filesystem = new Filesystem(); $filesystem->remove($this->orphanagePath); } - public function testGetSpecificService() + public function testGetSpecificService(): void { $manager = new OrphanageManager($this->mockContainer, $this->mockConfig); $service = $manager->get('grumpycat'); @@ -49,11 +51,11 @@ class OrphanageManagerTest extends TestCase $this->assertTrue($service); } - public function testClearAllInPast() + public function testClearAllInPast(): void { // create n orphans with a filemtime in the past for ($i = 0; $i < $this->numberOfOrphans; ++$i) { - touch($this->orphanagePath.'/'.uniqid(), time() - 1000); + touch($this->orphanagePath . '/' . uniqid(), time() - 1000); } $manager = new OrphanageManager($this->mockContainer, $this->mockConfig); @@ -65,12 +67,12 @@ class OrphanageManagerTest extends TestCase $this->assertCount(0, $finder); } - public function testClearSomeInPast() + public function testClearSomeInPast(): void { // create n orphans with half filetimes in the past and half in the future // relative to the given threshold for ($i = 0; $i < $this->numberOfOrphans; ++$i) { - touch($this->orphanagePath.'/'.uniqid(), time() - $i * 20); + touch($this->orphanagePath . '/' . uniqid(), time() - $i * 20); } $manager = new OrphanageManager($this->mockContainer, $this->mockConfig); @@ -82,7 +84,7 @@ class OrphanageManagerTest extends TestCase $this->assertCount($this->numberOfOrphans / 2, $finder); } - public function testClearIfDirectoryDoesNotExist() + public function testClearIfDirectoryDoesNotExist(): void { $filesystem = new Filesystem(); $filesystem->remove($this->mockConfig['directory']); @@ -101,7 +103,7 @@ class OrphanageManagerTest extends TestCase ->expects($this->any()) ->method('get') ->with('oneup_uploader.orphanage.grumpycat') - ->will($this->returnValue(true)) + ->willReturn(true) ; return $mock; diff --git a/Tests/Uploader/Response/EmptyResponseTest.php b/Tests/Uploader/Response/EmptyResponseTest.php index cf9b039..be54dc9 100644 --- a/Tests/Uploader/Response/EmptyResponseTest.php +++ b/Tests/Uploader/Response/EmptyResponseTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; @@ -7,7 +9,7 @@ use PHPUnit\Framework\TestCase; class EmptyResponseTest extends TestCase { - public function testEmpty() + public function testEmpty(): void { $response = new EmptyResponse(); $assembled = $response->assemble(); @@ -16,7 +18,7 @@ class EmptyResponseTest extends TestCase $this->assertCount(0, $assembled); } - public function testWithItems() + public function testWithItems(): void { $response = new EmptyResponse(); diff --git a/Tests/Uploader/Response/FineUploaderResponseTest.php b/Tests/Uploader/Response/FineUploaderResponseTest.php index a68f16b..0fbbadb 100644 --- a/Tests/Uploader/Response/FineUploaderResponseTest.php +++ b/Tests/Uploader/Response/FineUploaderResponseTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\FineUploaderResponse; @@ -7,7 +9,7 @@ use PHPUnit\Framework\TestCase; class FineUploaderResponseTest extends TestCase { - public function testCreationOfResponse() + public function testCreationOfResponse(): void { $response = new FineUploaderResponse(); @@ -15,7 +17,7 @@ class FineUploaderResponseTest extends TestCase $this->assertNull($response->getError()); } - public function testFillOfResponse() + public function testFillOfResponse(): void { $response = new FineUploaderResponse(); @@ -45,7 +47,7 @@ class FineUploaderResponseTest extends TestCase $this->assertNull($response->getError()); } - public function testError() + public function testError(): void { $response = new FineUploaderResponse(); $response->setError('This response is grumpy'); @@ -53,7 +55,7 @@ class FineUploaderResponseTest extends TestCase $this->assertSame($response->getError(), 'This response is grumpy'); } - public function testOverwriteOfInternals() + public function testOverwriteOfInternals(): void { $response = new FineUploaderResponse(); $response['success'] = false; diff --git a/Tests/Uploader/Response/MooUploadResponseTest.php b/Tests/Uploader/Response/MooUploadResponseTest.php index 55d183b..42132f0 100644 --- a/Tests/Uploader/Response/MooUploadResponseTest.php +++ b/Tests/Uploader/Response/MooUploadResponseTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Response; use Oneup\UploaderBundle\Uploader\Response\MooUploadResponse; @@ -7,7 +9,7 @@ use PHPUnit\Framework\TestCase; class MooUploadResponseTest extends TestCase { - public function testCreationOfResponse() + public function testCreationOfResponse(): void { $response = new MooUploadResponse(); @@ -15,7 +17,7 @@ class MooUploadResponseTest extends TestCase $this->assertSame(0, $response->getError()); } - public function testFunctionsOfResponse() + public function testFunctionsOfResponse(): void { $response = new MooUploadResponse(); $response->setId(3); @@ -33,7 +35,7 @@ class MooUploadResponseTest extends TestCase $this->assertSame('b1/2d/b12d23.jpg', $response->getUploadedName()); } - public function testFunctionsAfterOverwrite() + public function testFunctionsAfterOverwrite(): void { $response = new MooUploadResponse(); $response->setId(3); @@ -60,7 +62,7 @@ class MooUploadResponseTest extends TestCase $this->assertSame(!null, $response['princess']); } - public function testAssemble() + public function testAssemble(): void { $response = new MooUploadResponse(); $response->setId(3); diff --git a/Tests/Uploader/Storage/FilesystemOrphanageStorageTest.php b/Tests/Uploader/Storage/FilesystemOrphanageStorageTest.php index d72b7a2..1291f9f 100644 --- a/Tests/Uploader/Storage/FilesystemOrphanageStorageTest.php +++ b/Tests/Uploader/Storage/FilesystemOrphanageStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Oneup\UploaderBundle\Uploader\Chunk\Storage\FilesystemStorage as FilesystemChunkStorage; @@ -13,11 +15,11 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; class FilesystemOrphanageStorageTest extends OrphanageTest { - public function setUp() + public function setUp(): void { $this->numberOfPayloads = 5; - $this->tempDirectory = sys_get_temp_dir().'/orphanage'; - $this->realDirectory = sys_get_temp_dir().'/storage'; + $this->tempDirectory = sys_get_temp_dir() . '/orphanage'; + $this->realDirectory = sys_get_temp_dir() . '/storage'; $this->payloads = []; $filesystem = new Filesystem(); @@ -32,7 +34,7 @@ class FilesystemOrphanageStorageTest extends OrphanageTest fwrite($pointer, str_repeat('A', 1024), 1024); fclose($pointer); - $this->payloads[] = new FilesystemFile(new UploadedFile($file, $i.'grumpycat.jpeg', null, null, null, true)); + $this->payloads[] = new FilesystemFile(new UploadedFile($file, $i . 'grumpycat.jpeg', null, null, null, true)); } // create underlying storage diff --git a/Tests/Uploader/Storage/FilesystemStorageTest.php b/Tests/Uploader/Storage/FilesystemStorageTest.php index 6440908..d14664d 100644 --- a/Tests/Uploader/Storage/FilesystemStorageTest.php +++ b/Tests/Uploader/Storage/FilesystemStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; @@ -14,9 +16,9 @@ class FilesystemStorageTest extends TestCase protected $directory; protected $file; - public function setUp() + public function setUp(): void { - $this->directory = sys_get_temp_dir().'/storage'; + $this->directory = sys_get_temp_dir() . '/storage'; // create temporary file $this->file = tempnam(sys_get_temp_dir(), 'uploader'); @@ -26,13 +28,13 @@ class FilesystemStorageTest extends TestCase fclose($pointer); } - public function tearDown() + public function tearDown(): void { $filesystem = new Filesystem(); $filesystem->remove($this->directory); } - public function testUpload() + public function testUpload(): void { $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true)); $storage = new FilesystemStorage($this->directory); diff --git a/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php b/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php index f07107e..c0a69a7 100644 --- a/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php +++ b/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use League\Flysystem\Adapter\Local as Adapter; @@ -21,12 +23,12 @@ class FlysystemOrphanageStorageTest extends OrphanageTest protected $chunksKey = 'chunks'; protected $orphanageKey = 'orphanage'; - public function setUp() + public function setUp(): void { $this->numberOfPayloads = 5; - $this->realDirectory = sys_get_temp_dir().'/storage'; - $this->chunkDirectory = $this->realDirectory.'/'.$this->chunksKey; - $this->tempDirectory = $this->realDirectory.'/'.$this->orphanageKey; + $this->realDirectory = sys_get_temp_dir() . '/storage'; + $this->chunkDirectory = $this->realDirectory . '/' . $this->chunksKey; + $this->tempDirectory = $this->realDirectory . '/' . $this->orphanageKey; $this->payloads = []; $filesystem = new Filesystem(); @@ -66,17 +68,17 @@ class FlysystemOrphanageStorageTest extends OrphanageTest } } - public function tearDown() + public function tearDown(): void { (new Filesystem())->remove($this->realDirectory); FlysystemStreamWrapper::unregister('tests'); } - public function testUpload() + public function testUpload(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); @@ -89,10 +91,10 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $this->assertCount(0, $finder); } - public function testUploadAndFetching() + public function testUploadAndFetching(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); diff --git a/Tests/Uploader/Storage/FlysystemStorageTest.php b/Tests/Uploader/Storage/FlysystemStorageTest.php index 0f573dc..19da152 100644 --- a/Tests/Uploader/Storage/FlysystemStorageTest.php +++ b/Tests/Uploader/Storage/FlysystemStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use League\Flysystem\Adapter\Local as Adapter; @@ -21,9 +23,9 @@ class FlysystemStorageTest extends TestCase protected $storage; protected $file; - public function setUp() + public function setUp(): void { - $this->directory = sys_get_temp_dir().'/storage'; + $this->directory = sys_get_temp_dir() . '/storage'; // create temporary file $this->file = tempnam(sys_get_temp_dir(), 'uploader'); @@ -38,13 +40,13 @@ class FlysystemStorageTest extends TestCase $this->storage = new Storage($filesystem, 100000); } - public function tearDown() + public function tearDown(): void { $filesystem = new Filesystem(); $filesystem->remove($this->directory); } - public function testUpload() + public function testUpload(): void { $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true)); $this->storage->upload($payload, 'notsogrumpyanymore.jpeg'); @@ -60,7 +62,7 @@ class FlysystemStorageTest extends TestCase } } - public function testUploadWithPath() + public function testUploadWithPath(): void { $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true)); $this->storage->upload($payload, 'notsogrumpyanymore.jpeg', 'cat'); diff --git a/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php b/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php index 4afae8b..d7bdf51 100644 --- a/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php +++ b/Tests/Uploader/Storage/GaufretteAmazonS3StorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use AmazonS3 as AmazonClient; @@ -15,7 +17,7 @@ class GaufretteAmazonS3StorageTest extends TestCase protected $directory; protected $storage; - public function setUp() + public function setUp(): void { if ( false === getenv('AWS_ACCESS_KEY_ID') || @@ -26,7 +28,7 @@ class GaufretteAmazonS3StorageTest extends TestCase } $this->prefix = 'someObscureStorage'; - $this->directory = sys_get_temp_dir().'/'.$this->prefix; + $this->directory = sys_get_temp_dir() . '/' . $this->prefix; if (!file_exists($this->directory)) { mkdir($this->directory); } @@ -48,7 +50,7 @@ class GaufretteAmazonS3StorageTest extends TestCase $this->storage = new GaufretteStorage($this->filesystem, 100000, null); } - public function tearDown() + public function tearDown(): void { $files = $this->filesystem->listKeys($this->prefix); foreach ($files['keys'] as $filename) { @@ -58,10 +60,10 @@ class GaufretteAmazonS3StorageTest extends TestCase } } - public function testUpload() + public function testUpload(): void { $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true)); - $this->storage->upload($payload, $this->prefix.'/notsogrumpyanymore.jpeg'); + $this->storage->upload($payload, $this->prefix . '/notsogrumpyanymore.jpeg'); $files = $this->filesystem->listKeys($this->prefix); @@ -73,8 +75,8 @@ class GaufretteAmazonS3StorageTest extends TestCase // ignore the prefix directory continue; } - $this->assertSame($this->prefix.'/notsogrumpyanymore.jpeg', $filename); - $this->assertSame(1024, strlen($this->filesystem->read($filename))); + $this->assertSame($this->prefix . '/notsogrumpyanymore.jpeg', $filename); + $this->assertSame(1024, \strlen($this->filesystem->read($filename))); } } } diff --git a/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php b/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php index bb945d6..fcb6ffc 100644 --- a/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php +++ b/Tests/Uploader/Storage/GaufretteOrphanageStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Gaufrette\Adapter\Local as Adapter; @@ -19,12 +21,12 @@ class GaufretteOrphanageStorageTest extends OrphanageTest protected $chunksKey = 'chunks'; protected $orphanageKey = 'orphanage'; - public function setUp() + public function setUp(): void { $this->numberOfPayloads = 5; - $this->realDirectory = sys_get_temp_dir().'/storage'; - $this->chunkDirectory = $this->realDirectory.'/'.$this->chunksKey; - $this->tempDirectory = $this->realDirectory.'/'.$this->orphanageKey; + $this->realDirectory = sys_get_temp_dir() . '/storage'; + $this->chunkDirectory = $this->realDirectory . '/' . $this->chunksKey; + $this->tempDirectory = $this->realDirectory . '/' . $this->orphanageKey; $this->payloads = []; if (!$this->checkIfTempnameMatchesAfterCreation()) { @@ -66,10 +68,10 @@ class GaufretteOrphanageStorageTest extends OrphanageTest } } - public function testUpload() + public function testUpload(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); @@ -82,10 +84,10 @@ class GaufretteOrphanageStorageTest extends OrphanageTest $this->assertCount(0, $finder); } - public function testUploadAndFetching() + public function testUploadAndFetching(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); diff --git a/Tests/Uploader/Storage/GaufretteStorageTest.php b/Tests/Uploader/Storage/GaufretteStorageTest.php index 86ea059..a629917 100644 --- a/Tests/Uploader/Storage/GaufretteStorageTest.php +++ b/Tests/Uploader/Storage/GaufretteStorageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Gaufrette\Adapter\Local as Adapter; @@ -16,9 +18,9 @@ class GaufretteStorageTest extends TestCase protected $directory; protected $storage; - public function setUp() + public function setUp(): void { - $this->directory = sys_get_temp_dir().'/storage'; + $this->directory = sys_get_temp_dir() . '/storage'; // create temporary file $this->file = tempnam(sys_get_temp_dir(), 'uploader'); @@ -33,13 +35,13 @@ class GaufretteStorageTest extends TestCase $this->storage = new GaufretteStorage($filesystem, 100000); } - public function tearDown() + public function tearDown(): void { $filesystem = new Filesystem(); $filesystem->remove($this->directory); } - public function testUpload() + public function testUpload(): void { $payload = new FilesystemFile(new UploadedFile($this->file, 'grumpycat.jpeg', null, null, null, true)); $this->storage->upload($payload, 'notsogrumpyanymore.jpeg'); diff --git a/Tests/Uploader/Storage/OrphanageTest.php b/Tests/Uploader/Storage/OrphanageTest.php index 4b5ae59..670d95a 100644 --- a/Tests/Uploader/Storage/OrphanageTest.php +++ b/Tests/Uploader/Storage/OrphanageTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use PHPUnit\Framework\TestCase; @@ -19,17 +21,17 @@ abstract class OrphanageTest extends TestCase protected $payloads; protected $numberOfPayloads; - public function tearDown() + public function tearDown(): void { $filesystem = new Filesystem(); $filesystem->remove($this->tempDirectory); $filesystem->remove($this->realDirectory); } - public function testUpload() + public function testUpload(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); @@ -41,10 +43,10 @@ abstract class OrphanageTest extends TestCase $this->assertCount(0, $finder); } - public function testUploadAndFetching() + public function testUploadAndFetching(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { - $this->orphanage->upload($this->payloads[$i], $i.'notsogrumpyanymore.jpeg'); + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); } $finder = new Finder(); @@ -69,7 +71,7 @@ abstract class OrphanageTest extends TestCase $this->assertCount($this->numberOfPayloads, $finder); } - public function testUploadAndFetchingIfDirectoryDoesNotExist() + public function testUploadAndFetchingIfDirectoryDoesNotExist(): void { $filesystem = new Filesystem(); $filesystem->remove($this->tempDirectory); @@ -80,7 +82,7 @@ abstract class OrphanageTest extends TestCase $this->assertCount(0, $files); } - public function testIfGetFilesMethodIsAccessible() + public function testIfGetFilesMethodIsAccessible(): void { // since ticket #48, getFiles has to be public $method = new \ReflectionMethod($this->orphanage, 'getFiles'); diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index d00c03f..f10afb3 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -1,6 +1,8 @@ <?php -if (!($loader = @include __DIR__.'/../vendor/autoload.php')) { +declare(strict_types=1); + +if (!($loader = @include __DIR__ . '/../vendor/autoload.php')) { echo <<<'EOT' You need to install the project dependencies using Composer: $ wget http://getcomposer.org/composer.phar diff --git a/Twig/Extension/UploaderExtension.php b/Twig/Extension/UploaderExtension.php index a5a7c44..61f0fac 100644 --- a/Twig/Extension/UploaderExtension.php +++ b/Twig/Extension/UploaderExtension.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Twig\Extension; use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; diff --git a/UploadEvents.php b/UploadEvents.php index c4899cf..2cae80c 100644 --- a/UploadEvents.php +++ b/UploadEvents.php @@ -1,14 +1,16 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle; final class UploadEvents { - const PRE_UPLOAD = 'oneup_uploader.pre_upload'; - const POST_UPLOAD = 'oneup_uploader.post_upload'; - const POST_PERSIST = 'oneup_uploader.post_persist'; - const POST_CHUNK_UPLOAD = 'oneup_uploader.post_chunk_upload'; - const VALIDATION = 'oneup_uploader.validation'; + public const PRE_UPLOAD = 'oneup_uploader.pre_upload'; + public const POST_UPLOAD = 'oneup_uploader.post_upload'; + public const POST_PERSIST = 'oneup_uploader.post_persist'; + public const POST_CHUNK_UPLOAD = 'oneup_uploader.post_chunk_upload'; + public const VALIDATION = 'oneup_uploader.validation'; public static function preUpload(string $mapping): string { diff --git a/Uploader/Chunk/ChunkManager.php b/Uploader/Chunk/ChunkManager.php index 5c3f97f..a4f4081 100644 --- a/Uploader/Chunk/ChunkManager.php +++ b/Uploader/Chunk/ChunkManager.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk; use Oneup\UploaderBundle\Uploader\Chunk\Storage\ChunkStorageInterface; @@ -16,7 +18,7 @@ class ChunkManager implements ChunkManagerInterface $this->storage = $storage; } - public function clear() + public function clear(): void { $this->storage->clear($this->configuration['maxage']); } diff --git a/Uploader/Chunk/ChunkManagerInterface.php b/Uploader/Chunk/ChunkManagerInterface.php index 04b6319..2149f1c 100644 --- a/Uploader/Chunk/ChunkManagerInterface.php +++ b/Uploader/Chunk/ChunkManagerInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -9,10 +11,9 @@ interface ChunkManagerInterface /** * Adds a new Chunk to a given uuid. * - * @param string $uuid - * @param int $index - * @param UploadedFile $chunk - * @param string $original The file name of the original file + * @param string $uuid + * @param int $index + * @param string $original The file name of the original file * * @return File the moved chunk file */ diff --git a/Uploader/Chunk/Storage/ChunkStorageInterface.php b/Uploader/Chunk/Storage/ChunkStorageInterface.php index 2be1146..a348014 100644 --- a/Uploader/Chunk/Storage/ChunkStorageInterface.php +++ b/Uploader/Chunk/Storage/ChunkStorageInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk\Storage; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/Uploader/Chunk/Storage/FilesystemStorage.php b/Uploader/Chunk/Storage/FilesystemStorage.php index 196fc6d..2356c6e 100644 --- a/Uploader/Chunk/Storage/FilesystemStorage.php +++ b/Uploader/Chunk/Storage/FilesystemStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk\Storage; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; @@ -17,13 +19,13 @@ class FilesystemStorage implements ChunkStorageInterface $this->directory = $directory; } - public function clear($maxAge) + public function clear($maxAge): void { $system = new Filesystem(); $finder = new Finder(); try { - $finder->in($this->directory)->date('<='.-1 * (int) $maxAge.'seconds')->files(); + $finder->in($this->directory)->date('<=' . -1 * (int) $maxAge . 'seconds')->files(); } catch (\InvalidArgumentException $e) { // the finder will throw an exception of type InvalidArgumentException // if the directory he should search in does not exist diff --git a/Uploader/Chunk/Storage/FlysystemStorage.php b/Uploader/Chunk/Storage/FlysystemStorage.php index b715376..27fbcb7 100644 --- a/Uploader/Chunk/Storage/FlysystemStorage.php +++ b/Uploader/Chunk/Storage/FlysystemStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk\Storage; use League\Flysystem\FileNotFoundException; @@ -31,7 +33,7 @@ class FlysystemStorage implements ChunkStorageInterface $this->streamWrapperPrefix = $streamWrapperPrefix; } - public function clear($maxAge, $prefix = null) + public function clear($maxAge, $prefix = null): void { $prefix = $prefix ?: $this->prefix; $matches = $this->filesystem->listContents($prefix, true); @@ -45,7 +47,7 @@ class FlysystemStorage implements ChunkStorageInterface // would remain foreach ($matches as $key) { $path = $key['path']; - $timestamp = isset($key['timestamp']) ? $key['timestamp'] : $this->filesystem->getTimestamp($path); + $timestamp = $key['timestamp'] ?? $this->filesystem->getTimestamp($path); if ($maxAge <= $now - $timestamp) { $toDelete[] = $path; @@ -63,7 +65,7 @@ class FlysystemStorage implements ChunkStorageInterface } } - public function addChunk($uuid, $index, UploadedFile $chunk, $original) + public function addChunk($uuid, $index, UploadedFile $chunk, $original): void { // Prevent path traversal attacks $uuid = basename($uuid); @@ -79,8 +81,8 @@ class FlysystemStorage implements ChunkStorageInterface public function assembleChunks($chunks, $removeChunk, $renameChunk) { // the index is only added to be in sync with the filesystem storage - $path = $this->prefix.'/'.$this->unhandledChunk['uuid'].'/'; - $filename = $this->unhandledChunk['index'].'_'.$this->unhandledChunk['original']; + $path = $this->prefix . '/' . $this->unhandledChunk['uuid'] . '/'; + $filename = $this->unhandledChunk['index'] . '_' . $this->unhandledChunk['original']; if (empty($chunks)) { $target = $filename; @@ -96,8 +98,8 @@ class FlysystemStorage implements ChunkStorageInterface $mode = 'wb'; } - $file = fopen($this->unhandledChunk['chunk']->getPathname(), 'rb'); - $dest = fopen($this->streamWrapperPrefix.'/'.$path.$target, $mode); + $file = fopen($this->unhandledChunk['chunk']->getPathname(), 'r'); + $dest = fopen($this->streamWrapperPrefix . '/' . $path . $target, $mode); stream_copy_to_stream($file, $dest); @@ -112,14 +114,14 @@ class FlysystemStorage implements ChunkStorageInterface * the previous file is unaccessible by the user, but if it is not removed * it will block the user from trying to re-upload it. */ - if ($this->filesystem->has($path.$name)) { - $this->filesystem->delete($path.$name); + if ($this->filesystem->has($path . $name)) { + $this->filesystem->delete($path . $name); } - $this->filesystem->rename($path.$target, $path.$name); + $this->filesystem->rename($path . $target, $path . $name); $target = $name; } - $uploaded = $this->filesystem->get($path.$target); + $uploaded = $this->filesystem->get($path . $target); if (!$renameChunk) { return $uploaded; @@ -128,7 +130,7 @@ class FlysystemStorage implements ChunkStorageInterface return new FlysystemFile($uploaded, $this->filesystem, $this->streamWrapperPrefix); } - public function cleanup($path) + public function cleanup($path): void { try { $this->filesystem->delete($path); @@ -142,7 +144,7 @@ class FlysystemStorage implements ChunkStorageInterface // Prevent path traversal attacks $uuid = basename($uuid); - return $this->filesystem->listFiles($this->prefix.'/'.$uuid); + return $this->filesystem->listFiles($this->prefix . '/' . $uuid); } public function getFilesystem() diff --git a/Uploader/Chunk/Storage/GaufretteStorage.php b/Uploader/Chunk/Storage/GaufretteStorage.php index 4fbc98c..c3f6353 100644 --- a/Uploader/Chunk/Storage/GaufretteStorage.php +++ b/Uploader/Chunk/Storage/GaufretteStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Chunk\Storage; use Gaufrette\Adapter\StreamFactory; @@ -30,7 +32,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface : 'Gaufrette\Filesystem'; if (!$filesystem instanceof $base) { - throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, is_object($filesystem) ? get_class($filesystem) : gettype($filesystem))); + throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, \is_object($filesystem) ? \get_class($filesystem) : \gettype($filesystem))); } if (!($filesystem->getAdapter() instanceof StreamFactory)) { @@ -50,7 +52,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface * @param $maxAge * @param null $prefix */ - public function clear($maxAge, $prefix = null) + public function clear($maxAge, $prefix = null): void { $prefix = $prefix ?: $this->prefix; $matches = $this->filesystem->listKeys($prefix); @@ -101,12 +103,11 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface * for gaufrette based chunk storage therefore assembleChunks will * be called in the same request. * - * @param $uuid - * @param $index - * @param UploadedFile $chunk - * @param $original + * @param $uuid + * @param $index + * @param $original */ - public function addChunk($uuid, $index, UploadedFile $chunk, $original) + public function addChunk($uuid, $index, UploadedFile $chunk, $original): void { // Prevent path traversal attacks $uuid = basename($uuid); @@ -122,12 +123,12 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface public function assembleChunks($chunks, $removeChunk, $renameChunk) { // the index is only added to be in sync with the filesystem storage - $path = $this->prefix.'/'.$this->unhandledChunk['uuid'].'/'; - $filename = $this->unhandledChunk['index'].'_'.$this->unhandledChunk['original']; + $path = $this->prefix . '/' . $this->unhandledChunk['uuid'] . '/'; + $filename = $this->unhandledChunk['index'] . '_' . $this->unhandledChunk['original']; if (empty($chunks)) { $target = $filename; - $this->ensureRemotePathExists($path.$target); + $this->ensureRemotePathExists($path . $target); } else { /* * The array only contains items with matching prefix until the filename @@ -138,7 +139,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface $target = pathinfo($chunks[0], PATHINFO_BASENAME); } - $dst = $this->filesystem->createStream($path.$target); + $dst = $this->filesystem->createStream($path . $target); if (0 === $this->unhandledChunk['index']) { // if it's the first chunk overwrite the already existing part // to avoid appending to earlier failed uploads @@ -160,14 +161,14 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface * the previous file is unaccessible by the user, but if it is not removed * it will block the user from trying to re-upload it. */ - if ($this->filesystem->has($path.$name)) { - $this->filesystem->delete($path.$name); + if ($this->filesystem->has($path . $name)) { + $this->filesystem->delete($path . $name); } - $this->filesystem->rename($path.$target, $path.$name); + $this->filesystem->rename($path . $target, $path . $name); $target = $name; } - $uploaded = $this->filesystem->get($path.$target); + $uploaded = $this->filesystem->get($path . $target); if (!$renameChunk) { return $uploaded; @@ -176,7 +177,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface return new GaufretteFile($uploaded, $this->filesystem, $this->streamWrapperPrefix); } - public function cleanup($path) + public function cleanup($path): void { $this->filesystem->delete($path); } @@ -186,7 +187,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface // Prevent path traversal attacks $uuid = basename($uuid); - $results = $this->filesystem->listKeys($this->prefix.'/'.$uuid); + $results = $this->filesystem->listKeys($this->prefix . '/' . $uuid); /* exclude files without an index, so if there is a completed file which * failed to upload it will not get mixed together with new one's chunks. diff --git a/Uploader/ErrorHandler/BlueimpErrorHandler.php b/Uploader/ErrorHandler/BlueimpErrorHandler.php index 41b8892..11888ae 100644 --- a/Uploader/ErrorHandler/BlueimpErrorHandler.php +++ b/Uploader/ErrorHandler/BlueimpErrorHandler.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\ErrorHandler; use Exception; @@ -18,7 +20,7 @@ class BlueimpErrorHandler implements ErrorHandlerInterface $this->translator = $translator; } - public function addException(AbstractResponse $response, Exception $exception) + public function addException(AbstractResponse $response, Exception $exception): void { $message = $this->translator->trans($exception->getMessage(), [], 'OneupUploaderBundle'); $response->addToOffset(['error' => $message], ['files']); diff --git a/Uploader/ErrorHandler/DropzoneErrorHandler.php b/Uploader/ErrorHandler/DropzoneErrorHandler.php index b04f2bd..f1d578d 100755 --- a/Uploader/ErrorHandler/DropzoneErrorHandler.php +++ b/Uploader/ErrorHandler/DropzoneErrorHandler.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\ErrorHandler; use Exception; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\Uploader\Response\AbstractResponse; class DropzoneErrorHandler implements ErrorHandlerInterface { - public function addException(AbstractResponse $response, Exception $exception) + public function addException(AbstractResponse $response, Exception $exception): void { $errors[] = $exception; $message = $exception->getMessage(); diff --git a/Uploader/ErrorHandler/ErrorHandlerInterface.php b/Uploader/ErrorHandler/ErrorHandlerInterface.php index 70ff6e3..fff3fed 100644 --- a/Uploader/ErrorHandler/ErrorHandlerInterface.php +++ b/Uploader/ErrorHandler/ErrorHandlerInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\ErrorHandler; use Exception; @@ -9,9 +11,6 @@ interface ErrorHandlerInterface { /** * Adds an exception to a given response. - * - * @param AbstractResponse $response - * @param Exception $exception */ public function addException(AbstractResponse $response, Exception $exception); } diff --git a/Uploader/ErrorHandler/NoopErrorHandler.php b/Uploader/ErrorHandler/NoopErrorHandler.php index d1217d3..71826d3 100644 --- a/Uploader/ErrorHandler/NoopErrorHandler.php +++ b/Uploader/ErrorHandler/NoopErrorHandler.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\ErrorHandler; use Exception; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\Uploader\Response\AbstractResponse; class NoopErrorHandler implements ErrorHandlerInterface { - public function addException(AbstractResponse $response, Exception $exception) + public function addException(AbstractResponse $response, Exception $exception): void { // noop } diff --git a/Uploader/ErrorHandler/PluploadErrorHandler.php b/Uploader/ErrorHandler/PluploadErrorHandler.php index 177bdf7..6d4c0d7 100644 --- a/Uploader/ErrorHandler/PluploadErrorHandler.php +++ b/Uploader/ErrorHandler/PluploadErrorHandler.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\ErrorHandler; use Exception; @@ -7,7 +9,7 @@ use Oneup\UploaderBundle\Uploader\Response\AbstractResponse; class PluploadErrorHandler implements ErrorHandlerInterface { - public function addException(AbstractResponse $response, Exception $exception) + public function addException(AbstractResponse $response, Exception $exception): void { /* Plupload only needs an error message so it can be handled client side */ $message = $exception->getMessage(); diff --git a/Uploader/Exception/ValidationException.php b/Uploader/Exception/ValidationException.php index 47b75c0..5ffe8a3 100644 --- a/Uploader/Exception/ValidationException.php +++ b/Uploader/Exception/ValidationException.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Exception; use Symfony\Component\HttpFoundation\File\Exception\UploadException; diff --git a/Uploader/File/FileInterface.php b/Uploader/File/FileInterface.php index fa04701..0940d74 100644 --- a/Uploader/File/FileInterface.php +++ b/Uploader/File/FileInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\File; /** diff --git a/Uploader/File/FilesystemFile.php b/Uploader/File/FilesystemFile.php index 3d6d21e..4e0d315 100644 --- a/Uploader/File/FilesystemFile.php +++ b/Uploader/File/FilesystemFile.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\File; use Symfony\Component\HttpFoundation\File\File; diff --git a/Uploader/File/FlysystemFile.php b/Uploader/File/FlysystemFile.php index 3e0cdf7..a8c7bf6 100644 --- a/Uploader/File/FlysystemFile.php +++ b/Uploader/File/FlysystemFile.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\File; use League\Flysystem\File; @@ -45,4 +47,9 @@ class FlysystemFile extends File implements FileInterface { return pathinfo($this->getPath(), PATHINFO_EXTENSION); } + + public function getFilesystem() + { + return $this->filesystem; + } } diff --git a/Uploader/File/GaufretteFile.php b/Uploader/File/GaufretteFile.php index 8dfa5dc..9abdb40 100644 --- a/Uploader/File/GaufretteFile.php +++ b/Uploader/File/GaufretteFile.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\File; use Gaufrette\Adapter\AwsS3; @@ -14,7 +16,6 @@ class GaufretteFile extends File implements FileInterface protected $mimeType; /** - * @param File $file * @param FilesystemInterface|Filesystem $filesystem * @param string|null $streamWrapperPrefix */ @@ -25,7 +26,7 @@ class GaufretteFile extends File implements FileInterface : 'Gaufrette\Filesystem'; if (!$filesystem instanceof $base) { - throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, is_object($filesystem) ? get_class($filesystem) : gettype($filesystem))); + throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, \is_object($filesystem) ? \get_class($filesystem) : \gettype($filesystem))); } parent::__construct($file->getKey(), $filesystem); @@ -49,7 +50,7 @@ class GaufretteFile extends File implements FileInterface if ($this->filesystem->getAdapter() instanceof StreamFactory && !$this->size) { if ($this->streamWrapperPrefix) { try { - $this->setSize(filesize($this->streamWrapperPrefix.$this->getKey())); + $this->setSize(filesize($this->streamWrapperPrefix . $this->getKey())); } catch (\Exception $e) { // Fail gracefully if there was a problem with opening the file and // let gaufrette load the file into memory allowing it to throw exceptions @@ -88,7 +89,7 @@ class GaufretteFile extends File implements FileInterface if ($this->filesystem->getAdapter() instanceof StreamFactory && !$this->mimeType) { if ($this->streamWrapperPrefix) { $finfo = finfo_open(FILEINFO_MIME_TYPE); - $this->mimeType = finfo_file($finfo, $this->streamWrapperPrefix.$this->getKey()); + $this->mimeType = finfo_file($finfo, $this->streamWrapperPrefix . $this->getKey()); finfo_close($finfo); } } elseif ($this->filesystem->getAdapter() instanceof AwsS3 && !$this->mimeType) { diff --git a/Uploader/Gaufrette/StreamManager.php b/Uploader/Gaufrette/StreamManager.php index b6bb942..992ce93 100644 --- a/Uploader/Gaufrette/StreamManager.php +++ b/Uploader/Gaufrette/StreamManager.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Gaufrette; use Gaufrette\Stream; @@ -24,7 +26,7 @@ class StreamManager return new LocalStream($file->getPathname()); } - protected function ensureRemotePathExists($path) + protected function ensureRemotePathExists($path): void { if (!$this->filesystem->has($path)) { $this->filesystem->write($path, '', true); @@ -34,12 +36,12 @@ class StreamManager protected function openStream(Stream $stream, $mode) { // always use binary mode - $mode = $mode.'b+'; + $mode = $mode . 'b+'; return $stream->open(new StreamMode($mode)); } - protected function stream(FileInterface $file, Stream $dst) + protected function stream(FileInterface $file, Stream $dst): void { $src = $this->createSourceStream($file); diff --git a/Uploader/Naming/NamerInterface.php b/Uploader/Naming/NamerInterface.php index 0fe1479..568389e 100644 --- a/Uploader/Naming/NamerInterface.php +++ b/Uploader/Naming/NamerInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Naming; use Oneup\UploaderBundle\Uploader\File\FileInterface; @@ -9,8 +11,6 @@ interface NamerInterface /** * Name a given file and return the name. * - * @param FileInterface $file - * * @return string */ public function name(FileInterface $file); diff --git a/Uploader/Naming/UniqidNamer.php b/Uploader/Naming/UniqidNamer.php index 34a7141..1603194 100644 --- a/Uploader/Naming/UniqidNamer.php +++ b/Uploader/Naming/UniqidNamer.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Naming; use Oneup\UploaderBundle\Uploader\File\FileInterface; diff --git a/Uploader/Naming/UrlSafeNamer.php b/Uploader/Naming/UrlSafeNamer.php index bb4fdb5..2437cc6 100644 --- a/Uploader/Naming/UrlSafeNamer.php +++ b/Uploader/Naming/UrlSafeNamer.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Naming; use Oneup\UploaderBundle\Uploader\File\FileInterface; @@ -9,14 +11,12 @@ class UrlSafeNamer implements NamerInterface /** * Name a given file and return the name. * - * @param FileInterface $file - * * @return string */ public function name(FileInterface $file) { $bytes = random_bytes(256 / 8); - return rtrim(strtr(base64_encode($bytes), '+/', '-_'), '=').'.'.$file->getExtension(); + return rtrim(strtr(base64_encode($bytes), '+/', '-_'), '=') . '.' . $file->getExtension(); } } diff --git a/Uploader/Orphanage/OrphanageManager.php b/Uploader/Orphanage/OrphanageManager.php index 1e3aa92..3d5eeee 100644 --- a/Uploader/Orphanage/OrphanageManager.php +++ b/Uploader/Orphanage/OrphanageManager.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Orphanage; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -27,7 +29,7 @@ class OrphanageManager return $this->container->get(sprintf('oneup_uploader.orphanage.%s', $key)); } - public function clear() + public function clear(): void { // Really ugly solution to clearing the orphanage on gaufrette $class = $this->container->getParameter('oneup_uploader.orphanage.class'); @@ -41,7 +43,7 @@ class OrphanageManager $finder = new Finder(); try { - $finder->in($this->config['directory'])->date('<='.-1 * (int) $this->config['maxage'].'seconds')->files(); + $finder->in($this->config['directory'])->date('<=' . -1 * (int) $this->config['maxage'] . 'seconds')->files(); } catch (\InvalidArgumentException $e) { // the finder will throw an exception of type InvalidArgumentException // if the directory he should search in does not exist @@ -59,7 +61,7 @@ class OrphanageManager $finder->in($this->config['directory'])->directories(); $dirArray = iterator_to_array($finder, false); - $size = count($dirArray); + $size = \count($dirArray); // We crawl the array backward as the Finder returns the parent first for ($i = $size - 1; $i >= 0; --$i) { diff --git a/Uploader/Response/AbstractResponse.php b/Uploader/Response/AbstractResponse.php index 967ae2e..2e55fb6 100644 --- a/Uploader/Response/AbstractResponse.php +++ b/Uploader/Response/AbstractResponse.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Response; abstract class AbstractResponse implements \ArrayAccess, ResponseInterface @@ -11,7 +13,7 @@ abstract class AbstractResponse implements \ArrayAccess, ResponseInterface $this->data = []; } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { null === $offset ? $this->data[] = $value : $this->data[$offset] = $value; } @@ -21,7 +23,7 @@ abstract class AbstractResponse implements \ArrayAccess, ResponseInterface return isset($this->data[$offset]); } - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->data[$offset]); } @@ -36,19 +38,18 @@ abstract class AbstractResponse implements \ArrayAccess, ResponseInterface * This function will take a path of arrays and add a new element to it, creating the path if needed. * * @param mixed $value - * @param array $offsets * * @throws \InvalidArgumentException if the path contains non-array items */ - public function addToOffset($value, array $offsets) + public function addToOffset($value, array $offsets): void { $element = &$this->data; foreach ($offsets as $offset) { if (isset($element[$offset])) { - if (is_array($element[$offset])) { + if (\is_array($element[$offset])) { $element = &$element[$offset]; } else { - throw new \InvalidArgumentException('The specified offset is set but is not an array at'.$offset); + throw new \InvalidArgumentException('The specified offset is set but is not an array at' . $offset); } } else { $element[$offset] = []; diff --git a/Uploader/Response/EmptyResponse.php b/Uploader/Response/EmptyResponse.php index 37d65a6..82059d9 100644 --- a/Uploader/Response/EmptyResponse.php +++ b/Uploader/Response/EmptyResponse.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Response; class EmptyResponse extends AbstractResponse diff --git a/Uploader/Response/FineUploaderResponse.php b/Uploader/Response/FineUploaderResponse.php index 629e81c..d769eac 100644 --- a/Uploader/Response/FineUploaderResponse.php +++ b/Uploader/Response/FineUploaderResponse.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Response; class FineUploaderResponse extends AbstractResponse diff --git a/Uploader/Response/MooUploadResponse.php b/Uploader/Response/MooUploadResponse.php index 0b3b471..f139f06 100644 --- a/Uploader/Response/MooUploadResponse.php +++ b/Uploader/Response/MooUploadResponse.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Response; class MooUploadResponse extends AbstractResponse diff --git a/Uploader/Response/ResponseInterface.php b/Uploader/Response/ResponseInterface.php index 7d826be..160bbcf 100644 --- a/Uploader/Response/ResponseInterface.php +++ b/Uploader/Response/ResponseInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Response; interface ResponseInterface diff --git a/Uploader/Storage/FilesystemOrphanageStorage.php b/Uploader/Storage/FilesystemOrphanageStorage.php index 8d9667e..7a73789 100644 --- a/Uploader/Storage/FilesystemOrphanageStorage.php +++ b/Uploader/Storage/FilesystemOrphanageStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use Oneup\UploaderBundle\Uploader\Chunk\Storage\ChunkStorageInterface; diff --git a/Uploader/Storage/FilesystemStorage.php b/Uploader/Storage/FilesystemStorage.php index a4824b8..ac879dd 100644 --- a/Uploader/Storage/FilesystemStorage.php +++ b/Uploader/Storage/FilesystemStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use Oneup\UploaderBundle\Uploader\File\FileInterface; @@ -21,7 +23,7 @@ class FilesystemStorage implements StorageInterface // now that we have the correct path, compute the correct name // and target directory $targetName = basename($path); - $targetDir = dirname($path); + $targetDir = \dirname($path); $file = $file->move($targetDir, $targetName); diff --git a/Uploader/Storage/FlysystemOrphanageStorage.php b/Uploader/Storage/FlysystemOrphanageStorage.php index f866307..54535b6 100644 --- a/Uploader/Storage/FlysystemOrphanageStorage.php +++ b/Uploader/Storage/FlysystemOrphanageStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use League\Flysystem\File; @@ -17,11 +19,9 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto protected $type; /** - * @param StorageInterface $storage - * @param SessionInterface $session - * @param ChunkStorage $chunkStorage this class is only used if the gaufrette chunk storage is used - * @param $config - * @param $type + * @param ChunkStorage $chunkStorage this class is only used if the gaufrette chunk storage is used + * @param $config + * @param $type */ public function __construct(StorageInterface $storage, SessionInterface $session, ChunkStorage $chunkStorage, $config, $type) { diff --git a/Uploader/Storage/FlysystemStorage.php b/Uploader/Storage/FlysystemStorage.php index 913de52..8d3d26b 100644 --- a/Uploader/Storage/FlysystemStorage.php +++ b/Uploader/Storage/FlysystemStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use League\Flysystem\Filesystem; @@ -38,13 +40,13 @@ class FlysystemStorage implements StorageInterface $path = null === $path ? $name : sprintf('%s/%s', $path, $name); if ($file instanceof FilesystemFile) { - $stream = fopen($file->getPathname(), 'r+b'); + $stream = fopen($file->getPathname(), 'r+'); $this->filesystem->putStream($path, $stream, [ 'mimetype' => $file->getMimeType(), ]); - if (is_resource($stream)) { + if (\is_resource($stream)) { fclose($stream); } diff --git a/Uploader/Storage/GaufretteOrphanageStorage.php b/Uploader/Storage/GaufretteOrphanageStorage.php index 14182d0..c630a15 100644 --- a/Uploader/Storage/GaufretteOrphanageStorage.php +++ b/Uploader/Storage/GaufretteOrphanageStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use Gaufrette\File; @@ -17,8 +19,6 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto protected $type; /** - * @param StorageInterface $storage - * @param SessionInterface $session * @param GaufretteChunkStorage $chunkStorage this class is only used if the gaufrette chunk storage is used * @param $config * @param $type diff --git a/Uploader/Storage/GaufretteStorage.php b/Uploader/Storage/GaufretteStorage.php index 4370826..83fe013 100644 --- a/Uploader/Storage/GaufretteStorage.php +++ b/Uploader/Storage/GaufretteStorage.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use Gaufrette\Adapter\MetadataSupporter; @@ -26,7 +28,7 @@ class GaufretteStorage extends StreamManager implements StorageInterface : 'Gaufrette\Filesystem'; if (!$filesystem instanceof $base) { - throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, is_object($filesystem) ? get_class($filesystem) : gettype($filesystem))); + throw new \InvalidArgumentException(sprintf('Expected an instance of "%s", got "%s".', $base, \is_object($filesystem) ? \get_class($filesystem) : \gettype($filesystem))); } $this->filesystem = $filesystem; diff --git a/Uploader/Storage/OrphanageStorageInterface.php b/Uploader/Storage/OrphanageStorageInterface.php index 96c0d97..0b916e2 100644 --- a/Uploader/Storage/OrphanageStorageInterface.php +++ b/Uploader/Storage/OrphanageStorageInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; interface OrphanageStorageInterface extends StorageInterface diff --git a/Uploader/Storage/StorageInterface.php b/Uploader/Storage/StorageInterface.php index 31665d8..d61e301 100644 --- a/Uploader/Storage/StorageInterface.php +++ b/Uploader/Storage/StorageInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Oneup\UploaderBundle\Uploader\Storage; use Oneup\UploaderBundle\Uploader\File\FileInterface; diff --git a/composer.json b/composer.json index 3a90d01..381dd24 100644 --- a/composer.json +++ b/composer.json @@ -22,27 +22,28 @@ "require": { "php": "^7.1", - "symfony/asset": "^3.0|^4.0", - "symfony/finder": "^3.0|^4.0", - "symfony/framework-bundle": "^3.0|^4.0", - "symfony/http-foundation": "^3.0|^4.0", - "symfony/templating": "^3.0|^4.0", - "symfony/translation": "^3.0|^4.0", - "symfony/yaml": "^3.0|^4.0", + "symfony/asset": "^3.4|^4.0", + "symfony/finder": "^3.4|^4.0", + "symfony/framework-bundle": "^3.4|^4.0", + "symfony/http-foundation": "^3.4|^4.0", + "symfony/templating": "^3.4|^4.0", + "symfony/translation": "^3.4|^4.0", + "symfony/yaml": "^3.4|^4.0", "twig/twig": "^1.41|^2.10|^3.0" }, "require-dev": { "amazonwebservices/aws-sdk-for-php": "1.5.*", + "friendsofphp/php-cs-fixer": "^2.16", "knplabs/gaufrette": "^0.9", "oneup/flysystem-bundle": "^1.2|^2.0|^3.0", "phpunit/phpunit": "^7.5", "sensio/framework-extra-bundle": "^5.0", - "symfony/browser-kit": "^3.0|^4.0", - "symfony/class-loader": "^3.0|^4.0", + "symfony/browser-kit": "^3.4|^4.0", + "symfony/class-loader": "^3.4|^4.0", "symfony/phpunit-bridge": "^5.0", - "symfony/security-bundle": "^3.0|^4.0", - "symfony/var-dumper": "^3.0|^4.0", + "symfony/security-bundle": "^3.4|^4.0", + "symfony/var-dumper": "^3.4|^4.0", "twistor/flysystem-stream-wrapper": "^1.0" }, "config": {
0
24da05f985198393205b62018983ba235d2aa74e
1up-lab/OneupUploaderBundle
Inject request_stack service instead of session (#426) Co-authored-by: David Greminger <[email protected]>
commit 24da05f985198393205b62018983ba235d2aa74e Author: Erwan Nader <[email protected]> Date: Wed Jul 20 11:54:29 2022 +0200 Inject request_stack service instead of session (#426) Co-authored-by: David Greminger <[email protected]> diff --git a/src/DependencyInjection/OneupUploaderExtension.php b/src/DependencyInjection/OneupUploaderExtension.php index ab33a88..56195e5 100644 --- a/src/DependencyInjection/OneupUploaderExtension.php +++ b/src/DependencyInjection/OneupUploaderExtension.php @@ -241,7 +241,7 @@ class OneupUploaderExtension extends Extension $this->container ->register($orphanageName, '%oneup_uploader.orphanage.class%') ->addArgument($storageService) - ->addArgument(new Reference('session')) + ->addArgument(new Reference('request_stack')) ->addArgument(new Reference('oneup_uploader.chunks_storage')) ->addArgument($this->config['orphanage']) ->addArgument($key) diff --git a/src/Uploader/Storage/FilesystemOrphanageStorage.php b/src/Uploader/Storage/FilesystemOrphanageStorage.php index 36c587b..7ed19a3 100644 --- a/src/Uploader/Storage/FilesystemOrphanageStorage.php +++ b/src/Uploader/Storage/FilesystemOrphanageStorage.php @@ -9,6 +9,8 @@ use Oneup\UploaderBundle\Uploader\File\FileInterface; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpFoundation\File\File; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\SessionInterface; class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageStorageInterface @@ -38,12 +40,15 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS */ protected $type; - public function __construct(StorageInterface $storage, SessionInterface $session, ChunkStorage $chunkStorage, array $config, string $type) + public function __construct(StorageInterface $storage, RequestStack $requestStack, ChunkStorage $chunkStorage, array $config, string $type) { parent::__construct($config['directory']); + /** @var Request $request */ + $request = $requestStack->getCurrentRequest(); + $this->storage = $storage; - $this->session = $session; + $this->session = $request->getSession(); $this->chunkStorage = $chunkStorage; $this->config = $config; $this->type = $type; @@ -56,7 +61,7 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS */ public function upload($file, string $name, string $path = null) { - if (!$this->session->isStarted()) { + if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); } diff --git a/src/Uploader/Storage/FlysystemOrphanageStorage.php b/src/Uploader/Storage/FlysystemOrphanageStorage.php index 984c545..aedc716 100644 --- a/src/Uploader/Storage/FlysystemOrphanageStorage.php +++ b/src/Uploader/Storage/FlysystemOrphanageStorage.php @@ -9,6 +9,8 @@ use Oneup\UploaderBundle\Uploader\Chunk\Storage\FlysystemStorage as ChunkStorage use Oneup\UploaderBundle\Uploader\File\FileInterface; use Oneup\UploaderBundle\Uploader\File\FlysystemFile; use Symfony\Component\HttpFoundation\File\File as SymfonyFile; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\SessionInterface; class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageStorageInterface @@ -38,7 +40,7 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto */ protected $type; - public function __construct(StorageInterface $storage, SessionInterface $session, ChunkStorage $chunkStorage, array $config, string $type) + public function __construct(StorageInterface $storage, RequestStack $requestStack, ChunkStorage $chunkStorage, array $config, string $type) { /* * initiate the storage on the chunk storage's filesystem @@ -46,9 +48,12 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto */ parent::__construct($chunkStorage->getFilesystem(), $chunkStorage->bufferSize, $chunkStorage->getStreamWrapperPrefix()); + /** @var Request $request */ + $request = $requestStack->getCurrentRequest(); + $this->storage = $storage; $this->chunkStorage = $chunkStorage; - $this->session = $session; + $this->session = $request->getSession(); $this->config = $config; $this->type = $type; } @@ -60,7 +65,7 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto */ public function upload($file, string $name, string $path = null) { - if (!$this->session->isStarted()) { + if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); } diff --git a/src/Uploader/Storage/GaufretteOrphanageStorage.php b/src/Uploader/Storage/GaufretteOrphanageStorage.php index abc0d0c..cfab590 100644 --- a/src/Uploader/Storage/GaufretteOrphanageStorage.php +++ b/src/Uploader/Storage/GaufretteOrphanageStorage.php @@ -8,6 +8,8 @@ use Gaufrette\File; use Oneup\UploaderBundle\Uploader\Chunk\Storage\GaufretteStorage as GaufretteChunkStorage; use Oneup\UploaderBundle\Uploader\File\FileInterface; use Oneup\UploaderBundle\Uploader\File\GaufretteFile; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\SessionInterface; class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageStorageInterface @@ -37,7 +39,7 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto */ protected $type; - public function __construct(StorageInterface $storage, SessionInterface $session, GaufretteChunkStorage $chunkStorage, array $config, string $type) + public function __construct(StorageInterface $storage, RequestStack $requestStack, GaufretteChunkStorage $chunkStorage, array $config, string $type) { /* * initiate the storage on the chunk storage's filesystem @@ -45,9 +47,12 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto */ parent::__construct($chunkStorage->getFilesystem(), $chunkStorage->buffersize, $chunkStorage->getStreamWrapperPrefix()); + /** @var Request $request */ + $request = $requestStack->getCurrentRequest(); + $this->storage = $storage; $this->chunkStorage = $chunkStorage; - $this->session = $session; + $this->session = $request->getSession(); $this->config = $config; $this->type = $type; } @@ -59,7 +64,7 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto */ public function upload($file, string $name, string $path = null) { - if (!$this->session->isStarted()) { + if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); } diff --git a/tests/Uploader/Storage/FilesystemOrphanageStorageTest.php b/tests/Uploader/Storage/FilesystemOrphanageStorageTest.php index 5701f75..ffa1675 100644 --- a/tests/Uploader/Storage/FilesystemOrphanageStorageTest.php +++ b/tests/Uploader/Storage/FilesystemOrphanageStorageTest.php @@ -10,6 +10,8 @@ use Oneup\UploaderBundle\Uploader\Storage\FilesystemOrphanageStorage; use Oneup\UploaderBundle\Uploader\Storage\FilesystemStorage; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; @@ -49,8 +51,13 @@ class FilesystemOrphanageStorageTest extends OrphanageTest $session = new Session(new MockArraySessionStorage()); $session->start(); + $requestStack = new RequestStack(); + $request = new Request(); + $request->setSession($session); + $requestStack->push($request); + $config = ['directory' => $this->tempDirectory]; - $this->orphanage = new FilesystemOrphanageStorage($this->storage, $session, $chunkStorage, $config, 'cat'); + $this->orphanage = new FilesystemOrphanageStorage($this->storage, $requestStack, $chunkStorage, $config, 'cat'); } } diff --git a/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php b/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php index 94529d6..f8ed31d 100644 --- a/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php +++ b/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php @@ -13,6 +13,8 @@ use Oneup\UploaderBundle\Uploader\Storage\FlysystemOrphanageStorage; use Oneup\UploaderBundle\Uploader\Storage\FlysystemStorage as Storage; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Twistor\FlysystemStreamWrapper; @@ -60,9 +62,14 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $session = new Session(new MockArraySessionStorage()); $session->start(); + $requestStack = new RequestStack(); + $request = new Request(); + $request->setSession($session); + $requestStack->push($request); + $config = ['directory' => 'orphanage']; - $this->orphanage = new FlysystemOrphanageStorage($this->storage, $session, $chunkStorage, $config, 'cat'); + $this->orphanage = new FlysystemOrphanageStorage($this->storage, $requestStack, $chunkStorage, $config, 'cat'); for ($i = 0; $i < $this->numberOfPayloads; ++$i) { // create temporary file as if it was reassembled by the chunk manager diff --git a/tests/Uploader/Storage/GaufretteOrphanageStorageTest.php b/tests/Uploader/Storage/GaufretteOrphanageStorageTest.php index 58b6542..a1fde8e 100644 --- a/tests/Uploader/Storage/GaufretteOrphanageStorageTest.php +++ b/tests/Uploader/Storage/GaufretteOrphanageStorageTest.php @@ -12,6 +12,8 @@ use Oneup\UploaderBundle\Uploader\File\GaufretteFile; use Oneup\UploaderBundle\Uploader\Storage\GaufretteOrphanageStorage; use Oneup\UploaderBundle\Uploader\Storage\GaufretteStorage; use Symfony\Component\Finder\Finder; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; @@ -60,9 +62,14 @@ class GaufretteOrphanageStorageTest extends OrphanageTest $session = new Session(new MockArraySessionStorage()); $session->start(); + $requestStack = new RequestStack(); + $request = new Request(); + $request->setSession($session); + $requestStack->push($request); + $config = ['directory' => 'orphanage']; - $this->orphanage = new GaufretteOrphanageStorage($this->storage, $session, $chunkStorage, $config, 'cat'); + $this->orphanage = new GaufretteOrphanageStorage($this->storage, $requestStack, $chunkStorage, $config, 'cat'); for ($i = 0; $i < $this->numberOfPayloads; ++$i) { // create temporary file as if it was reassembled by the chunk manager
0
0127666ebd0a6aa0c69a768f7276a79fdc8f14ee
1up-lab/OneupUploaderBundle
Replaced deprecated global Twig functions (#366)
commit 0127666ebd0a6aa0c69a768f7276a79fdc8f14ee Author: Koen van Wijnen <[email protected]> Date: Wed Feb 5 07:25:08 2020 +0100 Replaced deprecated global Twig functions (#366) diff --git a/Twig/Extension/UploaderExtension.php b/Twig/Extension/UploaderExtension.php index a8664b1..a5a7c44 100644 --- a/Twig/Extension/UploaderExtension.php +++ b/Twig/Extension/UploaderExtension.php @@ -3,8 +3,10 @@ namespace Oneup\UploaderBundle\Twig\Extension; use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; +use Twig\Extension\AbstractExtension; +use Twig\TwigFunction; -class UploaderExtension extends \Twig_Extension +class UploaderExtension extends AbstractExtension { protected $helper; @@ -21,11 +23,11 @@ class UploaderExtension extends \Twig_Extension public function getFunctions() { return [ - new \Twig_SimpleFunction('oneup_uploader_endpoint', [$this, 'endpoint']), - new \Twig_SimpleFunction('oneup_uploader_progress', [$this, 'progress']), - new \Twig_SimpleFunction('oneup_uploader_cancel', [$this, 'cancel']), - new \Twig_SimpleFunction('oneup_uploader_upload_key', [$this, 'uploadKey']), - new \Twig_SimpleFunction('oneup_uploader_maxsize', [$this, 'maxSize']), + new TwigFunction('oneup_uploader_endpoint', [$this, 'endpoint']), + new TwigFunction('oneup_uploader_progress', [$this, 'progress']), + new TwigFunction('oneup_uploader_cancel', [$this, 'cancel']), + new TwigFunction('oneup_uploader_upload_key', [$this, 'uploadKey']), + new TwigFunction('oneup_uploader_maxsize', [$this, 'maxSize']), ]; } diff --git a/composer.json b/composer.json index 6da9463..3a90d01 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "symfony/http-foundation": "^3.0|^4.0", "symfony/templating": "^3.0|^4.0", "symfony/translation": "^3.0|^4.0", - "symfony/yaml": "^3.0|^4.0" + "symfony/yaml": "^3.0|^4.0", + "twig/twig": "^1.41|^2.10|^3.0" }, "require-dev": {
0
92434b7da6713332e2abeed0a7bf4ffbe6fb2441
1up-lab/OneupUploaderBundle
Return the new File instead of the old UploadedFile in FilesystemStorage.
commit 92434b7da6713332e2abeed0a7bf4ffbe6fb2441 Author: Jim Schmid <[email protected]> Date: Mon Apr 8 11:17:10 2013 +0200 Return the new File instead of the old UploadedFile in FilesystemStorage. diff --git a/Uploader/Storage/FilesystemStorage.php b/Uploader/Storage/FilesystemStorage.php index fcc3e51..2cd35ea 100644 --- a/Uploader/Storage/FilesystemStorage.php +++ b/Uploader/Storage/FilesystemStorage.php @@ -29,7 +29,7 @@ class FilesystemStorage implements StorageInterface $targetName = basename($path); $targetDir = dirname($path); - $file->move($targetDir, $targetName); + $file = $file->move($targetDir, $targetName); return $file; }
0
b69175b94f3aff3dcc82cc9f9e228693434b6ef8
1up-lab/OneupUploaderBundle
Added tests for Dropzone uploader.
commit b69175b94f3aff3dcc82cc9f9e228693434b6ef8 Author: Jim Schmid <[email protected]> Date: Wed Sep 18 12:22:28 2013 +0200 Added tests for Dropzone uploader. diff --git a/Tests/App/config/config.yml b/Tests/App/config/config.yml index 43d37c3..619cebc 100644 --- a/Tests/App/config/config.yml +++ b/Tests/App/config/config.yml @@ -43,6 +43,21 @@ oneup_uploader: allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] + dropzone: + frontend: dropzone + storage: + directory: %kernel.root_dir%/cache/%kernel.environment%/upload + + dropzone_validation: + frontend: dropzone + max_size: 256 + storage: + directory: %kernel.root_dir%/cache/%kernel.environment%/upload + allowed_extensions: [ "ok" ] + disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] + disallowed_mimetypes: [ "image/gif" ] + yui3: frontend: yui3 storage: diff --git a/Tests/Controller/DropzoneTest.php b/Tests/Controller/DropzoneTest.php new file mode 100644 index 0000000..a5aa7d0 --- /dev/null +++ b/Tests/Controller/DropzoneTest.php @@ -0,0 +1,29 @@ +<?php + +namespace Oneup\UploaderBundle\Tests\Controller; + +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Oneup\UploaderBundle\Tests\Controller\AbstractUploadTest; + +class DropzoneTest extends AbstractUploadTest +{ + protected function getConfigKey() + { + return 'dropzone'; + } + + protected function getRequestParameters() + { + return array(); + } + + protected function getRequestFile() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txt', + 'text/plain', + 128 + ); + } +} diff --git a/Tests/Controller/DropzoneValidationTest.php b/Tests/Controller/DropzoneValidationTest.php new file mode 100644 index 0000000..73cb5ff --- /dev/null +++ b/Tests/Controller/DropzoneValidationTest.php @@ -0,0 +1,69 @@ +<?php + +namespace Oneup\UploaderBundle\Tests\Controller; + +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Oneup\UploaderBundle\Tests\Controller\AbstractValidationTest; + +class DropzoneValidationTest extends AbstractValidationTest +{ + protected function getConfigKey() + { + return 'dropzone_validation'; + } + + protected function getRequestParameters() + { + return array(); + } + + protected function getOversizedFile() + { + return new UploadedFile( + $this->createTempFile(512), + 'cat.ok', + 'text/plain', + 512 + ); + } + + protected function getFileWithCorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.ok', + 'text/plain', + 128 + ); + } + + protected function getFileWithIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.fail', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeType() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.ok', + 'image/jpg', + 128 + ); + } + + protected function getFileWithIncorrectMimeType() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.ok', + 'image/gif', + 128 + ); + } +}
0
bf10b7b1a6a831cc5eabe4a84b68378482cf9f5e
1up-lab/OneupUploaderBundle
enable dropzone chunked upload
commit bf10b7b1a6a831cc5eabe4a84b68378482cf9f5e Author: Thomas Piard <[email protected]> Date: Tue Nov 21 15:18:09 2017 +0100 enable dropzone chunked upload diff --git a/Controller/DropzoneController.php b/Controller/DropzoneController.php index b4fdc99..feab508 100644 --- a/Controller/DropzoneController.php +++ b/Controller/DropzoneController.php @@ -2,11 +2,12 @@ namespace Oneup\UploaderBundle\Controller; -use Symfony\Component\HttpFoundation\File\Exception\UploadException; - use Oneup\UploaderBundle\Uploader\Response\EmptyResponse; +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\File\Exception\UploadException; -class DropzoneController extends AbstractController +class DropzoneController extends AbstractChunkedController { public function upload() { @@ -14,9 +15,15 @@ class DropzoneController extends AbstractController $response = new EmptyResponse(); $files = $this->getFiles($request->files); $statusCode = 200; + + $chunked = !is_null($request->request->get('dzchunkindex')); + foreach ($files as $file) { try { - $this->handleUpload($file, $response, $request); + $chunked ? + $this->handleChunkedUpload($file, $response, $request) : + $this->handleUpload($file, $response, $request) + ; } catch (UploadException $e) { $statusCode = 500; //Dropzone displays error if HTTP response is 40x or 50x $this->errorHandler->addException($response, $e); @@ -24,10 +31,26 @@ class DropzoneController extends AbstractController $message = $translator->trans($e->getMessage(), array(), 'OneupUploaderBundle'); $response = $this->createSupportedJsonResponse(array('error'=>$message )); $response->setStatusCode(400); - return $response; + return $response; } } return $this->createSupportedJsonResponse($response->assemble(), $statusCode); } + + protected function parseChunkedRequest(Request $request) + { + $totalChunkCount = $request->get('dztotalchunkcount'); + $index = $request->get('dzchunkindex'); + $last = ($index + 1) === (int) $totalChunkCount; + $uuid = $request->get('dzuuid'); + + /** + * @var UploadedFile $file + */ + $file = $request->files->get('file')->getClientOriginalName(); + $orig = $file; + + return [$last, $uuid, $index, $orig]; + } }
0
f41e06bf3252be7d661e11d4ab9b874971855eb7
1up-lab/OneupUploaderBundle
Add a link to flystem documenation
commit f41e06bf3252be7d661e11d4ab9b874971855eb7 Author: Shank <[email protected]> Date: Mon Sep 5 13:21:43 2016 -0700 Add a link to flystem documenation diff --git a/Resources/doc/index.md b/Resources/doc/index.md index 7b6601e..1b07234 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -137,6 +137,7 @@ some more advanced features. * [Return custom data to frontend](response.md) * [Enable chunked uploads](chunked_uploads.md) * [Using the Orphanage](orphanage.md) +* [Use Flysystem as storage layer](flysystem_storage.md) * [Use Gaufrette as storage layer](gaufrette_storage.md) * [Include your own Namer](custom_namer.md) * [Use custom error handlers](custom_error_handler.md)
0
8ec27f83672c465ce032961e5c3eb684b767db68
1up-lab/OneupUploaderBundle
Added the session id to the uuid, as it is possible that two users upload the same filename at the same time.
commit 8ec27f83672c465ce032961e5c3eb684b767db68 Author: Jim Schmid <[email protected]> Date: Fri Apr 12 15:52:37 2013 +0200 Added the session id to the uuid, as it is possible that two users upload the same filename at the same time. diff --git a/Controller/PluploadController.php b/Controller/PluploadController.php index 6b0cfe3..c445174 100644 --- a/Controller/PluploadController.php +++ b/Controller/PluploadController.php @@ -40,11 +40,17 @@ class PluploadController extends AbstractChunkedController protected function parseChunkedRequest(Request $request) { + $session = $this->container->get('session'); + $orig = $request->get('name'); - $uuid = $request->get('name'); $index = $request->get('chunk'); $last = $request->get('chunks') - 1 == $request->get('chunk'); + // it is possible, that two clients send a file with the + // exact same filename, therefore we have to add the session + // to the uuid otherwise we will get a mess + $uuid = md5(sprintf('%s.%s', $orig, $session->getId())); + return array($last, $uuid, $index, $orig); } } \ No newline at end of file
0
e9ca3e0ca7dbe1032cada59394dcce77da9d1315
1up-lab/OneupUploaderBundle
Test this bundle with Symfony Version 2.3
commit e9ca3e0ca7dbe1032cada59394dcce77da9d1315 Author: Jim Schmid <[email protected]> Date: Tue Jun 4 10:15:54 2013 +0200 Test this bundle with Symfony Version 2.3 diff --git a/.travis.yml b/.travis.yml index 40d1a2d..0acf73b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ php: env: - SYMFONY_VERSION=2.1.* - SYMFONY_VERSION=2.2.* + - SYMFONY_VERSION=2.3.* before_script: - composer require symfony/framework-bundle:${SYMFONY_VERSION} --prefer-source
0
593e54e58981f4bb0796364760ddd34ecca3b23d
1up-lab/OneupUploaderBundle
Merge pull request #167 from giosh94mhz/allow_put_patch Allow PUT and PATCH method for upload route
commit 593e54e58981f4bb0796364760ddd34ecca3b23d (from 829d3e48ae681619d011cb000e965dcf443f4293) Merge: 829d3e4 d60f1ae Author: Jim Schmid <[email protected]> Date: Wed Mar 11 08:04:36 2015 +0100 Merge pull request #167 from giosh94mhz/allow_put_patch Allow PUT and PATCH method for upload route diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index fad6c0f..cd8c070 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -32,14 +32,22 @@ class RouteLoader extends Loader $upload = new Route( sprintf('%s/_uploader/%s/upload', $options['route_prefix'], $type), array('_controller' => $service . ':upload', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST', 'PUT', 'PATCH') ); if ($options['enable_progress'] === true) { $progress = new Route( sprintf('%s/_uploader/%s/progress', $options['route_prefix'], $type), array('_controller' => $service . ':progress', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST') ); $routes->add(sprintf('_uploader_progress_%s', $type), $progress); @@ -49,7 +57,11 @@ class RouteLoader extends Loader $progress = new Route( sprintf('%s/_uploader/%s/cancel', $options['route_prefix'], $type), array('_controller' => $service . ':cancel', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST') ); $routes->add(sprintf('_uploader_cancel_%s', $type), $progress); diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index 9e6d26a..2b0abf7 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -40,8 +40,7 @@ abstract class AbstractControllerTest extends WebTestCase */ public function testCallByGet() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('GET', $endpoint); + $this->implTestCallBy('GET'); } /** @@ -49,25 +48,30 @@ abstract class AbstractControllerTest extends WebTestCase */ public function testCallByDelete() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('DELETE', $endpoint); + $this->implTestCallBy('DELETE'); } - /** - * @expectedException Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException - */ - public function testCallByPut() + public function testCallByPatch() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('PUT', $endpoint); + $this->implTestCallBy('PATCH'); } public function testCallByPost() + { + $this->implTestCallBy('POST'); + } + + public function testCallByPut() + { + $this->implTestCallBy('PUT'); + } + + protected function implTestCallBy($method) { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); - $client->request('POST', $endpoint, array(), array(), $this->requestHeaders); + $client->request($method, $endpoint, array(), array(), $this->requestHeaders); $response = $client->getResponse(); $this->assertTrue($response->isSuccessful()); diff --git a/Tests/Routing/RouteLoaderTest.php b/Tests/Routing/RouteLoaderTest.php index 4058039..95b35ab 100644 --- a/Tests/Routing/RouteLoaderTest.php +++ b/Tests/Routing/RouteLoaderTest.php @@ -33,8 +33,8 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase foreach ($routes as $route) { $this->assertInstanceOf('Symfony\Component\Routing\Route', $route); - $this->assertEquals($route->getDefault('_format'), 'json'); - $this->assertEquals($route->getRequirement('_method'), 'POST'); + $this->assertEquals('json', $route->getDefault('_format')); + $this->assertContains('POST', $route->getMethods()); } } @@ -55,8 +55,8 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase foreach ($routes as $route) { $this->assertInstanceOf('Symfony\Component\Routing\Route', $route); - $this->assertEquals($route->getDefault('_format'), 'json'); - $this->assertEquals($route->getRequirement('_method'), 'POST'); + $this->assertEquals('json', $route->getDefault('_format')); + $this->assertContains('POST', $route->getMethods()); $this->assertEquals(0, strpos($route->getPath(), $prefix)); } commit 593e54e58981f4bb0796364760ddd34ecca3b23d (from d60f1ae8960853385ad3f803bb3fcd3a5651c2c6) Merge: 829d3e4 d60f1ae Author: Jim Schmid <[email protected]> Date: Wed Mar 11 08:04:36 2015 +0100 Merge pull request #167 from giosh94mhz/allow_put_patch Allow PUT and PATCH method for upload route diff --git a/Resources/doc/orphanage.md b/Resources/doc/orphanage.md index 6848615..9e4db06 100644 --- a/Resources/doc/orphanage.md +++ b/Resources/doc/orphanage.md @@ -53,6 +53,18 @@ class AcmeController extends Controller You will get an array containing the moved files. +Note that you can move only one or a set of defined files out of the orphanage by passing an array to $manager->getFiles(). +For instance, you can use this to move a specific file: +```php + // get files + $files = $manager->getFiles(); + + // reduce the scope of the Finder object to what you want + $files->files()->name($filename); + $manager->uploadFiles(iterator_to_array($files)); +``` +In this example, $filename is the name of the file you want to move out of the orphanage. + > If you are using Gaufrette, these files are instances of `Gaufrette\File`, otherwise `SplFileInfo`. ## Configure the Orphanage
0
eb40fefab5a195b30bb9af3b6ca1923e2068c4bf
1up-lab/OneupUploaderBundle
Added new parameters to ChunkManagerInterface.
commit eb40fefab5a195b30bb9af3b6ca1923e2068c4bf Author: Jim Schmid <[email protected]> Date: Thu Jul 25 17:50:20 2013 +0200 Added new parameters to ChunkManagerInterface. diff --git a/Uploader/Chunk/ChunkManagerInterface.php b/Uploader/Chunk/ChunkManagerInterface.php index 3fad75a..1ba2c15 100644 --- a/Uploader/Chunk/ChunkManagerInterface.php +++ b/Uploader/Chunk/ChunkManagerInterface.php @@ -8,7 +8,7 @@ interface ChunkManagerInterface { public function clear(); public function addChunk($uuid, $index, UploadedFile $chunk, $original); - public function assembleChunks(\IteratorAggregate $chunks); + public function assembleChunks(\IteratorAggregate $chunks, $removeChunk = true, $renameChunk = false); public function cleanup($path); public function getChunks($uuid); }
0
ad5577f64f954377521b8724ce7de3f7b4682987
1up-lab/OneupUploaderBundle
gaufrette chunk storage
commit ad5577f64f954377521b8724ce7de3f7b4682987 Author: mitom <[email protected]> Date: Wed Oct 9 21:48:18 2013 +0200 gaufrette chunk storage diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index 7f930d4..2678a66 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -74,8 +74,7 @@ abstract class AbstractChunkedController extends AbstractController $path = $assembled->getPath(); // create a temporary uploaded file to meet the interface restrictions - $uploadedFile = new UploadedFile($assembled->getPathname(), $assembled->getBasename(), null, $assembled->getSize(), null, true); - $uploaded = $this->handleUpload($uploadedFile, $response, $request); + $this->handleUpload($assembled, $response, $request); $chunkManager->cleanup($path); } diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index 04397d2..aea039e 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -2,6 +2,7 @@ namespace Oneup\UploaderBundle\Controller; +use Oneup\UploaderBundle\Uploader\File\FileInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -103,7 +104,7 @@ abstract class AbstractController * @param response A response object. * @param request The request object. */ - protected function handleUpload(UploadedFile $file, ResponseInterface $response, Request $request) + protected function handleUpload(FileInterface $file, ResponseInterface $response, Request $request) { $this->validate($file); @@ -126,7 +127,7 @@ abstract class AbstractController * @param response A response object. * @param request The request object. */ - protected function dispatchPreUploadEvent(UploadedFile $uploaded, ResponseInterface $response, Request $request) + protected function dispatchPreUploadEvent(FileInterface $uploaded, ResponseInterface $response, Request $request) { $dispatcher = $this->container->get('event_dispatcher'); @@ -161,7 +162,7 @@ abstract class AbstractController } } - protected function validate(UploadedFile $file) + protected function validate(FileInterface $file) { $dispatcher = $this->container->get('event_dispatcher'); $event = new ValidationEvent($file, $this->container->get('request'), $this->config, $this->type); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 97b1eef..ab37255 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -18,7 +18,18 @@ class Configuration implements ConfigurationInterface ->addDefaultsIfNotSet() ->children() ->scalarNode('maxage')->defaultValue(604800)->end() - ->scalarNode('directory')->defaultNull()->end() + ->arrayNode('storage') + ->addDefaultsIfNotSet() + ->children() + ->enumNode('type') + ->values(array('filesystem', 'gaufrette')) + ->defaultValue('filesystem') + ->end() + ->scalarNode('filesystem')->defaultNull()->end() + ->scalarNode('directory')->defaultNull()->end() + ->scalarNode('sync_buffer_size')->defaultValue('100K')->end() + ->end() + ->end() ->booleanNode('load_distribution')->defaultTrue()->end() ->end() ->end() diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index fae9056..72445fa 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -13,11 +13,14 @@ use Symfony\Component\DependencyInjection\Loader; class OneupUploaderExtension extends Extension { protected $storageServices = array(); + protected $container; + protected $config; public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); - $config = $this->processConfiguration($configuration, $configs); + $this->config = $this->processConfiguration($configuration, $configs); + $this->container = $container; $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('uploader.xml'); @@ -25,88 +28,45 @@ class OneupUploaderExtension extends Extension $loader->load('validators.xml'); $loader->load('errorhandler.xml'); - if ($config['twig']) { + if ($this->config['twig']) { $loader->load('twig.xml'); } - $config['chunks']['directory'] = is_null($config['chunks']['directory']) ? - sprintf('%s/uploader/chunks', $container->getParameter('kernel.cache_dir')) : - $this->normalizePath($config['chunks']['directory']) - ; + if ($this->config['chunks']['storage']['type'] === 'filesystem' && + !isset($this->config['chunks']['storage']['directory'])) { + $this->config['chunks']['storage']['directory'] = sprintf('%s/uploader/chunks', $container->getParameter('kernel.cache_dir')); + } elseif ($this->config['chunks']['storage']['type'] === 'gaufrette' ) { + // Force load distribution when using gaufrette chunk storage + $this->config['chunks']['load_distribution'] = true; + } + + // register the service for the chunk storage + $this->createStorageService($this->config['chunks']['storage'], 'chunk'); - $config['orphanage']['directory'] = is_null($config['orphanage']['directory']) ? + + $this->config['orphanage']['directory'] = is_null($this->config['orphanage']['directory']) ? sprintf('%s/uploader/orphanage', $container->getParameter('kernel.cache_dir')) : - $this->normalizePath($config['orphanage']['directory']) + $this->normalizePath($this->config['orphanage']['directory']) ; - $container->setParameter('oneup_uploader.chunks', $config['chunks']); - $container->setParameter('oneup_uploader.orphanage', $config['orphanage']); + $container->setParameter('oneup_uploader.chunks', $this->config['chunks']); + $container->setParameter('oneup_uploader.orphanage', $this->config['orphanage']); $controllers = array(); // handle mappings - foreach ($config['mappings'] as $key => $mapping) { + foreach ($this->config['mappings'] as $key => $mapping) { + if ($key === 'chunk') { + throw new InvalidArgumentException('"chunk" is a protected mapping name, please use a different one.'); + } + $mapping['max_size'] = $mapping['max_size'] < 0 ? $this->getMaxUploadSize($mapping['max_size']) : $mapping['max_size'] ; // create the storage service according to the configuration - $storageService = null; - - // if a service is given, return a reference to this service - // this allows a user to overwrite the storage layer if needed - if (!is_null($mapping['storage']['service'])) { - $storageService = new Reference($mapping['storage']['service']); - } else { - // no service was given, so we create one - $storageName = sprintf('oneup_uploader.storage.%s', $key); - - if ($mapping['storage']['type'] == 'filesystem') { - $mapping['storage']['directory'] = is_null($mapping['storage']['directory']) ? - sprintf('%s/../web/uploads/%s', $container->getParameter('kernel.root_dir'), $key) : - $this->normalizePath($mapping['storage']['directory']) - ; - - $container - ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $mapping['storage']['type'])) - ->addArgument($mapping['storage']['directory']) - ; - } - - if ($mapping['storage']['type'] == 'gaufrette') { - if(!class_exists('Gaufrette\\Filesystem')) - throw new InvalidArgumentException('You have to install Gaufrette in order to use it as a storage service.'); - - if(strlen($mapping['storage']['filesystem']) <= 0) - throw new ServiceNotFoundException('Empty service name'); - - $container - ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $mapping['storage']['type'])) - ->addArgument(new Reference($mapping['storage']['filesystem'])) - ->addArgument($this->getValueInBytes($mapping['storage']['sync_buffer_size'])) - ; - } - - $storageService = new Reference($storageName); - - if ($mapping['use_orphanage']) { - $orphanageName = sprintf('oneup_uploader.orphanage.%s', $key); - - // this mapping wants to use the orphanage, so create - // a masked filesystem for the controller - $container - ->register($orphanageName, '%oneup_uploader.orphanage.class%') - ->addArgument($storageService) - ->addArgument(new Reference('session')) - ->addArgument($config['orphanage']) - ->addArgument($key) - ; - - // switch storage of mapping to orphanage - $storageService = new Reference($orphanageName); - } - } + $storageService = $this->createStorageService($mapping['storage'], $key, isset($mapping['orphanage']) ? :null); if ($mapping['frontend'] != 'custom') { $controllerName = sprintf('oneup_uploader.controller.%s', $key); @@ -154,6 +114,68 @@ class OneupUploaderExtension extends Extension $container->setParameter('oneup_uploader.controllers', $controllers); } + protected function createStorageService($storage, $key, $orphanage = null) + { + $storageService = null; + + // if a service is given, return a reference to this service + // this allows a user to overwrite the storage layer if needed + if (isset($storage['service']) && !is_null($storage['service'])) { + $storageService = new Reference($storage['storage']['service']); + } else { + // no service was given, so we create one + $storageName = sprintf('oneup_uploader.storage.%s', $key); + + if ($storage['type'] == 'filesystem') { + $storage['directory'] = is_null($storage['directory']) ? + sprintf('%s/../web/uploads/%s', $this->container->getParameter('kernel.root_dir'), $key) : + $this->normalizePath($storage['directory']) + ; + + $this->container + ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $storage['type'])) + ->addArgument($storage['directory']) + ; + } + + if ($storage['type'] == 'gaufrette') { + if(!class_exists('Gaufrette\\Filesystem')) + throw new InvalidArgumentException('You have to install Gaufrette in order to use it as a storage service.'); + + if(strlen($storage['filesystem']) <= 0) + throw new ServiceNotFoundException('Empty service name'); + + $this->container + ->register($storageName, sprintf('%%oneup_uploader.storage.%s.class%%', $storage['type'])) + ->addArgument(new Reference($storage['filesystem'])) + ->addArgument($this->getValueInBytes($storage['sync_buffer_size'])) + ; + } + + $storageService = new Reference($storageName); + + if ($orphanage) { + $orphanageName = sprintf('oneup_uploader.orphanage.%s', $key); + + // this mapping wants to use the orphanage, so create + // a masked filesystem for the controller + $this->container + ->register($orphanageName, '%oneup_uploader.orphanage.class%') + ->addArgument($storageService) + ->addArgument(new Reference('session')) + ->addArgument($this->config['orphanage']) + ->addArgument($key) + ; + + // switch storage of mapping to orphanage + $storageService = new Reference($orphanageName); + } + } + + return $storageService; + } + + protected function getMaxUploadSize($input) { $input = $this->getValueInBytes($input); diff --git a/Event/ValidationEvent.php b/Event/ValidationEvent.php index 8110b78..15e1c18 100644 --- a/Event/ValidationEvent.php +++ b/Event/ValidationEvent.php @@ -2,8 +2,8 @@ namespace Oneup\UploaderBundle\Event; +use Oneup\UploaderBundle\Uploader\File\FileInterface; use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; class ValidationEvent extends Event @@ -13,7 +13,7 @@ class ValidationEvent extends Event protected $type; protected $request; - public function __construct(UploadedFile $file, Request $request, array $config, $type) + public function __construct(FileInterface $file, Request $request, array $config, $type) { $this->file = $file; $this->config = $config; diff --git a/EventListener/AllowedExtensionValidationListener.php b/EventListener/AllowedExtensionValidationListener.php index 68c26e8..add50ca 100644 --- a/EventListener/AllowedExtensionValidationListener.php +++ b/EventListener/AllowedExtensionValidationListener.php @@ -12,7 +12,7 @@ class AllowedExtensionValidationListener $config = $event->getConfig(); $file = $event->getFile(); - $extension = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION); + $extension = $file->getExtension(); if (count($config['allowed_extensions']) > 0 && !in_array($extension, $config['allowed_extensions'])) { throw new ValidationException('error.whitelist'); diff --git a/EventListener/AllowedMimetypeValidationListener.php b/EventListener/AllowedMimetypeValidationListener.php index 195f6bd..66aa7b9 100644 --- a/EventListener/AllowedMimetypeValidationListener.php +++ b/EventListener/AllowedMimetypeValidationListener.php @@ -16,8 +16,7 @@ class AllowedMimetypeValidationListener return; } - $finfo = finfo_open(FILEINFO_MIME_TYPE); - $mimetype = finfo_file($finfo, $file->getRealpath()); + $mimetype = $file->getMimeType(); if (!in_array($mimetype, $config['allowed_mimetypes'])) { throw new ValidationException('error.whitelist'); diff --git a/EventListener/DisallowedExtensionValidationListener.php b/EventListener/DisallowedExtensionValidationListener.php index 9cdac58..9f000de 100644 --- a/EventListener/DisallowedExtensionValidationListener.php +++ b/EventListener/DisallowedExtensionValidationListener.php @@ -12,7 +12,7 @@ class DisallowedExtensionValidationListener $config = $event->getConfig(); $file = $event->getFile(); - $extension = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION); + $extension = $file->getExtension(); if (count($config['disallowed_extensions']) > 0 && in_array($extension, $config['disallowed_extensions'])) { throw new ValidationException('error.blacklist'); diff --git a/EventListener/DisallowedMimetypeValidationListener.php b/EventListener/DisallowedMimetypeValidationListener.php index 452eff6..c5ace44 100644 --- a/EventListener/DisallowedMimetypeValidationListener.php +++ b/EventListener/DisallowedMimetypeValidationListener.php @@ -16,8 +16,7 @@ class DisallowedMimetypeValidationListener return; } - $finfo = finfo_open(FILEINFO_MIME_TYPE); - $mimetype = finfo_file($finfo, $file->getRealpath()); + $mimetype = $file->getExtension(); if (in_array($mimetype, $config['disallowed_mimetypes'])) { throw new ValidationException('error.blacklist'); diff --git a/Resources/config/uploader.xml b/Resources/config/uploader.xml index 39502ab..3c95386 100644 --- a/Resources/config/uploader.xml +++ b/Resources/config/uploader.xml @@ -26,6 +26,7 @@ <!-- managers --> <service id="oneup_uploader.chunk_manager" class="%oneup_uploader.chunks.manager.class%"> <argument>%oneup_uploader.chunks%</argument> + <argument type="service" id="oneup_uploader.storage.chunk" /> </service> <service id="oneup_uploader.orphanage_manager" class="%oneup_uploader.orphanage.manager.class%"> diff --git a/Uploader/Chunk/ChunkManager.php b/Uploader/Chunk/ChunkManager.php index 4f7733b..39bd2d2 100644 --- a/Uploader/Chunk/ChunkManager.php +++ b/Uploader/Chunk/ChunkManager.php @@ -2,6 +2,7 @@ namespace Oneup\UploaderBundle\Uploader\Chunk; +use Oneup\UploaderBundle\Uploader\Storage\ChunkStorageInterface; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Finder\Finder; @@ -11,102 +12,38 @@ use Oneup\UploaderBundle\Uploader\Chunk\ChunkManagerInterface; class ChunkManager implements ChunkManagerInterface { - public function __construct($configuration) + protected $configuration; + protected $storage; + + public function __construct($configuration, ChunkStorageInterface $storage) { $this->configuration = $configuration; + $this->storage = $storage; } public function clear() { - $system = new Filesystem(); - $finder = new Finder(); - - try { - $finder->in($this->configuration['directory'])->date('<=' . -1 * (int) $this->configuration['maxage'] . 'seconds')->files(); - } catch (\InvalidArgumentException $e) { - // the finder will throw an exception of type InvalidArgumentException - // if the directory he should search in does not exist - // in that case we don't have anything to clean - return; - } - - foreach ($finder as $file) { - $system->remove($file); - } + $this->storage->clear($this->configuration['maxage']); } public function addChunk($uuid, $index, UploadedFile $chunk, $original) { - $filesystem = new Filesystem(); - $path = sprintf('%s/%s', $this->configuration['directory'], $uuid); - $name = sprintf('%s_%s', $index, $original); - - // create directory if it does not yet exist - if(!$filesystem->exists($path)) - $filesystem->mkdir(sprintf('%s/%s', $this->configuration['directory'], $uuid)); - - return $chunk->move($path, $name); + return $this->storage->addChunk($uuid, $index, $chunk, $original); } - public function assembleChunks(\IteratorAggregate $chunks, $removeChunk = true, $renameChunk = false) + public function assembleChunks($chunks, $removeChunk = true, $renameChunk = false) { - $iterator = $chunks->getIterator()->getInnerIterator(); - - $base = $iterator->current(); - $iterator->next(); - - while ($iterator->valid()) { - - $file = $iterator->current(); - - if (false === file_put_contents($base->getPathname(), file_get_contents($file->getPathname()), \FILE_APPEND | \LOCK_EX)) { - throw new \RuntimeException('Reassembling chunks failed.'); - } - - if ($removeChunk) { - $filesystem = new Filesystem(); - $filesystem->remove($file->getPathname()); - } - - $iterator->next(); - } - - $name = $base->getBasename(); - - if ($renameChunk) { - $name = preg_replace('/^(\d+)_/', '', $base->getBasename()); - } - - // remove the prefix added by self::addChunk - $assembled = new File($base->getRealPath()); - $assembled = $assembled->move($base->getPath(), $name); - - return $assembled; + return $this->storage->assembleChunks($chunks, $removeChunk, $renameChunk); } public function cleanup($path) { - // cleanup - $filesystem = new Filesystem(); - $filesystem->remove($path); - - return true; + return $this->storage->cleanup($path); } public function getChunks($uuid) { - $finder = new Finder(); - $finder - ->in(sprintf('%s/%s', $this->configuration['directory'], $uuid))->files()->sort(function(\SplFileInfo $a, \SplFileInfo $b) { - $t = explode('_', $a->getBasename()); - $s = explode('_', $b->getBasename()); - $t = (int) $t[0]; - $s = (int) $s[0]; - - return $s < $t; - }); - - return $finder; + return $this->storage->getChunks($uuid); } public function getLoadDistribution() diff --git a/Uploader/Chunk/ChunkManagerInterface.php b/Uploader/Chunk/ChunkManagerInterface.php index 0991a3e..99ad60c 100644 --- a/Uploader/Chunk/ChunkManagerInterface.php +++ b/Uploader/Chunk/ChunkManagerInterface.php @@ -21,13 +21,13 @@ interface ChunkManagerInterface /** * Assembles the given chunks and return the resulting file. * - * @param \IteratorAggregate $chunks + * @param $chunks * @param bool $removeChunk Remove the chunk file once its assembled. * @param bool $renameChunk Rename the chunk file once its assembled. * * @return File */ - public function assembleChunks(\IteratorAggregate $chunks, $removeChunk = true, $renameChunk = false); + public function assembleChunks($chunks, $removeChunk = true, $renameChunk = false); /** * Get chunks associated with the given uuid. diff --git a/Uploader/File/FileInterface.php b/Uploader/File/FileInterface.php new file mode 100644 index 0000000..47e4266 --- /dev/null +++ b/Uploader/File/FileInterface.php @@ -0,0 +1,50 @@ +<?php + +namespace Oneup\UploaderBundle\Uploader\File; + +/** + * Every function in this interface should be considered unsafe. + * They are only meant to abstract away some basic file functionality. + * For safe methods rely on the parent functions. + * + * Interface FileInterface + * + * @package Oneup\UploaderBundle\Uploader\File + */ +interface FileInterface +{ + /** + * Returns the size of the file + * + * @return int + */ + public function getSize(); + + /** + * Returns the directory of the file without the filename + * + * @return string + */ + public function getPath(); + + /** + * Returns the guessed mime type of the file + * + * @return string + */ + public function getMimeType(); + + /** + * Returns the filename of the file + * + * @return string + */ + public function getName(); + + /** + * Returns the guessed extension of the file + * + * @return mixed + */ + public function getExtension(); +} \ No newline at end of file diff --git a/Uploader/File/FilesystemFile.php b/Uploader/File/FilesystemFile.php new file mode 100644 index 0000000..eed8d67 --- /dev/null +++ b/Uploader/File/FilesystemFile.php @@ -0,0 +1,15 @@ +<?php + +namespace Oneup\UploaderBundle\Uploader\File; + +use Symfony\Component\HttpFoundation\File\UploadedFile; + +class FilesystemFile extends UploadedFile implements FileInterface +{ + protected $file; + public function __construct(UploadedFile $file) + { + $this->file = $file; + parent::__construct($file->getPath(), $file->getClientOriginalName(), $file->getClientMimeType(), $file->getClientSize(), $file->getError(), true); + } +} \ No newline at end of file diff --git a/Uploader/File/GaufretteFile.php b/Uploader/File/GaufretteFile.php new file mode 100644 index 0000000..7771c4a --- /dev/null +++ b/Uploader/File/GaufretteFile.php @@ -0,0 +1,62 @@ +<?php + +namespace Oneup\UploaderBundle\Uploader\File; + +use Gaufrette\File; +use Gaufrette\Filesystem; + +class GaufretteFile extends File implements FileInterface +{ + protected $filesystem; + + public function __construct(File $file, Filesystem $filesystem) { + parent::__construct($file->getKey(), $filesystem); + $this->filesystem = $filesystem; + } + + /** + * Returns the size of the file + * + * !! WARNING !! + * Calling this loads the entire file into memory, + * in case of bigger files this could throw exceptions, + * and will have heavy performance footprint. + * !! ------- !! + * + * TODO mock/calculate the size if possible and use that instead? + */ + public function getSize() + { + return parent::getSize(); + } + + public function getPath() + { + return pathinfo($this->getKey(), PATHINFO_DIRNAME); + } + + public function getName() + { + return pathinfo($this->getKey(), PATHINFO_BASENAME); + } + + /** + * @return string + */ + public function getMimeType() + { + $finfo = finfo_open(FILEINFO_MIME_TYPE); + return finfo_file($finfo, $this->getKey()); + } + + public function getExtension() + { + return pathinfo($this->getKey(), PATHINFO_EXTENSION); + } + + public function getFilesystem() + { + return $this->filesystem; + } + +} \ No newline at end of file diff --git a/Uploader/Naming/NamerInterface.php b/Uploader/Naming/NamerInterface.php index d44b817..173e0b8 100644 --- a/Uploader/Naming/NamerInterface.php +++ b/Uploader/Naming/NamerInterface.php @@ -2,15 +2,16 @@ namespace Oneup\UploaderBundle\Uploader\Naming; -use Symfony\Component\HttpFoundation\File\UploadedFile; + +use Oneup\UploaderBundle\Uploader\File\FileInterface; interface NamerInterface { /** * Name a given file and return the name * - * @param UploadedFile $file + * @param FileInterface $file * @return string */ - public function name(UploadedFile $file); + public function name(FileInterface $file); } diff --git a/Uploader/Naming/UniqidNamer.php b/Uploader/Naming/UniqidNamer.php index 4c16b98..80bc741 100644 --- a/Uploader/Naming/UniqidNamer.php +++ b/Uploader/Naming/UniqidNamer.php @@ -2,13 +2,13 @@ namespace Oneup\UploaderBundle\Uploader\Naming; -use Symfony\Component\HttpFoundation\File\UploadedFile; -use Oneup\UploaderBundle\Uploader\Naming\NamerInterface; + +use Oneup\UploaderBundle\Uploader\File\FileInterface; class UniqidNamer implements NamerInterface { - public function name(UploadedFile $file) + public function name(FileInterface $file) { - return sprintf('%s.%s', uniqid(), $file->guessExtension()); + return sprintf('%s.%s', uniqid(), $file->getExtension()); } } diff --git a/Uploader/Storage/ChunkStorageInterface.php b/Uploader/Storage/ChunkStorageInterface.php new file mode 100644 index 0000000..b9fa1f6 --- /dev/null +++ b/Uploader/Storage/ChunkStorageInterface.php @@ -0,0 +1,19 @@ +<?php + +namespace Oneup\UploaderBundle\Uploader\Storage; + + +use Symfony\Component\HttpFoundation\File\UploadedFile; + +interface ChunkStorageInterface +{ + public function clear($maxAge); + + public function addChunk($uuid, $index, UploadedFile $chunk, $original); + + public function assembleChunks($chunks, $removeChunk, $renameChunk); + + public function cleanup($path); + + public function getChunks($uuid); +} \ No newline at end of file diff --git a/Uploader/Storage/FilesystemStorage.php b/Uploader/Storage/FilesystemStorage.php index d6915e0..d443f3c 100644 --- a/Uploader/Storage/FilesystemStorage.php +++ b/Uploader/Storage/FilesystemStorage.php @@ -2,11 +2,15 @@ namespace Oneup\UploaderBundle\Uploader\Storage; +use Oneup\UploaderBundle\Uploader\File\FileInterface; +use Oneup\UploaderBundle\Uploader\File\FilesystemFile; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Finder\Finder; use Symfony\Component\HttpFoundation\File\File; -use Oneup\UploaderBundle\Uploader\Storage\StorageInterface; +use Symfony\Component\HttpFoundation\File\UploadedFile; -class FilesystemStorage implements StorageInterface +class FilesystemStorage implements StorageInterface,ChunkStorageInterface { protected $directory; @@ -15,8 +19,12 @@ class FilesystemStorage implements StorageInterface $this->directory = $directory; } - public function upload(File $file, $name, $path = null) + public function upload(FileInterface $file, $name, $path = null) { + if (!($file instanceof File)) { + throw new \InvalidArgumentException('file must be an instance of Symfony\Component\HttpFoundation\File\File'); + } + $path = is_null($path) ? $name : sprintf('%s/%s', $path, $name); $path = sprintf('%s/%s', $this->directory, $path); @@ -29,4 +37,107 @@ class FilesystemStorage implements StorageInterface return $file; } + + public function clear($maxAge) + { + $system = new Filesystem(); + $finder = new Finder(); + + try { + $finder->in($this->directory)->date('<=' . -1 * (int) $maxAge . 'seconds')->files(); + } catch (\InvalidArgumentException $e) { + // the finder will throw an exception of type InvalidArgumentException + // if the directory he should search in does not exist + // in that case we don't have anything to clean + return; + } + + foreach ($finder as $file) { + $system->remove($file); + } + } + + public function addChunk($uuid, $index, UploadedFile $chunk, $original) + { + $filesystem = new Filesystem(); + $path = sprintf('%s/%s', $this->directory, $uuid); + $name = sprintf('%s_%s', $index, $original); + + // create directory if it does not yet exist + if(!$filesystem->exists($path)) + $filesystem->mkdir(sprintf('%s/%s', $this->directory, $uuid)); + + return $chunk->move($path, $name); + } + + public function assembleChunks($chunks, $removeChunk, $renameChunk) + { + if (!($chunks instanceof \IteratorAggregate)) { + throw new \InvalidArgumentException('The first argument must implement \IteratorAggregate interface.'); + } + + $iterator = $chunks->getIterator()->getInnerIterator(); + + $base = $iterator->current(); + $iterator->next(); + + while ($iterator->valid()) { + + $file = $iterator->current(); + + if (false === file_put_contents($base->getPathname(), file_get_contents($file->getPathname()), \FILE_APPEND | \LOCK_EX)) { + throw new \RuntimeException('Reassembling chunks failed.'); + } + + if ($removeChunk) { + $filesystem = new Filesystem(); + $filesystem->remove($file->getPathname()); + } + + $iterator->next(); + } + + $name = $base->getBasename(); + + if ($renameChunk) { + // remove the prefix added by self::addChunk + $name = preg_replace('/^(\d+)_/', '', $base->getBasename()); + } + + $assembled = new File($base->getRealPath()); + $assembled = $assembled->move($base->getPath(), $name); + + // the file is only renamed before it is uploaded + if ($renameChunk) { + // create an file to meet interface restrictions + $assembled = new FilesystemFile(new UploadedFile($assembled->getPathname(), $assembled->getBasename(), null, $assembled->getSize(), null, true)); + } + + return $assembled; + } + + public function cleanup($path) + { + // cleanup + $filesystem = new Filesystem(); + $filesystem->remove($path); + + return true; + } + + public function getChunks($uuid) + { + $finder = new Finder(); + $finder + ->in(sprintf('%s/%s', $this->directory, $uuid))->files()->sort(function(\SplFileInfo $a, \SplFileInfo $b) { + $t = explode('_', $a->getBasename()); + $s = explode('_', $b->getBasename()); + $t = (int) $t[0]; + $s = (int) $s[0]; + + return $s < $t; + }); + + return $finder; + } } diff --git a/Uploader/Storage/GaufretteStorage.php b/Uploader/Storage/GaufretteStorage.php index f2229d0..6c82693 100644 --- a/Uploader/Storage/GaufretteStorage.php +++ b/Uploader/Storage/GaufretteStorage.php @@ -2,18 +2,21 @@ namespace Oneup\UploaderBundle\Uploader\Storage; -use Symfony\Component\HttpFoundation\File\File; +use Oneup\UploaderBundle\Uploader\File\FileInterface; +use Oneup\UploaderBundle\Uploader\File\GaufretteFile; use Gaufrette\Stream\Local as LocalStream; use Gaufrette\StreamMode; use Gaufrette\Filesystem; use Gaufrette\Adapter\MetadataSupporter; -use Oneup\UploaderBundle\Uploader\Storage\StorageInterface; +use Symfony\Component\HttpFoundation\File\UploadedFile; -class GaufretteStorage implements StorageInterface +class GaufretteStorage implements StorageInterface, ChunkStorageInterface { protected $filesystem; protected $bufferSize; + protected $unhandledChunk; + protected $chunkPrefix = 'chunks'; public function __construct(Filesystem $filesystem, $bufferSize) { @@ -21,25 +24,142 @@ class GaufretteStorage implements StorageInterface $this->bufferSize = $bufferSize; } - public function upload(File $file, $name, $path = null) + public function upload(FileInterface $file, $name, $path = null) { $path = is_null($path) ? $name : sprintf('%s/%s', $path, $name); + if ($file instanceof GaufretteFile) { + if ($file->getFilesystem() == $this->filesystem) { + $file->getFilesystem()->rename($file->getKey(), $path); + + return $this->filesystem->get($path); + } + } + + $this->stream($file, $path, $name); + + return $this->filesystem->get($path); + } + + public function clear($maxAge) + { + $matches = $this->filesystem->listKeys($this->chunkPrefix); + + $limit = time()+$maxAge; + $toDelete = array(); + + // Collect the directories that are old, + // this also means the files inside are old + // but after the files are deleted the dirs + // would remain + foreach ($matches['dirs'] as $key) { + if ($limit < $this->filesystem->mtime($key)) { + $toDelete[] = $key; + } + } + // The same directory is returned for every file it contains + array_unique($toDelete); + foreach ($matches['keys'] as $key) { + if ($limit < $this->filesystem->mtime($key)) { + $this->filesystem->delete($key); + } + } + + foreach($toDelete as $key) { + // The filesystem will throw exceptions if + // a directory is not empty + try { + $this->filesystem->delete($key); + } catch (\Exception $e) { + //do nothing + } + } + } + + /** + * Only saves the information about the chunk to avoid moving it + * forth-and-back to reassemble it. Load distribution is enforced + * for gaufrette based chunk storage therefore assembleChunks will + * be called in the same request. + * + * @param $uuid + * @param $index + * @param UploadedFile $chunk + * @param $original + */ + public function addChunk($uuid, $index, UploadedFile $chunk, $original) + { + $this->unhandledChunk = array( + 'uuid' => $uuid, + 'index' => $index, + 'chunk' => $chunk, + 'original' => $original + ); + return; + } + + public function assembleChunks($chunks, $removeChunk, $renameChunk) + { + // the index is only added to be in sync with the filesystem storage + $path = $this->chunkPrefix.'/'.$this->unhandledChunk['uuid'].'/'; + $filename = $this->unhandledChunk['index'].'_'.$this->unhandledChunk['original']; + + if (empty($chunks)) { + $target = $filename; + } else { + /* + * The array only contains items with matching prefix until the filename + * therefore the order will be decided depending on the filename + * It is only case-insensitive to be overly-careful. + */ + sort($chunks, SORT_STRING | SORT_FLAG_CASE); + $target = pathinfo($chunks[0], PATHINFO_BASENAME); + } + + $this->stream($this->unhandledChunk['chunk'], $path, $target); + + if ($renameChunk) { + $name = preg_replace('/^(\d+)_/', '', $target); + $this->filesystem->rename($path.$target, $path.$name); + $target = $name; + } + $uploaded = $this->filesystem->get($path.$target); + + if (!$renameChunk) { + return $uploaded; + } + + return new GaufretteFile($uploaded, $this->filesystem); + } + + public function cleanup($path) + { + $this->filesystem->delete($path); + } + + public function getChunks($uuid) + { + return $this->filesystem->listKeys($this->chunkPrefix.'/'.$uuid)['keys']; + } + + protected function stream($file, $path, $name) + { if ($this->filesystem->getAdapter() instanceof MetadataSupporter) { $this->filesystem->getAdapter()->setMetadata($name, array('contentType' => $file->getMimeType())); } - $src = new LocalStream($file->getPathname()); - $dst = $this->filesystem->createStream($path); - + $path = $path.$name; // this is a somehow ugly workaround introduced // because the stream-mode is not able to create // subdirectories. if(!$this->filesystem->has($path)) $this->filesystem->write($path, '', true); + $src = new LocalStream($file->getPathname()); + $dst = $this->filesystem->createStream($path); + $src->open(new StreamMode('rb+')); - $dst->open(new StreamMode('wb+')); + $dst->open(new StreamMode('ab+')); while (!$src->eof()) { $data = $src->read($this->bufferSize); @@ -48,7 +168,6 @@ class GaufretteStorage implements StorageInterface $dst->close(); $src->close(); - - return $this->filesystem->get($path); } + } diff --git a/Uploader/Storage/OrphanageStorage.php b/Uploader/Storage/OrphanageStorage.php index fcbbaf0..a50a3bd 100644 --- a/Uploader/Storage/OrphanageStorage.php +++ b/Uploader/Storage/OrphanageStorage.php @@ -2,6 +2,7 @@ namespace Oneup\UploaderBundle\Uploader\Storage; +use Oneup\UploaderBundle\Uploader\File\FileInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\Finder\Finder; @@ -27,7 +28,7 @@ class OrphanageStorage extends FilesystemStorage implements OrphanageStorageInte $this->type = $type; } - public function upload(File $file, $name, $path = null) + public function upload(FileInterface $file, $name, $path = null) { if(!$this->session->isStarted()) throw new \RuntimeException('You need a running session in order to run the Orphanage.'); diff --git a/Uploader/Storage/StorageInterface.php b/Uploader/Storage/StorageInterface.php index 79fb3ae..a9e2332 100644 --- a/Uploader/Storage/StorageInterface.php +++ b/Uploader/Storage/StorageInterface.php @@ -2,6 +2,7 @@ namespace Oneup\UploaderBundle\Uploader\Storage; +use Oneup\UploaderBundle\Uploader\File\FileInterface; use Symfony\Component\HttpFoundation\File\File; interface StorageInterface @@ -13,5 +14,5 @@ interface StorageInterface * @param string $name * @param string $path */ - public function upload(File $file, $name, $path = null); + public function upload(FileInterface $file, $name, $path = null); }
0
fbaf18eccedde59de7878b7591a6c6b11d17e8ef
1up-lab/OneupUploaderBundle
Fix typo
commit fbaf18eccedde59de7878b7591a6c6b11d17e8ef Author: JHGitty <[email protected]> Date: Sun Feb 7 19:02:03 2016 +0100 Fix typo diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index fd6d87a..c577309 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -1,7 +1,7 @@ Using Chunked Uploads ===================== -Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabed, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. +Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabled, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. ```js $(document).ready(function()
0
c9c64c94c6d96b4532b4a18c238205ebf6b058f4
1up-lab/OneupUploaderBundle
Merge branch 'release-1.0' of github.com:mitom/OneupUploaderBundle into mitom-release-1.0 Conflicts: Controller/AbstractChunkedController.php
commit c9c64c94c6d96b4532b4a18c238205ebf6b058f4 (from 341c88053299b932efefbd1ae068b2cae9a267da) Merge: 341c880 0095863 Author: Jim Schmid <[email protected]> Date: Mon Oct 14 21:43:57 2013 +0200 Merge branch 'release-1.0' of github.com:mitom/OneupUploaderBundle into mitom-release-1.0 Conflicts: Controller/AbstractChunkedController.php diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index db4d784..62f9df1 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -53,7 +53,7 @@ abstract class AbstractChunkedController extends AbstractController $chunk = $chunkManager->addChunk($uuid, $index, $file, $orig); - if ($chunk) { + if (null !== $chunk) { $this->dispatchChunkEvents($chunk, $response, $request, $last); } @@ -61,7 +61,7 @@ abstract class AbstractChunkedController extends AbstractController $chunks = $chunkManager->getChunks($uuid); $assembled = $chunkManager->assembleChunks($chunks, true, $last); - if (is_null($chunk)) { + if (null === $chunk) { $this->dispatchChunkEvents($assembled, $response, $request, $last); } } commit c9c64c94c6d96b4532b4a18c238205ebf6b058f4 (from 009586389c5345fc96de2e59f598016de23f11a0) Merge: 341c880 0095863 Author: Jim Schmid <[email protected]> Date: Mon Oct 14 21:43:57 2013 +0200 Merge branch 'release-1.0' of github.com:mitom/OneupUploaderBundle into mitom-release-1.0 Conflicts: Controller/AbstractChunkedController.php diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index 4116b4c..62f9df1 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -60,6 +60,7 @@ abstract class AbstractChunkedController extends AbstractController if ($chunkManager->getLoadDistribution()) { $chunks = $chunkManager->getChunks($uuid); $assembled = $chunkManager->assembleChunks($chunks, true, $last); + if (null === $chunk) { $this->dispatchChunkEvents($assembled, $response, $request, $last); } diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index c11e014..a9efae7 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -73,12 +73,6 @@ class Configuration implements ConfigurationInterface ->scalarNode('sync_buffer_size')->defaultValue('100K')->end() ->end() ->end() - ->arrayNode('allowed_extensions') - ->prototype('scalar')->end() - ->end() - ->arrayNode('disallowed_extensions') - ->prototype('scalar')->end() - ->end() ->arrayNode('allowed_mimetypes') ->prototype('scalar')->end() ->end() diff --git a/EventListener/AllowedExtensionValidationListener.php b/EventListener/AllowedExtensionValidationListener.php deleted file mode 100644 index add50ca..0000000 --- a/EventListener/AllowedExtensionValidationListener.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\EventListener; - -use Oneup\UploaderBundle\Event\ValidationEvent; -use Oneup\UploaderBundle\Uploader\Exception\ValidationException; - -class AllowedExtensionValidationListener -{ - public function onValidate(ValidationEvent $event) - { - $config = $event->getConfig(); - $file = $event->getFile(); - - $extension = $file->getExtension(); - - if (count($config['allowed_extensions']) > 0 && !in_array($extension, $config['allowed_extensions'])) { - throw new ValidationException('error.whitelist'); - } - } -} diff --git a/EventListener/DisallowedExtensionValidationListener.php b/EventListener/DisallowedExtensionValidationListener.php deleted file mode 100644 index 9f000de..0000000 --- a/EventListener/DisallowedExtensionValidationListener.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\EventListener; - -use Oneup\UploaderBundle\Event\ValidationEvent; -use Oneup\UploaderBundle\Uploader\Exception\ValidationException; - -class DisallowedExtensionValidationListener -{ - public function onValidate(ValidationEvent $event) - { - $config = $event->getConfig(); - $file = $event->getFile(); - - $extension = $file->getExtension(); - - if (count($config['disallowed_extensions']) > 0 && in_array($extension, $config['disallowed_extensions'])) { - throw new ValidationException('error.blacklist'); - } - } -} diff --git a/Resources/config/validators.xml b/Resources/config/validators.xml index 5b2ffe0..4c3fc73 100644 --- a/Resources/config/validators.xml +++ b/Resources/config/validators.xml @@ -8,14 +8,6 @@ <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> </service> - <service id="oneup_uploader.validation_listener.allowed_extension" class="Oneup\UploaderBundle\EventListener\AllowedExtensionValidationListener"> - <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> - </service> - - <service id="oneup_uploader.validation_listener.disallowed_extension" class="Oneup\UploaderBundle\EventListener\DisallowedExtensionValidationListener"> - <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> - </service> - <service id="oneup_uploader.validation_listener.allowed_mimetype" class="Oneup\UploaderBundle\EventListener\AllowedMimetypeValidationListener"> <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> </service> diff --git a/Resources/doc/configuration_reference.md b/Resources/doc/configuration_reference.md index 0a712c9..dcc5a20 100644 --- a/Resources/doc/configuration_reference.md +++ b/Resources/doc/configuration_reference.md @@ -34,8 +34,6 @@ oneup_uploader: directory: ~ stream_wrapper: ~ sync_buffer_size: 100K - allowed_extensions: [] - disallowed_extensions: [] allowed_mimetypes: [] disallowed_mimetypes: [] error_handler: oneup_uploader.error_handler.noop diff --git a/Tests/App/config/config.yml b/Tests/App/config/config.yml index 619cebc..a350ddb 100644 --- a/Tests/App/config/config.yml +++ b/Tests/App/config/config.yml @@ -23,8 +23,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -38,8 +37,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -53,8 +51,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -68,8 +65,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -83,8 +79,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -98,8 +93,7 @@ oneup_uploader: max_size: 256 storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] @@ -115,8 +109,7 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload error_handler: oneup_uploader.error_handler.blueimp - allowed_extensions: [ "ok" ] - disallowed_extensions: [ "fail" ] + allowed_mimetypes: [ "image/jpg", "text/plain" ] disallowed_mimetypes: [ "image/gif" ] diff --git a/Tests/Controller/AbstractValidationTest.php b/Tests/Controller/AbstractValidationTest.php index 1a3c4b7..77a5bac 100644 --- a/Tests/Controller/AbstractValidationTest.php +++ b/Tests/Controller/AbstractValidationTest.php @@ -7,8 +7,6 @@ use Oneup\UploaderBundle\UploadEvents; abstract class AbstractValidationTest extends AbstractControllerTest { - abstract protected function getFileWithCorrectExtension(); - abstract protected function getFileWithIncorrectExtension(); abstract protected function getFileWithCorrectMimeType(); abstract protected function getFileWithIncorrectMimeType(); abstract protected function getOversizedFile(); @@ -27,26 +25,6 @@ abstract class AbstractValidationTest extends AbstractControllerTest $this->assertCount(0, $this->getUploadedFiles()); } - public function testAgainstCorrectExtension() - { - // assemble a request - $client = $this->client; - $endpoint = $this->helper->endpoint($this->getConfigKey()); - - $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectExtension())); - $response = $client->getResponse(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals($response->headers->get('Content-Type'), 'application/json'); - $this->assertCount(1, $this->getUploadedFiles()); - - foreach ($this->getUploadedFiles() as $file) { - $this->assertTrue($file->isFile()); - $this->assertTrue($file->isReadable()); - $this->assertEquals(128, $file->getSize()); - } - } - public function testEvents() { $client = $this->client; @@ -60,7 +38,7 @@ abstract class AbstractValidationTest extends AbstractControllerTest ++ $validationCount; }); - $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectExtension())); + $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectMimeType())); $this->assertEquals(1, $validationCount); } @@ -82,25 +60,11 @@ abstract class AbstractValidationTest extends AbstractControllerTest ++ $validationCount; }); - $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectExtension())); + $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectMimeType())); $this->assertEquals(1, $validationCount); } - public function testAgainstIncorrectExtension() - { - // assemble a request - $client = $this->client; - $endpoint = $this->helper->endpoint($this->getConfigKey()); - - $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithIncorrectExtension())); - $response = $client->getResponse(); - - //$this->assertTrue($response->isNotSuccessful()); - $this->assertEquals($response->headers->get('Content-Type'), 'application/json'); - $this->assertCount(0, $this->getUploadedFiles()); - } - public function testAgainstCorrectMimeType() { // assemble a request diff --git a/Tests/Controller/BlueimpValidationTest.php b/Tests/Controller/BlueimpValidationTest.php index 95667fd..2aec2f7 100644 --- a/Tests/Controller/BlueimpValidationTest.php +++ b/Tests/Controller/BlueimpValidationTest.php @@ -22,26 +22,6 @@ class BlueimpValidationTest extends AbstractValidationTest $this->assertCount(0, $this->getUploadedFiles()); } - public function testAgainstCorrectExtension() - { - // assemble a request - $client = $this->client; - $endpoint = $this->helper->endpoint($this->getConfigKey()); - - $client->request('POST', $endpoint, $this->getRequestParameters(), $this->getFileWithCorrectExtension(), array('HTTP_ACCEPT' => 'application/json')); - $response = $client->getResponse(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals($response->headers->get('Content-Type'), 'application/json'); - $this->assertCount(1, $this->getUploadedFiles()); - - foreach ($this->getUploadedFiles() as $file) { - $this->assertTrue($file->isFile()); - $this->assertTrue($file->isReadable()); - $this->assertEquals(128, $file->getSize()); - } - } - public function testEvents() { $client = $this->client; @@ -55,25 +35,11 @@ class BlueimpValidationTest extends AbstractValidationTest ++ $validationCount; }); - $client->request('POST', $endpoint, $this->getRequestParameters(), $this->getFileWithCorrectExtension()); + $client->request('POST', $endpoint, $this->getRequestParameters(), $this->getFileWithCorrectMimeType()); $this->assertEquals(1, $validationCount); } - public function testAgainstIncorrectExtension() - { - // assemble a request - $client = $this->client; - $endpoint = $this->helper->endpoint($this->getConfigKey()); - - $client->request('POST', $endpoint, $this->getRequestParameters(), $this->getFileWithIncorrectExtension(), array('HTTP_ACCEPT' => 'application/json')); - $response = $client->getResponse(); - - //$this->assertTrue($response->isNotSuccessful()); - $this->assertEquals($response->headers->get('Content-Type'), 'application/json'); - $this->assertCount(0, $this->getUploadedFiles()); - } - public function testAgainstCorrectMimeType() { // assemble a request @@ -130,26 +96,6 @@ class BlueimpValidationTest extends AbstractValidationTest ))); } - protected function getFileWithCorrectExtension() - { - return array('files' => array(new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ))); - } - - protected function getFileWithIncorrectExtension() - { - return array('files' => array(new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ))); - } - protected function getFileWithCorrectMimeType() { return array('files' => array(new UploadedFile( diff --git a/Tests/Controller/DropzoneValidationTest.php b/Tests/Controller/DropzoneValidationTest.php index 73cb5ff..abe7f06 100644 --- a/Tests/Controller/DropzoneValidationTest.php +++ b/Tests/Controller/DropzoneValidationTest.php @@ -27,26 +27,6 @@ class DropzoneValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile( diff --git a/Tests/Controller/FancyUploadValidationTest.php b/Tests/Controller/FancyUploadValidationTest.php index 7e48964..1f78228 100644 --- a/Tests/Controller/FancyUploadValidationTest.php +++ b/Tests/Controller/FancyUploadValidationTest.php @@ -27,26 +27,6 @@ class FancyUploadValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile( diff --git a/Tests/Controller/FineUploaderValidationTest.php b/Tests/Controller/FineUploaderValidationTest.php index d1961e4..a3b1a7e 100644 --- a/Tests/Controller/FineUploaderValidationTest.php +++ b/Tests/Controller/FineUploaderValidationTest.php @@ -27,26 +27,6 @@ class FineUploaderValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile( diff --git a/Tests/Controller/PluploadValidationTest.php b/Tests/Controller/PluploadValidationTest.php index 61ffc55..c9e9be9 100644 --- a/Tests/Controller/PluploadValidationTest.php +++ b/Tests/Controller/PluploadValidationTest.php @@ -27,26 +27,6 @@ class PluploadValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile( diff --git a/Tests/Controller/UploadifyValidationTest.php b/Tests/Controller/UploadifyValidationTest.php index 0f10650..086267f 100644 --- a/Tests/Controller/UploadifyValidationTest.php +++ b/Tests/Controller/UploadifyValidationTest.php @@ -27,26 +27,6 @@ class UploadifyValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile( diff --git a/Tests/Controller/YUI3ValidationTest.php b/Tests/Controller/YUI3ValidationTest.php index ca4919c..2325c61 100644 --- a/Tests/Controller/YUI3ValidationTest.php +++ b/Tests/Controller/YUI3ValidationTest.php @@ -27,26 +27,6 @@ class YUI3ValidationTest extends AbstractValidationTest ); } - protected function getFileWithCorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.ok', - 'text/plain', - 128 - ); - } - - protected function getFileWithIncorrectExtension() - { - return new UploadedFile( - $this->createTempFile(128), - 'cat.fail', - 'text/plain', - 128 - ); - } - protected function getFileWithCorrectMimeType() { return new UploadedFile(
0
8c19eef2c76baeff52bc5812bad0ab3e53ab4d79
1up-lab/OneupUploaderBundle
Require symfony/mime directly (#380)
commit 8c19eef2c76baeff52bc5812bad0ab3e53ab4d79 Author: David Greminger <[email protected]> Date: Mon Jun 29 17:41:57 2020 +0200 Require symfony/mime directly (#380) diff --git a/composer.json b/composer.json index 278b963..ef7faad 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "symfony/event-dispatcher-contracts": "^1.0|^2.0", "symfony/finder": "^4.4|^5.0", "symfony/framework-bundle": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0", "symfony/templating": "^4.4|^5.0", "symfony/translation": "^4.4|^5.0", "symfony/translation-contracts": "^1.0|^2.0",
0
6213f01230fa69768c0222e65a23e476a7eeaaab
1up-lab/OneupUploaderBundle
Add a file extension validation whitelist mapped to an allowed mimetype
commit 6213f01230fa69768c0222e65a23e476a7eeaaab Author: Kévin Liagre <[email protected]> Date: Wed Jul 27 02:06:56 2016 +0200 Add a file extension validation whitelist mapped to an allowed mimetype diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 75d64b4..a6f3b2b 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -76,7 +76,15 @@ class Configuration implements ConfigurationInterface ->end() ->scalarNode('route_prefix')->defaultValue('')->end() ->arrayNode('allowed_mimetypes') - ->prototype('scalar')->end() + ->useAttributeAsKey('type') + ->prototype('array') + ->prototype('scalar') + ->beforeNormalization() + ->ifString() + ->then(function ($v) { return strtolower($v); }) + ->end() + ->end() + ->end() ->end() ->arrayNode('disallowed_mimetypes') ->prototype('scalar')->end() diff --git a/EventListener/AllowedMimetypeAndExtensionValidationListener.php b/EventListener/AllowedMimetypeAndExtensionValidationListener.php new file mode 100644 index 0000000..707563e --- /dev/null +++ b/EventListener/AllowedMimetypeAndExtensionValidationListener.php @@ -0,0 +1,34 @@ +<?php + +namespace Oneup\UploaderBundle\EventListener; + +use Oneup\UploaderBundle\Event\ValidationEvent; +use Oneup\UploaderBundle\Uploader\Exception\ValidationException; + +class AllowedMimetypeAndExtensionValidationListener +{ + public function onValidate(ValidationEvent $event) + { + $config = $event->getConfig(); + $file = $event->getFile(); + + if (empty($config['allowed_mimetypes'])) { + return; + } + + $mimetype = $file->getMimeType(); + $extension = strtolower($file->getExtension()); + + if (!isset($config['allowed_mimetypes'][$mimetype])) { + throw new ValidationException('error.whitelist'); + } + + if (empty($config['allowed_mimetypes'][$mimetype]) + || in_array($extension, $config['allowed_mimetypes'][$mimetype]) + ) { + return; + } + + throw new ValidationException('error.whitelist'); + } +} diff --git a/EventListener/AllowedMimetypeValidationListener.php b/EventListener/AllowedMimetypeValidationListener.php deleted file mode 100644 index 66aa7b9..0000000 --- a/EventListener/AllowedMimetypeValidationListener.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\EventListener; - -use Oneup\UploaderBundle\Event\ValidationEvent; -use Oneup\UploaderBundle\Uploader\Exception\ValidationException; - -class AllowedMimetypeValidationListener -{ - public function onValidate(ValidationEvent $event) - { - $config = $event->getConfig(); - $file = $event->getFile(); - - if (count($config['allowed_mimetypes']) == 0) { - return; - } - - $mimetype = $file->getMimeType(); - - if (!in_array($mimetype, $config['allowed_mimetypes'])) { - throw new ValidationException('error.whitelist'); - } - } -} diff --git a/Resources/config/validators.xml b/Resources/config/validators.xml index 4c3fc73..fefc20e 100644 --- a/Resources/config/validators.xml +++ b/Resources/config/validators.xml @@ -8,7 +8,7 @@ <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> </service> - <service id="oneup_uploader.validation_listener.allowed_mimetype" class="Oneup\UploaderBundle\EventListener\AllowedMimetypeValidationListener"> + <service id="oneup_uploader.validation_listener.allowed_mimetype" class="Oneup\UploaderBundle\EventListener\AllowedMimetypeAndExtensionValidationListener"> <tag name="kernel.event_listener" event="oneup_uploader.validation" method="onValidate" /> </service> diff --git a/Tests/App/config/config.yml b/Tests/App/config/config.yml index a350ddb..382b566 100644 --- a/Tests/App/config/config.yml +++ b/Tests/App/config/config.yml @@ -24,7 +24,10 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] + disallowed_mimetypes: [ "image/gif" ] fancyupload: @@ -38,7 +41,9 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] dropzone: @@ -52,7 +57,9 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] yui3: @@ -66,7 +73,9 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] plupload: @@ -80,7 +89,9 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] uploadify: @@ -94,7 +105,9 @@ oneup_uploader: storage: directory: %kernel.root_dir%/cache/%kernel.environment%/upload - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] blueimp: @@ -110,7 +123,9 @@ oneup_uploader: directory: %kernel.root_dir%/cache/%kernel.environment%/upload error_handler: oneup_uploader.error_handler.blueimp - allowed_mimetypes: [ "image/jpg", "text/plain" ] + allowed_mimetypes: + image/jpeg : ['jpg', 'jpeg', 'jpe'] + text/plain : ['txt'] disallowed_mimetypes: [ "image/gif" ] mooupload: diff --git a/Tests/Controller/AbstractValidationTest.php b/Tests/Controller/AbstractValidationTest.php index 3688213..fee2f35 100644 --- a/Tests/Controller/AbstractValidationTest.php +++ b/Tests/Controller/AbstractValidationTest.php @@ -8,6 +8,7 @@ use Oneup\UploaderBundle\UploadEvents; abstract class AbstractValidationTest extends AbstractControllerTest { abstract protected function getFileWithCorrectMimeType(); + abstract protected function getFileWithCorrectMimeTypeAndIncorrectExtension(); abstract protected function getFileWithIncorrectMimeType(); abstract protected function getOversizedFile(); @@ -85,6 +86,19 @@ abstract class AbstractValidationTest extends AbstractControllerTest } } + public function testAgainstCorrectMimeTypeAndIncorrectExtension() + { + // assemble a request + $client = $this->client; + $endpoint = $this->helper->endpoint($this->getConfigKey()); + + $client->request('POST', $endpoint, $this->getRequestParameters(), array($this->getFileWithCorrectMimeTypeAndIncorrectExtension()), $this->requestHeaders); + $response = $client->getResponse(); + + $this->assertEquals($response->headers->get('Content-Type'), 'application/json'); + $this->assertCount(0, $this->getUploadedFiles()); + } + public function testAgainstIncorrectMimeType() { $this->markTestSkipped('Mock mime type getter.'); diff --git a/Tests/Controller/BlueimpValidationTest.php b/Tests/Controller/BlueimpValidationTest.php index 871e687..ca8c8bd 100644 --- a/Tests/Controller/BlueimpValidationTest.php +++ b/Tests/Controller/BlueimpValidationTest.php @@ -103,12 +103,22 @@ class BlueimpValidationTest extends AbstractValidationTest { return array('files' => array(new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', 128 ))); } + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', + 128 + ); + } + protected function getFileWithIncorrectMimeType() { return array(new UploadedFile( diff --git a/Tests/Controller/DropzoneValidationTest.php b/Tests/Controller/DropzoneValidationTest.php index abe7f06..4b5a87d 100644 --- a/Tests/Controller/DropzoneValidationTest.php +++ b/Tests/Controller/DropzoneValidationTest.php @@ -31,8 +31,18 @@ class DropzoneValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); } diff --git a/Tests/Controller/FancyUploadValidationTest.php b/Tests/Controller/FancyUploadValidationTest.php index 1f78228..568f0ce 100644 --- a/Tests/Controller/FancyUploadValidationTest.php +++ b/Tests/Controller/FancyUploadValidationTest.php @@ -31,8 +31,18 @@ class FancyUploadValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); } diff --git a/Tests/Controller/FineUploaderValidationTest.php b/Tests/Controller/FineUploaderValidationTest.php index a3b1a7e..fe4d6d9 100644 --- a/Tests/Controller/FineUploaderValidationTest.php +++ b/Tests/Controller/FineUploaderValidationTest.php @@ -31,8 +31,18 @@ class FineUploaderValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); } diff --git a/Tests/Controller/PluploadValidationTest.php b/Tests/Controller/PluploadValidationTest.php index c9e9be9..f487f5c 100644 --- a/Tests/Controller/PluploadValidationTest.php +++ b/Tests/Controller/PluploadValidationTest.php @@ -31,8 +31,18 @@ class PluploadValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); } diff --git a/Tests/Controller/UploadifyValidationTest.php b/Tests/Controller/UploadifyValidationTest.php index 086267f..de6747c 100644 --- a/Tests/Controller/UploadifyValidationTest.php +++ b/Tests/Controller/UploadifyValidationTest.php @@ -31,8 +31,18 @@ class UploadifyValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); } diff --git a/Tests/Controller/YUI3ValidationTest.php b/Tests/Controller/YUI3ValidationTest.php index 2325c61..6977959 100644 --- a/Tests/Controller/YUI3ValidationTest.php +++ b/Tests/Controller/YUI3ValidationTest.php @@ -31,8 +31,18 @@ class YUI3ValidationTest extends AbstractValidationTest { return new UploadedFile( $this->createTempFile(128), - 'cat.ok', - 'image/jpg', + 'cat.txt', + 'text/plain', + 128 + ); + } + + protected function getFileWithCorrectMimeTypeAndIncorrectExtension() + { + return new UploadedFile( + $this->createTempFile(128), + 'cat.txxt', + 'text/plain', 128 ); }
0
4bb9d1812694dc5fbbe78271c85f4a83f3fd4190
1up-lab/OneupUploaderBundle
Added a switch to globally enable and disable the orphanage.
commit 4bb9d1812694dc5fbbe78271c85f4a83f3fd4190 Author: Jim Schmid <[email protected]> Date: Fri Mar 15 16:37:39 2013 +0100 Added a switch to globally enable and disable the orphanage. diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 9d98300..4e14207 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -25,7 +25,8 @@ class Configuration implements ConfigurationInterface ->arrayNode('orphanage') ->addDefaultsIfNotSet() ->children() - ->scalarNode('directory')->end() + ->booleanNode('enabled')->defaultFalse()->end() + ->scalarNode('storage')->defaultNull()->end() ->scalarNode('maxage')->defaultValue(604800)->end() ->end() ->end()
0
57df3e8ff7d1e0d1f72b997b21e1214cbc5e1868
1up-lab/OneupUploaderBundle
Extended custom_logic.md documentation.
commit 57df3e8ff7d1e0d1f72b997b21e1214cbc5e1868 Author: Jim Schmid <[email protected]> Date: Tue Apr 9 14:26:06 2013 +0200 Extended custom_logic.md documentation. diff --git a/Resources/doc/custom_logic.md b/Resources/doc/custom_logic.md index 4d66237..aff8967 100644 --- a/Resources/doc/custom_logic.md +++ b/Resources/doc/custom_logic.md @@ -38,4 +38,44 @@ And register it in your `services.xml`. </services> ``` -You can now implement you custom logic in the `onUpload` method of your EventListener. \ No newline at end of file +You can now implement you custom logic in the `onUpload` method of your EventListener. + +## Use custom input data +FineUploader supports passing custom data through the request as the following examples states. For example you can pass the id of an entity you wish to paste the images to. + +```html +<script type="text/javascript"> +var uploader = new qq.FineUploader({ + element: document.getElementById('fine-uploader'), + text: { + uploadButton: "{{ 'edit.selectfile' | trans({}, 'myphotos') }}" + }, + request: { + endpoint: "{{ path('_uploader_gallery') }}", + params: { + gallery: "{{ gallery.id }}" + } + } +}); +</script> +``` + +As you can see, we extended the `request` part of the Fine Uploader by adding a `params` section. These variables are accessible through the request object in the EventHander. + +```php +public function onUpload(PostPersistEvent $event) +{ + $request = $event->getRequest(); + $gallery = $request->get('gallery'); + + // ... +} +``` + +## Other available variables +The Event object provides the following methods. + +* `getFile`: Get the uploaded file. Is either an instance of `Gaufrette\File` or `Symfony\Component\HttpFoundation\File\File`. +* `getRequest`: Get the current request including custom variables. +* `getType`: Get the name of the mapping of the current upload. Useful if you have multiple mappings and EventListeners. +* `getConfig`: Get the config of the mapping. \ No newline at end of file
0
98f2a903a34bb4f1cfd4b7fd1f73bbde6f9ae5f4
1up-lab/OneupUploaderBundle
fix for php5.3
commit 98f2a903a34bb4f1cfd4b7fd1f73bbde6f9ae5f4 Author: mitom <[email protected]> Date: Fri Oct 11 15:08:59 2013 +0200 fix for php5.3 diff --git a/Tests/Uploader/Storage/OrphanageTest.php b/Tests/Uploader/Storage/OrphanageTest.php index bc536ac..836ab86 100644 --- a/Tests/Uploader/Storage/OrphanageTest.php +++ b/Tests/Uploader/Storage/OrphanageTest.php @@ -4,7 +4,6 @@ namespace Oneup\UploaderBundle\Tests\Uploader\Storage; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpFoundation\Session\Session; abstract class OrphanageTest extends \PHPUnit_Framework_Testcase { diff --git a/Uploader/Chunk/Storage/GaufretteStorage.php b/Uploader/Chunk/Storage/GaufretteStorage.php index cfd55e3..6c4cd04 100644 --- a/Uploader/Chunk/Storage/GaufretteStorage.php +++ b/Uploader/Chunk/Storage/GaufretteStorage.php @@ -147,7 +147,9 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface public function getChunks($uuid) { - return $this->filesystem->listKeys($this->prefix.'/'.$uuid)['keys']; + $results = $this->filesystem->listKeys($this->prefix.'/'.$uuid); + + return $results['keys']; } public function getFilesystem()
0
fc971abe3a82160bd26165c0ce93734f69836e99
1up-lab/OneupUploaderBundle
Documented how to use your custom namer.
commit fc971abe3a82160bd26165c0ce93734f69836e99 Author: Jim Schmid <[email protected]> Date: Sun Apr 7 20:04:28 2013 +0200 Documented how to use your custom namer. diff --git a/Resources/doc/index.md b/Resources/doc/index.md index 574d337..021561b 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -105,6 +105,6 @@ some more advanced features. * [Enable chunked uploads](chunked_uploads.md) * Using the Orphanage * Use Gaufrette as storage layer -* Include your own Namer +* [Include your own Namer](custom_namer.md) * Testing this bundle * [Configuration Reference](configuration_reference.md) \ No newline at end of file diff --git a/Resources/doc/namer.md b/Resources/doc/namer.md new file mode 100644 index 0000000..65fe084 --- /dev/null +++ b/Resources/doc/namer.md @@ -0,0 +1,46 @@ +Custom Namer +============ + +The purpose of a namer service is to name an uploaded file before it is stored to the storage layer. Currently the OneupUploaderBundle only provides a single namer service called `UniqidNamer`, which will return a system wide unique filename using the `uniqid()` function. + +## Use a custom namer + +First, create a custom namer which implements ```Oneup\UploaderBundle\Uploader\Naming\NamerInterface```. + +```php +<?php + +namespace Acme\DemoBundle; + +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Oneup\UploaderBundle\Uploader\Naming\NamerInterface; + +class CatNamer implements NamerInterface +{ + public function name(UploadedFile $file) + { + return 'grumpycat.jpg'; + } +} +``` + +To match the `NamerInterface` you have to implement the function `name()` which expects an `UploadedFile` and should return a string representing the name of the given file. The example above would name every file _grumpycat.jpg_ and is therefore not very useful. + +Next, register your created namer as a service in your `services.xml` + +```xml +<services> + <service id="acme_demo.custom_namer" class="Acme\DemoBundle\CatNamer" /> +</services> +``` + +Now you can use your custom service by adding it to your configuration: + +```yml +oneup_uploader: + mappings: + gallery: + namer: acme_demo.custom_namer +``` + +Every file uploaded through the `Controller` of this mapping will be named with your custom namer. \ No newline at end of file
0
f005301a898b3468e055be5196373677d1ed5473
1up-lab/OneupUploaderBundle
Don't skip tests
commit f005301a898b3468e055be5196373677d1ed5473 Author: Jérôme Parmentier <[email protected]> Date: Fri Oct 6 17:55:16 2017 +0200 Don't skip tests diff --git a/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php b/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php index ddb5664..af5a194 100644 --- a/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php +++ b/Tests/Uploader/Storage/FlysystemOrphanageStorageTest.php @@ -35,10 +35,6 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $filesystem->mkdir($this->chunkDirectory); $filesystem->mkdir($this->tempDirectory); - if (!$this->checkIfTempnameMatchesAfterCreation()) { - $this->markTestSkipped('Temporary directories do not match'); - } - $adapter = new Adapter($this->realDirectory); $filesystem = new FSAdapter($adapter); @@ -121,13 +117,4 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $finder->in($this->realDirectory)->files(); $this->assertCount($this->numberOfPayloads, $finder); } - - public function checkIfTempnameMatchesAfterCreation() - { - $testName = tempnam($this->chunkDirectory, 'uploader'); - $result = strpos($testName, $this->chunkDirectory) === 0; - unlink($testName); - - return $result; - } }
0
4b188afdbe9f8521412873f9548e3ac6e815d255
1up-lab/OneupUploaderBundle
Fix for #238
commit 4b188afdbe9f8521412873f9548e3ac6e815d255 Author: Devi Prasad <[email protected]> Date: Wed May 4 13:59:28 2016 +0530 Fix for #238 diff --git a/Uploader/Orphanage/OrphanageManager.php b/Uploader/Orphanage/OrphanageManager.php index 9352b4e..9442712 100644 --- a/Uploader/Orphanage/OrphanageManager.php +++ b/Uploader/Orphanage/OrphanageManager.php @@ -32,7 +32,7 @@ class OrphanageManager // Really ugly solution to clearing the orphanage on gaufrette $class = $this->container->getParameter('oneup_uploader.orphanage.class'); if ($class === 'Oneup\UploaderBundle\Uploader\Storage\GaufretteOrphanageStorage') { - $chunkStorage = $this->container->get('oneup_uploader.chunks_storage '); + $chunkStorage = $this->container->get('oneup_uploader.chunks_storage'); $chunkStorage->clear($this->config['maxage'], $this->config['directory']); return;
0
4c3304cce13233b5877f397f7ef1eba83c15695b
1up-lab/OneupUploaderBundle
Fix PHP 7.1 Notice: A non well formed numeric value Sorry it took so long. This is proper fix for #272
commit 4c3304cce13233b5877f397f7ef1eba83c15695b Author: Martin Hlaváč <[email protected]> Date: Mon Jan 23 13:19:08 2017 +0100 Fix PHP 7.1 Notice: A non well formed numeric value Sorry it took so long. This is proper fix for #272 diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 0d472ff..c2c14eb 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -294,7 +294,7 @@ class OneupUploaderExtension extends Extension // see: http://www.php.net/manual/en/function.ini-get.php $input = trim($input); $last = strtolower($input[strlen($input) - 1]); - $numericInput = substr($input, 0, -1); + $numericInput = (float) substr($input, 0, -1); switch ($last) { case 'g': $numericInput *= 1024;
0
49bb6feea7542bb373f12de48020425f7a1bdd73
1up-lab/OneupUploaderBundle
Fix codestyle (#439)
commit 49bb6feea7542bb373f12de48020425f7a1bdd73 Author: David Greminger <[email protected]> Date: Mon Feb 5 13:07:57 2024 +0100 Fix codestyle (#439) diff --git a/src/Controller/AbstractChunkedController.php b/src/Controller/AbstractChunkedController.php index c169915..3f78149 100644 --- a/src/Controller/AbstractChunkedController.php +++ b/src/Controller/AbstractChunkedController.php @@ -39,7 +39,7 @@ abstract class AbstractChunkedController extends AbstractController * returned array to reassemble the uploaded chunks. * * @param UploadedFile $file - The uploaded chunk - * @param responseInterface $response - A response object + * @param ResponseInterface $response - A response object * @param Request $request - The request object */ protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request): void @@ -84,7 +84,7 @@ abstract class AbstractChunkedController extends AbstractController * This function is a helper function which dispatches post chunk upload event. * * @param mixed $uploaded - The uploaded chunk - * @param responseInterface $response - A response object + * @param ResponseInterface $response - A response object * @param Request $request - The request object * @param bool $isLast - True if this is the last chunk, false otherwise */ diff --git a/src/Controller/AbstractController.php b/src/Controller/AbstractController.php index 76ba042..7dbd5b6 100644 --- a/src/Controller/AbstractController.php +++ b/src/Controller/AbstractController.php @@ -164,7 +164,7 @@ abstract class AbstractController } } - protected function validate(FileInterface $file, Request $request, ResponseInterface $response = null): void + protected function validate(FileInterface $file, Request $request, ?ResponseInterface $response = null): void { $event = new ValidationEvent($file, $request, $this->config, $this->type, $response); @@ -204,7 +204,7 @@ abstract class AbstractController /** * Event dispatch proxy that avoids using deprecated interfaces. */ - protected function dispatchEvent(Event $event, string $eventName = null): void + protected function dispatchEvent(Event $event, ?string $eventName = null): void { /** @var EventDispatcherInterface $dispatcher */ $dispatcher = $this->container->get('event_dispatcher'); diff --git a/src/DependencyInjection/OneupUploaderExtension.php b/src/DependencyInjection/OneupUploaderExtension.php index af23747..d2e4942 100644 --- a/src/DependencyInjection/OneupUploaderExtension.php +++ b/src/DependencyInjection/OneupUploaderExtension.php @@ -256,7 +256,7 @@ class OneupUploaderExtension extends Extension return $storageService; } - protected function registerFilesystem(string $type, string $key, string $class, string $filesystem, string $buffer, string $streamWrapper = null, string $prefix = ''): void + protected function registerFilesystem(string $type, string $key, string $class, string $filesystem, string $buffer, ?string $streamWrapper = null, string $prefix = ''): void { switch ($type) { case 'gaufrette': diff --git a/src/Routing/RouteLoader.php b/src/Routing/RouteLoader.php index 39279c0..cd7658b 100644 --- a/src/Routing/RouteLoader.php +++ b/src/Routing/RouteLoader.php @@ -15,12 +15,12 @@ class RouteLoader extends Loader parent::__construct(); } - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { return 'uploader' === $type; } - public function load(mixed $resource, string $type = null): RouteCollection + public function load(mixed $resource, ?string $type = null): RouteCollection { $routes = new RouteCollection(); $separator = '::'; diff --git a/src/Uploader/Chunk/Storage/FlysystemStorage.php b/src/Uploader/Chunk/Storage/FlysystemStorage.php index f28bd0c..5f75d47 100644 --- a/src/Uploader/Chunk/Storage/FlysystemStorage.php +++ b/src/Uploader/Chunk/Storage/FlysystemStorage.php @@ -37,7 +37,7 @@ class FlysystemStorage implements ChunkStorageInterface /** * @throws FilesystemException */ - public function clear(int $maxAge, string $prefix = null): void + public function clear(int $maxAge, ?string $prefix = null): void { $prefix = $prefix ?: $this->prefix; $matches = $this->filesystem->listContents($prefix, true); diff --git a/src/Uploader/Chunk/Storage/GaufretteStorage.php b/src/Uploader/Chunk/Storage/GaufretteStorage.php index 345f028..12bee41 100644 --- a/src/Uploader/Chunk/Storage/GaufretteStorage.php +++ b/src/Uploader/Chunk/Storage/GaufretteStorage.php @@ -42,7 +42,7 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface * $prefix must be passable so it can clean the orphanage too * as it is forced to be the same filesystem. */ - public function clear(int $maxAge, string $prefix = null): void + public function clear(int $maxAge, ?string $prefix = null): void { $prefix = $prefix ?: $this->prefix; $matches = $this->filesystem->listKeys($prefix); diff --git a/src/Uploader/Response/FineUploaderResponse.php b/src/Uploader/Response/FineUploaderResponse.php index b37b310..34eb0bc 100644 --- a/src/Uploader/Response/FineUploaderResponse.php +++ b/src/Uploader/Response/FineUploaderResponse.php @@ -42,7 +42,7 @@ class FineUploaderResponse extends AbstractResponse return $this->success; } - public function setError(string $msg = null): self + public function setError(?string $msg = null): self { $this->error = $msg; diff --git a/src/Uploader/Response/MooUploadResponse.php b/src/Uploader/Response/MooUploadResponse.php index 3a5cad9..c273aa9 100644 --- a/src/Uploader/Response/MooUploadResponse.php +++ b/src/Uploader/Response/MooUploadResponse.php @@ -42,7 +42,7 @@ class MooUploadResponse extends AbstractResponse return $this->id; } - public function setName(string $name = null): self + public function setName(?string $name = null): self { $this->name = $name; diff --git a/src/Uploader/Storage/FilesystemOrphanageStorage.php b/src/Uploader/Storage/FilesystemOrphanageStorage.php index 83cfaa1..8dfce6a 100644 --- a/src/Uploader/Storage/FilesystemOrphanageStorage.php +++ b/src/Uploader/Storage/FilesystemOrphanageStorage.php @@ -34,7 +34,7 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS * * @return FileInterface|File */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); @@ -43,7 +43,7 @@ class FilesystemOrphanageStorage extends FilesystemStorage implements OrphanageS return parent::upload($file, $name, $this->getPath()); } - public function uploadFiles(array $files = null): array + public function uploadFiles(?array $files = null): array { try { if (null === $files) { diff --git a/src/Uploader/Storage/FilesystemStorage.php b/src/Uploader/Storage/FilesystemStorage.php index a67f7a2..d7cc420 100644 --- a/src/Uploader/Storage/FilesystemStorage.php +++ b/src/Uploader/Storage/FilesystemStorage.php @@ -19,7 +19,7 @@ class FilesystemStorage implements StorageInterface * * @return FileInterface|File */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { $path = null === $path ? $name : sprintf('%s/%s', $path, $name); $path = sprintf('%s/%s', $this->directory, $path); diff --git a/src/Uploader/Storage/FlysystemOrphanageStorage.php b/src/Uploader/Storage/FlysystemOrphanageStorage.php index 9f51f63..2d771c4 100644 --- a/src/Uploader/Storage/FlysystemOrphanageStorage.php +++ b/src/Uploader/Storage/FlysystemOrphanageStorage.php @@ -41,7 +41,7 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto * * @return FileInterface|SymfonyFile */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); @@ -53,7 +53,7 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto /** * @throws FilesystemException */ - public function uploadFiles(array $files = null): array + public function uploadFiles(?array $files = null): array { try { if (null === $files) { diff --git a/src/Uploader/Storage/FlysystemStorage.php b/src/Uploader/Storage/FlysystemStorage.php index c689587..4187b4f 100644 --- a/src/Uploader/Storage/FlysystemStorage.php +++ b/src/Uploader/Storage/FlysystemStorage.php @@ -25,7 +25,7 @@ class FlysystemStorage implements StorageInterface * * @return FileInterface|SymfonyFile */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { $path = null === $path ? $name : sprintf('%s/%s', $path, $name); diff --git a/src/Uploader/Storage/GaufretteOrphanageStorage.php b/src/Uploader/Storage/GaufretteOrphanageStorage.php index bac1a92..2f4a2e7 100644 --- a/src/Uploader/Storage/GaufretteOrphanageStorage.php +++ b/src/Uploader/Storage/GaufretteOrphanageStorage.php @@ -37,7 +37,7 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto * * @return FileInterface|GaufretteFile */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) { throw new \RuntimeException('You need a running session in order to run the Orphanage.'); @@ -46,7 +46,7 @@ class GaufretteOrphanageStorage extends GaufretteStorage implements OrphanageSto return parent::upload($file, $name, $this->getPath()); } - public function uploadFiles(array $files = null): array + public function uploadFiles(?array $files = null): array { try { if (null === $files) { diff --git a/src/Uploader/Storage/GaufretteStorage.php b/src/Uploader/Storage/GaufretteStorage.php index ea2cd83..aea8128 100644 --- a/src/Uploader/Storage/GaufretteStorage.php +++ b/src/Uploader/Storage/GaufretteStorage.php @@ -33,7 +33,7 @@ class GaufretteStorage extends StreamManager implements StorageInterface * * @return FileInterface|GaufretteFile */ - public function upload($file, string $name, string $path = null) + public function upload($file, string $name, ?string $path = null) { $path = null === $path ? $name : sprintf('%s/%s', $path, $name); diff --git a/src/Uploader/Storage/OrphanageStorageInterface.php b/src/Uploader/Storage/OrphanageStorageInterface.php index 21c6c8d..b10b26a 100644 --- a/src/Uploader/Storage/OrphanageStorageInterface.php +++ b/src/Uploader/Storage/OrphanageStorageInterface.php @@ -6,5 +6,5 @@ namespace Oneup\UploaderBundle\Uploader\Storage; interface OrphanageStorageInterface extends StorageInterface { - public function uploadFiles(array $files = null): array; + public function uploadFiles(?array $files = null): array; } diff --git a/src/Uploader/Storage/StorageInterface.php b/src/Uploader/Storage/StorageInterface.php index 0259db7..2c75db1 100644 --- a/src/Uploader/Storage/StorageInterface.php +++ b/src/Uploader/Storage/StorageInterface.php @@ -16,5 +16,5 @@ interface StorageInterface * * @return FileInterface|File */ - public function upload($file, string $name, string $path = null); + public function upload($file, string $name, ?string $path = null); } diff --git a/tests/Uploader/File/GaufretteFileTest.php b/tests/Uploader/File/GaufretteFileTest.php index 1febc13..a8fa2e0 100644 --- a/tests/Uploader/File/GaufretteFileTest.php +++ b/tests/Uploader/File/GaufretteFileTest.php @@ -16,7 +16,7 @@ class GaufretteFileTest extends FileTest protected function setUp(): void { $adapter = new Adapter(sys_get_temp_dir(), true); - $filesystem = new GaufretteFilesystem($adapter); + $filesystem = new GaufretteFileSystem($adapter); $map = StreamWrapper::getFilesystemMap(); $map->set('oneup', $filesystem);
0
195d142885ea46068cee20f8cd7d6c6d39e3f644
1up-lab/OneupUploaderBundle
Added a ChunkManager including an Interface and a proper service.
commit 195d142885ea46068cee20f8cd7d6c6d39e3f644 Author: Jim Schmid <[email protected]> Date: Mon Mar 11 10:33:58 2013 +0100 Added a ChunkManager including an Interface and a proper service. diff --git a/Resources/config/uploader.xml b/Resources/config/uploader.xml index f32be1c..f10809d 100644 --- a/Resources/config/uploader.xml +++ b/Resources/config/uploader.xml @@ -2,5 +2,15 @@ <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - + + <parameters> + <parameter key="oneup_uploader.chunks.manager.class">Oneup\UploaderBundle\Uploader\Chunks\ChunkManager</parameter> + </parameters> + + <services> + <service id="oneup_uploader.chunks.manager" class="%oneup_uploader.chunks.manager.class%"> + <argument>%oneup_uploader.chunks%</argument> + </service> + </services> + </container> \ No newline at end of file diff --git a/Uploader/Chunk/ChunkManager.php b/Uploader/Chunk/ChunkManager.php new file mode 100644 index 0000000..332ae47 --- /dev/null +++ b/Uploader/Chunk/ChunkManager.php @@ -0,0 +1,28 @@ +<?php + +namespace Oneup\UploaderBundle\Uploder\Chunk; + +use Symfony\Component\Filesystem\Filesystem; +use Oneup\UploaderBundle\Uploader\ChunkManagerInterface; + +class ChunkManager implements ChunkManagerInterafce +{ + public function __construct($configuration) + { + $this->configuration = $configuration; + } + + public function warmup() + { + $fileSystem = new FileSystem(); + $fileSystem->mkdir($this->configuration['directory']); + } + + public function clear() + { + $fileSystem = new FileSystem(); + $fileSystem->remove($this->configuration['directory']); + + $this->warmup(); + } +} \ No newline at end of file diff --git a/Uploader/Chunk/ChunkManagerInterface.php b/Uploader/Chunk/ChunkManagerInterface.php new file mode 100644 index 0000000..12574c9 --- /dev/null +++ b/Uploader/Chunk/ChunkManagerInterface.php @@ -0,0 +1,9 @@ +<?php + +namespace Oneup\UploaderBundle\Uploader\Chunk; + +interface ChunkManagerInterface +{ + public function warmup(); + public function clear(); +} \ No newline at end of file
0
b9c8d4868b0b5e3bf1be21a081e36a2573fe6d0f
1up-lab/OneupUploaderBundle
Enable cancelation flag for configuration.
commit b9c8d4868b0b5e3bf1be21a081e36a2573fe6d0f Author: Jim Schmid <[email protected]> Date: Tue Jun 25 11:26:14 2013 +0200 Enable cancelation flag for configuration. diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index aa704c3..e51b8b0 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -71,8 +71,9 @@ class Configuration implements ConfigurationInterface ->prototype('scalar')->end() ->end() ->scalarNode('max_size')->defaultValue(\PHP_INT_MAX)->end() - ->booleanNode('use_upload_progress')->defaultValue(false)->end() ->booleanNode('use_orphanage')->defaultFalse()->end() + ->booleanNode('use_upload_progress')->defaultValue(false)->end() + ->booleanNode('enable_cancelation')->defaultFalse()->end() ->scalarNode('namer')->defaultValue('oneup_uploader.namer.uniqid')->end() ->end() ->end() diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index b5d7c58..ede54fb 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -130,7 +130,8 @@ class OneupUploaderExtension extends Extension ; $controllers[$key] = array($controllerName, array( - 'use_upload_progress' => $mapping['use_upload_progress'] + 'use_upload_progress' => $mapping['use_upload_progress'], + 'enable_cancelation' => $mapping['enable_cancelation'] )); } diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index 62c3cab..1e2f8ca 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -45,6 +45,16 @@ class RouteLoader extends Loader $routes->add(sprintf('_uploader_progress_%s', $type), $progress); } + if ($options['enable_cancelation'] === true) { + $progress = new Route( + sprintf('/_uploader/%s/cancel', $type), + array('_controller' => $service . ':cancel', '_format' => 'json'), + array('_method' => 'POST') + ); + + $routes->add(sprintf('_uploader_cancel_%s', $type), $progress); + } + $routes->add(sprintf('_uploader_upload_%s', $type), $upload); } diff --git a/Tests/Routing/RouteLoaderTest.php b/Tests/Routing/RouteLoaderTest.php index 9a362f5..db6b86d 100644 --- a/Tests/Routing/RouteLoaderTest.php +++ b/Tests/Routing/RouteLoaderTest.php @@ -12,8 +12,14 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase $dog = 'HelloThisIsDogController'; $routeLoader = new RouteLoader(array( - 'cat' => array($cat, array('use_upload_progress' => false)), - 'dog' => array($dog, array('use_upload_progress' => true)), + 'cat' => array($cat, array( + 'use_upload_progress' => false, + 'enable_cancelation' => false + )), + 'dog' => array($dog, array( + 'use_upload_progress' => true, + 'enable_cancelation' => true + )), )); $routes = $routeLoader->load(null); @@ -21,7 +27,7 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase // for code coverage $this->assertTrue($routeLoader->supports('grumpy', 'uploader')); $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes); - $this->assertCount(3, $routes); + $this->assertCount(4, $routes); foreach ($routes as $route) { $this->assertInstanceOf('Symfony\Component\Routing\Route', $route);
0
b915fe5bb57e427f9cadf73454d835350b3529b6
1up-lab/OneupUploaderBundle
fixed uploads not being retryable if there was an error
commit b915fe5bb57e427f9cadf73454d835350b3529b6 Author: mitom <[email protected]> Date: Mon Dec 16 14:27:53 2013 +0100 fixed uploads not being retryable if there was an error diff --git a/Uploader/Chunk/Storage/GaufretteStorage.php b/Uploader/Chunk/Storage/GaufretteStorage.php index 5c641d0..dec76ce 100644 --- a/Uploader/Chunk/Storage/GaufretteStorage.php +++ b/Uploader/Chunk/Storage/GaufretteStorage.php @@ -120,7 +120,6 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface $this->openStream($dst, 'a'); } - // Meet the interface requirements $uploadedFile = new FilesystemFile($this->unhandledChunk['chunk']); @@ -128,6 +127,16 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface if ($renameChunk) { $name = preg_replace('/^(\d+)_/', '', $target); + /* The name can only match if the same user in the same session is + * trying to upload a file under the same name AND the previous upload failed, + * somewhere between this function, and the cleanup call. If that happened + * the previous file is unaccessible by the user, but if it is not removed + * it will block the user from trying to re-upload it. + */ + if ($this->filesystem->has($path.$name)) { + $this->filesystem->delete($path.$name); + } + $this->filesystem->rename($path.$target, $path.$name); $target = $name; } @@ -149,7 +158,11 @@ class GaufretteStorage extends StreamManager implements ChunkStorageInterface { $results = $this->filesystem->listKeys($this->prefix.'/'.$uuid); - return $results['keys']; + /* exclude files without an index, so if there is a completed file which + * failed to upload it will not get mixed together with new one's chunks. + */ + + return preg_grep('/^.+\/(\d+)_/', $results['keys']); } public function getFilesystem()
0
164034b17415acda36711a47c334a03232dab9ec
1up-lab/OneupUploaderBundle
Added dependency check image.
commit 164034b17415acda36711a47c334a03232dab9ec Author: Jim Schmid <[email protected]> Date: Mon Jun 3 11:40:20 2013 +0300 Added dependency check image. diff --git a/README.md b/README.md index 1e702c7..d828af8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Features included: * Fully unit tested [![Build Status](https://travis-ci.org/1up-lab/OneupUploaderBundle.png?branch=master)](https://travis-ci.org/1up-lab/OneupUploaderBundle) +[![Dependencies Status](https://d2xishtp1ojlk0.cloudfront.net/d/8654803)](http://depending.in/1up-lab/OneupUploaderBundle) Documentation -------------
0
8511e3bad4e273f973df019942949620a960c026
1up-lab/OneupUploaderBundle
Use the new ErrorHandler in the Controllers.
commit 8511e3bad4e273f973df019942949620a960c026 Author: Jim Schmid <[email protected]> Date: Sun Jul 14 23:11:00 2013 +0200 Use the new ErrorHandler in the Controllers. diff --git a/Controller/FancyUploadController.php b/Controller/FancyUploadController.php index c26f040..00858f6 100644 --- a/Controller/FancyUploadController.php +++ b/Controller/FancyUploadController.php @@ -20,8 +20,7 @@ class FancyUploadController extends AbstractController try { $uploaded = $this->handleUpload($file, $response, $request); } catch (UploadException $e) { - // return nothing - return new JsonResponse(array()); + $this->errorHandler->addException($response, $e); } } diff --git a/Controller/FineUploaderController.php b/Controller/FineUploaderController.php index 2fcfe00..0c862a3 100644 --- a/Controller/FineUploaderController.php +++ b/Controller/FineUploaderController.php @@ -30,6 +30,8 @@ class FineUploaderController extends AbstractChunkedController } catch (UploadException $e) { $response->setSuccess(false); $response->setError($translator->trans($e->getMessage(), array(), 'OneupUploaderBundle')); + + $this->errorHandler->addException($response, $e); // an error happended, return this error message. return new JsonResponse($response->assemble()); diff --git a/Controller/MooUploadController.php b/Controller/MooUploadController.php index dbc75f6..8b6cce5 100644 --- a/Controller/MooUploadController.php +++ b/Controller/MooUploadController.php @@ -50,6 +50,8 @@ class MooUploadController extends AbstractChunkedController $response->setFinish(true); $response->setError(-1); + $this->errorHandler->addException($response, $e); + // return nothing return new JsonResponse($response->assemble()); } diff --git a/Controller/PluploadController.php b/Controller/PluploadController.php index 162f6a8..d2b6a8a 100644 --- a/Controller/PluploadController.php +++ b/Controller/PluploadController.php @@ -26,8 +26,7 @@ class PluploadController extends AbstractChunkedController $this->handleUpload($file, $response, $request) ; } catch (UploadException $e) { - // return nothing - return new JsonResponse(array()); + $this->errorHandler->addException($response, $e); } } diff --git a/Controller/UploadifyController.php b/Controller/UploadifyController.php index fe57183..de75cdd 100644 --- a/Controller/UploadifyController.php +++ b/Controller/UploadifyController.php @@ -20,8 +20,7 @@ class UploadifyController extends AbstractController try { $uploaded = $this->handleUpload($file, $response, $request); } catch (UploadException $e) { - // return nothing - return new JsonResponse(array()); + $this->errorHandler->addException($response, $e); } } diff --git a/Controller/YUI3Controller.php b/Controller/YUI3Controller.php index 5b1e98f..ac4760c 100644 --- a/Controller/YUI3Controller.php +++ b/Controller/YUI3Controller.php @@ -20,8 +20,7 @@ class YUI3Controller extends AbstractController try { $uploaded = $this->handleUpload($file, $response, $request); } catch (UploadException $e) { - // return nothing - return new JsonResponse(array()); + $this->errorHandler->addException($response, $e); } }
0
d84e960953588ca47ce2984f6dd7da69942d5cee
1up-lab/OneupUploaderBundle
Removed first title in chunked_uploads.md
commit d84e960953588ca47ce2984f6dd7da69942d5cee Author: Jim Schmid <[email protected]> Date: Tue Apr 9 09:14:01 2013 +0200 Removed first title in chunked_uploads.md diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index bd1238b..af3b780 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -1,8 +1,6 @@ Using Chunked Uploads ===================== -## Enable - Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabed, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. ```js
0
09243d68e30e4a5e8112f6443323f1ccd6743d65
1up-lab/OneupUploaderBundle
Do not use deprecated _method requirement
commit 09243d68e30e4a5e8112f6443323f1ccd6743d65 Author: Giorgio Premi <[email protected]> Date: Mon Mar 2 12:44:48 2015 +0100 Do not use deprecated _method requirement diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index fad6c0f..4e8df11 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -32,14 +32,22 @@ class RouteLoader extends Loader $upload = new Route( sprintf('%s/_uploader/%s/upload', $options['route_prefix'], $type), array('_controller' => $service . ':upload', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST') ); if ($options['enable_progress'] === true) { $progress = new Route( sprintf('%s/_uploader/%s/progress', $options['route_prefix'], $type), array('_controller' => $service . ':progress', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST') ); $routes->add(sprintf('_uploader_progress_%s', $type), $progress); @@ -49,7 +57,11 @@ class RouteLoader extends Loader $progress = new Route( sprintf('%s/_uploader/%s/cancel', $options['route_prefix'], $type), array('_controller' => $service . ':cancel', '_format' => 'json'), - array('_method' => 'POST') + array(), + array(), + '', + array(), + array('POST') ); $routes->add(sprintf('_uploader_cancel_%s', $type), $progress); diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index 9e6d26a..b5460ef 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -40,8 +40,7 @@ abstract class AbstractControllerTest extends WebTestCase */ public function testCallByGet() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('GET', $endpoint); + $this->implTestCallBy('GET'); } /** @@ -49,8 +48,12 @@ abstract class AbstractControllerTest extends WebTestCase */ public function testCallByDelete() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('DELETE', $endpoint); + $this->implTestCallBy('DELETE'); + } + + public function testCallByPost() + { + $this->implTestCallBy('POST'); } /** @@ -58,16 +61,15 @@ abstract class AbstractControllerTest extends WebTestCase */ public function testCallByPut() { - $endpoint = $this->helper->endpoint($this->getConfigKey()); - $this->client->request('PUT', $endpoint); + $this->implTestCallBy('PUT'); } - public function testCallByPost() + protected function implTestCallBy($method) { $client = $this->client; $endpoint = $this->helper->endpoint($this->getConfigKey()); - $client->request('POST', $endpoint, array(), array(), $this->requestHeaders); + $client->request($method, $endpoint, array(), array(), $this->requestHeaders); $response = $client->getResponse(); $this->assertTrue($response->isSuccessful()); diff --git a/Tests/Routing/RouteLoaderTest.php b/Tests/Routing/RouteLoaderTest.php index 4058039..a09385e 100644 --- a/Tests/Routing/RouteLoaderTest.php +++ b/Tests/Routing/RouteLoaderTest.php @@ -33,8 +33,8 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase foreach ($routes as $route) { $this->assertInstanceOf('Symfony\Component\Routing\Route', $route); - $this->assertEquals($route->getDefault('_format'), 'json'); - $this->assertEquals($route->getRequirement('_method'), 'POST'); + $this->assertEquals('json', $route->getDefault('_format')); + $this->assertEquals(array('POST'), $route->getMethods()); } } @@ -55,8 +55,8 @@ class RouteLoaderTest extends \PHPUnit_Framework_TestCase foreach ($routes as $route) { $this->assertInstanceOf('Symfony\Component\Routing\Route', $route); - $this->assertEquals($route->getDefault('_format'), 'json'); - $this->assertEquals($route->getRequirement('_method'), 'POST'); + $this->assertEquals('json', $route->getDefault('_format')); + $this->assertEquals(array('POST'), $route->getMethods()); $this->assertEquals(0, strpos($route->getPath(), $prefix)); }
0
17264b2a45f9d6acee144e4369b6abf3e19fea60
1up-lab/OneupUploaderBundle
Merge branch 'robertfausk-patch-1'
commit 17264b2a45f9d6acee144e4369b6abf3e19fea60 (from cdc567739906d0e7f42dbc06a005774589ec03af) Merge: cdc5677 3150571 Author: David Greminger <[email protected]> Date: Tue Nov 7 09:01:54 2017 +0100 Merge branch 'robertfausk-patch-1' diff --git a/Resources/doc/custom_logic.md b/Resources/doc/custom_logic.md index 3471492..421b66a 100644 --- a/Resources/doc/custom_logic.md +++ b/Resources/doc/custom_logic.md @@ -53,7 +53,7 @@ And register it in your `services.xml`. ```yml services: - acme_hello.upload_listener: + app.upload_listener: class: AppBundle\EventListener\UploadListener arguments: ["@doctrine.orm.entity_manager"] tags:
0
d519bab7f4029f22a812409bbd84936170d85261
1up-lab/OneupUploaderBundle
Removed old controller tests.
commit d519bab7f4029f22a812409bbd84936170d85261 Author: Jim Schmid <[email protected]> Date: Sat May 4 13:59:53 2013 +0200 Removed old controller tests. diff --git a/Tests/Controller/AbstractControllerChunkedTest.php b/Tests/Controller/AbstractControllerChunkedTest.php deleted file mode 100644 index 771282f..0000000 --- a/Tests/Controller/AbstractControllerChunkedTest.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpFoundation\File\UploadedFile; - -use Oneup\UploaderBundle\Uploader\Chunk\ChunkManager; -use Oneup\UploaderBundle\Uploader\Naming\UniqidNamer; -use Oneup\UploaderBundle\Uploader\Storage\FilesystemStorage; - -abstract class AbstractControllerChunkedTest extends \PHPUnit_Framework_TestCase -{ - protected $tempChunks; - protected $currentChunk; - protected $chunkUuid; - protected $numberOfChunks; - - abstract public function getControllerString(); - abstract protected function getRequestMock(); - - public function setUp() - { - $this->numberOfChunks = 10; - - // create 10 chunks - for($i = 0; $i < $this->numberOfChunks; $i++) - { - // create temporary file - $chunk = tempnam(sys_get_temp_dir(), 'uploader'); - - $pointer = fopen($chunk, 'w+'); - fwrite($pointer, str_repeat('A', 1024), 1024); - fclose($pointer); - - $this->tempChunks[] = $chunk; - } - - $this->currentChunk = 0; - $this->chunkUuid = uniqid(); - } - - public function testUpload() - { - $container = $this->getContainerMock(); - $storage = new FilesystemStorage(sys_get_temp_dir() . '/uploader'); - $config = array( - 'use_orphanage' => false, - 'namer' => 'namer', - 'max_size' => 2048, - 'allowed_extensions' => array(), - 'disallowed_extensions' => array() - ); - - $responses = array(); - $str = $this->getControllerString(); - $controller = new $str($container, $storage, $config, 'cat'); - - // mock as much requests as there are parts to assemble - for($i = 0; $i < $this->numberOfChunks; $i ++) - { - $responses[] = $controller->upload(); - - // will be used internaly - $this->currentChunk++; - } - - for($i = 0; $i < $this->numberOfChunks; $i ++) - { - // check if original file has been moved - $this->assertFalse(file_exists($this->tempChunks[$i])); - - $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $responses[$i]); - $this->assertEquals(200, $responses[$i]->getStatusCode()); - } - - // check if assembled file is here - $finder = new Finder(); - $finder->in(sys_get_temp_dir() . '/uploader')->files(); - $this->assertCount(1, $finder); - - // and check if chunks are gone - $finder = new Finder(); - $finder->in(sys_get_temp_dir() . '/chunks')->files(); - $this->assertCount(0, $finder); - } - - protected function getContainerMock() - { - $mock = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $mock - ->expects($this->any()) - ->method('get') - ->will($this->returnCallback(array($this, 'containerGetCb'))) - ; - - return $mock; - } - - public function containerGetCb($inp) - { - if($inp == 'request') - return $this->getRequestMock(); - - if($inp == 'event_dispatcher') - return $this->getEventDispatcherMock(); - - if($inp == 'namer') - return new UniqidNamer(); - - if($inp == 'oneup_uploader.chunk_manager') - return $this->getChunkManager(); - } - - protected function getEventDispatcherMock() - { - $mock = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - $mock - ->expects($this->any()) - ->method('dispatch') - ->will($this->returnValue(true)) - ; - - return $mock; - } - - protected function getUploadedFile() - { - return new UploadedFile($this->tempChunks[$this->currentChunk], 'grumpy-cat.jpeg', 'image/jpeg', 1024, null, true); - } - - protected function getChunkManager() - { - return new ChunkManager(array( - 'directory' => sys_get_temp_dir() . '/chunks' - )); - } - - public function tearDown() - { - // remove all files in tmp folder - $filesystem = new Filesystem(); - $filesystem->remove(sys_get_temp_dir() . '/uploader'); - $filesystem->remove(sys_get_temp_dir() . '/chunks'); - } -} \ No newline at end of file diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php deleted file mode 100644 index 80176e9..0000000 --- a/Tests/Controller/AbstractControllerTest.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpFoundation\File\UploadedFile; - -use Oneup\UploaderBundle\Uploader\Naming\UniqidNamer; -use Oneup\UploaderBundle\Uploader\Storage\FilesystemStorage; - -abstract class AbstractControllerTest extends \PHPUnit_Framework_TestCase -{ - protected $tempFile; - - abstract public function getControllerString(); - abstract protected function getRequestMock(); - - public function setUp() - { - // create temporary file - $this->tempFile = tempnam(sys_get_temp_dir(), 'uploader'); - - $pointer = fopen($this->tempFile, 'w+'); - fwrite($pointer, str_repeat('A', 1024), 1024); - fclose($pointer); - } - - public function testUpload() - { - $container = $this->getContainerMock(); - $storage = new FilesystemStorage(sys_get_temp_dir() . '/uploader'); - $config = array( - 'use_orphanage' => false, - 'namer' => 'namer', - 'max_size' => 2048, - 'allowed_extensions' => array(), - 'disallowed_extensions' => array() - ); - - $str = $this->getControllerString(); - $controller = new $str($container, $storage, $config, 'cat'); - $response = $controller->upload(); - - // check if original file has been moved - $this->assertFalse(file_exists($this->tempFile)); - - // testing response - $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); - $this->assertEquals(200, $response->getStatusCode()); - - // check if file is present - $finder = new Finder(); - $finder->in(sys_get_temp_dir() . '/uploader')->files(); - - $this->assertCount(1, $finder); - } - - public function testUploadWhichFails() - { - $container = $this->getContainerMock(); - $storage = new FilesystemStorage(sys_get_temp_dir() . '/uploader'); - $config = array( - 'use_orphanage' => false, - 'namer' => 'namer', - 'max_size' => 1, - 'allowed_extensions' => array(), - 'disallowed_extensions' => array() - ); - - $str = $this->getControllerString(); - $controller = new $str($container, $storage, $config, 'cat'); - $response = $controller->upload(); - - $json = json_decode($response->getContent()); - - // testing response - $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); - $this->assertEquals(200, $response->getStatusCode()); - } - - protected function getContainerMock() - { - $mock = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $mock - ->expects($this->any()) - ->method('get') - ->will($this->returnCallback(array($this, 'containerGetCb'))) - ; - - return $mock; - } - - public function containerGetCb($inp) - { - if($inp == 'request') - return $this->getRequestMock(); - - if($inp == 'event_dispatcher') - return $this->getEventDispatcherMock(); - - if($inp == 'namer') - return new UniqidNamer(); - - if($inp == 'translator') - return $this->getTranslatorMock(); - } - - protected function getEventDispatcherMock() - { - $mock = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - $mock - ->expects($this->any()) - ->method('dispatch') - ->will($this->returnValue(true)) - ; - - return $mock; - } - - protected function getTranslatorMock() - { - $mock = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); - $mock - ->expects($this->any()) - ->method('trans') - ->will($this->returnValue('A translated error.')) - ; - - return $mock; - } - - protected function getUploadedFile() - { - return new UploadedFile($this->tempFile, 'grumpy-cat.jpeg', 'image/jpeg', 1024, null, true); - } - - public function tearDown() - { - // remove all files in tmp folder - $filesystem = new Filesystem(); - $filesystem->remove(sys_get_temp_dir() . '/uploader'); - } -} \ No newline at end of file diff --git a/Tests/Controller/BlueimpControllerChunkedTest.php b/Tests/Controller/BlueimpControllerChunkedTest.php deleted file mode 100644 index 9b95ca5..0000000 --- a/Tests/Controller/BlueimpControllerChunkedTest.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Oneup\UploaderBundle\Tests\Controller\AbstractControllerChunkedTest; - -class BlueimpControllerChunkedTest extends AbstractControllerChunkedTest -{ - public function getControllerString() - { - return 'Oneup\UploaderBundle\Controller\BlueimpController'; - } - - protected function getRequestMock() - { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Request'); - - $headers = $this->getMock('Symfony\Component\HttpFoundation\HeaderBag'); - $headers - ->expects($this->any()) - ->method('get') - ->will($this->returnCallback(array($this, 'headersGetCb'))) - ; - - $mock->headers = $headers; - - $mock->files = array( - array($this->getUploadedFile()) - ); - - return $mock; - } - - public function containerGetCb($inp) - { - if($inp == 'session') - { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Session\Session'); - $mock - ->expects($this->any()) - ->method('getId') - ->will($this->returnValue('fixed-id')) - ; - - return $mock; - } - - return parent::containerGetCb($inp); - } - - public function headersGetCb($inp) - { - if($inp == 'content-disposition') - return 'grumpy-cat.jpeg'; - - if($inp == 'content-range') - { - if($this->currentChunk == ($this->numberOfChunks - 1)) - { - return sprintf('- 9218, 10240/10241'); - } - else - { - $size = 1024; - $ret = sprintf('- %d, %d/%d', $this->currentChunk * $size, $this->currentChunk * $size + $size, 10240); - - return $ret; - } - } - } -} diff --git a/Tests/Controller/BlueimpControllerTest.php b/Tests/Controller/BlueimpControllerTest.php deleted file mode 100644 index 19ffefa..0000000 --- a/Tests/Controller/BlueimpControllerTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Oneup\UploaderBundle\Tests\Controller\AbstractControllerTest; - -class BlueimpControllerTest extends AbstractControllerTest -{ - public function getControllerString() - { - return 'Oneup\UploaderBundle\Controller\BlueimpController'; - } - - protected function getRequestMock() - { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Request'); - $headers = $this->getMock('Symfony\Component\HttpFoundation\HeaderBag'); - $headers - ->expects($this->any()) - ->method('get') - ->will($this->returnValue(null)) - ; - - $mock->headers = $headers; - - $mock->files = array( - array($this->getUploadedFile()) - ); - - return $mock; - } -} \ No newline at end of file diff --git a/Tests/Controller/FineUploaderControllerChunkedTest.php b/Tests/Controller/FineUploaderControllerChunkedTest.php deleted file mode 100644 index 9d9adb1..0000000 --- a/Tests/Controller/FineUploaderControllerChunkedTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Oneup\UploaderBundle\Tests\Controller\AbstractControllerChunkedTest; - -class FineUploaderControllerChunkedTest extends AbstractControllerChunkedTest -{ - public function getControllerString() - { - return 'Oneup\UploaderBundle\Controller\FineUploaderController'; - } - - protected function getRequestMock() - { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Request'); - $mock - ->expects($this->any()) - ->method('get') - ->will($this->returnCallback(array($this, 'requestGetCb'))) - ; - - $mock->files = array( - $this->getUploadedFile() - ); - - return $mock; - } - - public function requestGetCb($inp) - { - if($inp == 'qqtotalparts') - return $this->numberOfChunks; - - if($inp == 'qqpartindex') - return $this->currentChunk; - - if($inp == 'qquuid') - return $this->chunkUuid; - - if($inp == 'qqfilename') - return 'grumpy-cat.jpeg'; - } -} \ No newline at end of file diff --git a/Tests/Controller/FineUploaderControllerTest.php b/Tests/Controller/FineUploaderControllerTest.php deleted file mode 100644 index 5fafc14..0000000 --- a/Tests/Controller/FineUploaderControllerTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\Tests\Controller; - -use Oneup\UploaderBundle\Tests\Controller\AbstractControllerTest; - -class FineUploaderControllerTest extends AbstractControllerTest -{ - public function getControllerString() - { - return 'Oneup\UploaderBundle\Controller\FineUploaderController'; - } - - protected function getRequestMock() - { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Request'); - $mock - ->expects($this->any()) - ->method('get') - ->with('qqtotalparts') - ->will($this->returnValue(1)) - ; - - $mock->files = array( - $this->getUploadedFile() - ); - - return $mock; - } -} \ No newline at end of file
0
774c82dd0c23716688e8ee818d7407a91990d436
1up-lab/OneupUploaderBundle
Fixed tests
commit 774c82dd0c23716688e8ee818d7407a91990d436 Author: David Greminger <[email protected]> Date: Tue Sep 19 12:39:56 2017 +0200 Fixed tests diff --git a/.travis.yml b/.travis.yml index 0e69924..f9876e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,9 +40,11 @@ matrix: - php: 5.6 env: SYMFONY_VERSION=dev-master -before_script: +before_install: - composer selfupdate - - composer require symfony/http-kernel:${SYMFONY_VERSION} --prefer-source - - composer install --dev --prefer-source + +before_script: + - travis_wait composer require symfony/framework-bundle:${SYMFONY_VERSION} --prefer-source + - travis_wait composer install --dev --prefer-source script: ./vendor/bin/phpunit
0
de814a130556372d7468d4983ff1e4b427ce7690
1up-lab/OneupUploaderBundle
Use the native createFile instead of an empty write to create the file in the first place.
commit de814a130556372d7468d4983ff1e4b427ce7690 Author: Jim Schmid <[email protected]> Date: Wed Mar 13 09:07:05 2013 +0100 Use the native createFile instead of an empty write to create the file in the first place. diff --git a/Uploader/Storage/GaufretteStorage.php b/Uploader/Storage/GaufretteStorage.php index a5fb5d8..b6918c6 100644 --- a/Uploader/Storage/GaufretteStorage.php +++ b/Uploader/Storage/GaufretteStorage.php @@ -26,9 +26,9 @@ class GaufretteStorage implements StorageInterface // this is a somehow ugly workaround introduced // because the stream-mode is not able to create - // subdirectories, while "write" does. + // subdirectories. if(!$this->filesystem->has($name)) - $this->filesystem->write($name, '', true); + $this->filesystem->createFile($name); $src->open(new StreamMode('rb+')); $dst->open(new StreamMode('ab+'));
0
470b11eeee82946fbf93d5944c63749bcdf65f6f
1up-lab/OneupUploaderBundle
Widen typehint (#445)
commit 470b11eeee82946fbf93d5944c63749bcdf65f6f Author: David Greminger <[email protected]> Date: Thu Apr 4 08:57:10 2024 +0200 Widen typehint (#445) diff --git a/src/Controller/AbstractController.php b/src/Controller/AbstractController.php index 7dbd5b6..1e1a867 100644 --- a/src/Controller/AbstractController.php +++ b/src/Controller/AbstractController.php @@ -100,10 +100,8 @@ abstract class AbstractController * function in the implemented Controller. * * Note: The return value differs when - * - * @param File $file The file to upload */ - protected function handleUpload(File $file, ResponseInterface $response, Request $request): void + protected function handleUpload(FileInterface|File $file, ResponseInterface $response, Request $request): void { // wrap the file if it is not done yet which can only happen // if it wasn't a chunked upload, in which case it is definitely @@ -130,12 +128,8 @@ abstract class AbstractController /** * This function is a helper function which dispatches pre upload event. - * - * @param FileInterface $uploaded the uploaded file - * @param ResponseInterface $response a response object - * @param Request $request the request object */ - protected function dispatchPreUploadEvent(FileInterface $uploaded, ResponseInterface $response, Request $request): void + protected function dispatchPreUploadEvent(FileInterface|File $uploaded, ResponseInterface $response, Request $request): void { // dispatch pre upload event (both the specific and the general) $preUploadEvent = new PreUploadEvent($uploaded, $response, $request, $this->type, $this->config); @@ -146,10 +140,8 @@ abstract class AbstractController /** * This function is a helper function which dispatches post upload * and post persist events. - * - * @param File $uploaded the uploaded file */ - protected function dispatchPostEvents(File $uploaded, ResponseInterface $response, Request $request): void + protected function dispatchPostEvents(FileInterface|File $uploaded, ResponseInterface $response, Request $request): void { // dispatch post upload event (both the specific and the general) $postUploadEvent = new PostUploadEvent($uploaded, $response, $request, $this->type, $this->config); @@ -164,7 +156,7 @@ abstract class AbstractController } } - protected function validate(FileInterface $file, Request $request, ?ResponseInterface $response = null): void + protected function validate(FileInterface|File $file, Request $request, ?ResponseInterface $response = null): void { $event = new ValidationEvent($file, $request, $this->config, $this->type, $response);
0
03cf8be8ef7e0b181c1cff6412fca24f78fa9a32
1up-lab/OneupUploaderBundle
CS fixes for Event and EventListener
commit 03cf8be8ef7e0b181c1cff6412fca24f78fa9a32 Author: Jim Schmid <[email protected]> Date: Thu Jun 20 21:25:30 2013 +0200 CS fixes for Event and EventListener diff --git a/Event/PostChunkUploadEvent.php b/Event/PostChunkUploadEvent.php index 7d5aacd..9b32dfd 100644 --- a/Event/PostChunkUploadEvent.php +++ b/Event/PostChunkUploadEvent.php @@ -14,7 +14,7 @@ class PostChunkUploadEvent extends Event protected $response; protected $config; protected $isLast; - + public function __construct($chunk, ResponseInterface $response, Request $request, $isLast, $type, array $config) { $this->chunk = $chunk; @@ -24,37 +24,37 @@ class PostChunkUploadEvent extends Event $this->type = $type; $this->config = $config; } - + public function getChunk() { return $this->chunk; } - + public function getRequest() { return $this->request; } - + public function getType() { return $this->type; } - + public function getResponse() { return $this->response; } - + public function getConfig() { return $this->config; } - + public function getIsLast() { return $this->isLast; } - + public function isLast() { return $this->isLast; diff --git a/Event/PostPersistEvent.php b/Event/PostPersistEvent.php index a25dc19..7615c8f 100644 --- a/Event/PostPersistEvent.php +++ b/Event/PostPersistEvent.php @@ -13,7 +13,7 @@ class PostPersistEvent extends Event protected $type; protected $response; protected $config; - + public function __construct($file, ResponseInterface $response, Request $request, $type, array $config) { $this->file = $file; @@ -22,29 +22,29 @@ class PostPersistEvent extends Event $this->type = $type; $this->config = $config; } - + public function getFile() { return $this->file; } - + public function getRequest() { return $this->request; } - + public function getType() { return $this->type; } - + public function getResponse() { return $this->response; } - + public function getConfig() { return $this->config; } -} \ No newline at end of file +} diff --git a/Event/PostUploadEvent.php b/Event/PostUploadEvent.php index 872a131..6fd1dd5 100644 --- a/Event/PostUploadEvent.php +++ b/Event/PostUploadEvent.php @@ -13,7 +13,7 @@ class PostUploadEvent extends Event protected $type; protected $response; protected $config; - + public function __construct($file, ResponseInterface $response, Request $request, $type, array $config) { $this->file = $file; @@ -22,29 +22,29 @@ class PostUploadEvent extends Event $this->type = $type; $this->config = $config; } - + public function getFile() { return $this->file; } - + public function getRequest() { return $this->request; } - + public function getType() { return $this->type; } - + public function getResponse() { return $this->response; } - + public function getConfig() { return $this->config; } -} \ No newline at end of file +} diff --git a/Event/ValidationEvent.php b/Event/ValidationEvent.php index 5fd4d98..a3ecef1 100644 --- a/Event/ValidationEvent.php +++ b/Event/ValidationEvent.php @@ -9,24 +9,24 @@ class ValidationEvent extends Event { protected $file; protected $config; - + public function __construct(UploadedFile $file, array $config, $type) { $this->file = $file; $this->config = $config; $this->type = $type; } - + public function getFile() { return $this->file; } - + public function getConfig() { return $this->config; } - + public function getType() { return $this->type; diff --git a/EventListener/AllowedExtensionValidationListener.php b/EventListener/AllowedExtensionValidationListener.php index 69ab16a..68c26e8 100644 --- a/EventListener/AllowedExtensionValidationListener.php +++ b/EventListener/AllowedExtensionValidationListener.php @@ -11,11 +11,11 @@ class AllowedExtensionValidationListener { $config = $event->getConfig(); $file = $event->getFile(); - + $extension = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION); - - if(count($config['allowed_extensions']) > 0 && !in_array($extension, $config['allowed_extensions'])) { + + if (count($config['allowed_extensions']) > 0 && !in_array($extension, $config['allowed_extensions'])) { throw new ValidationException('error.whitelist'); } } -} \ No newline at end of file +} diff --git a/EventListener/AllowedMimetypeValidationListener.php b/EventListener/AllowedMimetypeValidationListener.php index 62bfa93..195f6bd 100644 --- a/EventListener/AllowedMimetypeValidationListener.php +++ b/EventListener/AllowedMimetypeValidationListener.php @@ -11,15 +11,15 @@ class AllowedMimetypeValidationListener { $config = $event->getConfig(); $file = $event->getFile(); - - if(count($config['allowed_mimetypes']) == 0) { + + if (count($config['allowed_mimetypes']) == 0) { return; } - + $finfo = finfo_open(FILEINFO_MIME_TYPE); $mimetype = finfo_file($finfo, $file->getRealpath()); - - if(!in_array($mimetype, $config['allowed_mimetypes'])) { + + if (!in_array($mimetype, $config['allowed_mimetypes'])) { throw new ValidationException('error.whitelist'); } } diff --git a/EventListener/DisallowedExtensionValidationListener.php b/EventListener/DisallowedExtensionValidationListener.php index 14319a3..9cdac58 100644 --- a/EventListener/DisallowedExtensionValidationListener.php +++ b/EventListener/DisallowedExtensionValidationListener.php @@ -11,10 +11,10 @@ class DisallowedExtensionValidationListener { $config = $event->getConfig(); $file = $event->getFile(); - + $extension = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION); - - if(count($config['disallowed_extensions']) > 0 && in_array($extension, $config['disallowed_extensions'])) { + + if (count($config['disallowed_extensions']) > 0 && in_array($extension, $config['disallowed_extensions'])) { throw new ValidationException('error.blacklist'); } } diff --git a/EventListener/DisallowedMimetypeValidationListener.php b/EventListener/DisallowedMimetypeValidationListener.php index 3981298..452eff6 100644 --- a/EventListener/DisallowedMimetypeValidationListener.php +++ b/EventListener/DisallowedMimetypeValidationListener.php @@ -11,15 +11,15 @@ class DisallowedMimetypeValidationListener { $config = $event->getConfig(); $file = $event->getFile(); - - if(count($config['disallowed_mimetypes']) == 0) { + + if (count($config['disallowed_mimetypes']) == 0) { return; } - + $finfo = finfo_open(FILEINFO_MIME_TYPE); $mimetype = finfo_file($finfo, $file->getRealpath()); - - if(in_array($mimetype, $config['disallowed_mimetypes'])) { + + if (in_array($mimetype, $config['disallowed_mimetypes'])) { throw new ValidationException('error.blacklist'); } } diff --git a/EventListener/MaxSizeValidationListener.php b/EventListener/MaxSizeValidationListener.php index e3b6d90..0b31660 100644 --- a/EventListener/MaxSizeValidationListener.php +++ b/EventListener/MaxSizeValidationListener.php @@ -11,8 +11,8 @@ class MaxSizeValidationListener { $config = $event->getConfig(); $file = $event->getFile(); - - if($file->getSize() > $config['max_size']) { + + if ($file->getSize() > $config['max_size']) { throw new ValidationException('error.maxsize'); } }
0
d7a2376b3367c4ca3841d1c70acdac267da43ca6
1up-lab/OneupUploaderBundle
Refactored Route loading as addMethodCall won't be called if Bundle is loaded through composer.
commit d7a2376b3367c4ca3841d1c70acdac267da43ca6 Author: Jim Schmid <[email protected]> Date: Mon Apr 8 10:26:03 2013 +0200 Refactored Route loading as addMethodCall won't be called if Bundle is loaded through composer. diff --git a/DependencyInjection/Compiler/ControllerCompilerPass.php b/DependencyInjection/Compiler/ControllerCompilerPass.php deleted file mode 100644 index a56ea90..0000000 --- a/DependencyInjection/Compiler/ControllerCompilerPass.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Oneup\UploaderBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -class ControllerCompilerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - $tags = $container->findTaggedServiceIds('oneup_uploader.routable'); - - if(count($tags) > 0 && $container->hasDefinition('oneup_uploader.routing.loader')) - { - $loader = $container->getDefinition('oneup_uploader.routing.loader'); - - foreach($tags as $id => $tag) - { - $loader->addMethodCall('addController', array($tag[0]['type'], $id)); - } - } - } -} \ No newline at end of file diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index c828879..04eb240 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -35,6 +35,8 @@ class OneupUploaderExtension extends Extension $container->setParameter('oneup_uploader.chunks', $config['chunks']); $container->setParameter('oneup_uploader.orphanage', $config['orphanage']); + $controllers = array(); + // handle mappings foreach($config['mappings'] as $key => $mapping) { @@ -102,9 +104,11 @@ class OneupUploaderExtension extends Extension } } + $controllerName = sprintf('oneup_uploader.controller.%s', $key); + // create controllers based on mapping $container - ->register(sprintf('oneup_uploader.controller.%s', $key), $container->getParameter('oneup_uploader.controller.class')) + ->register($controllerName, $container->getParameter('oneup_uploader.controller.class')) ->addArgument(new Reference('service_container')) ->addArgument($storageService) @@ -114,7 +118,11 @@ class OneupUploaderExtension extends Extension ->addTag('oneup_uploader.routable', array('type' => $key)) ->setScope('request') ; + + $controllers[$key] = $controllerName; } + + $container->setParameter('oneup_uploader.controllers', $controllers); } protected function getMaxUploadSize($input) diff --git a/OneupUploaderBundle.php b/OneupUploaderBundle.php index f359549..693f273 100644 --- a/OneupUploaderBundle.php +++ b/OneupUploaderBundle.php @@ -9,10 +9,4 @@ use Oneup\UploaderBundle\DependencyInjection\Compiler\ControllerCompilerPass; class OneupUploaderBundle extends Bundle { - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new ControllerCompilerPass); - } } \ No newline at end of file diff --git a/Resources/config/uploader.xml b/Resources/config/uploader.xml index 0f9d511..13baac6 100644 --- a/Resources/config/uploader.xml +++ b/Resources/config/uploader.xml @@ -31,6 +31,7 @@ <!-- routing --> <service id="oneup_uploader.routing.loader" class="%oneup_uploader.routing.loader.class%"> + <argument>%oneup_uploader.controllers%</argument> <tag name="routing.loader" /> </service> diff --git a/Routing/RouteLoader.php b/Routing/RouteLoader.php index c7dfb91..9145ff1 100644 --- a/Routing/RouteLoader.php +++ b/Routing/RouteLoader.php @@ -10,14 +10,9 @@ class RouteLoader extends Loader { protected $controllers; - public function __construct() + public function __construct(array $controllers) { - $this->controllers = array(); - } - - public function addController($type, $controller) - { - $this->controllers[$type] = $controller; + $this->controllers = $controllers; } public function supports($resource, $type = null)
0
b1fd72a35532b4317bc2537cfc6ac4931ab5422d
1up-lab/OneupUploaderBundle
Support for flysystem v2 (#412)
commit b1fd72a35532b4317bc2537cfc6ac4931ab5422d Author: Martin Mandl <[email protected]> Date: Wed Jul 20 14:20:27 2022 +0200 Support for flysystem v2 (#412) diff --git a/README.md b/README.md index eaa78ab..daa56ae 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The entry point of the documentation can be found in the file `docs/index.md` Upgrade Notes ------------- +* Version **4.0.0* supports now [Flysystem 2 & 3](https://github.com/1up-lab/OneupFlysystemBundle) (kudos to @[m2mtech](https://github.com/m2mtech)), see [#412](https://github.com/1up-lab/OneupUploaderBundle/pull/412)! Flysystem 1 and OneupFlysystemBundle < 4.0 support was dropped. * Version **3.2.0** supports now Symfony 6 (kudos to @[pich](https://github.com/pich)), see [#421](https://github.com/1up-lab/OneupUploaderBundle/pull/421)! PHP 7.2/7.3 support was dropped. * Version **3.0.0** supports now Symfony 5 (kudos to @[steveWinter](https://github.com/steveWinter), @[gubler](https://github.com/gubler), @[patrickbussmann](https://github.com/patrickbussmann), @[ErnadoO](https://github.com/ErnadoO) and @[enumag](https://github.com/enumag), see [#373](https://github.com/1up-lab/OneupUploaderBundle/pull/373)! Symfony 3.x support was dropped. * Version **2.0.0** supports now Symfony 4 (Thank you @[istvancsabakis](https://github.com/istvancsabakis), see [#295](https://github.com/1up-lab/OneupUploaderBundle/pull/295))! Symfony 2.x support was dropped. You can also configure a file extension validation whitelist now (PR [#262](https://github.com/1up-lab/OneupUploaderBundle/pull/262)). diff --git a/composer.json b/composer.json index 000d258..f170b07 100644 --- a/composer.json +++ b/composer.json @@ -50,10 +50,11 @@ "doctrine/doctrine-bundle": "^2.4", "friendsofphp/php-cs-fixer": "^2.16", "knplabs/gaufrette": "^0.9", - "oneup/flysystem-bundle": "^1.2 || ^2.0 || ^3.0", + "oneup/flysystem-bundle": "^4.1", "phpstan/phpstan": "^0.12.10", "phpunit/phpunit": "^9.5", "sensio/framework-extra-bundle": "^5.0 || ^6.0", + "m2mtech/flysystem-stream-wrapper": "^1.0", "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0", "symfony/phpunit-bridge": "^5.4", "symfony/security-bundle": "^4.4 || ^5.4 || ^6.0", @@ -63,7 +64,7 @@ "suggest": { "knplabs/knp-gaufrette-bundle": "0.1.*", "oneup/flysystem-bundle": "^3.0", - "twistor/flysystem-stream-wrapper": "^1.0 (Required when using Flysystem)" + "m2mtech/flysystem-stream-wrapper": "^1.0 (Required when using Flysystem)" }, "config": { "sort-packages": true diff --git a/src/Uploader/Chunk/Storage/FlysystemStorage.php b/src/Uploader/Chunk/Storage/FlysystemStorage.php index 50d2d8b..9b3a642 100644 --- a/src/Uploader/Chunk/Storage/FlysystemStorage.php +++ b/src/Uploader/Chunk/Storage/FlysystemStorage.php @@ -4,9 +4,10 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Uploader\Chunk\Storage; -use League\Flysystem\FileNotFoundException; use League\Flysystem\Filesystem; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; +use League\Flysystem\StorageAttributes; use Oneup\UploaderBundle\Uploader\File\FlysystemFile; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -33,7 +34,7 @@ class FlysystemStorage implements ChunkStorageInterface protected $streamWrapperPrefix; /** - * @var Filesystem + * @var FilesystemOperator */ private $filesystem; @@ -58,6 +59,9 @@ class FlysystemStorage implements ChunkStorageInterface ]; } + /** + * @throws FilesystemException + */ public function clear(int $maxAge, string $prefix = null): void { $prefix = $prefix ?: $this->prefix; @@ -70,9 +74,10 @@ class FlysystemStorage implements ChunkStorageInterface // this also means the files inside are old // but after the files are deleted the dirs // would remain + /** @var StorageAttributes $key */ foreach ($matches as $key) { - $path = $key['path']; - $timestamp = $key['timestamp'] ?? $this->filesystem->getTimestamp($path); + $path = $key->path(); + $timestamp = $key->lastModified(); if ($maxAge <= $now - $timestamp) { $toDelete[] = $path; @@ -92,6 +97,8 @@ class FlysystemStorage implements ChunkStorageInterface /** * @param array $chunks + * + * @throws FilesystemException */ public function assembleChunks($chunks, bool $removeChunk, bool $renameChunk): FlysystemFile { @@ -132,42 +139,48 @@ class FlysystemStorage implements ChunkStorageInterface * the previous file is unaccessible by the user, but if it is not removed * it will block the user from trying to re-upload it. */ - if ($this->filesystem->has($path . $name)) { + if ($this->filesystem->fileExists($path . $name)) { $this->filesystem->delete($path . $name); } - $this->filesystem->rename($path . $target, $path . $name); + $this->filesystem->move($path . $target, $path . $name); $target = $name; } - /** @var FlysystemFile $uploaded */ - $uploaded = $this->filesystem->get($path . $target); - - if (!$renameChunk) { - return $uploaded; - } - - return new FlysystemFile($uploaded, $this->filesystem, $this->streamWrapperPrefix); + return new FlysystemFile($path . $target, $this->filesystem); } public function cleanup(string $path): void { try { $this->filesystem->delete($path); - } catch (FileNotFoundException $e) { + } catch (FilesystemException $e) { // File already gone. } } + /** + * @throws FilesystemException + */ public function getChunks(string $uuid): array { // Prevent path traversal attacks $uuid = basename($uuid); - return $this->filesystem->listFiles($this->prefix . '/' . $uuid); + return $this->filesystem->listContents($this->prefix . '/' . $uuid) + ->filter(function (StorageAttributes $attributes) { return $attributes->isFile(); }) + ->sortByPath() + ->map(function (StorageAttributes $attributes) { + return [ + 'path' => $attributes->path(), + 'type' => $attributes->type(), + 'timestamp' => $attributes->lastModified(), + 'size' => $this->filesystem->fileSize($attributes->path()), + ]; + })->toArray(); } - public function getFilesystem(): FilesystemInterface + public function getFilesystem(): FilesystemOperator { return $this->filesystem; } diff --git a/src/Uploader/File/FlysystemFile.php b/src/Uploader/File/FlysystemFile.php index 1324347..ab179a9 100644 --- a/src/Uploader/File/FlysystemFile.php +++ b/src/Uploader/File/FlysystemFile.php @@ -4,44 +4,60 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Uploader\File; -use League\Flysystem\File; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; -class FlysystemFile extends File implements FileInterface +class FlysystemFile implements FileInterface { - /** - * @var string|null - */ - protected $streamWrapperPrefix; + /** @var string */ + private $pathname; + + /** @var FilesystemOperator */ + private $filesystem; + + public function __construct(string $pathname, FilesystemOperator $filesystem) + { + $this->pathname = $pathname; + $this->filesystem = $filesystem; + } /** - * @var string + * @throws FilesystemException */ - protected $mimeType; + public function getSize(): int + { + return $this->filesystem->fileSize($this->pathname); + } - public function __construct(File $file, FilesystemInterface $filesystem, string $streamWrapperPrefix = null) + public function getPathname(): string { - parent::__construct($filesystem, $file->getPath()); + return $this->pathname; + } - $this->streamWrapperPrefix = $streamWrapperPrefix; + public function getPath(): string + { + return pathinfo($this->pathname, \PATHINFO_DIRNAME); } - public function getPathname(): string + /** + * @throws FilesystemException + */ + public function getMimeType(): string { - return $this->getPath(); + return $this->filesystem->mimeType($this->pathname); } public function getBasename(): string { - return pathinfo($this->getPath(), \PATHINFO_BASENAME); + return basename($this->pathname); } public function getExtension(): string { - return pathinfo($this->getPath(), \PATHINFO_EXTENSION); + return pathinfo($this->pathname, \PATHINFO_EXTENSION); } - public function getFilesystem(): FilesystemInterface + public function getFilesystem(): FilesystemOperator { return $this->filesystem; } diff --git a/src/Uploader/Storage/FlysystemOrphanageStorage.php b/src/Uploader/Storage/FlysystemOrphanageStorage.php index aedc716..49307c8 100644 --- a/src/Uploader/Storage/FlysystemOrphanageStorage.php +++ b/src/Uploader/Storage/FlysystemOrphanageStorage.php @@ -4,7 +4,8 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Uploader\Storage; -use League\Flysystem\File; +use League\Flysystem\FilesystemException; +use League\Flysystem\StorageAttributes; use Oneup\UploaderBundle\Uploader\Chunk\Storage\FlysystemStorage as ChunkStorage; use Oneup\UploaderBundle\Uploader\File\FileInterface; use Oneup\UploaderBundle\Uploader\File\FlysystemFile; @@ -61,6 +62,8 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto /** * @param FileInterface|SymfonyFile $file * + * @throws FilesystemException + * * @return FileInterface|SymfonyFile */ public function upload($file, string $name, string $path = null) @@ -72,6 +75,9 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto return parent::upload($file, $name, $this->getPath()); } + /** + * @throws FilesystemException + */ public function uploadFiles(array $files = null): array { try { @@ -95,6 +101,9 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto } } + /** + * @throws FilesystemException + */ public function getFiles(): array { $fileList = $this->chunkStorage @@ -102,13 +111,11 @@ class FlysystemOrphanageStorage extends FlysystemStorage implements OrphanageSto ->listContents($this->getPath()); $files = []; + /** @var StorageAttributes $fileDetail */ foreach ($fileList as $fileDetail) { - $key = $fileDetail['path']; - if ('file' === $fileDetail['type']) { - $files[$key] = new FlysystemFile( - new File($this->chunkStorage->getFilesystem(), $key), - $this->chunkStorage->getFilesystem() - ); + $key = $fileDetail->path(); + if ($fileDetail->isFile()) { + $files[$key] = new FlysystemFile($key, $this->chunkStorage->getFilesystem()); } } diff --git a/src/Uploader/Storage/FlysystemStorage.php b/src/Uploader/Storage/FlysystemStorage.php index 8b0040e..854757d 100644 --- a/src/Uploader/Storage/FlysystemStorage.php +++ b/src/Uploader/Storage/FlysystemStorage.php @@ -4,13 +4,12 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Uploader\Storage; -use League\Flysystem\File; -use League\Flysystem\FilesystemInterface; +use League\Flysystem\FilesystemException; +use League\Flysystem\FilesystemOperator; use League\Flysystem\MountManager; use Oneup\UploaderBundle\Uploader\File\FileInterface; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; use Oneup\UploaderBundle\Uploader\File\FlysystemFile; -use Symfony\Component\Filesystem\Filesystem as LocalFilesystem; use Symfony\Component\HttpFoundation\File\File as SymfonyFile; class FlysystemStorage implements StorageInterface @@ -26,11 +25,11 @@ class FlysystemStorage implements StorageInterface protected $bufferSize; /** - * @var FilesystemInterface + * @var FilesystemOperator */ private $filesystem; - public function __construct(FilesystemInterface $filesystem, int $bufferSize, ?string $streamWrapperPrefix = null) + public function __construct(FilesystemOperator $filesystem, int $bufferSize, ?string $streamWrapperPrefix = null) { $this->filesystem = $filesystem; $this->bufferSize = $bufferSize; @@ -40,6 +39,8 @@ class FlysystemStorage implements StorageInterface /** * @param FileInterface|SymfonyFile $file * + * @throws FilesystemException + * * @return FileInterface|SymfonyFile */ public function upload($file, string $name, string $path = null) @@ -50,7 +51,7 @@ class FlysystemStorage implements StorageInterface /** @var resource $stream */ $stream = fopen($file->getPathname(), 'r+'); - $this->filesystem->putStream($path, $stream, [ + $this->filesystem->writeStream($path, $stream, [ 'mimetype' => $file->getMimeType(), ]); @@ -58,22 +59,17 @@ class FlysystemStorage implements StorageInterface fclose($stream); } - $filesystem = new LocalFilesystem(); - $filesystem->remove($file->getPathname()); + $resultFile = new FlysystemFile($path, $this->filesystem); - /** @var File $file */ - $file = $this->filesystem->get($path); + unlink($file->getPathname()); - return new FlysystemFile($file, $this->filesystem, $this->streamWrapperPrefix); + return $resultFile; } if ($file instanceof FlysystemFile && $file->getFilesystem() === $this->filesystem) { - $file->getFilesystem()->rename($file->getPath(), $path); - - /** @var File $file */ - $file = $this->filesystem->get($path); + $file->getFilesystem()->move($file->getPathname(), $path); - return new FlysystemFile($file, $this->filesystem, $this->streamWrapperPrefix); + return new FlysystemFile($path, $this->filesystem); } if ($file instanceof FileInterface) { @@ -82,12 +78,9 @@ class FlysystemStorage implements StorageInterface 'dest' => $this->filesystem, ]); - $manager->move(sprintf('chunks://%s', $file->getPathname()), sprintf('dest://%s', $path)); + $manager->move('chunks://' . $file->getPathname(), 'dest://' . $path); } - /** @var File $file */ - $file = $this->filesystem->get($path); - - return new FlysystemFile($file, $this->filesystem, $this->streamWrapperPrefix); + return new FlysystemFile($path, $this->filesystem); } } diff --git a/tests/Uploader/Chunk/Storage/FlysystemStorageTest.php b/tests/Uploader/Chunk/Storage/FlysystemStorageTest.php index c96f558..a3ba11c 100644 --- a/tests/Uploader/Chunk/Storage/FlysystemStorageTest.php +++ b/tests/Uploader/Chunk/Storage/FlysystemStorageTest.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Tests\Uploader\Chunk\Storage; -use League\Flysystem\Adapter\Local as Adapter; use League\Flysystem\Filesystem as LeagueFilesystem; -use League\Flysystem\Plugin\ListFiles; +use League\Flysystem\FilesystemException; +use League\Flysystem\Local\LocalFilesystemAdapter as Adapter; +use M2MTech\FlysystemStreamWrapper\FlysystemStreamWrapper; use Oneup\UploaderBundle\Uploader\Chunk\Storage\FlysystemStorage; use Symfony\Component\Filesystem\Filesystem; -use Twistor\FlysystemStreamWrapper; class FlysystemStorageTest extends ChunkStorageTest { @@ -41,7 +41,6 @@ class FlysystemStorageTest extends ChunkStorageTest $adapter = new Adapter($this->parentDir); $filesystem = new LeagueFilesystem($adapter); - $filesystem->addPlugin(new ListFiles()); FlysystemStreamWrapper::register('tests', $filesystem); @@ -58,4 +57,30 @@ class FlysystemStorageTest extends ChunkStorageTest FlysystemStreamWrapper::unregister('tests'); } + + /** + * @throws FilesystemException + */ + public function testGetChunks(): void + { + $uuid = uniqid('', true); + $dir = $this->tmpDir . '/' . $uuid; + $system = new Filesystem(); + $system->mkdir($dir); + $timeFrom = time(); + $system->mkdir($dir . '/shouldNotBeListed'); + $system->dumpFile($dir . '/chunk1', 'test'); + $system->dumpFile($dir . '/chunk2', 'test'); + $system->dumpFile($dir . '/chunk3', 'test'); + $timeTo = time(); + + $files = $this->storage->getChunks($uuid); + $this->assertCount(3, $files); + $file = $files[0]; + $this->assertSame($this->chunkKey . '/' . $uuid . '/chunk1', $file['path']); + $this->assertSame('file', $file['type']); + $this->assertGreaterThanOrEqual($timeFrom, $file['timestamp']); + $this->assertLessThanOrEqual($timeTo, $file['timestamp']); + $this->assertSame(4, $file['size']); + } } diff --git a/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php b/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php index f8ed31d..764d943 100644 --- a/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php +++ b/tests/Uploader/Storage/FlysystemOrphanageStorageTest.php @@ -4,9 +4,10 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Tests\Uploader\Storage; -use League\Flysystem\Adapter\Local as Adapter; -use League\Flysystem\File; use League\Flysystem\Filesystem as FSAdapter; +use League\Flysystem\FilesystemException; +use League\Flysystem\Local\LocalFilesystemAdapter as Adapter; +use M2MTech\FlysystemStreamWrapper\FlysystemStreamWrapper; use Oneup\UploaderBundle\Uploader\Chunk\Storage\FlysystemStorage as ChunkStorage; use Oneup\UploaderBundle\Uploader\File\FlysystemFile; use Oneup\UploaderBundle\Uploader\Storage\FlysystemOrphanageStorage; @@ -17,7 +18,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Twistor\FlysystemStreamWrapper; class FlysystemOrphanageStorageTest extends OrphanageTest { @@ -85,7 +85,7 @@ class FlysystemOrphanageStorageTest extends OrphanageTest // It seems that tempnam on OS X prepends 'private' to chunkDirectory, so strip that off as well $fileKey = str_replace([$this->realDirectory, '/private'], '', $file); - $this->payloads[] = new FlysystemFile(new File($filesystem, $fileKey), $filesystem); + $this->payloads[] = new FlysystemFile($fileKey, $filesystem); } } @@ -96,6 +96,9 @@ class FlysystemOrphanageStorageTest extends OrphanageTest FlysystemStreamWrapper::unregister('tests'); } + /** + * @throws FilesystemException + */ public function testUpload(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { @@ -112,6 +115,9 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $this->assertCount(0, $finder); } + /** + * @throws FilesystemException + */ public function testUploadAndFetching(): void { for ($i = 0; $i < $this->numberOfPayloads; ++$i) { @@ -139,4 +145,25 @@ class FlysystemOrphanageStorageTest extends OrphanageTest $finder->in($this->realDirectory)->files(); $this->assertCount($this->numberOfPayloads, $finder); } + + /** + * @throws FilesystemException + */ + public function testGetFiles(): void + { + for ($i = 0; $i < $this->numberOfPayloads; ++$i) { + $this->orphanage->upload($this->payloads[$i], $i . 'notsogrumpyanymore.jpeg'); + } + + if (!$this->orphanage instanceof FlysystemOrphanageStorage) { + $this->fail(); + } + $files = $this->orphanage->getFiles(); + $this->assertCount(5, $files); + + $key = key($files); + $file = $files[$key]; + $this->assertSame($key, $file->getPathname()); + $this->assertSame(1024, $file->getSize()); + } } diff --git a/tests/Uploader/Storage/FlysystemStorageTest.php b/tests/Uploader/Storage/FlysystemStorageTest.php index 42e6b1f..4205ea4 100644 --- a/tests/Uploader/Storage/FlysystemStorageTest.php +++ b/tests/Uploader/Storage/FlysystemStorageTest.php @@ -4,9 +4,11 @@ declare(strict_types=1); namespace Oneup\UploaderBundle\Tests\Uploader\Storage; -use League\Flysystem\Adapter\Local as Adapter; use League\Flysystem\Filesystem as FSAdapter; +use League\Flysystem\FilesystemException; +use League\Flysystem\Local\LocalFilesystemAdapter as Adapter; use Oneup\UploaderBundle\Uploader\File\FilesystemFile; +use Oneup\UploaderBundle\Uploader\File\FlysystemFile; use Oneup\UploaderBundle\Uploader\Storage\FlysystemStorage as Storage; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; @@ -30,6 +32,9 @@ class FlysystemStorageTest extends TestCase */ protected $file; + /** @var FSAdapter */ + protected $filesystem; + protected function setUp(): void { $this->directory = sys_get_temp_dir() . '/storage'; @@ -44,9 +49,9 @@ class FlysystemStorageTest extends TestCase fclose($pointer); $adapter = new Adapter($this->directory); - $filesystem = new FSAdapter($adapter); + $this->filesystem = new FSAdapter($adapter); - $this->storage = new Storage($filesystem, 100000); + $this->storage = new Storage($this->filesystem, 100000); } protected function tearDown(): void @@ -55,12 +60,18 @@ class FlysystemStorageTest extends TestCase $filesystem->remove($this->directory); } + /** + * @throws FilesystemException + */ public function testUpload(): void { $uploadedFile = new UploadedFile($this->file, 'grumpycat.jpeg', null, null, true); $payload = new FilesystemFile($uploadedFile); - $this->storage->upload($payload, 'notsogrumpyanymore.jpeg'); + $file = $this->storage->upload($payload, 'notsogrumpyanymore.jpeg'); + $this->assertInstanceOf(FlysystemFile::class, $file); + $this->assertSame('notsogrumpyanymore.jpeg', $file->getPathname()); + $this->assertSame(1024, $file->getSize()); $finder = new Finder(); $finder->in($this->directory)->files(); @@ -73,12 +84,18 @@ class FlysystemStorageTest extends TestCase } } + /** + * @throws FilesystemException + */ public function testUploadWithPath(): void { $uploadedFile = new UploadedFile($this->file, 'grumpycat.jpeg', null, null, true); $payload = new FilesystemFile($uploadedFile); - $this->storage->upload($payload, 'notsogrumpyanymore.jpeg', 'cat'); + $file = $this->storage->upload($payload, 'notsogrumpyanymore.jpeg', 'cat'); + $this->assertInstanceOf(FlysystemFile::class, $file); + $this->assertSame('cat/notsogrumpyanymore.jpeg', $file->getPathname()); + $this->assertSame(1024, $file->getSize()); $finder = new Finder(); $finder->in($this->directory)->files(); @@ -86,8 +103,42 @@ class FlysystemStorageTest extends TestCase $this->assertCount(1, $finder); foreach ($finder as $file) { + $this->assertStringEndsWith('cat', $file->getPath()); $this->assertSame($file->getFilename(), 'notsogrumpyanymore.jpeg'); $this->assertSame($file->getSize(), 1024); } } + + public function testUploadFlysystemFile(): void + { + $tempFileName = basename($this->file); + $localPath = $this->directory . '/' . $tempFileName; + $flysystemFile = new FlysystemFile($tempFileName, $this->filesystem); + copy($this->file, $localPath); + $this->assertFileExists($localPath); + + $file = $this->storage->upload($flysystemFile, 'final.jpg'); + $this->assertInstanceOf(FlysystemFile::class, $file); + $this->assertSame('final.jpg', $file->getPathname()); + $this->assertSame(1024, $file->getSize()); + + $this->assertFileDoesNotExist($localPath); + $this->assertFileExists($this->directory . '/final.jpg'); + } + + public function testUploadFlysystemFileFromDifferentFilesystem(): void + { + $adapter = new Adapter(sys_get_temp_dir()); + $filesystem = new FSAdapter($adapter); + + $flysystemFile = new FlysystemFile(basename($this->file), $filesystem); + + $file = $this->storage->upload($flysystemFile, 'final.jpg'); + $this->assertInstanceOf(FlysystemFile::class, $file); + $this->assertSame('final.jpg', $file->getPathname()); + $this->assertSame(1024, $file->getSize()); + + $this->assertFileDoesNotExist($this->file); + $this->assertFileExists($this->directory . '/final.jpg'); + } }
0
fd081007887586f13ab15c35c2f7007c05bdacc3
1up-lab/OneupUploaderBundle
Documented chunked uploads.
commit fd081007887586f13ab15c35c2f7007c05bdacc3 Author: Jim Schmid <[email protected]> Date: Sun Apr 7 13:25:56 2013 +0200 Documented chunked uploads. diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md new file mode 100644 index 0000000..c4b7861 --- /dev/null +++ b/Resources/doc/chunked_uploads.md @@ -0,0 +1,24 @@ +Using Chunked Uploads +===================== + +Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabed, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. + +```js +$(document).ready(function() +{ + var uploader = new qq.FineUploader({ + element: document.getElementById('uploader'), + request: { + endpoint: "{{ path('_uploader_gallery') }}" + }, + chunking: { + enabled: true, + partSize: 10000000 + } + }); +}); +``` + +The `partSize` property defines the maximum size of a blob, in this case 10MB. + +> Be sure to select a partSize that fits your requirement. If it is too small, the speed of the overall upload drops significantly. \ No newline at end of file diff --git a/Resources/doc/index.md b/Resources/doc/index.md index 85994bd..574d337 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -102,7 +102,7 @@ This is of course a very minimal setup. Be sure to include stylesheets for Fine After installing and setting up the basic functionality of this bundle you can move on and integrate some more advanced features. -* Enable chunked uploads +* [Enable chunked uploads](chunked_uploads.md) * Using the Orphanage * Use Gaufrette as storage layer * Include your own Namer
0
4769708e0d1ba25f354c309cf542768e14e7a730
1up-lab/OneupUploaderBundle
fix non-chunked uploads and improve extension handling
commit 4769708e0d1ba25f354c309cf542768e14e7a730 Author: mitom <[email protected]> Date: Thu Oct 10 14:09:58 2013 +0200 fix non-chunked uploads and improve extension handling diff --git a/Controller/AbstractChunkedController.php b/Controller/AbstractChunkedController.php index 2678a66..0b92d58 100644 --- a/Controller/AbstractChunkedController.php +++ b/Controller/AbstractChunkedController.php @@ -73,7 +73,6 @@ abstract class AbstractChunkedController extends AbstractController $path = $assembled->getPath(); - // create a temporary uploaded file to meet the interface restrictions $this->handleUpload($assembled, $response, $request); $chunkManager->cleanup($path); diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index aea039e..6d5f0b4 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -3,6 +3,7 @@ namespace Oneup\UploaderBundle\Controller; use Oneup\UploaderBundle\Uploader\File\FileInterface; +use Oneup\UploaderBundle\Uploader\File\FilesystemFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -100,12 +101,18 @@ abstract class AbstractController * * Note: The return value differs when * - * @param UploadedFile The file to upload + * @param The file to upload * @param response A response object. * @param request The request object. */ - protected function handleUpload(FileInterface $file, ResponseInterface $response, Request $request) + protected function handleUpload($file, ResponseInterface $response, Request $request) { + // wrap the file if it is not done yet which can only happen + // if it wasn't a chunked upload, in which case it is definitely + // on the local filesystem. + if (!($file instanceof FileInterface)) { + $file = new FilesystemFile($file); + } $this->validate($file); $this->dispatchPreUploadEvent($file, $response, $request); diff --git a/Uploader/File/FilesystemFile.php b/Uploader/File/FilesystemFile.php index f30d028..c24ba28 100644 --- a/Uploader/File/FilesystemFile.php +++ b/Uploader/File/FilesystemFile.php @@ -6,10 +6,17 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class FilesystemFile extends UploadedFile implements FileInterface { - protected $file; public function __construct(UploadedFile $file) { - $this->file = $file; parent::__construct($file->getPathname(), $file->getClientOriginalName(), $file->getClientMimeType(), $file->getClientSize(), $file->getError(), true); + + } + + public function getExtension() + { + // If the file is in tmp, it has no extension, but the wrapper object + // will have the original extension, otherwise it is better to rely + // on the actual extension + return parent::getExtension() ? :$this->getClientOriginalExtension(); } } diff --git a/Uploader/Storage/GaufretteStorage.php b/Uploader/Storage/GaufretteStorage.php index 315b92b..c376167 100644 --- a/Uploader/Storage/GaufretteStorage.php +++ b/Uploader/Storage/GaufretteStorage.php @@ -35,7 +35,7 @@ class GaufretteStorage extends StreamManager implements StorageInterface } } - $this->ensureRemotePathExists($path.$name); + $this->ensureRemotePathExists($path); $dst = $this->filesystem->createStream($path); $this->openStream($dst, 'w');
0
b8811ba876cb7634cc4238fb1463890f4a6de26c
1up-lab/OneupUploaderBundle
Documented new Twig function.
commit b8811ba876cb7634cc4238fb1463890f4a6de26c Author: Jim Schmid <[email protected]> Date: Fri Apr 12 18:18:39 2013 +0200 Documented new Twig function. diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index af3b780..d649a14 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -9,7 +9,7 @@ $(document).ready(function() var uploader = new qq.FineUploader({ element: document.getElementById('uploader'), request: { - endpoint: "{{ path('_uploader_gallery') }}" + endpoint: "{{ oneup_uploader_endpoint('gallery') }}" }, chunking: { enabled: true, diff --git a/Resources/doc/custom_logic.md b/Resources/doc/custom_logic.md index 741e1f2..84af61e 100644 --- a/Resources/doc/custom_logic.md +++ b/Resources/doc/custom_logic.md @@ -48,7 +48,7 @@ FineUploader supports passing custom data through the request as the following e var uploader = new qq.FineUploader({ element: document.getElementById('fine-uploader'), request: { - endpoint: "{{ path('_uploader_gallery') }}", + endpoint: "{{ oneup_uploader_endpoint('gallery') }}", params: { gallery: "{{ gallery.id }}" } diff --git a/Resources/doc/frontend_blueimp.md b/Resources/doc/frontend_blueimp.md index 453dd54..f6935c2 100644 --- a/Resources/doc/frontend_blueimp.md +++ b/Resources/doc/frontend_blueimp.md @@ -15,7 +15,7 @@ $(document).ready(function() }); </script> -<input id="fileupload" type="file" name="files[]" data-url="{{ path('_uploader_gallery') }}" multiple /> +<input id="fileupload" type="file" name="files[]" data-url="{{ oneup_uploader_endpoint('gallery') }}" multiple /> ``` Configure the OneupUploaderBundle to use the correct controller: diff --git a/Resources/doc/frontend_fancyupload.md b/Resources/doc/frontend_fancyupload.md index da918c2..02bef21 100644 --- a/Resources/doc/frontend_fancyupload.md +++ b/Resources/doc/frontend_fancyupload.md @@ -59,7 +59,7 @@ window.addEvent('domready', function() </script> -<form action="{{ path('_uploader_gallery') }}" method="post" enctype="multipart/form-data" id="form-demo"> +<form action="{{ oneup_uploader_endpoint('gallery') }}" method="post" enctype="multipart/form-data" id="form-demo"> <fieldset id="demo-fallback"> <legend>File Upload</legend> <p> diff --git a/Resources/doc/frontend_fineuploader.md b/Resources/doc/frontend_fineuploader.md index dbe3d67..91a0f77 100644 --- a/Resources/doc/frontend_fineuploader.md +++ b/Resources/doc/frontend_fineuploader.md @@ -12,7 +12,7 @@ $(document).ready(function() var uploader = new qq.FineUploader({ element: $('#uploader'), request: { - endpoint: "{{ path('_uploader_gallery') }}" + endpoint: "{{ oneup_uploader_endpoint('gallery') }}" } }); }); diff --git a/Resources/doc/frontend_mooupload.md b/Resources/doc/frontend_mooupload.md index 5dfa4cb..5c31868 100644 --- a/Resources/doc/frontend_mooupload.md +++ b/Resources/doc/frontend_mooupload.md @@ -12,7 +12,7 @@ window.addEvent("domready", function() { var myUpload = new MooUpload("fileupload", { - action: "{{ path('_uploader_gallery') }}", + action: "{{ oneup_uploader_endpoint('gallery') }}", method: "auto" }); }); diff --git a/Resources/doc/frontend_plupload.md b/Resources/doc/frontend_plupload.md index b27657c..34c1dc5 100644 --- a/Resources/doc/frontend_plupload.md +++ b/Resources/doc/frontend_plupload.md @@ -16,7 +16,7 @@ $(document).ready(function() $("#fileupload").plupload( { runtimes: "html5", - url: "{{ path('_uploader_gallery') }}" + url: "{{ oneup_uploader_endpoint('gallery') }}" }); }); </script> diff --git a/Resources/doc/frontend_uploadify.md b/Resources/doc/frontend_uploadify.md index e84c7d5..072f22c 100644 --- a/Resources/doc/frontend_uploadify.md +++ b/Resources/doc/frontend_uploadify.md @@ -14,7 +14,7 @@ $(document).ready(function() $('#fileupload').uploadify( { swf: "{{ asset('bundles/acmedemo/js/uploadify.swf') }}", - uploader: "{{ path('_uploader_gallery') }}" + uploader: "{{ oneup_uploader_endpoint('gallery') }}" }); }); diff --git a/Resources/doc/frontend_yui3.md b/Resources/doc/frontend_yui3.md index 5b267fd..88e9e4c 100644 --- a/Resources/doc/frontend_yui3.md +++ b/Resources/doc/frontend_yui3.md @@ -11,7 +11,7 @@ YUI().use('uploader', function (Y) { var uploader = new Y.Uploader( { multipleFiles: true, - uploadURL: "{{ path('_uploader_gallery') }}" + uploadURL: "{{ oneup_uploader_endpoint('gallery') }}" }).render("#fileupload"); uploader.on('fileselect', function() diff --git a/Resources/doc/index.md b/Resources/doc/index.md index cb24aa1..5a3bb15 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -86,9 +86,16 @@ oneup_uploader: ### Step 4: Prepare your frontend -Currently the OneupUploaderBundle supports four different kind of frontends. ([FineUploader](http://fineuploader.com/), [jQuery File Uploader](http://blueimp.github.io/jQuery-File-Upload/), [YUI3 Uploader](http://yuilibrary.com/yui/docs/uploader/), [Uploadify](http://www.uploadify.com/)) No matter what library you choose, be sure to connect the corresponding endpoint property to the dynamic route created from your mapping. It has the following form: +Currently the OneupUploaderBundle supports four different kind of frontends. ([FineUploader](http://fineuploader.com/), [jQuery File Uploader](http://blueimp.github.io/jQuery-File-Upload/), [YUI3 Uploader](http://yuilibrary.com/yui/docs/uploader/), [Uploadify](http://www.uploadify.com/)) No matter what library you choose, be sure to connect the corresponding endpoint property to the dynamic route created from your mapping. To get a url for a specific mapping you can use the `oneup_uploader.templating.uploader_helper` service as follows: - _uploader_{mapping_key} +```php +$helper = $this->container->get('oneup_uploader.templating.uploader_helper'); +$endpoint = $helper->endpoint('gallery'); +``` + +or in a Twig template you can use the `oneup_uploader_endpoint` function: + + {{ oneup_uploader_endpoint('gallery') }} So if you take the mapping described before, the generated route name would be `_uploader_gallery`. Follow one of the listed guides to include your frontend:
0
b0e8666cbfe5a21cb3c9825bcdf7de02e2d3a4d5
1up-lab/OneupUploaderBundle
Renamed chunk_manager to chunks To match the DI configuration
commit b0e8666cbfe5a21cb3c9825bcdf7de02e2d3a4d5 Author: Dirk Luijk <[email protected]> Date: Wed Jul 24 15:45:06 2013 +0200 Renamed chunk_manager to chunks To match the DI configuration diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index d649a14..4f5c5e1 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -29,7 +29,7 @@ You can configure the `ChunkManager` by using the following configuration parame ``` oneup_uploader: - chunk_manager: + chunks: maxage: 86400 directory: %kernel.cache_dir%/uploader/chunks ```
0
0fe09da6f001b463f7b0ffe5ac54800f6acf42cd
1up-lab/OneupUploaderBundle
Fixed a link in the README where I was pointing to the doc/index.md instead of the doc/custom_uploader.md file.
commit 0fe09da6f001b463f7b0ffe5ac54800f6acf42cd Author: Jim Schmid <[email protected]> Date: Thu Apr 18 18:40:07 2013 +0200 Fixed a link in the README where I was pointing to the doc/index.md instead of the doc/custom_uploader.md file. diff --git a/README.md b/README.md index 12b3dc7..1e702c7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ OneupUploaderBundle =================== -The OneupUploaderBundle for Symfony2 adds support for handling file uploads using one of the following Javascript libraries, or [your own implementation](https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/index.md). +The OneupUploaderBundle for Symfony2 adds support for handling file uploads using one of the following Javascript libraries, or [your own implementation](https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/custom_uploader.md). * [FineUploader](http://fineuploader.com/) * [jQuery File Uploader](http://blueimp.github.io/jQuery-File-Upload/)
0
88ae15b1a4e51f0df78394697e7f01bb36e6789d
1up-lab/OneupUploaderBundle
Updated documented version to install Issued in: #113
commit 88ae15b1a4e51f0df78394697e7f01bb36e6789d Author: Jim Schmid <[email protected]> Date: Wed Jun 25 13:42:39 2014 +0200 Updated documented version to install Issued in: #113 diff --git a/Resources/doc/index.md b/Resources/doc/index.md index e9469ad..2e90a51 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -34,7 +34,7 @@ Add OneupUploaderBundle to your composer.json using the following construct: ```js { "require": { - "oneup/uploader-bundle": "1.0.*@dev" + "oneup/uploader-bundle": "~1.3" } } ```
0
34bb6417558e151386e1d416024bf41f65f0cd40
1up-lab/OneupUploaderBundle
Increased phpunit version to fix travis build.
commit 34bb6417558e151386e1d416024bf41f65f0cd40 Author: Jim Schmid <[email protected]> Date: Wed Jun 25 13:54:53 2014 +0200 Increased phpunit version to fix travis build. diff --git a/composer.json b/composer.json index a6be9f8..aa66e5d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/security-bundle": "2.*", "sensio/framework-extra-bundle": "2.*", "symfony/browser-kit": "2.*", - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "~4.1" }, "suggest": {
0
14b855d0cbc38e3b19c0992623749f542dbe309b
1up-lab/OneupUploaderBundle
Renamed validation.xml to validator.xml as otherwise the DTD parse fails.
commit 14b855d0cbc38e3b19c0992623749f542dbe309b Author: Jim Schmid <[email protected]> Date: Tue Apr 23 15:15:01 2013 +0200 Renamed validation.xml to validator.xml as otherwise the DTD parse fails. diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 81804fc..c8acf0a 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -22,7 +22,7 @@ class OneupUploaderExtension extends Extension $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('uploader.xml'); $loader->load('templating.xml'); - $loader->load('validation.xml'); + $loader->load('validators.xml'); if($config['twig']) { diff --git a/Resources/config/validation.xml b/Resources/config/validators.xml similarity index 100% rename from Resources/config/validation.xml rename to Resources/config/validators.xml
0
cb9e36c8873f69ad207a28516d239c8b511e2f16
1up-lab/OneupUploaderBundle
Remove metric suffix from input Eliminates notice on php 7.1 caused by invalid string in arithmetic
commit cb9e36c8873f69ad207a28516d239c8b511e2f16 Author: Bronisław Białek <[email protected]> Date: Sat Oct 8 13:42:36 2016 +0200 Remove metric suffix from input Eliminates notice on php 7.1 caused by invalid string in arithmetic diff --git a/DependencyInjection/OneupUploaderExtension.php b/DependencyInjection/OneupUploaderExtension.php index 5ffbe09..0d472ff 100644 --- a/DependencyInjection/OneupUploaderExtension.php +++ b/DependencyInjection/OneupUploaderExtension.php @@ -294,11 +294,14 @@ class OneupUploaderExtension extends Extension // see: http://www.php.net/manual/en/function.ini-get.php $input = trim($input); $last = strtolower($input[strlen($input) - 1]); + $numericInput = substr($input, 0, -1); switch ($last) { - case 'g': $input *= 1024; - case 'm': $input *= 1024; - case 'k': $input *= 1024; + case 'g': $numericInput *= 1024; + case 'm': $numericInput *= 1024; + case 'k': $numericInput *= 1024; + + return $numericInput; } return $input;
0
6a7158e0174adac36daae74e9fca822cc7b52d4c
1up-lab/OneupUploaderBundle
Added test setup including a dummy test for travis tests.
commit 6a7158e0174adac36daae74e9fca822cc7b52d4c Author: Jim Schmid <[email protected]> Date: Fri Mar 8 18:53:49 2013 +0100 Added test setup including a dummy test for travis tests. diff --git a/.gitignore b/.gitignore index 19982ea..e1c36a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ composer.lock +phpunit.xml vendor \ No newline at end of file diff --git a/Tests/DependencyInjection/OneupUploaderExtensionTest.php b/Tests/DependencyInjection/OneupUploaderExtensionTest.php new file mode 100644 index 0000000..b713e61 --- /dev/null +++ b/Tests/DependencyInjection/OneupUploaderExtensionTest.php @@ -0,0 +1,11 @@ +<?php + +namespace Oneup\UploaderBundle\Tests\DependencyInjection; + +class OneupUploaderExtensionTest extends \PHPUnit_Framework_TestCase +{ + public function testDummyForSetup() + { + $this->assertTrue(true); + } +} \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..b34158b --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit colors="true"> + + <testsuites> + <testsuite name="OneupUploaderBundle test suite"> + <directory suffix="Test.php">./Tests</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>./</directory> + <exclude> + <directory>./Resources</directory> + <directory>./Tests</directory> + </exclude> + </whitelist> + </filter> +</phpunit> \ No newline at end of file
0
49e3a2c29af4cf893c4d6295d6d2b60e0b636ef2
1up-lab/OneupUploaderBundle
Added FancyUpload to list on README.md
commit 49e3a2c29af4cf893c4d6295d6d2b60e0b636ef2 Author: Jim Schmid <[email protected]> Date: Thu Apr 11 22:46:05 2013 +0200 Added FancyUpload to list on README.md diff --git a/README.md b/README.md index f87ca55..dea7969 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ The OneupUploaderBundle adds support for handling file uploads using one of the * [jQuery File Uploader](http://blueimp.github.io/jQuery-File-Upload/) * [YUI3 Uploader](http://yuilibrary.com/yui/docs/uploader/) * [Uploadify](http://www.uploadify.com/) +* [FancyUpload](http://digitarald.de/project/fancyupload/) Features included:
0
c965c77eb68b7146ccd274d30a2e2fabf07a394e
1up-lab/OneupUploaderBundle
Register POST_DELETE Event (whops) and dispatch the correct one.
commit c965c77eb68b7146ccd274d30a2e2fabf07a394e Author: Jim Schmid <[email protected]> Date: Thu Mar 14 20:16:20 2013 +0100 Register POST_DELETE Event (whops) and dispatch the correct one. diff --git a/Controller/UploaderController.php b/Controller/UploaderController.php index ddd87ea..0d103a5 100644 --- a/Controller/UploaderController.php +++ b/Controller/UploaderController.php @@ -13,6 +13,7 @@ use Symfony\Component\Finder\Finder; use Oneup\UploaderBundle\UploadEvents; use Oneup\UploaderBundle\Event\PostPersistEvent; use Oneup\UploaderBundle\Event\PostUploadEvent; +use Oneup\UploaderBundle\Event\PostDeleteEvent; use Oneup\UploaderBundle\Controller\UploadControllerInterface; use Oneup\UploaderBundle\Uploader\Naming\NamerInterface; use Oneup\UploaderBundle\Uploader\Storage\StorageInterface; @@ -72,10 +73,10 @@ class UploaderController implements UploadControllerInterface if($result) { - $postUploadEvent = new PostUploadEvent($this->request, $uuid, $this->type); - $this->dispatcher->dispatch(UploadEvents::POST_UPLOAD, $postUploadEvent); + $postUploadEvent = new PostDeleteEvent($this->request, $uuid, $this->type); + $this->dispatcher->dispatch(UploadEvents::POST_DELETE, $postUploadEvent); - return new JsonResponse(array('success' => true)): + return new JsonResponse(array('success' => true)); } return new JsonResponse(array('error' => 'An unknown error occured.')); diff --git a/UploadEvents.php b/UploadEvents.php index 6a9967b..f272c9d 100644 --- a/UploadEvents.php +++ b/UploadEvents.php @@ -6,4 +6,5 @@ final class UploadEvents { const POST_PERSIST = 'oneup.uploader.post.persist'; const POST_UPLOAD = 'oneup.uploader.post.upload'; + const POST_DELETE = 'oneup.uploader.post.delete'; } \ No newline at end of file
0
453e2f216418e48b93f70c0b40bcb9a66c488001
1up-lab/OneupUploaderBundle
Merge pull request #218 from JHGitty/patch-4 Improve installation steps
commit 453e2f216418e48b93f70c0b40bcb9a66c488001 (from 2f9cd2b4dd6a67a93ca49b9cc5c7c9aab8bd6fba) Merge: 2f9cd2b eae52b2 Author: Jim Schmid <[email protected]> Date: Mon Feb 8 08:29:23 2016 +0100 Merge pull request #218 from JHGitty/patch-4 Improve installation steps diff --git a/Resources/doc/index.md b/Resources/doc/index.md index 4178e9e..39ab715 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -34,19 +34,9 @@ Perform the following steps to install and use the basic functionality of the On Add OneupUploaderBundle to your composer.json using the following construct: -```js -{ - "require": { - "oneup/uploader-bundle": "~1.4" - } -} -``` - -Now tell composer to download the bundle by running the following command: - - $> php composer.phar update oneup/uploader-bundle + $ composer require oneup/uploader-bundle "~1.4" -Composer will now fetch and install this bundle in the vendor directory ```vendor/oneup``` +Composer will install the bundle to your project's ``vendor/oneup/uploader-bundle`` directory. ### Step 2: Enable the bundle commit 453e2f216418e48b93f70c0b40bcb9a66c488001 (from eae52b2c241977c0b10994aeeccc88a8ecdb0335) Merge: 2f9cd2b eae52b2 Author: Jim Schmid <[email protected]> Date: Mon Feb 8 08:29:23 2016 +0100 Merge pull request #218 from JHGitty/patch-4 Improve installation steps diff --git a/Resources/doc/chunked_uploads.md b/Resources/doc/chunked_uploads.md index fd6d87a..c577309 100644 --- a/Resources/doc/chunked_uploads.md +++ b/Resources/doc/chunked_uploads.md @@ -1,7 +1,7 @@ Using Chunked Uploads ===================== -Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabed, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. +Fine Uploader comes bundled with the possibility to use so called chunked uploads. If enabled, an uploaded file will be split into equal sized blobs which are sequentially uploaded afterwards. In order to use this feature, be sure to enable it in the frontend. ```js $(document).ready(function() diff --git a/Resources/doc/custom_namer.md b/Resources/doc/custom_namer.md index c83002d..0d9dc17 100644 --- a/Resources/doc/custom_namer.md +++ b/Resources/doc/custom_namer.md @@ -24,7 +24,7 @@ class CatNamer implements NamerInterface } ``` -To match the `NamerInterface` you have to implement the function `name()` which expects an `FileInterface` and should return a string representing the name of the given file. The example above would name every file _grumpycat.jpg_ and is therefore not very useful. +To match the `NamerInterface` you have to implement the function `name()` which expects an `FileInterface` and should return a string representing the name of the given file. The example above would name every file _grumpycat.jpg_ and is therefore not very useful. The namer should return an unique name to avoid issues if the file already exists. Next, register your created namer as a service in your `services.xml`
0