!15 更新版本至v0.1-2

From: @anatas
Reviewed-by: @yaqiangchen
Signed-off-by: @yaqiangchen
This commit is contained in:
openeuler-ci-bot 2021-04-21 15:08:21 +08:00 committed by Gitee
commit f2f79df786
3 changed files with 131 additions and 23 deletions

View File

@ -1,37 +1,62 @@
# nvwa
#### 介绍
A daemon process for kernel online update
#### 软件架构
软件架构说明
一个用于自动化openEuler热升级过程的工具
#### 构建方式
```
cd src
go get nvwa
go build
```
#### 关于配置
配置文件放置在config目录下运行时二进制会去三个地方寻找配置文件按照先后为
1. 运行目录
2. 运行目录的config子目录
3. /etc/nvwa
配置文件包括:
1. nvwa-restore.yaml
需要进行现场恢复的进程和服务两者区别在于对于每一个服务nvwa会去修改systemd的配置通过systemd恢复运行状态
2. nvwa-server.yaml
热升级使用中需要用到的目录,日志,二进制目录配置等等
#### 安装教程
#### 支持的命令
1. xxxx
2. xxxx
3. xxxx
+ nvwa check -- 运行环境检查
#### 使用说明
+ nvwa update <version> -- 热升级到相应的内核版本(相关文件需放置在/boot下)
1. xxxx
2. xxxx
3. xxxx
nvwa将会去/boot目录下寻找需要的kernel和rootfskernel的命名格式需为vmlinuz-<version>, rootfs命名格式需为initramfs-<version>.img
#### 参与贡献
+ nvwa restore <process> -- 恢复某个之前freeze的进程
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
+ nvwa help
显示client相关的帮助信息
#### 特技
+ nvwa --help
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/)
显示server相关的帮助信息
#### 开发计划
+ 将/boot目录下kernel和rootfs的命名格式放入配置项
+ 支持日志重定向至文件
+ 配置文件改变后,服务自动重新加载
+ server必须以root权限运行
+ server/client帮助文本的问题
+ 优化使用体验
+ 配置文件存在模糊的地方
+ nvwa的启动时机存在一定问题(criu对lsm之类存在依赖)
+ 网络dump/restore变成可选(否则会造成开机网络失效)

BIN
nvwa-v0.1.tar.gz Normal file

Binary file not shown.

83
nvwa.spec Normal file
View File

@ -0,0 +1,83 @@
Name: nvwa
Version: 0.1
Release: 3
Summary: a tool used for openEuler kernel update
License: MulanPSL-2.0 and Apache-2.0 and MIT and MPL-2.0
URL: https://gitee.com/openeuler/nvwa
Source: %{name}-v%{version}.tar.gz
BuildRequires: golang >= 1.13
Requires: kexec-tools criu
Requires: systemd-units iptables-services iproute
Requires: gcc
%description
A tool used to automate the process of seamless update of the openEuler.
%global debug_package %{nil}
%prep
%autosetup -n %{name}-v%{version}
%build
cd src
go build -mod=vendor -buildmode=pie
cd -
cd tools
gcc %{name}-pin.c -o %{name}-pin -fstack-protector-all -fPIE -pie -Wl,-z,noexecstack,-z,relro,-z,now
cd -
%install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/etc/%{name}
mkdir -p %{buildroot}/etc/%{name}/log
mkdir -p %{buildroot}/usr/lib/systemd/system
mkdir -p %{buildroot}/var/%{name}
mkdir -p %{buildroot}/var/%{name}/running
install -m 0750 %{_builddir}/%{name}-v%{version}/src/%{name} %{buildroot}/%{_bindir}/
install -m 0750 %{_builddir}/%{name}-v%{version}/tools/%{name}-pin %{buildroot}/%{_bindir}/
install -m 0640 %{_builddir}/%{name}-v%{version}/config/%{name}-restore.yaml %{buildroot}/etc/%{name}/
install -m 0640 %{_builddir}/%{name}-v%{version}/config/%{name}-server.yaml %{buildroot}/etc/%{name}/
install -m 0750 %{_builddir}/%{name}-v%{version}/misc/%{name}-pre.sh %{buildroot}/%{_bindir}/
install -m 0644 %{_builddir}/%{name}-v%{version}/misc/%{name}.service %{buildroot}/usr/lib/systemd/system
install -m 0644 %{_builddir}/%{name}-v%{version}/misc/%{name}-pre.service %{buildroot}/usr/lib/systemd/system
%post
%systemd_post %{name}.service
%systemd_post %{name}-pre.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%license LICENSE
%dir /etc/%{name}/
%dir /etc/%{name}/log
%dir /var/%{name}
%dir /var/%{name}/running
/etc/%{name}/%{name}-restore.yaml
/etc/%{name}/%{name}-server.yaml
/usr/lib/systemd/system/%{name}.service
/usr/lib/systemd/system/%{name}-pre.service
%{_bindir}/%{name}
%{_bindir}/%{name}-pin
%{_bindir}/%{name}-pre.sh
%changelog
* Fri 19 Mar 2021 snoweay <snoweay@163.com> - 0.1-3
- Add secure compile args.
* Thu 18 Mar 2021 anatasluo <luolongjun@huawei.com>
- Update to 0.1-r2
* Thu Feb 18 2021 anatasluo <luolongjun@huawei.com>
- Update to 0.0.1