diff options
Diffstat (limited to 'recipes-containers/criu/files')
10 files changed, 568 insertions, 164 deletions
diff --git a/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch b/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch deleted file mode 100644 index bd7a6c57..00000000 --- a/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch +++ /dev/null @@ -1,102 +0,0 @@ -From c005b7a4874f55df687ff22bc425551775581421 Mon Sep 17 00:00:00 2001 -From: Mark Asselstine <mark.asselstine@windriver.com> -Date: Fri, 8 Sep 2017 15:02:14 -0400 -Subject: [PATCH] criu: Fix toolchain hardcode - -Replace ":=" to "?=" so that the toolchain used by bitbake build system will -be taken. - -Signed-off-by: Yang Shi <yang.shi@windriver.com> -Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - Makefile | 2 +- - scripts/nmk/scripts/include.mk | 2 +- - scripts/nmk/scripts/tools.mk | 40 ++++++++++++++++++++-------------------- - 3 files changed, 22 insertions(+), 22 deletions(-) - -diff --git a/Makefile b/Makefile -index f2583a2..d7f51e5 100644 ---- a/Makefile -+++ b/Makefile -@@ -17,7 +17,7 @@ ifeq ($(origin HOSTCFLAGS), undefined) - HOSTCFLAGS := $(CFLAGS) $(USERCFLAGS) - endif - --UNAME-M := $(shell uname -m) -+UNAME-M ?= $(shell uname -m) - - # - # Supported Architectures -diff --git a/scripts/nmk/scripts/include.mk b/scripts/nmk/scripts/include.mk -index 04ccb3a..0d63bc7 100644 ---- a/scripts/nmk/scripts/include.mk -+++ b/scripts/nmk/scripts/include.mk -@@ -22,7 +22,7 @@ SUBARCH := $(shell uname -m | sed \ - -e s/aarch64.*/aarch64/) - - ARCH ?= $(SUBARCH) --SRCARCH := $(ARCH) -+SRCARCH ?= $(ARCH) - - export SUBARCH ARCH SRCARCH - -diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk -index 56dba84..1698821 100644 ---- a/scripts/nmk/scripts/tools.mk -+++ b/scripts/nmk/scripts/tools.mk -@@ -2,35 +2,35 @@ ifndef ____nmk_defined__tools - - # - # System tools shorthands --RM := rm -f -+RM ?= rm -f - HOSTLD ?= ld - ifeq ($(origin LD), default) - LD := $(CROSS_COMPILE)$(HOSTLD) - endif - HOSTCC ?= gcc - ifeq ($(origin CC), default) - CC := $(CROSS_COMPILE)$(HOSTCC) - endif --CPP := $(CC) -E --AS := $(CROSS_COMPILE)as --AR := $(CROSS_COMPILE)ar --STRIP := $(CROSS_COMPILE)strip --OBJCOPY := $(CROSS_COMPILE)objcopy --OBJDUMP := $(CROSS_COMPILE)objdump --NM := $(CROSS_COMPILE)nm --MAKE := make --MKDIR := mkdir -p --AWK := awk --PERL := perl --FULL_PYTHON := $(shell which python2 2>/dev/null || which python3 2>/dev/null) -+CPP ?= $(CC) -E -+AS ?= $(CROSS_COMPILE)as -+AR ?= $(CROSS_COMPILE)ar -+STRIP ?= $(CROSS_COMPILE)strip -+OBJCOPY ?= $(CROSS_COMPILE)objcopy -+OBJDUMP ?= $(CROSS_COMPILE)objdump -+NM ?= $(CROSS_COMPILE)nm -+MAKE ?= make -+MKDIR ?= mkdir -p -+AWK ?= awk -+PERL ?= perl -+FULL_PYTHON ?= $(shell which python2 2>/dev/null || which python3 2>/dev/null) - PYTHON ?= $(shell basename $(FULL_PYTHON)) --FIND := find --SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ -+FIND ?= find -+SH ?= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ - else if [ -x /bin/bash ]; then echo /bin/bash; \ - else echo sh; fi ; fi) --CSCOPE := cscope --ETAGS := etags --CTAGS := ctags -+CSCOPE ?= cscope -+ETAGS ?= etags -+CTAGS ?= ctags - - export RM HOSTLD LD HOSTCC CC CPP AS AR STRIP OBJCOPY OBJDUMP - export NM SH MAKE MKDIR AWK PERL PYTHON SH CSCOPE diff --git a/recipes-containers/criu/files/0002-criu-Skip-documentation-install.patch b/recipes-containers/criu/files/0001-criu-Skip-documentation-install.patch index af45db73..dd33b1bd 100644 --- a/recipes-containers/criu/files/0002-criu-Skip-documentation-install.patch +++ b/recipes-containers/criu/files/0001-criu-Skip-documentation-install.patch @@ -1,22 +1,23 @@ -From 45d74ae8a314c481398ba91a3697ffbd074cd98b Mon Sep 17 00:00:00 2001 +From 485e957a4c3289d105dd6203af31c0e4e1438ac6 Mon Sep 17 00:00:00 2001 From: Jianchuan Wang <jianchuan.wang@windriver.com> Date: Tue, 16 Aug 2016 09:42:24 +0800 -Subject: [PATCH] criu: Skip documentation install +Subject: [PATCH 1/3] criu: Skip documentation install asciidoc is needed to generate CRIU documentation, so skip it in install. -Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> --- Makefile.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.install b/Makefile.install -index 3987bcc..1def3cf 100644 +index aafb95469..1b02b70af 100644 --- a/Makefile.install +++ b/Makefile.install -@@ -29,7 +29,7 @@ export PREFIX BINDIR SBINDIR MANDIR RUNDIR - export LIBDIR INCLUDEDIR LIBEXECDIR +@@ -30,7 +30,7 @@ export PREFIX BINDIR SBINDIR MANDIR RUNDIR + export LIBDIR INCLUDEDIR LIBEXECDIR PLUGINDIR install-man: - $(Q) $(MAKE) -C Documentation install @@ -24,3 +25,6 @@ index 3987bcc..1def3cf 100644 .PHONY: install-man install-lib: lib +-- +2.25.1 + diff --git a/recipes-containers/criu/files/0001-criu-Change-libraries-install-directory.patch b/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch index afb1332d..1a1beafd 100644 --- a/recipes-containers/criu/files/0001-criu-Change-libraries-install-directory.patch +++ b/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch @@ -1,25 +1,31 @@ -From f64fbca70e6049dad3c404d871f2383d97725d2d Mon Sep 17 00:00:00 2001 +From dcbf7f8ad1b07ff718eac2ce79ed522ac1cee189 Mon Sep 17 00:00:00 2001 From: Mark Asselstine <mark.asselstine@windriver.com> Date: Fri, 8 Sep 2017 15:11:31 -0400 -Subject: [PATCH] criu: Change libraries install directory +Subject: [PATCH 2/3] criu: Change libraries install directory Install the libraries into /usr/lib(or /usr/lib64) +Upstream-Status: Inappropriate [embedded specific] + Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +Rebase for criu 3.17.1. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> --- Makefile.install | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Makefile.install b/Makefile.install -index 1def3cf..d020eef 100644 +index 1b02b70af..2839ef5fe 100644 --- a/Makefile.install +++ b/Makefile.install @@ -9,19 +9,6 @@ LIBEXECDIR ?= $(PREFIX)/libexec RUNDIR ?= /run + PLUGINDIR ?= $(PREFIX)/lib/criu - # +-# -# For recent Debian/Ubuntu with multiarch support. -DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null) -ifneq "$(DEB_HOST_MULTIARCH)" "" @@ -32,7 +38,9 @@ index 1def3cf..d020eef 100644 - endif -endif - --# + # # LIBDIR falls back to the standard path. LIBDIR ?= $(PREFIX)/lib - +-- +2.25.1 + diff --git a/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch b/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch new file mode 100644 index 00000000..0796bb24 --- /dev/null +++ b/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch @@ -0,0 +1,77 @@ +From 40d2f0735d668dca893a5f0e787f1f11af74cf25 Mon Sep 17 00:00:00 2001 +From: Tim Orling <tim.orling@konsulko.com> +Date: Fri, 1 Mar 2024 22:22:37 -0800 +Subject: [PATCH] crit/pycriu: build and install wheels + +Rather than using heavy handed pip (which requires network access to +fetch the index), mimic what we do in python_pep517.bbclass do_compile +and do_install for both crit/ and lib/pycriu + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Tim Orling <tim.orling@konsulko.com> +--- + crit/Makefile | 8 ++++++-- + lib/Makefile | 11 +++++++++-- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/crit/Makefile b/crit/Makefile +index 9a856db6d..9b36f4be1 100644 +--- a/crit/Makefile ++++ b/crit/Makefile +@@ -1,5 +1,7 @@ + PYTHON_EXTERNALLY_MANAGED := $(shell $(PYTHON) -c 'import os, sysconfig; print(int(os.path.isfile(os.path.join(sysconfig.get_path("stdlib"), "EXTERNALLY-MANAGED"))))') + PIP_BREAK_SYSTEM_PACKAGES := 0 ++PEP517_SOURCE_PATH := ./crit ++PEP517_BUILD_OPTS := + + VERSION_FILE := $(if $(obj),$(addprefix $(obj)/,crit/version.py),crit/version.py) + +@@ -16,11 +18,13 @@ 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 build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + endif + else ++ $(E) " BUILD " crit ++ $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + $(E) " INSTALL " crit +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit ++ $(Q) $(PYTHON) -m installer $(INSTALL_WHEEL_COMPILE_BYTECODE) --interpreter "$(USRBINPATH)/env $(PEP517_INSTALL_PYTHON)" --destdir=$(DESTDIR) $(PEP517_WHEEL_PATH)/crit-*.whl + endif + .PHONY: install + +diff --git a/lib/Makefile b/lib/Makefile +index ae371e78e..b5f147482 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -1,6 +1,9 @@ + CRIU_SO := libcriu.so + CRIU_A := libcriu.a + UAPI_HEADERS := lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h ++PEP517_SOURCE_PATH := ./lib ++PEP517_BUILD_OPTS := ++INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" + + all-y += lib-c lib-a lib-py + +@@ -63,11 +66,15 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) + $(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) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + endif + else ++ $(E) " BUILD " pycriu ++ $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + $(E) " INSTALL " pycriu +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib ++ #nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl ++ ++ $(Q) $(PYTHON) -m installer $(INSTALL_WHEEL_COMPILE_BYTECODE) --interpreter "$(USRBINPATH)/env $(PEP517_INSTALL_PYTHON)" --destdir=$(DESTDIR) $(PEP517_WHEEL_PATH)/pycriu-*.whl + endif + .PHONY: install + diff --git a/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch b/recipes-containers/criu/files/0003-lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch index 70ccb287..0f87e366 100644 --- a/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch +++ b/recipes-containers/criu/files/0003-lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch @@ -1,23 +1,24 @@ -From 6caf90592d61c8c45b32cb7ff76709f9326030e2 Mon Sep 17 00:00:00 2001 +From 0a04c5bc80319485e17e9a86e799fe2c5bfa3d38 Mon Sep 17 00:00:00 2001 From: Mark Asselstine <mark.asselstine@windriver.com> Date: Fri, 8 Sep 2017 15:40:49 -0400 -Subject: [PATCH] lib/Makefile: overwrite install-lib, to allow multiarch +Subject: [PATCH 3/3] lib/Makefile: overwrite install-lib, to allow multiarch I am not sure why Yocto installs python modules in arch specific /usr/libXX directories but it does. Allow the recipe to pass this via INSTALL_LIB. -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile -index b1bb057..06f5c5d 100644 +index 575a7bad3..f503d430b 100644 --- a/lib/Makefile +++ b/lib/Makefile -@@ -53,7 +53,7 @@ install: lib-c lib-py crit/crit lib/c/criu.pc.in +@@ -59,7 +59,7 @@ install: lib-c lib-a lib-py crit/crit lib/c/criu.pc.in $(Q) sed -e 's,@version@,$(CRIU_VERSION),' -e 's,@libdir@,$(LIBDIR),' -e 's,@includedir@,$(dir $(INCLUDEDIR)/criu/),' lib/c/criu.pc.in > lib/c/criu.pc $(Q) install -m 644 lib/c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig $(E) " INSTALL " crit @@ -26,3 +27,6 @@ index b1bb057..06f5c5d 100644 .PHONY: install uninstall: +-- +2.25.1 + diff --git a/recipes-containers/criu/files/0004-criu-fix-conflicting-headers.patch b/recipes-containers/criu/files/0004-criu-fix-conflicting-headers.patch new file mode 100644 index 00000000..f03f51da --- /dev/null +++ b/recipes-containers/criu/files/0004-criu-fix-conflicting-headers.patch @@ -0,0 +1,290 @@ +Backport patch to fix criu compile error with glibc 2.36. Update context +for Makefile.config. + +Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/commit/4c86d6a7] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +From 4c86d6a7d54abb64fc5a15131f3351224e8c071b Mon Sep 17 00:00:00 2001 +From: Radostin Stoyanov <rstoyanov@fedoraproject.org> +Date: Sun, 31 Jul 2022 16:07:30 +0000 +Subject: [PATCH] criu: fix conflicting headers + +There are several changes in glibc 2.36 that make sys/mount.h header +incompatible with kernel headers: + +https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E + +This patch removes conflicting includes for `<linux/mount.h>` and +updates the content of `criu/include/linux/mount.h` to match +`/usr/include/sys/mount.h`. In addition, inline definitions sys_*() +functions have been moved from "linux/mount.h" to "syscall.h" to +avoid conflicts with `uapi/compel/plugins/std/syscall.h` and +`<unistd.h>`. The include for `<linux/aio_abi.h>` has been replaced +with local include to avoid conflicts with `<sys/mount.h>`. + +Fixes: #1949 + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> +--- + Makefile.config | 2 +- + criu/cgroup.c | 1 + + criu/cr-check.c | 2 +- + criu/cr-restore.c | 3 ++- + criu/include/aio.h | 2 +- + criu/include/linux/aio_abi.h | 14 +++++++++++ + criu/include/linux/mount.h | 48 +++++++++++++++++++----------------- + criu/include/syscall.h | 17 +++++++++++++ + criu/pie/parasite.c | 2 +- + criu/util.c | 1 + + scripts/feature-tests.mak | 13 ---------- + 11 files changed, 64 insertions(+), 41 deletions(-) + create mode 100644 criu/include/linux/aio_abi.h + create mode 100644 criu/include/syscall.h + +diff --git a/Makefile.config b/Makefile.config +index d113e2246..270ec61c0 100644 +--- a/Makefile.config ++++ b/Makefile.config +@@ -78,7 +78,7 @@ export DEFINES += $(FEATURE_DEFINES) + export CFLAGS += $(FEATURE_DEFINES) + + FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \ +- SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW FSCONFIG MEMFD_CREATE OPENAT2 ++ SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW MEMFD_CREATE OPENAT2 + + # $1 - config name + define gen-feature-test +diff --git a/criu/cgroup.c b/criu/cgroup.c +index e05b0832e..325df6a1d 100644 +--- a/criu/cgroup.c ++++ b/criu/cgroup.c +@@ -27,6 +27,7 @@ + #include "images/cgroup.pb-c.h" + #include "kerndat.h" + #include "linux/mount.h" ++#include "syscall.h" + + /* + * This structure describes set of controller groups +diff --git a/criu/cr-check.c b/criu/cr-check.c +index f589a91da..0ca80192c 100644 +--- a/criu/cr-check.c ++++ b/criu/cr-check.c +@@ -21,7 +21,6 @@ + #include <sys/prctl.h> + #include <sched.h> + #include <sys/mount.h> +-#include <linux/aio_abi.h> + + #include "../soccr/soccr.h" + +@@ -52,6 +51,7 @@ + #include "net.h" + #include "restorer.h" + #include "uffd.h" ++#include "linux/aio_abi.h" + + #include "images/inventory.pb-c.h" + +diff --git a/criu/cr-restore.c b/criu/cr-restore.c +index 279246c19..d11d28173 100644 +--- a/criu/cr-restore.c ++++ b/criu/cr-restore.c +@@ -22,7 +22,6 @@ + #include <compel/ptrace.h> + #include "common/compiler.h" + +-#include "linux/mount.h" + #include "linux/rseq.h" + + #include "clone-noasan.h" +@@ -86,6 +85,8 @@ + #include <compel/plugins/std/syscall-codes.h> + #include "compel/include/asm/syscall.h" + ++#include "linux/mount.h" ++ + #include "protobuf.h" + #include "images/sa.pb-c.h" + #include "images/timer.pb-c.h" +diff --git a/criu/include/aio.h b/criu/include/aio.h +index d1655739d..38e704020 100644 +--- a/criu/include/aio.h ++++ b/criu/include/aio.h +@@ -1,7 +1,7 @@ + #ifndef __CR_AIO_H__ + #define __CR_AIO_H__ + +-#include <linux/aio_abi.h> ++#include "linux/aio_abi.h" + #include "images/mm.pb-c.h" + unsigned int aio_estimate_nr_reqs(unsigned int size); + int dump_aio_ring(MmEntry *mme, struct vma_area *vma); +diff --git a/criu/include/linux/aio_abi.h b/criu/include/linux/aio_abi.h +new file mode 100644 +index 000000000..d9ce78720 +--- /dev/null ++++ b/criu/include/linux/aio_abi.h +@@ -0,0 +1,14 @@ ++#ifndef __LINUX__AIO_ABI_H ++#define __LINUX__AIO_ABI_H ++ ++typedef __kernel_ulong_t aio_context_t; ++ ++/* read() from /dev/aio returns these structures. */ ++struct io_event { ++ __u64 data; /* the data field from the iocb */ ++ __u64 obj; /* what iocb this event came from */ ++ __s64 res; /* result code for this event */ ++ __s64 res2; /* secondary result */ ++}; ++ ++#endif /* __LINUX__AIO_ABI_H */ +diff --git a/criu/include/linux/mount.h b/criu/include/linux/mount.h +index 9a3a28b10..0d55a588c 100644 +--- a/criu/include/linux/mount.h ++++ b/criu/include/linux/mount.h +@@ -4,32 +4,34 @@ + #include "common/config.h" + #include "compel/plugins/std/syscall-codes.h" + +-#ifdef CONFIG_HAS_FSCONFIG +-#include <linux/mount.h> +-#else ++/* Copied from /usr/include/sys/mount.h */ ++ ++#ifndef FSCONFIG_CMD_CREATE ++/* The type of fsconfig call made. */ + enum fsconfig_command { +- FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ +- FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ +- FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ +- FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ +- FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ +- FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ +- FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ ++ FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ ++#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG ++ FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ ++#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING ++ FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ ++#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY ++ FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ ++#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH ++ FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ ++#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY ++ FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ ++#define FSCONFIG_SET_FD FSCONFIG_SET_FD ++ FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ ++#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE + FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ ++#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE + }; +-#endif ++#endif // FSCONFIG_CMD_CREATE + +-static inline int sys_fsopen(const char *fsname, unsigned int flags) +-{ +- return syscall(__NR_fsopen, fsname, flags); +-} +-static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux) +-{ +- return syscall(__NR_fsconfig, fd, cmd, key, value, aux); +-} +-static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags) +-{ +- return syscall(__NR_fsmount, fd, flags, attr_flags); +-} ++#ifndef MS_MGC_VAL ++/* Magic mount flag number. Has to be or-ed to the flag values. */ ++#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */ ++#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */ ++#endif + + #endif +diff --git a/criu/include/syscall.h b/criu/include/syscall.h +new file mode 100644 +index 000000000..c38d6d971 +--- /dev/null ++++ b/criu/include/syscall.h +@@ -0,0 +1,17 @@ ++#ifndef __CR_SYSCALL_H__ ++#define __CR_SYSCALL_H__ ++ ++static inline int sys_fsopen(const char *fsname, unsigned int flags) ++{ ++ return syscall(__NR_fsopen, fsname, flags); ++} ++static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux) ++{ ++ return syscall(__NR_fsconfig, fd, cmd, key, value, aux); ++} ++static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags) ++{ ++ return syscall(__NR_fsmount, fd, flags, attr_flags); ++} ++ ++#endif /* __CR_SYSCALL_H__ */ +\ No newline at end of file +diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c +index e7eb1fcb6..f75fe13bb 100644 +--- a/criu/pie/parasite.c ++++ b/criu/pie/parasite.c +@@ -3,7 +3,6 @@ + #include <signal.h> + #include <linux/limits.h> + #include <linux/capability.h> +-#include <sys/mount.h> + #include <stdarg.h> + #include <sys/ioctl.h> + #include <sys/uio.h> +@@ -14,6 +13,7 @@ + #include "int.h" + #include "types.h" + #include <compel/plugins/std/syscall.h> ++#include "linux/mount.h" + #include "parasite.h" + #include "fcntl.h" + #include "prctl.h" +diff --git a/criu/util.c b/criu/util.c +index 5f69465b4..060ca3bd4 100644 +--- a/criu/util.c ++++ b/criu/util.c +@@ -40,6 +40,7 @@ + #include "mem.h" + #include "namespaces.h" + #include "criu-log.h" ++#include "syscall.h" + + #include "clone-noasan.h" + #include "cr_options.h" +diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak +index 014e893a8..fb5d2ef7a 100644 +--- a/scripts/feature-tests.mak ++++ b/scripts/feature-tests.mak +@@ -137,19 +137,6 @@ ENTRY(main) + END(main) + endef + +-define FEATURE_TEST_FSCONFIG +- +-#include <linux/mount.h> +- +-int main(void) +-{ +- if (FSCONFIG_CMD_CREATE > 0) +- return 0; +- return 0; +-} +- +-endef +- + define FEATURE_TEST_NFTABLES_LIB_API_0 + + #include <string.h> +-- +2.34.1 + diff --git a/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch b/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch new file mode 100644 index 00000000..a1334b7b --- /dev/null +++ b/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch @@ -0,0 +1,22 @@ +From a2b17e7b082786e2d7b7585b33815572c9c521f0 Mon Sep 17 00:00:00 2001 +From: Tim Orling <tim.orling@konsulko.com> +Date: Sat, 2 Mar 2024 13:47:46 -0800 +Subject: [PATCH] pycriu: attr pycriu.version.__version__ + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Tim Orling <tim.orling@konsulko.com> +--- + lib/pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/pyproject.toml b/lib/pyproject.toml +index 8eb4b7084..5a92f8540 100644 +--- a/lib/pyproject.toml ++++ b/lib/pyproject.toml +@@ -16,4 +16,4 @@ requires-python = ">=3.6" + packages = ["pycriu", "pycriu.images"] + + [tool.setuptools.dynamic] +-version = {attr = "pycriu.__version__"} ++version = {attr = "pycriu.version.__version__"} diff --git a/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch b/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch new file mode 100644 index 00000000..76b8a22e --- /dev/null +++ b/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch @@ -0,0 +1,114 @@ +build: integrate build fix + +[ + From 517c0947050e63aac72f63a3bf373d76264723b9 Mon Sep 17 00:00:00 2001 + From: Radostin Stoyanov <rstoyanov@fedoraproject.org> + Date: Wed, 24 Aug 2022 21:20:30 +0200 + Subject: [PATCH 2/2] mount: add definition for FSOPEN_CLOEXEC + + A recent change in glibc introduced `enum fsconfig_command` [1] and as a + result the compilation of criu fails with the following errors + + In file included from criu/pie/util.c:3: + /usr/include/sys/mount.h:240:6: error: redeclaration of 'enum fsconfig_command' + 240 | enum fsconfig_command + | ^~~~~~~~~~~~~~~~ + In file included from /usr/include/sys/mount.h:32: + criu/include/linux/mount.h:11:6: note: originally defined here + 11 | enum fsconfig_command { + | ^~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:242:3: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG' + 242 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ + | ^~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:12:9: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command' + 12 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ + | ^~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:244:3: error: redeclaration of enumerator 'FSCONFIG_SET_STRING' + 244 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ + | ^~~~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:14:9: note: previous definition of 'FSCONFIG_SET_STRING' with type 'enum fsconfig_command' + 14 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ + | ^~~~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:246:3: error: redeclaration of enumerator 'FSCONFIG_SET_BINARY' + 246 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ + | ^~~~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:16:9: note: previous definition of 'FSCONFIG_SET_BINARY' with type 'enum fsconfig_command' + 16 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ + | ^~~~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:248:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH' + 248 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ + | ^~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:18:9: note: previous definition of 'FSCONFIG_SET_PATH' with type 'enum fsconfig_command' + 18 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ + | ^~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:250:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH_EMPTY' + 250 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ + | ^~~~~~~~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:20:9: note: previous definition of 'FSCONFIG_SET_PATH_EMPTY' with type 'enum fsconfig_command' + 20 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ + | ^~~~~~~~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:252:3: error: redeclaration of enumerator 'FSCONFIG_SET_FD' + 252 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ + | ^~~~~~~~~~~~~~~ + criu/include/linux/mount.h:22:9: note: previous definition of 'FSCONFIG_SET_FD' with type 'enum fsconfig_command' + 22 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ + | ^~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:254:3: error: redeclaration of enumerator 'FSCONFIG_CMD_CREATE' + 254 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ + | ^~~~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:24:9: note: previous definition of 'FSCONFIG_CMD_CREATE' with type 'enum fsconfig_command' + 24 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ + | ^~~~~~~~~~~~~~~~~~~ + /usr/include/sys/mount.h:256:3: error: redeclaration of enumerator 'FSCONFIG_CMD_RECONFIGURE' + 256 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ + | ^~~~~~~~~~~~~~~~~~~~~~~~ + criu/include/linux/mount.h:26:9: note: previous definition of 'FSCONFIG_CMD_RECONFIGURE' with type 'enum fsconfig_command' + 26 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ + + This patch adds definition for FSOPEN_CLOEXEC to solve this problem. In particular, + sys/mount.h includes ifndef check for FSOPEN_CLOEXEC surrounding `enum fsconfig_command`. + + [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=7eae6a91e9b1670330c9f15730082c91c0b1d570 + + Reported-by: Younes Manton (@ymanton) + Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> +] + +Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/commit/517c0947] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + criu/include/linux/mount.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/criu/include/linux/mount.h b/criu/include/linux/mount.h +index 0d55a588c..fefafa89e 100644 +--- a/criu/include/linux/mount.h ++++ b/criu/include/linux/mount.h +@@ -6,7 +6,7 @@ + + /* Copied from /usr/include/sys/mount.h */ + +-#ifndef FSCONFIG_CMD_CREATE ++#ifndef FSOPEN_CLOEXEC + /* The type of fsconfig call made. */ + enum fsconfig_command { + FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ +@@ -26,7 +26,13 @@ enum fsconfig_command { + FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ + #define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE + }; +-#endif // FSCONFIG_CMD_CREATE ++ ++#endif // FSOPEN_CLOEXEC ++ ++/* fsopen flags. With the redundant definition, we check if the kernel, ++ * glibc value and our value still match. ++ */ ++#define FSOPEN_CLOEXEC 0x00000001 + + #ifndef MS_MGC_VAL + /* Magic mount flag number. Has to be or-ed to the flag values. */ +-- +2.34.1 + diff --git a/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch b/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch new file mode 100644 index 00000000..88872911 --- /dev/null +++ b/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch @@ -0,0 +1,32 @@ +From 2ec745ac11357e3243ef1f23f817c276518ce7cb Mon Sep 17 00:00:00 2001 +From: Tim Orling <tim.orling@konsulko.com> +Date: Sat, 2 Mar 2024 13:48:54 -0800 +Subject: [PATCH] pycriu: --skip-dependency-check during build + +It complains about needing protobuf<4, python3-protobuf is 4.25 in meta-python + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Tim Orling <tim.orling@konsulko.com> +--- + lib/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/Makefile b/lib/Makefile +index b5f147482..e3faa7a06 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -66,11 +66,11 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) + $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" + else + $(E) " INSTALL " pycriu +- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) ++ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + endif + else + $(E) " BUILD " pycriu +- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) ++ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) + $(E) " INSTALL " pycriu + #nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl + diff --git a/recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch b/recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch deleted file mode 100644 index 9361adc2..00000000 --- a/recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch +++ /dev/null @@ -1,45 +0,0 @@ -From b59947007362b53e9f41f1e5a33071dedf1c59ac Mon Sep 17 00:00:00 2001 -From: Adrian Reber <areber@redhat.com> -Date: Thu, 28 Sep 2017 09:13:33 +0000 -Subject: [PATCH] fix building on newest glibc and kernel - -On Fedora rawhide with kernel-headers-4.14.0-0.rc2.git0.1.fc28.x86_64 -glibc-devel-2.26.90-15.fc28.x86_64 criu does not build any more: - -In file included from /usr/include/linux/aio_abi.h:31:0, - from criu/cr-check.c:24: -/usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant - MS_RDONLY = 1, /* Mount read-only. */ - ^ -make[2]: *** [/builddir/build/BUILD/criu-3.5/scripts/nmk/scripts/build.mk:111: criu/cr-check.o] Error 1 -make[1]: *** [criu/Makefile:73: criu/built-in.o] Error 2 -make: *** [Makefile:233: criu] Error 2 - -This simple re-ordering of includes fixes it for me. - -Signed-off-by: Adrian Reber <areber@redhat.com> -Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> - -Upstream-Status: Backport -[https://github.com/checkpoint-restore/criu/commit/f41e386d4d40e3e26b0cfdc85a812b7edb337f1d#diff-cc847b1cc975358c6582595be92d48db] - -Signed-off-by: Yi Zhao <yi.zhao@windriver.com> - ---- - criu/cr-check.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/criu/cr-check.c b/criu/cr-check.c -index 1dd887a..93df2ab 100644 ---- a/criu/cr-check.c -+++ b/criu/cr-check.c -@@ -21,8 +21,8 @@ - #include <netinet/in.h> - #include <sys/prctl.h> - #include <sched.h> --#include <linux/aio_abi.h> - #include <sys/mount.h> -+#include <linux/aio_abi.h> - - #include "../soccr/soccr.h" - |