diff options
author | GUAN Xin <guanx.bac@gmail.com> | 2023-10-23 22:01:17 +0900 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-10-28 09:22:51 +0700 |
commit | c5b9e72e5f649a2be0188d7eee969bc69227bdcf (patch) | |
tree | d54d686c85c6706e896f1b32bc2010ad73733f88 /network/mstflint | |
parent | 912e0b95c44176592b23e0d67c2dac2b0ae59cb1 (diff) |
network/mstflint: Added (firmware tools).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/mstflint')
-rw-r--r-- | network/mstflint/README | 15 | ||||
-rw-r--r-- | network/mstflint/mstflint.SlackBuild | 123 | ||||
-rw-r--r-- | network/mstflint/mstflint.info | 10 | ||||
-rw-r--r-- | network/mstflint/slack-desc | 19 |
4 files changed, 167 insertions, 0 deletions
diff --git a/network/mstflint/README b/network/mstflint/README new file mode 100644 index 000000000000..b5d4b54723a1 --- /dev/null +++ b/network/mstflint/README @@ -0,0 +1,15 @@ +The mstflint is a set of tools for changing firmware configuration of +Mellanox ConnectX Ethernet NICs and Infiniband HCA/VPI cards, +as well as diagnosing (mainly hardware) problems and +burning firmware for these products. + +These open-source tools are based on a subset of the proprietary +Mellanox Firmware Tools (MFT) package. + +The functionality needed to burn firmware for +Mellanox Infiniband switches from a connected host can be enabled with: + + env ENABLE_INBAND=YES ./mstflint.SlackBuild + +which then pulls in the optional dependency upon "rdma-core" +(available on SlackBuilds.org). diff --git a/network/mstflint/mstflint.SlackBuild b/network/mstflint/mstflint.SlackBuild new file mode 100644 index 000000000000..5577d32a8146 --- /dev/null +++ b/network/mstflint/mstflint.SlackBuild @@ -0,0 +1,123 @@ +#!/bin/bash + +# Slackware build script for mstflint + +# Copyright 2023 GUAN Xin <guanx.bac@gmail.com> from Beijing +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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. + + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=mstflint +VERSION=${VERSION:-4.25.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +ENABLE_INBAND=${ENABLE_INBAND:-no} +if ! [ `echo x$ENABLE_INBAND | tr '[:lower:]' '[:upper:]'` = XYES ]; then + CONFIG_PARAMS_EXTRA="${CONFIG_PARAMS_EXTRA} --disable-inband" + SLACK_DESC_SED_CMD='s/ENABLE_INBAND/ but disabled at build time/g' +else + CONFIG_PARAMS_EXTRA= + SLACK_DESC_SED_CMD='s/ENABLE_INBAND//g' +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION-1.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux \ + --enable-xml2 \ + --enable-cs \ + --enable-adb-generic-tools \ + --enable-dpa \ + ${CONFIG_PARAMS_EXTRA} + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc | sed "$SLACK_DESC_SED_CMD" > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/mstflint/mstflint.info b/network/mstflint/mstflint.info new file mode 100644 index 000000000000..d83a2abc3e41 --- /dev/null +++ b/network/mstflint/mstflint.info @@ -0,0 +1,10 @@ +PRGNAM="mstflint" +VERSION="4.25.0" +HOMEPAGE="https://github.com/Mellanox/mstflint" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://github.com/Mellanox/mstflint/releases/download/v4.25.0-1/mstflint-4.25.0-1.tar.gz" +MD5SUM_x86_64="eb6e67084ed5d85271df0932cdcb4168" +REQUIRES="" +MAINTAINER="GUAN Xin" +EMAIL="guanx.bac@gmail.com" diff --git a/network/mstflint/slack-desc b/network/mstflint/slack-desc new file mode 100644 index 000000000000..b46242c6e551 --- /dev/null +++ b/network/mstflint/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +mstflint: mstflint (Mellanox firmware configuration tools) +mstflint: +mstflint: mstflint is a set of tools for firmware burning and configuration of +mstflint: Mellanox Ethernet NICs, Infiniband HCA/VPI cards. +mstflint: +mstflint: Firmware burning for Mellanox Infiniband switches from a +mstflint: connected host is supportedENABLE_INBAND. +mstflint: +mstflint: +mstflint: Home: https://github.com/Mellanox/mstflint +mstflint: |