diff --git a/README.en.md b/README.en.md deleted file mode 100644 index fcf569ccd776360cf1c6f5ec2cb52a3ae4797721..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# syscare - -#### Description -System Hot Services. We take care of the operating system. - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 8b9fc7e6ecfed11d6f691d73a72a55cdca45941a..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# syscare - -#### 介绍 -System Hot Services. We take care of the operating system. - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/get-version.sh b/get-version.sh new file mode 100755 index 0000000000000000000000000000000000000000..0cbf7163c8647c999c753ae4f7541be226dc2724 --- /dev/null +++ b/get-version.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e + +REPO=$1 +VERSION=$2 + +if [ -z "${REPO}" ]; then + echo "Please assign a directory of syscare repo." + exit 1 +fi + +if [ -z "${VERSION}" ]; then + VERSION=HEAD +fi + +cd ${REPO} +REPO=$(pwd) +REPO=${REPO##*/} +cd - +cp -r ${REPO} ${REPO}-${VERSION} +cd ${REPO}-${VERSION} + +git checkout ${VERSION} + +for file in `find . -name Cargo.toml` +do + dir=${file%/Cargo.toml*} + + if [ -n "${dir}" ]; then + cd ${dir} + cargo vendor + mkdir -p .cargo + + cat > .cargo/config << EOF +[source.crates-io] +replace-with = "local-registry" + +[source.local-registry] +directory = "vendor" +EOF + + cd - + fi +done + +cd .. + +rm -rf ${REPO}-${VERSION}/.git +tar -zcf ${REPO}-${VERSION}.tar.gz ${REPO}-${VERSION} +echo "Output: ${REPO}-${VERSION}.tar.gz" + diff --git a/syscare-0.1.1.tar.gz b/syscare-0.1.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8216ce3221c5753005e5c7e11a107077cffa4589 Binary files /dev/null and b/syscare-0.1.1.tar.gz differ diff --git a/syscare.spec b/syscare.spec new file mode 100644 index 0000000000000000000000000000000000000000..02b3e4e673aefb0f5ea0278cc0894dc5f4228c35 --- /dev/null +++ b/syscare.spec @@ -0,0 +1,69 @@ +%global debug_package %{nil} + +Name: syscare +Version: 0.1.1 +Release: 1 +Summary: system hot-fix service + +License: MulanPSL-2.0, GPL-2.0-only +URL: https://gitee.com/openeuler/syscare +Source0: %{name}-%{version}.tar.gz + +ExclusiveArch: x86_64 + +BuildRequires: rust cargo gcc gcc-g++ cmake make +BuildRequires: elfutils-libelf-devel + +Requires: kpatch-runtime + +%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. +The host can fix the system problem without rebooting. + +%package build +Summary: Tools for build syscare patch. +Requires: %{name} = %{version}-%{release} +Requires: kpatch make gcc openssl-devel dwarves python3-devel bison flex +Requires: rpm-build + +%description build +Syscare build tools. + +%prep +%autosetup -p1 + +%build +cmake . +make + +%install +%make_install + +mkdir -p %{buildroot}/usr/lib/systemd/system +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 + +%post +%systemd_post %{name}-restore.service +%systemd_post %{name}-pre.service + +%files +%defattr(-,root,root,-) +%attr(755,root,root) /usr/bin/syscare +%attr(755,root,root) /usr/libexec/%{name}/upatch-tool +%attr(755,root,root) /usr/libexec/%{name}/auto-recovery.sh +%attr(644,root,root) /usr/lib/systemd/system/%{name}-restore.service +%attr(644,root,root) /usr/lib/systemd/system/%{name}-pre.service + +%files build +%defattr(-,root,root,-) +%dir /usr/libexec/%{name} +%attr(755,root,root) /usr/libexec/%{name}/upatch-diff +%attr(755,root,root) /usr/libexec/%{name}/upatch-build +%attr(755,root,root) /usr/libexec/%{name}/syscare-build + +%changelog +* Mon Nov 28 2022 snoweay - 0.1.1-1 +- First version for test. Support patches restore, remove, insmod upatch.ko. +* Mon Nov 21 2022 snoweay - 0.1.0-1 +- init version for 0.1.1-1.