Compare commits

..

16 Commits

Author SHA1 Message Date
openeuler-ci-bot
852a4c7324
!51 [sync] PR-50: 在24.03版本关闭pin memory
From: @openeuler-sync-bot 
Reviewed-by: @snoweay 
Signed-off-by: @snoweay
2024-05-15 08:11:43 +00:00
renoseven
be8ec3d649 disable pin memory in oe24.03
Signed-off-by: renoseven <dev@renoseven.net>
(cherry picked from commit 902c2a58e2131a929c20ef300de21e6afa117227)
2024-05-15 15:53:50 +08:00
openeuler-ci-bot
26c293cbfa
!49 同步 22.03 LTS Next版本到24.03
From: @snoweay 
Reviewed-by: @hjx_gitff 
Signed-off-by: @hjx_gitff
2024-04-12 09:30:26 +00:00
snoweay
b7ebba7f32 Merge branch 'openEuler-24.03-LTS-Next' of gitee.com:src-openeuler/nvwa into openEuler-22.03-LTS-Next
Signed-off-by: snoweay <snoweay@163.com>
2024-04-12 07:32:17 +00:00
openeuler-ci-bot
e96fa0372b
!44 add loong64 support
From: @huajingyun 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2023-07-14 07:30:18 +00:00
Jingyun Hua
1887695486 Add loong64 support 2023-07-13 12:00:23 +00:00
openeuler-ci-bot
a0eae2dcb0
!43 [sync] PR-42: 解决rpm包编译未strip问题
From: @openeuler-sync-bot 
Reviewed-by: @snoweay 
Signed-off-by: @snoweay
2023-06-27 06:04:34 +00:00
Longjun Luo
d7d02fe3bc nvwa.spec: strip all binarys when build
nvwa is generated by golang, and it misses
some buildid notes. So it may lead to the
following error:
No build ID note found

Just ignore this error to let rpm to strip
the binary.

Signed-off-by: Longjun Luo <luolongjuna@gmail.com>
(cherry picked from commit b3555e273994bced5caa67350369848700f02200)
2023-06-27 11:55:23 +08:00
openeuler-ci-bot
d35f1d651c
!41 sync 22.03-next with 22.03-LTS-SP1
From: @anatas 
Reviewed-by: @snoweay 
Signed-off-by: @snoweay
2023-06-16 03:21:36 +00:00
openeuler-ci-bot
749970e5ba
!37 解决systemd的已知问题
From: @anatas 
Reviewed-by: @snoweay 
Signed-off-by: @snoweay
2023-01-09 07:10:20 +00:00
Longjun Luo
87aca38bde systemd: solve exist problems for systemd
Update to version 0.2-4

Signed-off-by: Longjun Luo <luolongjuna@gmail.com>
2023-01-09 14:26:22 +08:00
hejingxian
dc270b91fa ignore pin_memory init in x86 2022-12-02 18:09:45 +08:00
openeuler-ci-bot
60ae870890
!27 更新版本至0.2-2
From: @anatas 
Reviewed-by: @snoweay 
Signed-off-by: @snoweay
2022-09-07 03:01:44 +00:00
Anatas Luo
58e372fa7d update version to 0.2-2
This update including:
1) fix problems caused by ctrl-c
2) add NetworkManager-wait-online service for nvwa

Signed-off-by: Anatas Luo <luolongjuna@gmail.com>
2022-09-06 16:05:17 +08:00
openeuler-ci-bot
a5cbc382a2
!24 【轻量级 PR】:Fix changelog error
From: @liqiuyu123 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-06-09 08:05:19 +00:00
liqiuyu
63376dfd75
Fix changelog error 2022-06-09 03:22:20 +00:00
6 changed files with 151 additions and 44 deletions

View File

@ -0,0 +1,38 @@
From ef3b67cdd08819699eb43bb06c4f63b34eba477a Mon Sep 17 00:00:00 2001
From: renoseven <dev@renoseven.net>
Date: Wed, 15 May 2024 15:34:35 +0800
Subject: [PATCH] ignore pin memory init in oe24.03
Signed-off-by: renoseven <dev@renoseven.net>
---
misc/nvwa-pre.sh | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/misc/nvwa-pre.sh b/misc/nvwa-pre.sh
index 69f6de9..61535bc 100644
--- a/misc/nvwa-pre.sh
+++ b/misc/nvwa-pre.sh
@@ -1,7 +1,5 @@
#!/bin/bash
-set -e
-
# 1. Increase last pid by 2011 from saved last pid.
# So services restoring may use its old pid.
LAST_PID_FILE="/proc/sys/kernel/ns_last_pid"
@@ -31,11 +29,7 @@ else
rm -rf "${LAST_PID_SAVE_FILE}"
fi
-# 2. Enable Pin Memory
-modprobe pin_memory
-/usr/bin/nvwa-pin --init-pagemap-read
-
-# 3. Enable PMEM
+# 2. Enable PMEM
grep -q "Persistent Memory" /proc/iomem || exit 0
modprobe nd_e820
--
2.34.1

View File

@ -1,39 +0,0 @@
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

View File

@ -0,0 +1,54 @@
From c65a42ea5d2e3626adfd5d09864b2b4bdb0f27d5 Mon Sep 17 00:00:00 2001
From: Longjun Luo <luolongjuna@gmail.com>
Date: Mon, 26 Dec 2022 23:53:48 +0800
Subject: [PATCH] systemd: solve the problem of parsing pid of message
When restore the service of Notify, need to parse
the right pid.
Signed-off-by: Longjun Luo <luolongjuna@gmail.com>
---
src/client.go | 2 +-
src/systemd.go | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/client.go b/src/client.go
index 2bf6875..70d5832 100644
--- a/src/client.go
+++ b/src/client.go
@@ -79,7 +79,7 @@ func startClient(path string) {
if ret != 0 {
handleRet("restore", ret)
}
- RestoreMainPid(c.Args().Get(1))
+ RestoreMainPid(c.Args().First())
NotifySytemd()
SystemdReload()
return nil
diff --git a/src/systemd.go b/src/systemd.go
index 65c53bc..cae7c05 100644
--- a/src/systemd.go
+++ b/src/systemd.go
@@ -1,11 +1,18 @@
package main
import (
+ "strings"
"github.com/coreos/go-systemd/daemon"
log "github.com/sirupsen/logrus"
)
-func RestoreMainPid(pid string) {
+func RestoreMainPid(command string) {
+ commands := strings.Split(command, "@")
+ if (len(commands) != 2) {
+ log.Errorf("Invalid command format %s \n", command)
+ return
+ }
+ pid := commands[1]
ifSupport, err := daemon.SdNotify(false, "READY=1\nMAINPID="+pid)
if ifSupport == false || err != nil {
log.Errorf("Unable to notify systemd, support %v err %s \n", ifSupport, err)
--
2.38.1

View File

@ -0,0 +1,39 @@
From a6b0c93a80bfdfb51d92d2da0b61c520832add5c Mon Sep 17 00:00:00 2001
From: Longjun Luo <luolongjuna@gmail.com>
Date: Fri, 6 Jan 2023 11:16:37 +0800
Subject: [PATCH] nvwa: let nvwa to parse help/h and remove version print
Signed-off-by: Longjun Luo <luolongjuna@gmail.com>
---
src/client.go | 1 -
src/main.go | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/client.go b/src/client.go
index 70d5832..1f0c485 100644
--- a/src/client.go
+++ b/src/client.go
@@ -43,7 +43,6 @@ func startClient(path string) {
app := &cli.App{
Name: "nvwa",
Usage: "a tool used for openEuler kernel update.",
- Version: "0.1",
Compiled: time.Now(),
Commands: []*cli.Command{
{
diff --git a/src/main.go b/src/main.go
index bcb5bb4..27811ed 100644
--- a/src/main.go
+++ b/src/main.go
@@ -9,6 +9,8 @@ var socketPath = "/run/nvwa/nvwa.socket"
func main() {
server := flag.Int("server", 0,
"set this value to 1 to start a server")
+ _ = flag.Bool("h", false, "use nvwa help to see help text")
+ _ = flag.Bool("help", false, "use nvwa help to see help text")
flag.Parse()
if *server != 0 {
startServer(socketPath)
--
2.38.1

View File

@ -1,15 +1,20 @@
Name: nvwa
Version: 0.2
Release: 3
Release: 6
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
Patch1: 0001-ignore-pin-memory-init-in-oe24.03.patch
Patch2: 0002-systemd-solve-the-problem-of-parsing-pid-of-message.patch
Patch3: 0003-nvwa-let-nvwa-to-parse-help-h-and-remove-version-pri.patch
BuildRequires: golang >= 1.13
BuildRequires: systemd
Requires: kexec-tools criu
Requires: systemd-units iptables-services iproute
Requires: gcc
@ -17,9 +22,14 @@ Requires: gcc
%description
A tool used to automate the process of seamless update of the openEuler.
%undefine _missing_build_ids_terminate_build
%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
@ -79,9 +89,14 @@ source /usr/share/bash-completion/completions/nvwa
%{_bindir}/%{name}-pre.sh
%changelog
* Thu Dec 08 2022 fushanqing <fushanqing@kylinos.cn> - 0.2-3
* Wed May 15 2024 renoseven <dev@renoseven.net> - 0.2-6
- disable pin memory in oe24.03
* Thu Jul 13 2023 huajingyun <huajingyun@loongson.cn> - 0.2-5
- add loong64 support
* Tue Jan 03 2023 anatasluo <luolongjun@huawei.com> - 0.2-4
- Solve the problem of parsing pid of message
* Thu Dec 15 2022 fushanqing <fushanqing@kylinos.cn> - 0.2-3
- Enable debuginfo for fix strip
* Wed Dec 14 2022 anatasluo <luolongjun@huawei.com> - 0.2-2
- Fix issues caused by ctrl-c and systemd
* Fri Jul 30 2021 anatasluo <luolongjun@huawei.com> - 0.2-1

BIN
sys.tar.gz Normal file

Binary file not shown.