jiaoff 913cd917f9 toa: release 1.0.0-3
Fix 5.10 crash on arm64 and update toa.spec.
Cherry-pick related commits(a5830ce..f94d2b5) from openEuler-22.03-LTS branch
and squash into one commit.

Signed-off-by: jiaoff <jiaofenfang@uniontech.com>
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
(cherry picked from commit e2ca26badf3bd502dd8ab16c4c5a226431bf739f)
2023-06-16 14:18:32 +08:00

116 lines
3.0 KiB
RPMSpec

%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)
Name: TCP_option_address
Summary: Intel(R) Ethernet Adaptive Virtual Function Driver
Version: 1.0.0
Release: 3
#Release: 0.%{krelver}
Vendor: Huawei
License: GPL-2.0
URL: https://github.com/dongzerun/TCP_option_address
Source0: TCP_option_address.tar.gz
Patch0001: 0001-support-arm64.patch
Patch0002: 0002-fix-build-error.patch
Patch0003: 0003-patch-for-5_10.patch
Patch0004: 0004-fix-crash.patch
Requires: kernel, findutils, gawk, bash
BuildRequires: kernel-devel hwdata elfutils-devel gcc
%description
The TCP Option Address (TOA) module is a kernel module that obtains the source IPv4 address from the option section of a TCP header.
%prep
%autosetup -n %{name} -p1
%build
make -C src clean
make -C src
%install
make -C src DESTDIR=%{buildroot} install
# Remove modules files that we do not want to include
find %{buildroot}/lib/modules/ -name 'modules.*' -exec rm -f {} \;
cd %{buildroot}
find lib -name "toa" \
-fprintf %{_builddir}/%{name}/file.list "/%p\n"
%clean
rm -rf %{buildroot}
%files -f file.list
%defattr(-,root,root)
%doc README.md file.list
%license LICENSE NOTICE
%post
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true
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
%preun
%postun
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true
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
* Wed Aug 03 2022 jiaofenfang<jiaofenfang@uniontech.com> - 1.0.0-3
- fix crash on the arm64
* Sat Jul 30 2022 jiaofenfang<jiaofenfang@uniontech.com> - 1.0.0-2
- fix 5.10 crash on the arm64
* Mon Jan 24 2022 jiaofenfang<jiaofenfang@uniontech.com> - 1.0.0-1
- Package init