diff --git a/0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch b/0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch index 7ccdd8c1c8aaa4dc7f782a84ce0b3884047b5f77..d8a67462f1fa5c7ffe5e7fabf29618b34f415bed 100644 --- a/0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch +++ b/0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch @@ -1,44 +1,4 @@ -From f700bf90e9339d41132a62c24dde9b1c0fa8a9ee Mon Sep 17 00:00:00 2001 -From: snoweay -Date: Thu, 25 Apr 2024 17:36:32 +0800 -Subject: [PATCH] criu: dump and restore cpu affinity of each thread - -Criu should dump and restore threads' or processes' -cpu affinity. - -Add one entry of thread_cpuallow_entry into -thread_core_entry to save cpu affinity info. - -Restore it after threads restored but before running. - -Add option --with-cpu-affinity to enable this function -at restore. - -Signed-off-by: Sang Yan ---- - .../arch/arm/plugins/std/syscalls/syscall.def | 1 + - .../plugins/std/syscalls/syscall-ppc64.tbl | 1 + - .../plugins/std/syscalls/syscall-s390.tbl | 1 + - .../x86/plugins/std/syscalls/syscall_32.tbl | 1 + - .../x86/plugins/std/syscalls/syscall_64.tbl | 1 + - criu/config.c | 1 + - criu/cr-dump.c | 13 ++++++ - criu/cr-restore.c | 23 ++++++++++ - criu/crtools.c | 2 + - criu/include/cr_options.h | 2 + - criu/include/restorer.h | 3 ++ - criu/pie/restorer.c | 38 +++++++++++++++++ - criu/pstree.c | 7 ++++ - images/core.proto | 5 +++ - test/zdtm/static/Makefile | 1 + - test/zdtm/static/cpu-affinity0.c | 42 +++++++++++++++++++ - test/zdtm/static/cpu-affinity0.desc | 1 + - 17 files changed, 143 insertions(+) - create mode 100644 test/zdtm/static/cpu-affinity0.c - create mode 100644 test/zdtm/static/cpu-affinity0.desc - -diff --git a/compel/arch/arm/plugins/std/syscalls/syscall.def b/compel/arch/arm/plugins/std/syscalls/syscall.def -index 7489ee0..9403fc2 100644 +index 9a33009..4ebac0e 100644 --- a/compel/arch/arm/plugins/std/syscalls/syscall.def +++ b/compel/arch/arm/plugins/std/syscalls/syscall.def @@ -118,6 +118,7 @@ fsopen 430 430 (char *fsname, unsigned int flags) @@ -46,11 +6,23 @@ index 7489ee0..9403fc2 100644 fsmount 432 432 (int fd, unsigned int flags, unsigned int attr_flags) clone3 435 435 (struct clone_args *uargs, size_t size) +sched_setaffinity 122 241 (int fd, size_t cpusetsize, const cpu_set_t *mask) + close_range 436 436 (unsigned int fd, unsigned int max_fd, unsigned int flags) pidfd_open 434 434 (pid_t pid, unsigned int flags) openat2 437 437 (int dirfd, char *pathname, struct open_how *how, size_t size) - pidfd_getfd 438 438 (int pidfd, int targetfd, unsigned int flags) +diff --git a/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl b/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl +index aa6ffb4..f870f0e 100644 +--- a/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl ++++ b/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl +@@ -48,6 +48,7 @@ __NR_sys_timer_settime 110 sys_timer_settime (kernel_timer_t timer_id, int flag + __NR_sys_timer_delete 111 sys_timer_delete (kernel_timer_t timer_id) + __NR_clock_gettime 113 sys_clock_gettime (const clockid_t which_clock, const struct timespec *tp) + __NR_sched_setscheduler 119 sys_sched_setscheduler (int pid, int policy, struct sched_param *p) ++__NR_sched_setaffinity 122 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask) + __NR_restart_syscall 128 sys_restart_syscall (void) + __NR_kill 129 sys_kill (long pid, int sig) + __NR_sigaltstack 132 sys_sigaltstack (const void *uss, void *uoss) diff --git a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl -index 4c9b75c..43ecc40 100644 +index c56b4e6..e905a6b 100644 --- a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl +++ b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl @@ -114,6 +114,7 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags) @@ -58,11 +30,23 @@ index 4c9b75c..43ecc40 100644 __NR_fsmount 432 sys_fsmount (int fd, unsigned int flags, unsigned int attr_flags) __NR_clone3 435 sys_clone3 (struct clone_args *uargs, size_t size) +__NR_sched_setaffinity 222 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask) + __NR_close_range 436 sys_close_range (unsigned int fd, unsigned int max_fd, unsigned int flags) __NR_pidfd_open 434 sys_pidfd_open (pid_t pid, unsigned int flags) __NR_openat2 437 sys_openat2 (int dirfd, char *pathname, struct open_how *how, size_t size) - __NR_pidfd_getfd 438 sys_pidfd_getfd (int pidfd, int targetfd, unsigned int flags) +diff --git a/compel/arch/riscv64/plugins/std/syscalls/syscall.def b/compel/arch/riscv64/plugins/std/syscalls/syscall.def +index 17f763e..92cf955 100644 +--- a/compel/arch/riscv64/plugins/std/syscalls/syscall.def ++++ b/compel/arch/riscv64/plugins/std/syscalls/syscall.def +@@ -116,6 +116,7 @@ fsopen 430 430 (char *fsname, unsigned int flags) + fsconfig 431 431 (int fd, unsigned int cmd, const char *key, const char *value, int aux) + fsmount 432 432 (int fd, unsigned int flags, unsigned int attr_flags) + clone3 435 435 (struct clone_args *uargs, size_t size) ++sched_setaffinity 122 241 (int fd, size_t cpusetsize, const cpu_set_t *mask) + pidfd_open 434 434 (pid_t pid, unsigned int flags) + pidfd_getfd 438 438 (int pidfd, int targetfd, unsigned int flags) + rseq 293 293 (void *rseq, uint32_t rseq_len, int flags, uint32_t sig) diff --git a/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl b/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl -index af7d550..ef72a2f 100644 +index 018d58a..2c788d9 100644 --- a/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl +++ b/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl @@ -114,6 +114,7 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags) @@ -70,11 +54,11 @@ index af7d550..ef72a2f 100644 __NR_fsmount 432 sys_fsmount (int fd, unsigned int flags, unsigned int attr_flags) __NR_clone3 435 sys_clone3 (struct clone_args *uargs, size_t size) +__NR_sched_setaffinity 239 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask) + __NR_close_range 436 sys_close_range (unsigned int fd, unsigned int max_fd, unsigned int flags) __NR_pidfd_open 434 sys_pidfd_open (pid_t pid, unsigned int flags) __NR_openat2 437 sys_openat2 (int dirfd, char *pathname, struct open_how *how, size_t size) - __NR_pidfd_getfd 438 sys_pidfd_getfd (int pidfd, int targetfd, unsigned int flags) diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl -index ab36a5c..6c6522a 100644 +index cc23dc3..b0b95d7 100644 --- a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl +++ b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl @@ -63,6 +63,7 @@ __NR_mincore 218 sys_mincore (void *addr, unsigned long size, unsigned char * @@ -86,7 +70,7 @@ index ab36a5c..6c6522a 100644 __NR_get_thread_area 244 sys_get_thread_area (user_desc_t *info) __NR_io_setup 245 sys_io_setup (unsigned nr_reqs, aio_context_t *ctx32p) diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl -index 57681b7..4746bd2 100644 +index 7fbfd69..5011663 100644 --- a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl +++ b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl @@ -73,6 +73,7 @@ __NR_mount 165 sys_mount (char *dev_nmae, char *dir_name, char *type, unsign @@ -110,10 +94,10 @@ index 1322a49..f3f4666 100644 { "network-lock", required_argument, 0, 1100 }, BOOL_OPT("mntns-compat-mode", &opts.mntns_compat_mode), diff --git a/criu/cr-dump.c b/criu/cr-dump.c -index ee5974a..eb540b0 100644 +index 302078c..a5e47e3 100644 --- a/criu/cr-dump.c +++ b/criu/cr-dump.c -@@ -140,6 +140,7 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc) +@@ -142,6 +142,7 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc) { int ret; struct sched_param sp; @@ -121,7 +105,7 @@ index ee5974a..eb540b0 100644 BUILD_BUG_ON(SCHED_OTHER != 0); /* default in proto message */ -@@ -184,6 +185,18 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc) +@@ -191,6 +192,18 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc) pr_info("\tdumping %d nice for %d\n", ret, pid); tc->has_sched_nice = true; tc->sched_nice = ret; @@ -141,18 +125,18 @@ index ee5974a..eb540b0 100644 return 0; } diff --git a/criu/cr-restore.c b/criu/cr-restore.c -index 2700497..9855a3d 100644 +index 1f4881d..7f75bd1 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c -@@ -120,6 +120,7 @@ static int prepare_restorer_blob(void); +@@ -123,6 +123,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *ta, unsigned l + static int prepare_restorer_blob(void); static int prepare_rlimits(int pid, struct task_restore_args *, CoreEntry *core); - static int prepare_posix_timers(int pid, struct task_restore_args *ta, CoreEntry *core); static int prepare_signals(int pid, struct task_restore_args *, CoreEntry *core); +static int prepare_allowed_cpus(int pid, struct task_restore_args *ta, CoreEntry *leader_core); /* * Architectures can overwrite this function to restore registers that are not -@@ -921,6 +922,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core) +@@ -661,6 +662,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core) if (prepare_signals(pid, ta, core)) return -1; @@ -162,7 +146,7 @@ index 2700497..9855a3d 100644 if (prepare_posix_timers(pid, ta, core)) return -1; -@@ -3298,6 +3302,24 @@ out: +@@ -2831,6 +2835,24 @@ out: return ret; } @@ -187,7 +171,7 @@ index 2700497..9855a3d 100644 extern void __gcov_flush(void) __attribute__((weak)); void __gcov_flush(void) { -@@ -3762,6 +3784,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns +@@ -3300,6 +3322,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns RST_MEM_FIXUP_PPTR(task_args->timerfd); RST_MEM_FIXUP_PPTR(task_args->posix_timers); RST_MEM_FIXUP_PPTR(task_args->siginfo); @@ -196,10 +180,10 @@ index 2700497..9855a3d 100644 RST_MEM_FIXUP_PPTR(task_args->helpers); RST_MEM_FIXUP_PPTR(task_args->zombies); diff --git a/criu/crtools.c b/criu/crtools.c -index 94657f4..a8df89d 100644 +index 6f49385..2736277 100644 --- a/criu/crtools.c +++ b/criu/crtools.c -@@ -509,6 +509,8 @@ usage: +@@ -513,6 +513,8 @@ usage: " --file-validation METHOD\n" " pass the validation method to be used; argument\n" " can be 'filesize' or 'buildid' (default).\n" @@ -209,10 +193,10 @@ index 94657f4..a8df89d 100644 " Skip checking file permissions\n" " (r/w/x for u/g/o) on restore.\n" diff --git a/criu/include/cr_options.h b/criu/include/cr_options.h -index 60cf943..db7484a 100644 +index ab0bd8f..bc4538e 100644 --- a/criu/include/cr_options.h +++ b/criu/include/cr_options.h -@@ -212,6 +212,8 @@ struct cr_options { +@@ -220,6 +220,8 @@ struct cr_options { /* This stores which method to use for file validation. */ int file_validation_method; @@ -222,7 +206,7 @@ index 60cf943..db7484a 100644 /* Shows the mode criu is running at the moment: dump/pre-dump/restore/... */ enum criu_mode mode; diff --git a/criu/include/restorer.h b/criu/include/restorer.h -index f398d8d..668aa65 100644 +index a4fb7ea..db9ec38 100644 --- a/criu/include/restorer.h +++ b/criu/include/restorer.h @@ -1,6 +1,7 @@ @@ -233,7 +217,7 @@ index f398d8d..668aa65 100644 #include #include #include -@@ -170,6 +171,8 @@ struct task_restore_args { +@@ -177,6 +178,8 @@ struct task_restore_args { siginfo_t *siginfo; unsigned int siginfo_n; @@ -243,10 +227,10 @@ index f398d8d..668aa65 100644 unsigned int tcp_socks_n; diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c -index 0297165..d8e7d41 100644 +index 348ce66..26d4623 100644 --- a/criu/pie/restorer.c +++ b/criu/pie/restorer.c -@@ -477,6 +477,40 @@ static int restore_signals(siginfo_t *ptr, int nr, bool group) +@@ -496,6 +496,40 @@ static int restore_signals(siginfo_t *ptr, int nr, bool group) return 0; } @@ -287,7 +271,7 @@ index 0297165..d8e7d41 100644 static int restore_rseq(struct rst_rseq_param *rseq) { int ret; -@@ -2139,6 +2173,10 @@ __visible long __export_restore_task(struct task_restore_args *args) +@@ -2176,6 +2210,10 @@ __visible long __export_restore_task(struct task_restore_args *args) if (ret) goto core_restore_end; @@ -299,10 +283,10 @@ index 0297165..d8e7d41 100644 rst_tcp_socks_all(args); diff --git a/criu/pstree.c b/criu/pstree.c -index 8c44e71..efc52c0 100644 +index 660f1b9..1d692be 100644 --- a/criu/pstree.c +++ b/criu/pstree.c -@@ -58,11 +58,13 @@ CoreEntry *core_entry_alloc(int th, int tsk) +@@ -58,12 +58,14 @@ CoreEntry *core_entry_alloc(int th, int tsk) CredsEntry *ce = NULL; sz += sizeof(ThreadCoreEntry) + sizeof(ThreadSasEntry) + sizeof(CredsEntry); @@ -312,13 +296,14 @@ index 8c44e71..efc52c0 100644 sz += CR_CAP_SIZE * sizeof(ce->cap_prm[0]); sz += CR_CAP_SIZE * sizeof(ce->cap_eff[0]); sz += CR_CAP_SIZE * sizeof(ce->cap_bnd[0]); + sz += CR_CAP_SIZE * sizeof(ce->cap_amb[0]); + sz += sizeof(cpu_set_t); /* * @groups are dynamic and allocated * on demand. -@@ -127,6 +129,11 @@ CoreEntry *core_entry_alloc(int th, int tsk) - ce->cap_eff = xptr_pull_s(&m, CR_CAP_SIZE * sizeof(ce->cap_eff[0])); +@@ -130,6 +132,11 @@ CoreEntry *core_entry_alloc(int th, int tsk) ce->cap_bnd = xptr_pull_s(&m, CR_CAP_SIZE * sizeof(ce->cap_bnd[0])); + ce->cap_amb = xptr_pull_s(&m, CR_CAP_SIZE * sizeof(ce->cap_amb[0])); + core->thread_core->allowed_cpus = xptr_pull(&m, ThreadAllowedcpusEntry); + thread_allowedcpus_entry__init(core->thread_core->allowed_cpus); @@ -329,10 +314,10 @@ index 8c44e71..efc52c0 100644 xfree(core); core = NULL; diff --git a/images/core.proto b/images/core.proto -index 5b07b5c..e4ca389 100644 +index 1fa2386..5b2d1ce 100644 --- a/images/core.proto +++ b/images/core.proto -@@ -90,6 +90,10 @@ message thread_sas_entry { +@@ -91,6 +91,10 @@ message thread_sas_entry { required uint32 ss_flags = 3; } @@ -343,7 +328,7 @@ index 5b07b5c..e4ca389 100644 message thread_core_entry { required uint64 futex_rla = 1; required uint32 futex_rla_len = 2; -@@ -110,6 +114,7 @@ message thread_core_entry { +@@ -111,6 +115,7 @@ message thread_core_entry { optional uint64 blk_sigset_extended = 14; optional rseq_entry rseq_entry = 15; optional uint32 cg_set = 16; @@ -352,10 +337,10 @@ index 5b07b5c..e4ca389 100644 message task_rlimits_entry { diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile -index 07d3bc6..c25a46f 100644 +index 6a19cad..270857d 100644 --- a/test/zdtm/static/Makefile +++ b/test/zdtm/static/Makefile -@@ -266,6 +266,7 @@ TST_NOFILE := \ +@@ -279,6 +279,7 @@ TST_NOFILE := \ timens_nested \ timens_for_kids \ zombie_leader \ @@ -365,7 +350,7 @@ index 07d3bc6..c25a46f 100644 change_mnt_context \ diff --git a/test/zdtm/static/cpu-affinity0.c b/test/zdtm/static/cpu-affinity0.c new file mode 100644 -index 0000000..27afe73 +index 0000000..83dee19 --- /dev/null +++ b/test/zdtm/static/cpu-affinity0.c @@ -0,0 +1,42 @@ @@ -387,7 +372,7 @@ index 0000000..27afe73 + + CPU_ZERO(&old); + CPU_ZERO(&new); -+ ++ + /* test only 0 core because of CI test env limited */ + CPU_SET(0, &old); + @@ -419,5 +404,5 @@ index 0000000..0d0b8ae @@ -0,0 +1 @@ +{'dopts': '', 'ropts': '--with-cpu-affinity', 'flags': 'reqrst '} -- -2.33.0 +2.48.1 diff --git a/0002-Add-sys_sched_setaffinity-define-for-loongarch64.patch b/0002-Add-sys_sched_setaffinity-define-for-loongarch64.patch deleted file mode 100644 index 66d57325ba6e436251eb345a040e2abd590cbe97..0000000000000000000000000000000000000000 --- a/0002-Add-sys_sched_setaffinity-define-for-loongarch64.patch +++ /dev/null @@ -1,24 +0,0 @@ -From a8d438800b2b83bf8e64549d827bd4aa95c7562c Mon Sep 17 00:00:00 2001 -From: zhangzikang -Date: Mon, 13 May 2024 20:23:58 +0800 -Subject: [PATCH] Add sys_sched_setaffinity define for loongarch64 - ---- - compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl b/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl -index aa6ffb4..6bd19d1 100644 ---- a/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl -+++ b/compel/arch/loongarch64/plugins/std/syscalls/syscall_64.tbl -@@ -113,6 +113,7 @@ __NR_pidfd_open 434 sys_pidfd_open (pid_t pid, unsigned int flags) - __NR_clone3 435 sys_clone3 (struct clone_args *uargs, size_t size) - __NR_openat2 437 sys_openat2 (int dirfd, char *pathname, struct open_how *how, size_t size) - __NR_pidfd_getfd 438 sys_pidfd_getfd (int pidfd, int targetfd, unsigned int flags) -+__NR_sched_setaffinity 122 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask) - #__NR_dup2 ! sys_dup2 (int oldfd, int newfd) - #__NR_rmdir ! sys_rmdir (const char *name) - #__NR_unlink ! sys_unlink (char *pathname) --- -2.33.0 - diff --git a/0003-chore-support-building-without-network.patch b/0003-chore-support-building-without-network.patch deleted file mode 100644 index 4508240df1e325c2a7591189bce0477c5b7ee93e..0000000000000000000000000000000000000000 --- a/0003-chore-support-building-without-network.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 8b4b9f9020658554562665f78e019b897ff80647 Mon Sep 17 00:00:00 2001 -From: weidongkl -Date: Thu, 5 Dec 2024 10:56:26 +0800 -Subject: [PATCH] chore: support building without network - -Signed-off-by: weidongkl ---- - crit/Makefile | 8 ++++++-- - lib/Makefile | 5 ++--- - 2 files changed, 8 insertions(+), 5 deletions(-) - -diff --git a/crit/Makefile b/crit/Makefile -index 9a856db..34f1359 100644 ---- a/crit/Makefile -+++ b/crit/Makefile -@@ -16,11 +16,15 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) - $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" - else - $(E) " INSTALL " crit -- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit -+ #$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit -+ $(Q) cd crit;$(PYTHON) setup.py install --root $(DESTDIR) -+ - endif - else - $(E) " INSTALL " crit -- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit -+ #$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit -+ $(Q) cd crit;$(PYTHON) setup.py install --root $(DESTDIR) -+ - endif - .PHONY: install - -diff --git a/lib/Makefile b/lib/Makefile -index ae371e7..7fdd5b8 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -60,14 +60,13 @@ install: lib-c lib-a lib-py lib/c/criu.pc.in - ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) - ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) - $(E) " SKIP INSTALL pycriu: Externally managed python environment (See PEP 668 for more information)" -- $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" - else - $(E) " INSTALL " pycriu -- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib -+ $(Q) cd lib;$(PYTHON) setup.py install --root $(DESTDIR) - endif - else - $(E) " INSTALL " pycriu -- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib -+ $(Q) cd lib;$(PYTHON) setup.py install --root $(DESTDIR) - endif - .PHONY: install - --- -2.46.0 - diff --git a/criu-3.19.tar.gz b/criu-3.19.tar.gz deleted file mode 100644 index 7a57acba43258880039d01cc956dc0b3ccb6a75f..0000000000000000000000000000000000000000 Binary files a/criu-3.19.tar.gz and /dev/null differ diff --git a/criu-4.1.tar.gz b/criu-4.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d3367caefc2619ef10b114bcfa7c0c11ca2d97ac Binary files /dev/null and b/criu-4.1.tar.gz differ diff --git a/criu.spec b/criu.spec index 4dce3fd25d30a613f04ef0d46d3601b8e97dce19..0debcf76c5b8b25633c59e162dc9125f465527ba 100644 --- a/criu.spec +++ b/criu.spec @@ -1,8 +1,8 @@ %global _gcc_lto_cflags %{nil} Name: criu -Version: 3.19 -Release: 5 +Version: 4.1 +Release: 1 Provides: crtools = %{version}-%{release} Obsoletes: crtools <= 1.0-2 Summary: A tool of Checkpoint/Restore in User-space @@ -12,21 +12,35 @@ Source0: http://github.com/checkpoint-restore/criu/archive/v%{version}/%{n BuildRequires: systemd libnet-devel asciidoc xmlto perl-interpreter libselinux-devel gcc make BuildRequires: protobuf-devel protobuf-c-devel python3-devel libnl3-devel libcap-devel BuildRequires: python3-pip python3-setuptools python3-wheel python3-protobuf +BuildRequires: libdrm-devel libuuid-devel +BuildRequires: libbsd-devel gnutls-devel nftables-devel Recommends: tar -ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x loongarch64 +ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x loongarch64 riscv64 Requires: %{name} = %{version}-%{release} Provides: %{name}-libs = %{version}-%{release} Obsoletes: %{name}-libs < %{version}-%{release} Patch1: 0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch -Patch2: 0002-Add-sys_sched_setaffinity-define-for-loongarch64.patch -Patch3: 0003-chore-support-building-without-network.patch %description Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system. Using this tool,it is possible to freeze a running application (or part of it) and checkpoint it to persistent storage as a collection of files. +%package amdgpu-plugin +Summary: AMD GPU plugin for %{name} +Requires: %{name} = %{version}-%{release} + +%description amdgpu-plugin +This package contains the AMD GPU plugin for %{name} + +%package cuda-plugin +Summary: CUDA plugin for %{name} +Requires: %{name} = %{version}-%{release} + +%description cuda-plugin +This package contains the CUDA plugin for %{name} + %package devel Summary: Static files and header files of libraries for criu Requires: %{name} = %{version}-%{release} @@ -66,12 +80,16 @@ Help documents for criu. %autosetup -n %{name}-%{version} -p1 %build -CFLAGS+=`echo %{optflags}` make V=1 WERROR=0 PREFIX=%{_prefix} RUNDIR=/run/criu PYTHON=python3 +CFLAGS+=`echo %{optflags}` make V=1 WERROR=0 PREFIX=%{_prefix} RUNDIR=/run/criu PYTHON=python3 PLUGINDIR=%{_libdir}/criu NETWORK_LOCK_DEFAULT=NETWORK_LOCK_NFTABLES +make V=1 WERROR=0 PREFIX=%{_prefix} PLUGINDIR=%{_libdir}/criu amdgpu_plugin \ +PLUGIN_CFLAGS="-g -Wall -D _GNU_SOURCE -shared -nostartfiles -fPIC" %install -make install-criu DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} -make install-crit DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} -make install-lib DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} PYTHON=python3 +make install-amdgpu_plugin DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} PLUGINDIR=%{_libdir}/criu +make install-cuda_plugin DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} PLUGINDIR=%{_libdir}/criu +make install-criu DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} BINDIR=%{_bindir} SBINDIR=%{_sbindir} +make install-crit DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} BINDIR=%{_bindir} SBINDIR=%{_sbindir} PYTHON=python3 PIPFLAGS="--no-build-isolation --no-index --no-deps --progress-bar off --upgrade --ignore-installed" +make install-lib DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} PYTHON=python3 PIPFLAGS="--no-build-isolation --no-index --no-deps --progress-bar off --upgrade --ignore-installed" make install-man DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} install -d %{buildroot}/run/%{name}/ @@ -89,12 +107,20 @@ chmod 0755 %{buildroot}/run/%{name}/ %{_libdir}/pkgconfig/*.pc %exclude %{_libdir}/libcriu.a +%files amdgpu-plugin +%{_libdir}/%{name}/amdgpu_plugin.so +%doc %{_mandir}/man1/criu-amdgpu-plugin.1* + +%files cuda-plugin +%{_libdir}/%{name}/cuda_plugin.so +%doc plugins/cuda/README.md + %files -n python3-criu -%{python3_sitelib}/{pycriu,pycriu-*egg-info} +%{python3_sitelib}/{pycriu,pycriu-%{version}.dist-info} %files -n crit %{_bindir}/crit -%{python3_sitelib}/crit-%{version}-*egg-info/ +%{python3_sitelib}/crit-%{version}.dist-info/ %{python3_sitelib}/crit %files -n criu-ns @@ -106,6 +132,9 @@ chmod 0755 %{buildroot}/run/%{name}/ %doc %{_mandir}/man1/{compel.1*,crit.1*,criu-ns.1*,criu-amdgpu-plugin.1*} %changelog +* Fri May 16 2025 Dingli Zhang - 4.1-1 +- upgrade criu version to 4.1 + * Sat Feb 08 2025 snoweay - 3.19-5 - Fix compile error of 'undefined test_and_set_bit' - define global _gcc_lto_cflags to nil in spec