update to syscare-1.0.1-2

Signed-off-by: renoseven <dev@renoseven.net>
(cherry picked from commit 50ed636bcf32aeef2969ad40a4d7204c6479bafc)
(cherry picked from commit f65e8b37e26f49a37753c7308f6068ad0f267d2b)
This commit is contained in:
renoseven 2023-03-29 17:47:03 +08:00 committed by openeuler-sync-bot
parent 30b4e3afb8
commit 16823de88e

View File

@ -2,7 +2,7 @@
Name: syscare Name: syscare
Version: 1.0.1 Version: 1.0.1
Release: 1 Release: 2
Summary: system hot-fix service Summary: system hot-fix service
License: MulanPSL-2.0 and GPL-2.0-only License: MulanPSL-2.0 and GPL-2.0-only
@ -13,7 +13,7 @@ BuildRequires: rust cargo gcc gcc-g++ cmake make
BuildRequires: elfutils-libelf-devel BuildRequires: elfutils-libelf-devel
BuildRequires: kernel-devel BuildRequires: kernel-devel
Requires: kpatch-runtime coreutils Requires: coreutils systemd kpatch-runtime
%description %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. 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.
@ -44,21 +44,22 @@ make
%install %install
cd build_tmp cd build_tmp
%make_install %make_install
%ifarch x86_64
mkdir -p %{buildroot}/lib/modules/%{kernel_version}/extra/syscare
install -m 0640 %{buildroot}/usr/libexec/syscare/upatch.ko %{buildroot}/lib/modules/%{kernel_version}/extra/syscare
cd %{buildroot}
find lib -name "upatch.ko" -fprintf %{_builddir}/%{name}-%{version}/ko.files.list "/%p\n"
%endif
%post %post
# Create runtime directory at installation
if [ "$1" -eq 1 ]; then
mkdir -p /usr/lib/syscare/patches mkdir -p /usr/lib/syscare/patches
fi
%ifarch x86_64 %ifarch x86_64
# Copy upatch kernel module to lib/modules
mkdir -p /lib/modules/$(uname -r)/extra/syscare
install -m 0644 /usr/libexec/syscare/upatch.ko /lib/modules/$(uname -r)/extra/syscare
# Generate kernel module list
depmod -a > /dev/null 2>&1 || true depmod -a > /dev/null 2>&1 || true
%systemd_post syscare-pre.service # Start all services
%systemd_post syscare.service
systemctl enable syscare-pre.service systemctl enable syscare-pre.service
systemctl enable syscare.service systemctl enable syscare.service
systemctl start syscare-pre systemctl start syscare-pre
@ -66,19 +67,29 @@ mkdir -p /usr/lib/syscare/patches
%endif %endif
%preun %preun
rm -rf /usr/lib/syscare/patches
%ifarch x86_64 %ifarch x86_64
%systemd_preun syscare-pre.service # Stop all services
%systemd_preun syscare.service systemctl stop syscare.service
systemctl stop syscare-pre.service
systemctl disable syscare.service
systemctl disable syscare-pre.service
# Unload upatch kernel module
rmmod upatch > /dev/null 2>&1 || true
%endif %endif
%postun %postun
%ifarch x86_64 # Remove runtime directory at uninstallation
depmod -a > /dev/null 2>&1 || true if [ "$1" -eq 0 ] || { [ -n "$2" ] && [ "$2" -eq 0 ]; }; then
%endif rm -rf /usr/lib/syscare
fi
%ifarch x86_64 %ifarch x86_64
%files -f ko.files.list # Remove upatch kernel module from lib/modules
rm -rf /lib/modules/$(uname -r)/extra/syscare
# Generate kernel module list
depmod -a > /dev/null 2>&1 || true
%endif %endif
%files %files
@ -102,6 +113,8 @@ rm -rf /usr/lib/syscare/patches
%endif %endif
%changelog %changelog
* Wed Mar 29 2023 renoseven<dev@renoseven.net> - 1.0.1-2
- Fix rpm install & remove script issue
* Wed Mar 15 2023 renoseven<dev@renoseven.net> - 1.0.1-1 * Wed Mar 15 2023 renoseven<dev@renoseven.net> - 1.0.1-1
- New syscare cli - New syscare cli
- Support building patch for C++ code - Support building patch for C++ code