From 85383debec495ac82be096715c68d1b651177ef6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2016 15:55:32 +0000 Subject: import bnxt_en-1.2.0-2.el7_2 --- diff --git a/.bnxt_en.metadata b/.bnxt_en.metadata new file mode 100644 index 0000000..4681fa5 --- /dev/null +++ b/.bnxt_en.metadata @@ -0,0 +1 @@ +18854471f4618a583af57795d83b4f1def2a0657 SOURCES/bnxt_en-1.2.0.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..13797a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/bnxt_en-1.2.0.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/bnxt_en.files b/SOURCES/bnxt_en.files new file mode 100644 index 0000000..036fba9 --- /dev/null +++ b/SOURCES/bnxt_en.files @@ -0,0 +1,4 @@ +%defattr(644,root,root,755) +/lib/modules/%2-%1 +/etc/depmod.d/bnxt_en.conf +/usr/share/doc/kmod-bnxt_en/greylist.txt diff --git a/SOURCES/bnxt_en.patch b/SOURCES/bnxt_en.patch new file mode 100644 index 0000000..94fda24 --- /dev/null +++ b/SOURCES/bnxt_en.patch @@ -0,0 +1,48 @@ +From c9e14a2654f6b4cd65792844c01b2f582d430393 Mon Sep 17 00:00:00 2001 +From: Petr Oros +Date: Wed, 27 Jul 2016 17:44:36 +0200 +Subject: [PATCH] Backport bnxt_en for RHEL7.2GA + +Signed-off-by: Petr Oros +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 +-------- + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 3 +++ + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index e6aba37..2a95c32 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -6014,16 +6014,9 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu) + return 0; + } + +-static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto, +- struct tc_to_netdev *ntc) ++static int bnxt_setup_tc(struct net_device *dev, u8 tc) + { + struct bnxt *bp = netdev_priv(dev); +- u8 tc; +- +- if (ntc->type != TC_SETUP_MQPRIO) +- return -EINVAL; +- +- tc = ntc->tc; + + if (tc > bp->max_tc) { + netdev_err(dev, "too many traffic classes requested: %d Max supported is %d\n", +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h +index 3abc03b..6af73a1 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h +@@ -16,4 +16,7 @@ u32 _bnxt_fw_to_ethtool_adv_spds(u16, u8); + u32 bnxt_fw_to_ethtool_speed(u16); + u16 bnxt_get_fw_auto_link_speeds(u32); + ++#define SPEED_25000 25000 ++#define SPEED_50000 50000 ++ + #endif +-- +1.8.3.1 + diff --git a/SOURCES/depmodconf b/SOURCES/depmodconf new file mode 100755 index 0000000..d54ed63 --- /dev/null +++ b/SOURCES/depmodconf @@ -0,0 +1,10 @@ +#!/bin/bash +VAR=${2} +MAJOR=` echo $VAR | cut -f 1 -d "-" ` +VAR=${VAR##$MAJOR"-"} +MINOR=` echo $VAR | cut -f 1 -d "." ` +kver=$MAJOR-$MINOR.* +find $3 -name '*.ko' | sed 's|^.*/\([^/]*\)\.ko$|\1|' | sort -u | \ +while read -r module; do + echo "override $module $kver weak-updates/$1" +done diff --git a/SOURCES/find-provides.ksyms b/SOURCES/find-provides.ksyms new file mode 100755 index 0000000..38899cd --- /dev/null +++ b/SOURCES/find-provides.ksyms @@ -0,0 +1,11 @@ +#!/bin/bash +filelist=$(sed "s/['\"]/\\\&/g") +kolist=$(echo $filelist | tr '[:blank:]' \\n | grep -E '/lib/modules/.+\.ko$') +echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/redhat/find-provides.ksyms + +for module in $kolist; do + modname=$(echo $module | sed 's|^.*/\([^/]*\)\.ko$|\1|') + if [ "$modname" != "$1" ]; then + echo "kmod-$modname = $2" + fi +done | sort -u diff --git a/SOURCES/find-requires.ksyms b/SOURCES/find-requires.ksyms new file mode 100755 index 0000000..db86dd8 --- /dev/null +++ b/SOURCES/find-requires.ksyms @@ -0,0 +1,65 @@ +#! /bin/bash + +IFS=$'\n' + +all_provides() { + nm "$@" \ + | sed -r -ne 's:^([0-9a-f]+) A __crc_(.+):\1\t\2:p' \ + | sort -k2 -u +} + +all_requires() { + for module in "$@"; do + set -- $(/sbin/modinfo -F vermagic "$module" | sed -e 's: .*::' -e q) + /sbin/modprobe --dump-modversions "$module" \ + | awk --non-decimal-data ' + BEGIN { FS = "\t" ; OFS = "\t" } + {printf("0x%08x\t%s\n", $1, $2)}' \ + | sed -r -e 's:$:\t'"$1"':' + done \ + | sort -k2 -u +} + +rm -rf /tmp/krava + +if ! [ -e /sbin/modinfo -a -e /sbin/modprobe ]; then + cat > /dev/null + exit 0 +fi + +modules=($(grep -E '/lib/modules/.+\.ko$')) + +if [ ${#modules[@]} -gt 0 ]; then + kernel=$(/sbin/modinfo -F vermagic "${modules[0]}" | sed -e 's: .*::' -e q) + + # get all that kernel provides + symvers=$(mktemp -t ${0##*/}.XXXXX) + cat /usr/src/kernels/$kernel/Module.symvers | awk ' + BEGIN { FS = "\t" ; OFS = "\t" } + { print $2 "\t" $1 } + ' \ + | sed -r -e 's:$:\t'"$1"':' \ + | sort -u -k2 > $symvers + + # get all that we demands + reqs=$(mktemp -t ${0##*/}.XXXXX) + join -t $'\t' -j 2 -v 1 \ + <(all_requires "${modules[@]}") \ + <(all_provides "${modules[@]}") \ + | sort -u -k2 > $reqs + + # get kernel dependencies - kernel(symbol) = 0xHEX + join -t $'\t' -j2 -o 1.1 1.2 $symvers $reqs \ + | sort -u \ + | awk ' + { FS = "\t" ; OFS = "\t" } + { print "kernel(" $1 ") = " $2 } + ' + + # get module dependencies - ksym(symbol) = 0xHEX + join -t $'\t' -j2 -v2 $symvers $reqs \ + | sort -u | awk ' + { FS = "\t" ; OFS = "\t" } + { print "ksym(" $2 ") = " $1 } + ' +fi diff --git a/SOURCES/kmodtool b/SOURCES/kmodtool new file mode 100755 index 0000000..2b55385 --- /dev/null +++ b/SOURCES/kmodtool @@ -0,0 +1,315 @@ +#!/bin/bash + +# kmodtool - Helper script for building kernel module RPMs +# An original version appeared in Fedora. This version is +# generally called only by the %kernel_module_package RPM macro +# during the process of building Driver Update Packages (which +# are also known as "kmods" in the Fedora community). +# +# Copyright (c) 2003-2010 Ville Skyttä , +# Thorsten Leemhuis +# Jon Masters +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# 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. + +# Changelog: +# +# 2010/07/28 - Add fixes for filelists in line with LF standard +# - Remove now defunct "framepointer" kernel variant +# - Change version to "rhel7-rh1" as a consequence. +# +# 2010/01/10 - Simplified for RHEL6. We are working on upstream +# moving to a newer format and in any case do not +# need to retain support for really old systems. + +shopt -s extglob + +myprog="kmodtool" +myver="rhel7-rh1" +knownvariants=@(debug|kdump) +kmod_name= +kver= +verrel= +variant= + +get_kernel_release () +{ + if [[ -z $1 ]]; then + uname -r + return + fi + local arch=$(arch) + local verrel=${1%.$arch} + local verprefix=${verrel%.*} + local versuffix=${verrel#$verprefix} + verrel=$(ls -Ud /usr/src/kernels/$verprefix*$versuffix.$arch | sort -V | tail -n 1) + verrel=${verrel##*/} + [[ -z $verrel ]] && verrel=$1.$arch + echo "$verrel" +} + +get_verrel () +{ + verrel=$(get_kernel_release "$1") + verrel=${verrel%%$knownvariants} +} + +print_verrel () +{ + get_verrel $@ + echo "${verrel}" +} + +get_verrel_for_deps () +{ + verrel_dep=${1:-$(uname -r)} + verrel_dep=${verrel_dep%%$knownvariants} + # TODO: rpmtemplate should be called with %{kernel_version}, not %{kverrel} + # begin hack (remove z-stream subversion) + local verprefix=${verrel_dep%-*} + local versuffix=${verrel_dep##*-} + local verinfix=${versuffix%.*.*} + versuffix=${versuffix#$verinfix} + verinfix=${verinfix%%.*} + verrel_dep=$verprefix-$verinfix$versuffix + # end hack +} + +get_variant () +{ + get_verrel $@ + variant=$(get_kernel_release "$1") + variant=${variant##$verrel} + variant=${variant:-'""'} +} + +print_variant () +{ + get_variant $@ + echo "${variant}" +} + +get_filelist() { + local IFS=$'\n' + filelist=($(cat)) + + if [ ${#filelist[@]} -gt 0 ]; + then + for ((n = 0; n < ${#filelist[@]}; n++)); + do + line="${filelist[n]}" + line=$(echo "$line" \ + | sed -e "s/%verrel/$verrel/g" \ + | sed -e "s/%variant/$variant/g" \ + | sed -e "s/%dashvariant/$dashvariant/g" \ + | sed -e "s/%dotvariant/$dotvariant/g" \ + | sed -e "s/\.%1/$dotvariant/g" \ + | sed -e "s/\-%1/$dotvariant/g" \ + | sed -e "s/%2/$verrel/g") + echo "$line" + done + else + echo "%defattr(644,root,root,755)" + echo "/lib/modules/${verrel}${dotvariant}" + fi +} + + +get_rpmtemplate () +{ + local variant="${1}" + local dashvariant="${variant:+-${variant}}" + local dotvariant="${variant:+.${variant}}" + + echo "%package -n kmod-${kmod_name}${dashvariant}" + + if [ -z "$kmod_provides_summary" ]; then + echo "Summary: ${kmod_name} kernel module(s)" + fi + + if [ -z "$kmod_provides_group" ]; then + echo "Group: System Environment/Kernel" + fi + + if [ ! -z "$kmod_version" ]; then + echo "Version: %{kmod_version}" + fi + + if [ ! -z "$kmod_release" ]; then + echo "Release: %{kmod_release}" + fi + + # Turn of the internal dep generator so we will use the kmod scripts. + echo "%global _use_internal_dependency_generator 0" + cat < /dev/null || : +fi + +modules=( \$(find /lib/modules/${verrel}${dotvariant}/extra/${kmod_name} | grep '\.ko$') ) +if [ -x "/sbin/weak-modules" ]; then + printf '%s\n' "\${modules[@]}" \ + | /sbin/weak-modules --add-modules +fi +EOF + +cat < /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules +EOF + +cat < /dev/null || : +fi + +modules=( \$(cat /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules) ) +rm /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules +if [ -x "/sbin/weak-modules" ]; then + printf '%s\n' "\${modules[@]}" \ + | /sbin/weak-modules --remove-modules +fi +EOF + +echo "%files -n kmod-${kmod_name}${dashvariant}" + +if [ "" == "$override_filelist" ]; +then + echo "%defattr(644,root,root,755)" + echo "/lib/modules/${verrel}${dotvariant}" +else + cat "$override_filelist" | get_filelist +fi +} + +print_rpmtemplate () +{ + kmod_name="${1}" + shift + kver="${1}" + get_verrel "${1}" + get_verrel_for_deps "${1}" + shift + if [ -z "${kmod_name}" ] ; then + echo "Please provide the kmodule-name as first parameter." >&2 + exit 2 + elif [ -z "${kver}" ] ; then + echo "Please provide the kver as second parameter." >&2 + exit 2 + elif [ -z "${verrel}" ] ; then + echo "Couldn't find out the verrel." >&2 + exit 2 + fi + + for variant in "$@" ; do + if [ "default" == "$variant" ]; + then + get_rpmtemplate "" + else + get_rpmtemplate "${variant}" + fi + done +} + +usage () +{ + cat <