diff --git a/0001-add-use-fork-pid-support-for-kernel-4.19.patch b/0001-add-use-fork-pid-support-for-kernel-4.19.patch new file mode 100644 index 0000000000000000000000000000000000000000..57ebb6807bad21721bdf8f71a230aa1ca0acd23e --- /dev/null +++ b/0001-add-use-fork-pid-support-for-kernel-4.19.patch @@ -0,0 +1,42 @@ +From 8b2ad8b12dbef786ae508d9b5f342a56b491cba6 Mon Sep 17 00:00:00 2001 +From: anatasluo +Date: Mon, 26 Jul 2021 03:33:16 +0000 +Subject: [PATCH] add use fork pid support for kernel 4.19 + +Signed-off-by: anatasluo +--- + config/nvwa-restore.yaml | 3 ++- + src/server.go | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/config/nvwa-restore.yaml b/config/nvwa-restore.yaml +index 46201f9..ab97121 100644 +--- a/config/nvwa-restore.yaml ++++ b/config/nvwa-restore.yaml +@@ -2,4 +2,5 @@ pids: + services: + restore_net: false + enable_quick_kexec: false +-enable_pin_memory: false +\ No newline at end of file ++enable_pin_memory: false ++enable_use_fork_pid: false +diff --git a/src/server.go b/src/server.go +index 3de06a5..a5872da 100644 +--- a/src/server.go ++++ b/src/server.go +@@ -219,6 +219,11 @@ func getCriuExtPara() []string { + criuExtPara = append(criuExtPara, "--pin-memory") + } + ++ enableFP := nvwaRestoreConfig.GetBool("enable_use_fork_pid") ++ if enableFP { ++ criuExtPara = append(criuExtPara, "--use-fork-pid") ++ } ++ + return criuExtPara + } + +-- +2.25.1 + diff --git a/nvwa.spec b/nvwa.spec index 1353f2a59687d338de188da607513b9b2c81dcaa..535b030a9f875b1bd03b458a8fc837e0aea450b0 100644 --- a/nvwa.spec +++ b/nvwa.spec @@ -1,12 +1,14 @@ Name: nvwa Version: 0.1 -Release: 3 +Release: 4 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 +Patch1: 0001-add-use-fork-pid-support-for-kernel-4.19.patch + BuildRequires: golang >= 1.13 Requires: kexec-tools criu Requires: systemd-units iptables-services iproute @@ -18,8 +20,7 @@ A tool used to automate the process of seamless update of the openEuler. %global debug_package %{nil} %prep -%autosetup -n %{name}-v%{version} - +%autosetup -n %{name}-v%{version} -p1 %build @@ -74,6 +75,9 @@ install -m 0644 %{_builddir}/%{name}-v%{version}/misc/%{name}-pre.service %{buil %{_bindir}/%{name}-pre.sh %changelog +* Mon 26 Jul 2021 anatasluo - 0.1-4 +- Add use fork pid support for kernel 4.19 + * Fri 19 Mar 2021 snoweay - 0.1-3 - Add secure compile args.