Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.28)

project(criu-static VERSION 4.1)
project(criu-static VERSION 4.2)
include(GNUInstallDirs)
include(macros/dependencies.cmake)

# CRIU source configuration, specify either version or commit
set(CRIU_VERSION "${PROJECT_VERSION}" CACHE STRING "CRIU version to build (e.g., 4.1)")
set(CRIU_VERSION "${PROJECT_VERSION}" CACHE STRING "CRIU version to build (e.g., 4.2)")
set(CRIU_COMMIT "" CACHE STRING "CRIU git commit/tag to build instead of version")
set(CRIU_SHASUM "9a3094f3d0aa6cfa8bd5c9b92c05f4a566ad21ee20eb9b2fbc6129a74d1f6dc7" CACHE STRING "SHA256 checksum for CRIU source")
set(CRIU_SHASUM "0c6e51af878e63df7391e6dffbbe5f0ced429bc9f1e5a603020bfd2503065c39" CACHE STRING "SHA256 checksum for CRIU source")
set(BUILD_REVISION "" CACHE STRING "Build revision suffix (e.g., r1, r2) for build script changes")

# Force static building
Expand Down Expand Up @@ -75,6 +75,8 @@ set(CRIU_MAKE_PATH_ENV "${PROTOC_BIN_PATH}:${PROTOC_C_BIN_PATH}:$ENV{PATH}")
message("-- criu CFLAGS ${CRIU_CFLAGS}")
message("-- criu LDFLAGS ${CRIU_LDFLAGS}")
message("-- criu PATH ${CRIU_MAKE_PATH_ENV}")
message("-- libcap CFLAGS ${LIBCAP_CFLAGS}")
message("-- descriptor.proto file: ${DESCRIPTOR_PROTO_FILE}")

# CRIU build directories
set(CRIU_BUILD_DIR ${CMAKE_BINARY_DIR}/criu-build)
Expand Down Expand Up @@ -109,7 +111,7 @@ ExternalProject_Add(criu
DOWNLOAD_NAME ${DEP_criu_FILENAME}
BUILD_COMMAND
${CMAKE_MAKE_PROGRAM} -C <SOURCE_DIR> ${CRIU_MAKE_VARS} mrproper
COMMAND ${CMAKE_COMMAND} -E rm -f "<SOURCE_DIR>/images/google/protobuf/descriptor.proto"
COMMAND ${CMAKE_COMMAND} -E make_directory "<SOURCE_DIR>/images/google/protobuf"
COMMAND ${CMAKE_COMMAND} -E copy "${DESCRIPTOR_PROTO_FILE}" "<SOURCE_DIR>/images/google/protobuf/descriptor.proto"
COMMAND ${CMAKE_COMMAND} -E env
"CFLAGS=${CRIU_CFLAGS}"
Expand Down
37 changes: 26 additions & 11 deletions patch/criu-build.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/Makefile b/Makefile
index 5d8e89ac1..9006fc193 100644
index e26807158..aa9d7746d 100644
--- a/Makefile
+++ b/Makefile
@@ -268,7 +268,6 @@ criu-deps += $(SOCCR_A)
@@ -270,7 +270,6 @@ criu-deps += $(SOCCR_A)
# But note that we're already included
# the nmk so we can reuse it there.
criu/Makefile: ;
Expand All @@ -11,7 +11,7 @@ index 5d8e89ac1..9006fc193 100644
criu/%: $(criu-deps) .FORCE
$(Q) $(MAKE) $(build)=criu $@
diff --git a/Makefile.compel b/Makefile.compel
index 764afadc8..c211f52f4 100644
index a4209edc5..7e91ff42c 100644
--- a/Makefile.compel
+++ b/Makefile.compel
@@ -63,7 +63,7 @@ compel/plugins/fds.lib.a: $(compel-deps) compel/plugins/std.lib.a .FORCE
Expand All @@ -24,7 +24,7 @@ index 764afadc8..c211f52f4 100644
#
# And compel library.
diff --git a/Makefile.config b/Makefile.config
index 5ab689d41..d7ad71667 100644
index 5cf4b8216..adacedad3 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -5,58 +5,6 @@ include scripts/feature-tests.mak
Expand All @@ -35,7 +35,7 @@ index 5ab689d41..d7ad71667 100644
- LIBS_FEATURES += -lbsd
- FEATURE_DEFINES += -DCONFIG_HAS_LIBBSD
-else
- $(info Note: Building without setproctitle() and strlcpy() support.)
- $(info Note: Building without setproctitle() support.)
- $(info $S Install libbsd-devel (RPM) / libbsd-dev (DEB) to fix.)
-endif
-
Expand Down Expand Up @@ -87,20 +87,20 @@ index 5ab689d41..d7ad71667 100644

ifneq ($(PLUGINDIR),)
diff --git a/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h b/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h
index 9152024fd..6321c722e 100644
index a3528500d..5a907a7f9 100644
--- a/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h
+++ b/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h
@@ -1,9 +1,9 @@
#ifndef UAPI_COMPEL_ASM_SIGFRAME_H__
#define UAPI_COMPEL_ASM_SIGFRAME_H__

-#include <asm/sigcontext.h>
-#include <signal.h>
#include <sys/ucontext.h>

+#include <asm/types.h>
#include <stdint.h>
#include <asm/types.h>

/* Copied from the kernel header arch/arm64/include/uapi/asm/sigcontext.h */
diff --git a/criu/Makefile b/criu/Makefile
index bafdd980b..4cdb0c7d5 100644
--- a/criu/Makefile
Expand Down Expand Up @@ -140,14 +140,15 @@ index bafdd980b..4cdb0c7d5 100644
-all-y += check-packages $(obj)/criu
+all-y += $(obj)/criu
diff --git a/criu/arch/aarch64/include/asm/restorer.h b/criu/arch/aarch64/include/asm/restorer.h
index 64a9c24eb..0359e78db 100644
index 2174df4fa..11a487e3a 100644
--- a/criu/arch/aarch64/include/asm/restorer.h
+++ b/criu/arch/aarch64/include/asm/restorer.h
@@ -1,7 +1,6 @@
@@ -1,7 +1,7 @@
#ifndef __CR_ASM_RESTORER_H__
#define __CR_ASM_RESTORER_H__

-#include <asm/sigcontext.h>
-#include <signal.h>
+
#include <sys/ucontext.h>

#include "asm/types.h"
Expand Down Expand Up @@ -190,6 +191,20 @@ index ef78bcec7..4a64c975a 100644

#include "image.h"
#include "servicefd.h"
diff --git a/images/Makefile b/images/Makefile
index 2c33152e9..51d28901c 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -93,8 +93,7 @@ makefile-deps := Makefile $(obj)/Makefile
#
# Generate descriptor.pb-c.c and descriptor.pb-c.h to compile opts.proto.
DESCRIPTOR_DIR := images/google/protobuf
-GOOGLE_INCLUDE=$(shell pkg-config protobuf --variable=includedir)/google/protobuf
-$(DESCRIPTOR_DIR)/descriptor.pb-c.c: $(GOOGLE_INCLUDE)/descriptor.proto
+$(DESCRIPTOR_DIR)/descriptor.pb-c.c: images/google/protobuf/descriptor.proto
$(call msg-gen, $@)
$(Q) protoc --proto_path=/usr/include --proto_path=$(obj)/ --c_out=$(obj)/ $<

diff --git a/plugins/cuda/Makefile b/plugins/cuda/Makefile
index cc3d98ac9..6ba0defe8 100644
--- a/plugins/cuda/Makefile
Expand Down
18 changes: 9 additions & 9 deletions patch/criu-static-plugin.patch
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ index 4cdb0c7d5..efb86b018 100644
$(obj)/Makefile.crtools: ;
$(obj)/Makefile.packages: ;
diff --git a/criu/include/criu-plugin.h b/criu/include/criu-plugin.h
index 392ea9f53..a01872a2d 100644
index 9fb21a449..5bc7a991a 100644
--- a/criu/include/criu-plugin.h
+++ b/criu/include/criu-plugin.h
@@ -99,8 +99,25 @@ typedef struct {
@@ -102,8 +102,25 @@ typedef struct {
void *hooks[CR_PLUGIN_HOOK__MAX];
} cr_plugin_desc_t;

Expand All @@ -69,7 +69,7 @@ index 392ea9f53..a01872a2d 100644
#define CR_PLUGIN_REGISTER(___name, ___init, ___exit) \
cr_plugin_desc_t CR_PLUGIN_DESC = { \
.name = ___name, \
@@ -110,6 +127,9 @@ extern cr_plugin_desc_t CR_PLUGIN_DESC;
@@ -113,6 +130,9 @@ extern cr_plugin_desc_t CR_PLUGIN_DESC;
.max_hooks = CR_PLUGIN_HOOK__MAX, \
};

Expand All @@ -80,10 +80,10 @@ index 392ea9f53..a01872a2d 100644
{
return 0;
diff --git a/criu/plugin.c b/criu/plugin.c
index 65e79a069..56ec2bab8 100644
index 18da0499d..4ae7c145a 100644
--- a/criu/plugin.c
+++ b/criu/plugin.c
@@ -95,6 +95,77 @@ static int verify_plugin(cr_plugin_desc_t *d)
@@ -96,6 +96,77 @@ static int verify_plugin(cr_plugin_desc_t *d)
return 0;
}

Expand Down Expand Up @@ -161,7 +161,7 @@ index 65e79a069..56ec2bab8 100644
int criu_get_image_dir(void)
{
return get_service_fd(IMG_FD_OFF);
@@ -195,7 +266,11 @@ void cr_plugin_fini(int stage, int ret)
@@ -196,7 +267,11 @@ void cr_plugin_fini(int stage, int ret)

if (this->d->version == CRIU_PLUGIN_VERSION_OLD)
xfree(this->d);
Expand All @@ -174,7 +174,7 @@ index 65e79a069..56ec2bab8 100644
}
}

@@ -210,6 +285,16 @@ int cr_plugin_init(int stage)
@@ -211,6 +286,16 @@ int cr_plugin_init(int stage)
for (i = 0; i < ARRAY_SIZE(cr_plugin_ctl.hook_chain); i++)
INIT_LIST_HEAD(&cr_plugin_ctl.hook_chain[i]);

Expand Down Expand Up @@ -234,7 +234,7 @@ index 6ba0defe8..81959ba67 100644

mrproper: clean
diff --git a/plugins/cuda/cuda_plugin.c b/plugins/cuda/cuda_plugin.c
index 99e4caf74..b27e45852 100644
index 9ccb04224..8a38bcd5c 100644
--- a/plugins/cuda/cuda_plugin.c
+++ b/plugins/cuda/cuda_plugin.c
@@ -47,6 +47,12 @@ bool plugin_disabled = false;
Expand All @@ -250,7 +250,7 @@ index 99e4caf74..b27e45852 100644
struct pid_info {
int pid;
char checkpointed;
@@ -632,4 +638,3 @@ void cuda_plugin_fini(int stage, int ret)
@@ -628,4 +634,3 @@ void cuda_plugin_fini(int stage, int ret)
dealloc_pid_buffer(&cuda_pids);
}
}
Expand Down