Signed-off-by: anatasluo <luolongjuna@gmail.com>
This commit is contained in:
anatasluo 2021-02-23 03:53:31 +08:00 committed by root
parent 10e887c063
commit 8213d8f302
3 changed files with 110 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.0.1.tar.gz Normal file

Binary file not shown.

62
nvwa.spec Normal file
View File

@ -0,0 +1,62 @@
Name: nvwa
Version: 0.0.1
Release: 1
Summary: a tool used for openEuler kernel update
License: MulanPSL-2.0 and Apache-2.0 and MIT
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
%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
cd -
%install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/etc/%{name}
mkdir -p %{buildroot}/etc/%{name}/running/
mkdir -p %{buildroot}/etc/systemd/system/
install -m 0750 %{_builddir}/%{name}-v%{version}/src/%{name} %{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 0644 %{_builddir}/%{name}-v%{version}/%{name}.service %{buildroot}/etc/systemd/system/
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%license LICENSE
%dir /etc/%{name}/
/etc/%{name}/%{name}-restore.yaml
/etc/%{name}/%{name}-server.yaml
/etc/systemd/system/%{name}.service
%{_bindir}/%{name}
%changelog
* Thu Feb 18 2021 anatasluo <luolongjun@huawei.com>
- Update to 0.0.1