2022-11-15 12:55:32 +00:00
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
|
|
|
|
Name: syscare
|
2022-12-13 03:07:16 +00:00
|
|
|
Version: 1.0.0
|
2022-12-20 14:00:40 +00:00
|
|
|
Release: 6
|
2022-11-15 12:55:32 +00:00
|
|
|
Summary: system hot-fix service
|
|
|
|
|
|
2022-12-01 11:59:40 +00:00
|
|
|
License: MulanPSL-2.0 GPL-2.0-only
|
2022-11-15 12:55:32 +00:00
|
|
|
URL: https://gitee.com/openeuler/syscare
|
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2022-12-20 14:00:40 +00:00
|
|
|
Patch1: v1.0.0-6.patch
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
BuildRequires: rust cargo gcc gcc-g++ cmake make
|
|
|
|
|
BuildRequires: elfutils-libelf-devel
|
2022-12-02 11:45:58 +00:00
|
|
|
BuildRequires: kernel-devel
|
2022-11-15 12:55:32 +00:00
|
|
|
|
2022-12-15 11:04:03 +00:00
|
|
|
Requires: kpatch-runtime coreutils
|
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
|
|
|
|
|
|
|
|
%package build
|
|
|
|
|
Summary: Tools for build syscare patch.
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
Requires: kpatch make gcc openssl-devel dwarves python3-devel bison flex
|
2022-12-12 07:26:58 +00:00
|
|
|
Requires: elfutils-libelf-devel
|
2022-11-15 12:55:32 +00:00
|
|
|
Requires: rpm-build
|
|
|
|
|
|
|
|
|
|
%description build
|
|
|
|
|
Syscare build tools.
|
|
|
|
|
|
2022-12-02 11:45:58 +00:00
|
|
|
%define kernel_version $(rpm -q --qf "\%%{VERSION}-\%%{RELEASE}.\%%{ARCH}" `rpm -q kernel-devel` | head -n 1)
|
|
|
|
|
|
2022-11-15 12:55:32 +00:00
|
|
|
%prep
|
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
|
|
%build
|
2022-12-02 11:45:58 +00:00
|
|
|
mkdir -p tmp_build
|
|
|
|
|
cd tmp_build
|
2022-12-16 09:15:36 +00:00
|
|
|
cmake -DSYSCARE_BUILD_VERSION=%{version}-%{release} -DKERNEL_VERSION=%{kernel_version} ..
|
2022-11-15 12:55:32 +00:00
|
|
|
make
|
|
|
|
|
|
|
|
|
|
%install
|
2022-12-02 11:45:58 +00:00
|
|
|
cd tmp_build
|
2022-11-15 12:55:32 +00:00
|
|
|
%make_install
|
|
|
|
|
|
2022-12-02 11:45:58 +00:00
|
|
|
mkdir -p %{buildroot}/lib/modules/%{kernel_version}/extra/syscare
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-12-09 07:21:20 +00:00
|
|
|
install -m 0640 %{buildroot}/usr/libexec/%{name}/upatch.ko %{buildroot}/lib/modules/%{kernel_version}/extra/syscare
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-12-02 11:45:58 +00:00
|
|
|
|
2022-11-28 12:26:22 +00:00
|
|
|
mkdir -p %{buildroot}/usr/lib/systemd/system
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch aarch64
|
|
|
|
|
install -m 0644 %{_builddir}/%{name}-%{version}/misc/%{name}-restore-arm64.service %{buildroot}/usr/lib/systemd/system/%{name}-restore.service
|
|
|
|
|
%else
|
2022-11-28 12:26:22 +00:00
|
|
|
install -m 0644 %{_builddir}/%{name}-%{version}/misc/%{name}-restore.service %{buildroot}/usr/lib/systemd/system
|
|
|
|
|
install -m 0644 %{_builddir}/%{name}-%{version}/misc/%{name}-pre.service %{buildroot}/usr/lib/systemd/system
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-11-28 12:26:22 +00:00
|
|
|
|
2022-12-09 07:21:20 +00:00
|
|
|
mkdir -p %{buildroot}/usr/lib/syscare
|
|
|
|
|
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-12-09 07:21:20 +00:00
|
|
|
cd %{buildroot}
|
|
|
|
|
find lib -name "upatch.ko" \
|
|
|
|
|
-fprintf %{_builddir}/%{name}-%{version}/ko.files.list "/%p\n"
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-12-02 11:45:58 +00:00
|
|
|
|
2022-11-28 12:26:22 +00:00
|
|
|
%post
|
|
|
|
|
%systemd_post %{name}-restore.service
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-12-02 11:45:58 +00:00
|
|
|
%{_bindir}/systemctl enable %{name}-pre.service
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-12-13 03:07:16 +00:00
|
|
|
depmod -a > /dev/null 2>&1 || true
|
2022-12-02 11:45:58 +00:00
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun %{name}-restore.service
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-12-02 11:45:58 +00:00
|
|
|
%systemd_preun %{name}-pre.service
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-12-02 11:45:58 +00:00
|
|
|
|
|
|
|
|
%postun
|
2022-12-13 03:07:16 +00:00
|
|
|
depmod -a > /dev/null 2>&1 || true
|
2022-11-28 12:26:22 +00:00
|
|
|
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-12-09 07:21:20 +00:00
|
|
|
%files -f ko.files.list
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-11-15 12:55:32 +00:00
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root,-)
|
2022-12-09 07:21:20 +00:00
|
|
|
%dir /usr/lib/syscare
|
2022-11-22 11:44:18 +00:00
|
|
|
%attr(755,root,root) /usr/bin/syscare
|
2022-12-12 07:26:58 +00:00
|
|
|
%ifarch x86_64
|
2022-11-22 11:44:18 +00:00
|
|
|
%attr(755,root,root) /usr/libexec/%{name}/upatch-tool
|
2022-12-09 07:21:20 +00:00
|
|
|
%attr(640,root,root) /usr/libexec/%{name}/upatch.ko
|
2022-11-28 12:26:22 +00:00
|
|
|
%attr(644,root,root) /usr/lib/systemd/system/%{name}-pre.service
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
|
|
|
|
%attr(755,root,root) /usr/libexec/%{name}/auto-recovery.sh
|
|
|
|
|
%attr(644,root,root) /usr/lib/systemd/system/%{name}-restore.service
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
%files build
|
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
%dir /usr/libexec/%{name}
|
2022-12-12 07:26:58 +00:00
|
|
|
%attr(755,root,root) /usr/libexec/%{name}/syscare-build
|
|
|
|
|
%ifarch x86_64
|
2022-11-22 11:44:18 +00:00
|
|
|
%attr(755,root,root) /usr/libexec/%{name}/upatch-diff
|
|
|
|
|
%attr(755,root,root) /usr/libexec/%{name}/upatch-build
|
2022-12-12 07:26:58 +00:00
|
|
|
%endif
|
2022-11-15 12:55:32 +00:00
|
|
|
|
|
|
|
|
%changelog
|
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.
|