summaryrefslogtreecommitdiff
path: root/sys-process/criu
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
commit677b7ba5c317778df2ad7e70df94b9b7eec4adbc (patch)
tree6c418a1546fff5becab5d8b9ed6803323e7f316e /sys-process/criu
parentfbda87924e6faa7a1919f1a2b4182490bde5ec5c (diff)
gentoo resync : 10.09.2021
Diffstat (limited to 'sys-process/criu')
-rw-r--r--sys-process/criu/Manifest2
-rw-r--r--sys-process/criu/criu-3.15-r1.ebuild140
-rw-r--r--sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch168
3 files changed, 310 insertions, 0 deletions
diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index d3a6ee542f07..ae60cde619bf 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -2,8 +2,10 @@ AUX 2.2/criu-2.2-flags.patch 259 BLAKE2B 6e62d8e96ba9b2beaa4a525f14ebca1a198dae7
AUX 2.3/criu-2.3-no-git.patch 651 BLAKE2B 76d7bd15f67789a72cd0d58c854da5601cfdc42e657cc819acecd52653b2b3699db3f00cb5916148c9a1a8013159716d8607bfd6443d24a2f98bd6e0abe21f90 SHA512 9010b79a01f7bab35ca23749d6e61706404cca89d5cdacd31fc32aba82b088becd9997f9a82db460e16bd84d9f38b1b35e90d3c49ad04b0f141d037e9ebafdd8
AUX criu-3.12-automagic-libbsd.patch 457 BLAKE2B bd16c9e84ba67d0968371844c7b8121d1defea93371b17124130685c1d55969e3f472349f4e4f5ac211cd659980bfdecaa06b38a2fc6037d486d15dee6850884 SHA512 b535792caf39c9e8c21ed313551b9fc0f8675c494586c66d5caba17c67bb432c27c9ff3cbf5a7d2248c99fc438174c0daea355d89ef9d4ce1a8a26e688fdf7c3
AUX criu-3.15-pkg-config.patch 5131 BLAKE2B 3b4cc0a2ae3dac24eb5f76a20478844e10b601a9584e8ae7bdd6a0167add2ba715c606fd7ee00aea9893c9e99a9ee42f031b85b37c7f4fc5d4b1fcf9ecff78e7 SHA512 e424d3ee684463dfab504da234c7e178a8060a83efd743d940ad8c8ebc58f5c07de7a48cd3fc333fcc67a0947ad8c9b838e48163045a2093afe5923ca6ff1399
+AUX criu-3.15-protobuf-c-1.4.0.patch 5505 BLAKE2B 3131dcebf5cbf8205f70d5214bb9b6ae541df0d3111d2744f2b663589cef9e74dcc82dd6b600f1adc27154a4df5881b4eba9843c5353abdb5102a82847f955c5 SHA512 32d2b41028a4240e4e98df135eef108034a5b1a66d51766a7e82521a1719d9a560f3d4464f4bda11ef5b35cd76b1a004e74b098131c6a902c10a0b65d6b6fff6
DIST criu-3.14.tar.bz2 881407 BLAKE2B 418412681baf7ec9d3a03afe3860590c857bffcb6c57d01e60b77e85dd5ba2b30deee280c884ba1574665be5fcfd03f3cc058a4b7ae08f66aabe63a80373089b SHA512 97d064c5ffc41daf6e89edd6208b30e4198f313afc6d621d0dc74dadf94c303be70ba448d4e1ced9500f1c65f1bd12206eb88883be398911cc2c995310b17cc6
DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
EBUILD criu-3.14-r2.ebuild 3189 BLAKE2B e999b7fc1a7bd8bfeff3c090aa9c6eb02b6755bcf4a0927d3478589f1ca24cc3e6bac2e0bde300e3212ae287c08ed9f13577801169a348bede5c29e1e2e14e44 SHA512 d49d449c807e00b37f1621118ce90e629c1ba5882d4c7a73ac49cee8230ba3be1960ffa0aaea68e11596e8582b729f2633dba01caea66e828b0ec33ec21f8ffe
+EBUILD criu-3.15-r1.ebuild 3301 BLAKE2B 737d3a455a8d50f44c08e6ab58c275dc8642b105efe3b8b72c0584f2bb787eb10bc5844c3c2a66e04d2de73653b920db58251fdaf7b0a2d5c38b4c4ecb8d5b5e SHA512 0c36f4ecafe7420db49e1da2359a5cdfd05a29f443cc52cc22e97d399e0d35ab8b4595bdfce24941caefd22b4a7f5eb0aa40d09d271d96678376ad0a554fe39e
EBUILD criu-3.15.ebuild 3231 BLAKE2B a0958fac51d7daa641f33974a98a33cfcdee066a6e0e38c0f208b22ec398f2b90eeaf4056577c01121b08045efce1a46e80322ceb2dbcd64b2de4d42f16eee37 SHA512 ff3006e68f1fa48a7eda167d5152d61d7e6166303ae14fecbe14fce0f3646e1e36385298801d8c7dbe3a72507f9de44010ba0bc79d1d736f26b6ea4f8f60a1ba
MISC metadata.xml 489 BLAKE2B b147e18ffae358f6ea0c3ca2cc8addaa039d77fc845092758a258943852daa0bc674f9f2a5a94ba7094d2e6c65a179271304e2b0b4a01f1cff6d4ac20696dce8 SHA512 aebc8636c880916beff94bb80e4a9fda5eef6ef935c9e0305bbcab038e26e69a5947640e05d74978a034ca5b36d5096e177d9485c036314eaada010f16f144d4
diff --git a/sys-process/criu/criu-3.15-r1.ebuild b/sys-process/criu/criu-3.15-r1.ebuild
new file mode 100644
index 000000000000..bb76d9a19d33
--- /dev/null
+++ b/sys-process/criu/criu-3.15-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9} )
+
+inherit toolchain-funcs linux-info python-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="https://criu.org/"
+SRC_URI="https://download.openvz.org/criu/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64"
+IUSE="doc selinux setproctitle static-libs"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-libs/protobuf-c-1.4.0:=
+ dev-libs/libnl:3
+ net-libs/libnet:1.1
+ sys-libs/libcap
+ selinux? ( sys-libs/libselinux )
+ setproctitle? ( dev-libs/libbsd )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? (
+ app-text/asciidoc
+ app-text/xmlto
+ )"
+RDEPEND="${RDEPEND}
+ dev-python/protobuf-python[${PYTHON_USEDEP}]"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+ ~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
+
+# root access required for tests
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}"/2.2/${PN}-2.2-flags.patch
+ "${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
+ "${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
+ "${FILESDIR}"/${PN}-3.15-pkg-config.patch
+ "${FILESDIR}"/${PN}-3.15-protobuf-c-1.4.0.patch
+)
+
+criu_arch() {
+ # criu infers the arch from $(uname -m). We never want this to happen.
+ case ${ARCH} in
+ amd64) echo "x86";;
+ arm64) echo "aarch64";;
+ ppc64*) echo "ppc64";;
+ *) echo "${ARCH}";;
+ esac
+}
+
+pkg_setup() {
+ use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ if ! use selinux; then
+ sed \
+ -e 's:libselinux:no_libselinux:g' \
+ -i Makefile.config || die
+ fi
+
+ use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
+}
+
+src_configure() {
+ # Gold linker generates invalid object file when used with criu's custom
+ # linker script. Use the bfd linker instead. See https://crbug.com/839665#c3
+ tc-ld-disable-gold
+
+ # Build system uses this variable as a trigger to append coverage flags
+ # we'd like to avoid it. https://bugs.gentoo.org/744244
+ unset GCOV
+
+ python_setup
+}
+
+src_compile() {
+ local target="all $(usex doc 'docs' '')"
+ emake \
+ HOSTCC="$(tc-getBUILD_CC)" \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" \
+ AR="$(tc-getAR)" \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ PYTHON="${EPYTHON%.?}" \
+ FULL_PYTHON="${PYTHON%.?}" \
+ OBJCOPY="$(tc-getOBJCOPY)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ ARCH="$(criu_arch)" \
+ V=1 WERROR=0 DEBUG=0 \
+ SETPROCTITLE=$(usex setproctitle) \
+ ${target}
+}
+
+src_test() {
+ # root privileges are required to dump all necessary info
+ if [[ ${EUID} -eq 0 ]] ; then
+ emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
+ fi
+}
+
+install_crit() {
+ "${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
+ python_optimize
+}
+
+src_install() {
+ emake \
+ ARCH="$(criu_arch)" \
+ PREFIX="${EPREFIX}"/usr \
+ PYTHON="${EPYTHON%.?}" \
+ FULL_PYTHON="${PYTHON%.?}" \
+ LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ V=1 WERROR=0 DEBUG=0 \
+ install
+
+ use doc && dodoc CREDITS README.md
+
+ python_foreach_impl install_crit
+
+ if ! use static-libs; then
+ find "${D}" -name "*.a" -delete || die
+ fi
+}
diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
new file mode 100644
index 000000000000..ea0b9134c683
--- /dev/null
+++ b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
@@ -0,0 +1,168 @@
+https://bugs.gentoo.org/809092
+https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c
+
+From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001
+From: Zeyad Yasser <zeyady98@gmail.com>
+Date: Thu, 22 Jul 2021 11:39:34 +0200
+Subject: [PATCH] protobuf: remove leading underscores from protobuf structs
+
+Fixes: #1560
+
+The latest protobuf-c compiler breaks CRIU because they removed
+leading underscores from structs in 1.4.0.
+
+This replaces those definitions with the standard generated structs.
+
+v2: remove struct _VmaEntry, struct _CredsEntry and struct _CoreEntry
+
+Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
+---
+ criu/include/irmap.h | 8 +++++---
+ criu/include/parasite-syscall.h | 8 +++-----
+ criu/include/pstree.h | 2 +-
+ criu/include/rst_info.h | 5 ++---
+ criu/include/shmem.h | 1 -
+ criu/mem.c | 2 +-
+ lib/c/criu.h | 3 ++-
+ 7 files changed, 14 insertions(+), 15 deletions(-)
+
+diff --git a/criu/include/irmap.h b/criu/include/irmap.h
+index 033f71e372..188d753f4d 100644
+--- a/criu/include/irmap.h
++++ b/criu/include/irmap.h
+@@ -1,13 +1,15 @@
+ #ifndef __CR_IRMAP__H__
+ #define __CR_IRMAP__H__
++
++#include "images/fh.pb-c.h"
++
+ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino);
+-struct _FhEntry;
+ int irmap_queue_cache(unsigned int dev, unsigned long ino,
+- struct _FhEntry *fh);
++ FhEntry *fh);
+ int irmap_predump_prep(void);
+ int irmap_predump_run(void);
+ int check_open_handle(unsigned int s_dev, unsigned long i_ino,
+- struct _FhEntry *f_handle);
++ FhEntry *f_handle);
+ int irmap_load_cache(void);
+ int irmap_scan_path_add(char *path);
+ #endif
+diff --git a/criu/include/parasite-syscall.h b/criu/include/parasite-syscall.h
+index c86a724fd1..afba95a9e7 100644
+--- a/criu/include/parasite-syscall.h
++++ b/criu/include/parasite-syscall.h
+@@ -11,8 +11,6 @@ struct parasite_dump_misc;
+ struct parasite_drain_fd;
+ struct vm_area_list;
+ struct pstree_item;
+-struct _CredsEntry;
+-struct _CoreEntry;
+ struct list_head;
+ struct cr_imgset;
+ struct fd_opts;
+@@ -31,11 +29,11 @@ extern int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc
+ struct parasite_ctl *ctl, struct pstree_item *);
+
+ extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct parasite_dump_misc *misc);
+-extern int parasite_dump_creds(struct parasite_ctl *ctl, struct _CredsEntry *ce);
+-extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, struct _CoreEntry *core);
++extern int parasite_dump_creds(struct parasite_ctl *ctl, CredsEntry *ce);
++extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, CoreEntry *core);
+ extern int parasite_dump_thread_seized(struct parasite_thread_ctl *tctl,
+ struct parasite_ctl *ctl, int id,
+- struct pid *tid, struct _CoreEntry *core);
++ struct pid *tid, CoreEntry *core);
+ extern int dump_thread_core(int pid, CoreEntry *core,
+ const struct parasite_dump_thread *dt);
+
+diff --git a/criu/include/pstree.h b/criu/include/pstree.h
+index 61ab0ce0eb..17d22e791e 100644
+--- a/criu/include/pstree.h
++++ b/criu/include/pstree.h
+@@ -113,7 +113,7 @@ extern int prepare_task_entries(void);
+ extern int prepare_dummy_task_state(struct pstree_item *pi);
+
+ extern int get_task_ids(struct pstree_item *);
+-extern struct _TaskKobjIdsEntry *root_ids;
++extern TaskKobjIdsEntry *root_ids;
+
+ extern void core_entry_free(CoreEntry *core);
+ extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc);
+diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h
+index 3283849e44..3dc119a931 100644
+--- a/criu/include/rst_info.h
++++ b/criu/include/rst_info.h
+@@ -5,6 +5,7 @@
+ #include "common/list.h"
+ #include "vma.h"
+ #include "kerndat.h"
++#include "images/mm.pb-c.h"
+
+ struct task_entries {
+ int nr_threads, nr_tasks, nr_helpers;
+@@ -25,8 +26,6 @@ struct fdt {
+ futex_t fdt_lock;
+ };
+
+-struct _MmEntry;
+-
+ struct rst_info {
+ struct list_head fds;
+
+@@ -40,7 +39,7 @@ struct rst_info {
+ struct fdt *fdt;
+
+ struct vm_area_list vmas;
+- struct _MmEntry *mm;
++ MmEntry *mm;
+ struct list_head vma_io;
+ unsigned int pages_img_id;
+
+diff --git a/criu/include/shmem.h b/criu/include/shmem.h
+index 9afdb799af..798e28f347 100644
+--- a/criu/include/shmem.h
++++ b/criu/include/shmem.h
+@@ -5,7 +5,6 @@
+ #include "common/lock.h"
+ #include "images/vma.pb-c.h"
+
+-struct _VmaEntry;
+ struct vma_area;
+
+ extern int collect_shmem(int pid, struct vma_area *vma);
+diff --git a/criu/mem.c b/criu/mem.c
+index 9fabe4c470..b0a76e4da9 100644
+--- a/criu/mem.c
++++ b/criu/mem.c
+@@ -1230,7 +1230,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr)
+
+ static int maybe_disable_thp(struct pstree_item *t, struct page_read *pr)
+ {
+- struct _MmEntry *mm = rsti(t)->mm;
++ MmEntry *mm = rsti(t)->mm;
+
+ /*
+ * There is no need to disable it if the page read doesn't
+diff --git a/lib/c/criu.h b/lib/c/criu.h
+index 3d64939584..d2bfbf958c 100644
+--- a/lib/c/criu.h
++++ b/lib/c/criu.h
+@@ -22,6 +22,7 @@
+ #include <stdbool.h>
+
+ #include "version.h"
++#include "rpc.pb-c.h"
+
+ #ifdef __GNUG__
+ extern "C" {
+@@ -112,7 +113,7 @@ void criu_set_pidfd_store_sk(int sk);
+ * some non-existing one is reported.
+ */
+
+-typedef struct _CriuNotify *criu_notify_arg_t;
++typedef CriuNotify *criu_notify_arg_t;
+ void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na));
+
+ /* Get pid of root task. 0 if not available */