2022-11-15 12:55:32 +00:00
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
%define kernel_devel_rpm %(echo $(rpm -q kernel-devel | head -n 1))
|
2023-04-04 10:57:35 +08:00
|
|
|
%define kernel_version %(echo $(rpm -q --qf "\%%{VERSION}" %{kernel_devel_rpm}))
|
2023-03-29 18:42:15 +08:00
|
|
|
%define kernel_name %(echo $(rpm -q --qf "\%%{VERSION}-\%%{RELEASE}.\%%{ARCH}" %{kernel_devel_rpm}))
|
|
|
|
|
|
2022-11-15 12:55:32 +00:00
|
|
|
Name: syscare
|
2023-06-09 11:46:19 +08:00
|
|
|
Version: 1.0.2
|
2023-06-25 14:36:51 +08:00
|
|
|
Release: 3
|
2022-11-15 12:55:32 +00:00
|
|
|
Summary: system hot-fix service
|
|
|
|
|
|
2023-03-15 11:34:43 +08:00
|
|
|
License: MulanPSL-2.0 and GPL-2.0-only
|
2022-11-15 12:55:32 +00:00
|
|
|
URL: https://gitee.com/openeuler/syscare
|
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
|
|
BuildRequires: rust cargo gcc gcc-g++ cmake make
|
|
|
|
|
BuildRequires: elfutils-libelf-devel
|
|
|
|
|
|
2023-03-29 17:47:03 +08:00
|
|
|
Requires: coreutils systemd kpatch-runtime
|
2023-06-17 19:06:50 +08:00
|
|
|
Requires: %{name}-kmod >= 1.0.2-1
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
SysCare is a system-level hot-fix software that provides single-machine-level and cluster-level security patches and system error hot-fixes for the operating system.
|
2022-11-22 11:44:18 +00:00
|
|
|
The host can fix the system problem without rebooting.
|
2022-11-15 12:55:32 +00:00
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
%package kmod
|
|
|
|
|
Summary: Syscare kernel modules.
|
2023-06-02 17:11:44 +08:00
|
|
|
Requires: kernel >= %{kernel_version}
|
2023-03-29 18:42:15 +08:00
|
|
|
BuildRequires: kernel-devel
|
|
|
|
|
BuildRequires: make gcc bison flex
|
|
|
|
|
|
|
|
|
|
%description kmod
|
|
|
|
|
Syscare kernel modules dependency.
|
|
|
|
|
|
2022-11-15 12:55:32 +00:00
|
|
|
%package build
|
2023-03-15 11:34:43 +08:00
|
|
|
Summary: Tools for build syscare patch.
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
2023-06-17 19:06:50 +08:00
|
|
|
Requires: %{name}-kmod >= 1.0.2-1
|
|
|
|
|
Requires: make patch gcc g++
|
2023-06-06 21:55:03 +08:00
|
|
|
Requires: bison flex
|
|
|
|
|
Requires: kpatch dwarves
|
2023-03-15 11:34:43 +08:00
|
|
|
Requires: elfutils-libelf-devel
|
2023-06-02 17:11:44 +08:00
|
|
|
Requires: rpm-build tar gzip
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
%description build
|
|
|
|
|
Syscare build tools.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
|
|
%build
|
2023-06-02 17:11:44 +08:00
|
|
|
mkdir -p build
|
|
|
|
|
cd build
|
2023-03-15 11:34:43 +08:00
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_VERSION=%{version}-%{release} -DKERNEL_VERSION=%{kernel_name} ..
|
2022-11-15 12:55:32 +00:00
|
|
|
make
|
|
|
|
|
|
|
|
|
|
%install
|
2023-06-02 17:11:44 +08:00
|
|
|
cd build
|
2022-11-15 12:55:32 +00:00
|
|
|
%make_install
|
2023-03-29 18:42:15 +08:00
|
|
|
mkdir -p %{buildroot}/lib/modules/%{kernel_name}/extra/syscare
|
|
|
|
|
mv %{buildroot}/usr/libexec/syscare/upatch.ko %{buildroot}/lib/modules/%{kernel_name}/extra/syscare
|
2022-12-02 11:45:58 +00:00
|
|
|
|
2022-11-28 12:26:22 +00:00
|
|
|
%post
|
2023-04-04 10:57:35 +08:00
|
|
|
# Create runtime directory
|
|
|
|
|
mkdir -p /usr/lib/syscare/patches
|
2023-03-15 11:34:43 +08:00
|
|
|
|
2023-03-29 17:47:03 +08:00
|
|
|
# Start all services
|
2023-03-29 18:42:15 +08:00
|
|
|
systemctl enable syscare
|
2023-03-29 17:47:03 +08:00
|
|
|
systemctl start syscare
|
2022-12-02 11:45:58 +00:00
|
|
|
|
|
|
|
|
%preun
|
2023-03-29 17:47:03 +08:00
|
|
|
# Stop all services
|
2023-03-29 18:42:15 +08:00
|
|
|
systemctl stop syscare
|
|
|
|
|
systemctl disable syscare
|
2022-12-02 11:45:58 +00:00
|
|
|
|
|
|
|
|
%postun
|
2023-03-29 17:47:03 +08:00
|
|
|
# Remove runtime directory at uninstallation
|
|
|
|
|
if [ "$1" -eq 0 ] || { [ -n "$2" ] && [ "$2" -eq 0 ]; }; then
|
|
|
|
|
rm -rf /usr/lib/syscare
|
|
|
|
|
fi
|
2022-11-28 12:26:22 +00:00
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
%post kmod
|
2023-04-04 10:57:35 +08:00
|
|
|
# Create kmod weak-updates link
|
|
|
|
|
echo "/lib/modules/%{kernel_name}/extra/syscare/upatch.ko" | /sbin/weak-modules --add-module --no-initramfs --verbose >&2
|
2023-03-29 17:47:03 +08:00
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
# Start all services
|
|
|
|
|
systemctl enable syscare-upatch
|
|
|
|
|
systemctl start syscare-upatch
|
|
|
|
|
|
|
|
|
|
%preun kmod
|
|
|
|
|
# Stop all services
|
|
|
|
|
systemctl stop syscare-upatch
|
|
|
|
|
systemctl disable syscare-upatch
|
|
|
|
|
|
|
|
|
|
%postun kmod
|
2023-04-04 10:57:35 +08:00
|
|
|
# Remove kmod weak-updates link
|
|
|
|
|
echo "/lib/modules/%{kernel_name}/extra/syscare/upatch.ko" | /sbin/weak-modules --remove-module --no-initramfs --verbose >&2
|
2023-03-15 11:34:43 +08:00
|
|
|
|
2022-11-15 12:55:32 +00:00
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root,-)
|
2022-11-22 11:44:18 +00:00
|
|
|
%attr(755,root,root) /usr/bin/syscare
|
2023-03-15 11:34:43 +08:00
|
|
|
%attr(644,root,root) /usr/lib/systemd/system/syscare.service
|
2023-03-29 17:47:03 +08:00
|
|
|
%dir /usr/libexec/syscare
|
|
|
|
|
%attr(755,root,root) /usr/libexec/syscare/upatch-tool
|
2022-11-15 12:55:32 +00:00
|
|
|
|
2023-03-29 18:42:15 +08:00
|
|
|
%files kmod
|
|
|
|
|
%dir /lib/modules/%{kernel_name}/extra/syscare
|
|
|
|
|
%attr(640,root,root) /lib/modules/%{kernel_name}/extra/syscare/upatch.ko
|
|
|
|
|
%attr(644,root,root) /usr/lib/systemd/system/syscare-upatch.service
|
|
|
|
|
|
2022-11-15 12:55:32 +00:00
|
|
|
%files build
|
|
|
|
|
%defattr(-,root,root,-)
|
2023-03-15 11:34:43 +08:00
|
|
|
%dir /usr/libexec/syscare
|
|
|
|
|
%attr(755,root,root) /usr/libexec/syscare/syscare-build
|
|
|
|
|
%attr(755,root,root) /usr/libexec/syscare/upatch-build
|
2023-03-29 17:47:03 +08:00
|
|
|
%attr(755,root,root) /usr/libexec/syscare/upatch-diff
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
%changelog
|
2023-06-25 14:36:51 +08:00
|
|
|
* Sun Jun 25 2023 renoseven<dev@renoseven.net> - 1.0.2-3
|
|
|
|
|
- Fix various issue
|
2023-06-17 19:06:50 +08:00
|
|
|
* Mon Jun 19 2023 renoseven<dev@renoseven.net> - 1.0.2-2
|
|
|
|
|
- Fix various issue
|
|
|
|
|
- Update dependencies
|
2023-06-09 11:46:19 +08:00
|
|
|
* Fri Jun 09 2023 renoseven<dev@renoseven.net> - 1.0.2-1
|
|
|
|
|
- Fix 'rpmpbuild getcwd failed' issue
|
|
|
|
|
- Fix 'upatch ko prints redundant log' issue
|
2023-06-09 08:21:53 +08:00
|
|
|
* Fri Jun 09 2023 renoseven<dev@renoseven.net> - 1.0.1-9
|
|
|
|
|
- Fix 'patch file is not checked' issue
|
|
|
|
|
- Rename patched source package
|
|
|
|
|
- Update dependencies
|
2023-06-06 21:55:03 +08:00
|
|
|
* Tue Jun 06 2023 renoseven<dev@renoseven.net> - 1.0.1-8
|
|
|
|
|
- Fix 'kernel patch sys interface collision' issue
|
|
|
|
|
- Fix 'patch GOT table jump fails' issue
|
|
|
|
|
- Fix 'patch TLS variable relocation fails' issue
|
2023-06-02 17:11:44 +08:00
|
|
|
* Fri Jun 02 2023 renoseven<dev@renoseven.net> - 1.0.1-7
|
|
|
|
|
- Various bugfix
|
|
|
|
|
- Support multiple compiler
|
2023-05-31 08:13:47 +08:00
|
|
|
* Wed May 31 2023 renoseven<dev@renoseven.net> - 1.0.1-6
|
|
|
|
|
- Various bugfix
|
|
|
|
|
- Support multiple debuginfo package
|
2023-05-15 10:29:54 +08:00
|
|
|
* Mon May 15 2023 renoseven<dev@renoseven.net> - 1.0.1-5
|
|
|
|
|
- Fix aarch64 kmod patch jump instruction error issue
|
|
|
|
|
- Add ifunc support
|
|
|
|
|
- Add 'syscare accept' command
|
|
|
|
|
- Add patch 'ACCEPT' state
|
2023-04-04 10:57:35 +08:00
|
|
|
* Tue Apr 04 2023 renoseven<dev@renoseven.net> - 1.0.1-4
|
|
|
|
|
- Enable aarch64
|
|
|
|
|
- Fix syscare-upatch service may start failed issue
|
2023-03-29 18:42:15 +08:00
|
|
|
* Thu Mar 30 2023 renoseven<dev@renoseven.net> - 1.0.1-3
|
|
|
|
|
- Fix upatch may not contain all symbols issue
|
|
|
|
|
- Add syscare-kmod package
|
2023-03-29 17:47:03 +08:00
|
|
|
* Wed Mar 29 2023 renoseven<dev@renoseven.net> - 1.0.1-2
|
|
|
|
|
- Fix rpm install & remove script issue
|
2023-03-15 11:34:43 +08:00
|
|
|
* Wed Mar 15 2023 renoseven<dev@renoseven.net> - 1.0.1-1
|
|
|
|
|
- New syscare cli
|
|
|
|
|
- Support building patch for C++ code
|
|
|
|
|
- Support patch version verification
|
|
|
|
|
- Support elf name derivation
|
|
|
|
|
- Support fast reboot
|
2022-12-21 12:03:08 +00:00
|
|
|
* Wed Dec 21 2022 snoweay<snoweay@163.com> - 1.0.0-7
|
|
|
|
|
- Fix 42 relocation caused by gcc 11.
|
2022-12-20 14:00:40 +00:00
|
|
|
* Tue Dec 20 2022 snoweay<snoweay@163.com> - 1.0.0-6
|
|
|
|
|
- Fix patch open failure by reading patches at attach instead of load.
|
|
|
|
|
- Support epoch in spec.
|
2022-12-17 10:05:25 +00:00
|
|
|
* Sat Dec 17 2022 snoweay<snoweay@163.com> - 1.0.0-5
|
|
|
|
|
- Check version-release of source pkg & debuginfo pkg.
|
2022-12-16 09:15:36 +00:00
|
|
|
* Fri Dec 16 2022 snoweay<snoweay@163.com> - 1.0.0-4
|
|
|
|
|
- Avoid duplicate elfs by not following symlinks at build.
|
2022-12-15 11:04:03 +00:00
|
|
|
* Thu Dec 15 2022 snoweay<snoweay@163.com> - 1.0.0-3
|
|
|
|
|
- Change kernel patches' scontext before apply not at rpm-post.
|
2022-12-14 13:43:07 +00:00
|
|
|
* Wed Dec 14 2022 snoweay<snoweay@163.com> - 1.0.0-2
|
|
|
|
|
- Fix some issues:
|
|
|
|
|
- manager: Allow apply to actived kernel patch
|
|
|
|
|
- build: only 'NOT-APPLIED' patch package can be removed
|
|
|
|
|
- build: fix 'kernel patch cannot be insmod during system start' issue
|
|
|
|
|
- kmod: unregister when rmmod upatch
|
2022-12-13 03:07:16 +00:00
|
|
|
* Tue Dec 13 2022 snoweay<snoweay@163.com> - 1.0.0-1
|
|
|
|
|
- Release the first version 1.0.0.
|