代码拉取完成,页面将自动刷新
同步操作将从 anolis/kmod-bnxt_re 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%global pkg bnxt_re
%global kernel kernel version
%define pkg_version 1.10.3_229.0.139.0
%define anolis_release 1
Name: kmod-%{pkg}
Version: %(echo %{kernel} | sed -E 's/-/~/g; s/\.(an|al)[0-9]+$//g')
Release: %{pkg_version}~%{anolis_release}%{?dist}
Summary: Intel(R) 10GbE PCI Express Virtual Function Driver
Source: kmod-%{pkg}-%{pkg_version}.tar.gz
Vendor: Intel Corporation
License: @
ExclusiveOS: linux
Group: System Environment/Kernel
Provides: %{pkg}
URL: http://support.intel.com
BuildRoot: %{_tmppath}/%{pkg}-%{pkgh_version}-root
%global debug_package %{nil}
# macros for finding system files to update at install time (pci.ids, pcitable)
%define find() %(for f in %*; do if [ -e $f ]; then echo $f; break; fi; done)
%define _pciids /usr/share/pci.ids /usr/share/hwdata/pci.ids
%define pciids /usr/share/hwdata/pci.ids
%define _pcitable /usr/share/kudzu/pcitable /usr/share/hwdata/pcitable /dev/null
%define pcitable %find %{_pcitable}
Requires: kernel, findutils, gawk, bash, kmod
Requires: kmod-bnxt_en
Provides: kmod-%{pkg}-%{kernel}.%{_arch} = %{version}-%{release}
Obsoletes: kmod-%{pkg}-%{kernel}.%{_arch} < %{version}-%{release}
%global __strip /bin/true
%define kernel_ver %{kernel}.%{_arch}
%if 0%{?KSRC:1}
%define check_aux_args_ksrc -k %{KSRC}
%endif
%define check_aux_args %check_aux_args_kernel %check_aux_args_ksrc
# Check for existence of variable kernel_module_package_buildreqs ...
%if 0%{?!kernel_module_package_buildreqs:1}
# ... and provide a suitable definition if it is not defined
%define kernel_module_package_buildreqs kernel-devel
%endif
%define kernel_module_package_buildreqs_fixed %(/bin/bash -fc 'if [[ %{kernel_ver} == *uek* ]];
then echo %kernel_module_package_buildreqs | sed 's/kernel-devel/kernel-uek-devel/g' ; else echo %kernel_module_package_buildreqs ; fi')
BuildRequires: %kernel_module_package_buildreqs_fixed
%description
This package contains the Intel(R) 10GbE PCI Express Virtual Function Driver.
%prep
%setup -q -n kmod-%{pkg}-%{pkg_version}
%build
make KDIR=/usr/src/kernels/%{kernel}.%{_arch}/ KVER=%{kernel}.%{_arch} clean
make KDIR=/usr/src/kernels/%{kernel}.%{_arch}/ KVER=%{kernel}.%{_arch} -j32
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/lib/modules/%{kernel_ver}/extra/%{pkg}/
find ./ -name *.ko | while read line
do
cp $line %{buildroot}/lib/modules/%{kernel_ver}/extra/%{pkg}/
done
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
for kmod in $(find %{buildroot}/lib/modules/%{kernel}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
do
echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
echo "override $(basename $kmod .ko) * extra/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
done
%clean
rm -rf %{buildroot}
%files
/lib/modules/%{kernel_ver}/extra/%{pkg}/*.ko
%license licenses
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
%dir /lib/modules/%{kernel_ver}/extra/%{pkg}/
%post
depmod -a > /dev/null 2>&1
if [ -x "/usr/sbin/weak-modules" ]; then
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/bnxt_re/%{pkg}.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules
fi
if [ -d /usr/local/share/%{name} ]; then
rm -rf /usr/local/share/%{name}
fi
mkdir /usr/local/share/%{name}
cp --parents %{pciids} /usr/local/share/%{name}/
echo "original pci.ids saved in /usr/local/share/%{name}";
if [ "%{pcitable}" != "/dev/null" ]; then
cp --parents %{pcitable} /usr/local/share/%{name}/
echo "original pcitable saved in /usr/local/share/%{name}";
fi
LD="%{_docdir}/%{name}";
if [ -d %{_docdir}/%{name}-%{version} ]; then
LD="%{_docdir}/%{name}-%{version}";
fi
<<"END"
#! /bin/bash
# Copyright (C) 2017 - 2023 Intel Corporation
# For licensing information, see the file 'LICENSE' in the root folder
# $1 = system pci.ids file to update
# $2 = system pcitable file to update
# $3 = file with new entries in pci.ids file format
# $4 = pci.ids output file
# $5 = pcitable output file
# $6 = driver name for use in pcitable file
exec 3<$1
exec 4<$2
exec 5<$3
exec 6>$4
exec 7>$5
driver=$6
IFS=
# pattern matching strings
ID="[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]"
VEN="${ID}*"
DEV=" ${ID}*"
SUB=" ${ID}*"
TABLE_DEV="0x${ID} 0x${ID} \"*"
TABLE_SUB="0x${ID} 0x${ID} 0x${ID} 0x${ID} \"*"
line=
table_line=
ids_in=
table_in=
vendor=
device=
ids_device=
table_device=
subven=
ids_subven=
table_subven=
subdev=
ids_subdev=
table_subdev=
ven_str=
dev_str=
sub_str=
# force a sub-shell to fork with a new stdin
# this is needed if the shell is reading these instructions from stdin
while true
do
# get the first line of each data file to jump start things
exec 0<&3
read -r ids_in
if [ "$2" != "/dev/null" ];then
exec 0<&4
read -r table_in
fi
# outer loop reads lines from the updates file
exec 0<&5
while read -r line
do
# vendor entry
if [[ $line == $VEN ]]
then
vendor=0x${line:0:4}
ven_str=${line#${line:0:6}}
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $VEN ||
0x${ids_in:0:4} < $vendor ]]
do
echo "$ids_in"
read -r ids_in
done
echo "$line"
if [[ 0x${ids_in:0:4} == $vendor ]]
then
read -r ids_in
fi
# device entry
elif [[ $line == $DEV ]]
then
device=`echo ${line:1:4} | tr "[:upper:]" "[:lower:]"`
table_device=0x${line:1:4}
dev_str=${line#${line:0:7}}
ids_device=`echo ${ids_in:1:4} | tr "[:upper:]" "[:lower:]"`
table_line="$vendor $table_device \"$driver\" \"$ven_str|$dev_str\""
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $DEV ||
$ids_device < $device ]]
do
if [[ $ids_in == $VEN ]]
then
break
fi
if [[ $ids_device != ${ids_in:1:4} ]]
then
echo "${ids_in:0:1}$ids_device${ids_in#${ids_in:0:5}}"
else
echo "$ids_in"
fi
read -r ids_in
ids_device=`echo ${ids_in:1:4} | tr "[:upper:]" "[:lower:]"`
done
if [[ $device != ${line:1:4} ]]
then
echo "${line:0:1}$device${line#${line:0:5}}"
else
echo "$line"
fi
if [[ $ids_device == $device ]]
then
read -r ids_in
fi
# add entry to pcitable
if [ "$2" != "/dev/null" ];then
exec 0<&4
exec 1>&7
while [[ $table_in != $TABLE_DEV ||
${table_in:0:6} < $vendor ||
( ${table_in:0:6} == $vendor &&
${table_in:7:6} < $table_device ) ]]
do
echo "$table_in"
read -r table_in
done
echo "$table_line"
if [[ ${table_in:0:6} == $vendor &&
${table_in:7:6} == $table_device ]]
then
read -r table_in
fi
fi
# subsystem entry
elif [[ $line == $SUB ]]
then
subven=`echo ${line:2:4} | tr "[:upper:]" "[:lower:]"`
subdev=`echo ${line:7:4} | tr "[:upper:]" "[:lower:]"`
table_subven=0x${line:2:4}
table_subdev=0x${line:7:4}
sub_str=${line#${line:0:13}}
ids_subven=`echo ${ids_in:2:4} | tr "[:upper:]" "[:lower:]"`
ids_subdev=`echo ${ids_in:7:4} | tr "[:upper:]" "[:lower:]"`
table_line="$vendor $table_device $table_subven $table_subdev \"$driver\" \"$ven_str|$sub_str\""
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $SUB ||
$ids_subven < $subven ||
( $ids_subven == $subven &&
$ids_subdev < $subdev ) ]]
do
if [[ $ids_in == $VEN ||
$ids_in == $DEV ]]
then
break
fi
if [[ ! (${ids_in:2:4} == "1014" &&
${ids_in:7:4} == "052C") ]]
then
if [[ $ids_subven != ${ids_in:2:4} || $ids_subdev != ${ids_in:7:4} ]]
then
echo "${ids_in:0:2}$ids_subven $ids_subdev${ids_in#${ids_in:0:11}}"
else
echo "$ids_in"
fi
fi
read -r ids_in
ids_subven=`echo ${ids_in:2:4} | tr "[:upper:]" "[:lower:]"`
ids_subdev=`echo ${ids_in:7:4} | tr "[:upper:]" "[:lower:]"`
done
if [[ $subven != ${line:2:4} || $subdev != ${line:7:4} ]]
then
echo "${line:0:2}$subven $subdev${line#${line:0:11}}"
else
echo "$line"
fi
if [[ $ids_subven == $subven &&
$ids_subdev == $subdev ]]
then
read -r ids_in
fi
# add entry to pcitable
if [ "$2" != "/dev/null" ];then
exec 0<&4
exec 1>&7
while [[ $table_in != $TABLE_SUB ||
${table_in:14:6} < $table_subven ||
( ${table_in:14:6} == $table_subven &&
${table_in:21:6} < $table_subdev ) ]]
do
if [[ $table_in == $TABLE_DEV ]]
then
break
fi
if [[ ! (${table_in:14:6} == "0x1014" &&
${table_in:21:6} == "0x052C") ]]
then
echo "$table_in"
fi
read -r table_in
done
echo "$table_line"
if [[ ${table_in:14:6} == $table_subven &&
${table_in:21:6} == $table_subdev ]]
then
read -r table_in
fi
fi
fi
exec 0<&5
done
# print the remainder of the original files
exec 0<&3
exec 1>&6
echo "$ids_in"
while read -r ids_in
do
echo "$ids_in"
done
if [ "$2" != "/dev/null" ];then
exec 0>&4
exec 1>&7
echo "$table_in"
while read -r table_in
do
echo "$table_in"
done
fi
break
done <&5
exec 3<&-
exec 4<&-
exec 5<&-
exec 6>&-
exec 7>&-
END
%preun
echo "/lib/modules/%{kernel}.%{_arch}/extra/bnxt_re/%{pkg}.ko" >> /var/run/rpm-%{pkg}-modules.list
%postun
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true
if [ -x "/usr/sbin/weak-modules" ]; then
modules=( $(cat /var/run/rpm-%{pkg}-modules.list) )
printf '%s\n' "${modules[@]}" | /usr/sbin/weak-modules --no-initramfs --remove-modules
fi
rm /var/run/rpm-%{pkg}-modules.list
if which dracut >/dev/null 2>&1; then
echo "Updating initramfs with dracut..."
if dracut --force ; then
echo "Successfully updated initramfs."
else
echo "Failed to update initramfs."
echo "You must update your initramfs image for changes to take place."
exit -1
fi
elif which mkinitrd >/dev/null 2>&1; then
echo "Updating initrd with mkinitrd..."
if mkinitrd; then
echo "Successfully updated initrd."
else
echo "Failed to update initrd."
echo "You must update your initrd image for changes to take place."
exit -1
fi
else
echo "Unable to determine utility to update initrd image."
echo "You must update your initrd manually for changes to take place."
exit -1
fi
%changelog
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。