Compare commits
11 Commits
10e887c063
...
63b61275c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63b61275c9 | ||
|
|
0d2ee91e04 | ||
|
|
fbdc5bacc0 | ||
|
|
8fc81c77a1 | ||
|
|
a39bbe377c | ||
|
|
416f649640 | ||
|
|
3299128568 | ||
|
|
3386e47381 | ||
|
|
81599bcded | ||
|
|
f2f79df786 | ||
|
|
9bde36ed54 |
39
0001-ignore-pin-memory-init-in-x86.patch
Normal file
39
0001-ignore-pin-memory-init-in-x86.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From fe0b709d2fe196097796b3b964803226c6ca9578 Mon Sep 17 00:00:00 2001
|
||||
From: hejingxian <hejingxian@huawei.com>
|
||||
Date: Thu, 1 Dec 2022 23:02:21 +0800
|
||||
Subject: [PATCH] ignore pin memory init in x86
|
||||
|
||||
Signed-off-by: hejingxian <hejingxian@huawei.com>
|
||||
---
|
||||
misc/nvwa-pre.sh | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/misc/nvwa-pre.sh b/misc/nvwa-pre.sh
|
||||
index 69f6de9..18960e7 100644
|
||||
--- a/misc/nvwa-pre.sh
|
||||
+++ b/misc/nvwa-pre.sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
-set -e
|
||||
+#set -e
|
||||
|
||||
# 1. Increase last pid by 2011 from saved last pid.
|
||||
# So services restoring may use its old pid.
|
||||
@@ -32,8 +32,11 @@ else
|
||||
fi
|
||||
|
||||
# 2. Enable Pin Memory
|
||||
-modprobe pin_memory
|
||||
-/usr/bin/nvwa-pin --init-pagemap-read
|
||||
+is_x86=`uname -a | grep x86`
|
||||
+if [[ $is_x86"X" == "X" ]]; then
|
||||
+ modprobe pin_memory
|
||||
+ /usr/bin/nvwa-pin --init-pagemap-read
|
||||
+fi
|
||||
|
||||
# 3. Enable PMEM
|
||||
grep -q "Persistent Memory" /proc/iomem || exit 0
|
||||
--
|
||||
2.20.1.windows.1
|
||||
|
||||
71
README.md
71
README.md
@ -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和rootfs,kernel的命名格式需为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.2.tar.gz
Normal file
BIN
nvwa-v0.2.tar.gz
Normal file
Binary file not shown.
98
nvwa.spec
Normal file
98
nvwa.spec
Normal file
@ -0,0 +1,98 @@
|
||||
Name: nvwa
|
||||
Version: 0.2
|
||||
Release: 2
|
||||
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
|
||||
#source1 version sys@v0.0.0-20220908164124-27713097b956
|
||||
Source1: sys.tar.gz
|
||||
|
||||
Patch1: 0001-ignore-pin-memory-init-in-x86.patch
|
||||
|
||||
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} -p1
|
||||
%ifarch loongarch64
|
||||
rm -rf src/vendor/golang.org/x/sys
|
||||
tar -xf %{SOURCE1} -C src/vendor/golang.org/x/
|
||||
%endif
|
||||
|
||||
%build
|
||||
|
||||
cd src
|
||||
go build -mod=vendor -buildmode=pie
|
||||
cd -
|
||||
|
||||
cd tools/pin
|
||||
gcc %{name}-pin.c -o %{name}-pin -fstack-protector-all -fPIE -pie -Wl,-z,noexecstack,-z,relo,-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/pin/%{name}-pin %{buildroot}/%{_bindir}/
|
||||
install -m 0640 %{_builddir}/%{name}-v%{version}/src/config/%{name}-restore.yaml %{buildroot}/etc/%{name}/
|
||||
install -m 0640 %{_builddir}/%{name}-v%{version}/src/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
|
||||
|
||||
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions
|
||||
install -p -m 0644 %{_builddir}/%{name}-v%{version}/completion/nvwa %{buildroot}/usr/share/bash-completion/completions/nvwa
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service
|
||||
%systemd_post %{name}-pre.service
|
||||
source /usr/share/bash-completion/completions/nvwa
|
||||
|
||||
%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
|
||||
/usr/share/bash-completion/completions/nvwa
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/%{name}-pin
|
||||
%{_bindir}/%{name}-pre.sh
|
||||
|
||||
%changelog
|
||||
* Thu Jul 13 2023 huajingyun <huajingyun@loongson.cn> - 0.2-2
|
||||
- add loong64 support
|
||||
* Fri Jul 30 2021 anatasluo <luolongjun@huawei.com> - 0.2-1
|
||||
- Update to 0.2
|
||||
* Fri Mar 19 2021 snoweay <snoweay@163.com> - 0.1-3
|
||||
- Add secure compile args
|
||||
* Thu Mar 18 2021 anatasluo <luolongjun@huawei.com> 0.1-2
|
||||
- Update to 0.1-r2
|
||||
* Thu Feb 18 2021 anatasluo <luolongjun@huawei.com> - 0.0.1-1
|
||||
- Update to 0.0.1
|
||||
BIN
sys.tar.gz
Normal file
BIN
sys.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user