Skip to content

Commit 065622c

Browse files
build: adapt patches for criu v4.2
Co-Authored-By: Alberto Miranda <alberto.miranda@seqera.io>
1 parent 21862ac commit 065622c

File tree

3 files changed

+38
-20
lines changed

3 files changed

+38
-20
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ set(CRIU_MAKE_PATH_ENV "${PROTOC_BIN_PATH}:${PROTOC_C_BIN_PATH}:$ENV{PATH}")
7575
message("-- criu CFLAGS ${CRIU_CFLAGS}")
7676
message("-- criu LDFLAGS ${CRIU_LDFLAGS}")
7777
message("-- criu PATH ${CRIU_MAKE_PATH_ENV}")
78+
message("-- libcap CFLAGS ${LIBCAP_CFLAGS}")
79+
message("-- descriptor.proto file: ${DESCRIPTOR_PROTO_FILE}")
7880

7981
# CRIU build directories
8082
set(CRIU_BUILD_DIR ${CMAKE_BINARY_DIR}/criu-build)

patch/criu-build.patch

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Makefile b/Makefile
2-
index 5d8e89ac1..9006fc193 100644
2+
index e26807158..aa9d7746d 100644
33
--- a/Makefile
44
+++ b/Makefile
5-
@@ -268,7 +268,6 @@ criu-deps += $(SOCCR_A)
5+
@@ -270,7 +270,6 @@ criu-deps += $(SOCCR_A)
66
# But note that we're already included
77
# the nmk so we can reuse it there.
88
criu/Makefile: ;
@@ -11,7 +11,7 @@ index 5d8e89ac1..9006fc193 100644
1111
criu/%: $(criu-deps) .FORCE
1212
$(Q) $(MAKE) $(build)=criu $@
1313
diff --git a/Makefile.compel b/Makefile.compel
14-
index 764afadc8..c211f52f4 100644
14+
index a4209edc5..7e91ff42c 100644
1515
--- a/Makefile.compel
1616
+++ b/Makefile.compel
1717
@@ -63,7 +63,7 @@ compel/plugins/fds.lib.a: $(compel-deps) compel/plugins/std.lib.a .FORCE
@@ -24,7 +24,7 @@ index 764afadc8..c211f52f4 100644
2424
#
2525
# And compel library.
2626
diff --git a/Makefile.config b/Makefile.config
27-
index 5ab689d41..d7ad71667 100644
27+
index 5cf4b8216..adacedad3 100644
2828
--- a/Makefile.config
2929
+++ b/Makefile.config
3030
@@ -5,58 +5,6 @@ include scripts/feature-tests.mak
@@ -35,7 +35,7 @@ index 5ab689d41..d7ad71667 100644
3535
- LIBS_FEATURES += -lbsd
3636
- FEATURE_DEFINES += -DCONFIG_HAS_LIBBSD
3737
-else
38-
- $(info Note: Building without setproctitle() and strlcpy() support.)
38+
- $(info Note: Building without setproctitle() support.)
3939
- $(info $S Install libbsd-devel (RPM) / libbsd-dev (DEB) to fix.)
4040
-endif
4141
-
@@ -87,20 +87,20 @@ index 5ab689d41..d7ad71667 100644
8787

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

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

100100
+#include <asm/types.h>
101101
#include <stdint.h>
102+
#include <asm/types.h>
102103

103-
/* Copied from the kernel header arch/arm64/include/uapi/asm/sigcontext.h */
104104
diff --git a/criu/Makefile b/criu/Makefile
105105
index bafdd980b..4cdb0c7d5 100644
106106
--- a/criu/Makefile
@@ -140,14 +140,15 @@ index bafdd980b..4cdb0c7d5 100644
140140
-all-y += check-packages $(obj)/criu
141141
+all-y += $(obj)/criu
142142
diff --git a/criu/arch/aarch64/include/asm/restorer.h b/criu/arch/aarch64/include/asm/restorer.h
143-
index 64a9c24eb..0359e78db 100644
143+
index 2174df4fa..11a487e3a 100644
144144
--- a/criu/arch/aarch64/include/asm/restorer.h
145145
+++ b/criu/arch/aarch64/include/asm/restorer.h
146-
@@ -1,7 +1,6 @@
146+
@@ -1,7 +1,7 @@
147147
#ifndef __CR_ASM_RESTORER_H__
148148
#define __CR_ASM_RESTORER_H__
149149

150-
-#include <asm/sigcontext.h>
150+
-#include <signal.h>
151+
+
151152
#include <sys/ucontext.h>
152153

153154
#include "asm/types.h"
@@ -190,6 +191,21 @@ index ef78bcec7..4a64c975a 100644
190191

191192
#include "image.h"
192193
#include "servicefd.h"
194+
diff --git a/images/Makefile b/images/Makefile
195+
index 2c33152e9..0c811d30e 100644
196+
--- a/images/Makefile
197+
+++ b/images/Makefile
198+
@@ -93,8 +93,8 @@ makefile-deps := Makefile $(obj)/Makefile
199+
#
200+
# Generate descriptor.pb-c.c and descriptor.pb-c.h to compile opts.proto.
201+
DESCRIPTOR_DIR := images/google/protobuf
202+
-GOOGLE_INCLUDE=$(shell pkg-config protobuf --variable=includedir)/google/protobuf
203+
-$(DESCRIPTOR_DIR)/descriptor.pb-c.c: $(GOOGLE_INCLUDE)/descriptor.proto
204+
+# GOOGLE_INCLUDE=$(shell pkg-config protobuf --variable=includedir)/google/protobuf
205+
+$(DESCRIPTOR_DIR)/descriptor.pb-c.c:
206+
$(call msg-gen, $@)
207+
$(Q) protoc --proto_path=/usr/include --proto_path=$(obj)/ --c_out=$(obj)/ $<
208+
193209
diff --git a/plugins/cuda/Makefile b/plugins/cuda/Makefile
194210
index cc3d98ac9..6ba0defe8 100644
195211
--- a/plugins/cuda/Makefile

patch/criu-static-plugin.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ index 4cdb0c7d5..efb86b018 100644
3939
$(obj)/Makefile.crtools: ;
4040
$(obj)/Makefile.packages: ;
4141
diff --git a/criu/include/criu-plugin.h b/criu/include/criu-plugin.h
42-
index 392ea9f53..a01872a2d 100644
42+
index 9fb21a449..5bc7a991a 100644
4343
--- a/criu/include/criu-plugin.h
4444
+++ b/criu/include/criu-plugin.h
45-
@@ -99,8 +99,25 @@ typedef struct {
45+
@@ -102,8 +102,25 @@ typedef struct {
4646
void *hooks[CR_PLUGIN_HOOK__MAX];
4747
} cr_plugin_desc_t;
4848

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

@@ -80,10 +80,10 @@ index 392ea9f53..a01872a2d 100644
8080
{
8181
return 0;
8282
diff --git a/criu/plugin.c b/criu/plugin.c
83-
index 65e79a069..56ec2bab8 100644
83+
index 18da0499d..4ae7c145a 100644
8484
--- a/criu/plugin.c
8585
+++ b/criu/plugin.c
86-
@@ -95,6 +95,77 @@ static int verify_plugin(cr_plugin_desc_t *d)
86+
@@ -96,6 +96,77 @@ static int verify_plugin(cr_plugin_desc_t *d)
8787
return 0;
8888
}
8989

@@ -161,7 +161,7 @@ index 65e79a069..56ec2bab8 100644
161161
int criu_get_image_dir(void)
162162
{
163163
return get_service_fd(IMG_FD_OFF);
164-
@@ -195,7 +266,11 @@ void cr_plugin_fini(int stage, int ret)
164+
@@ -196,7 +267,11 @@ void cr_plugin_fini(int stage, int ret)
165165

166166
if (this->d->version == CRIU_PLUGIN_VERSION_OLD)
167167
xfree(this->d);
@@ -174,7 +174,7 @@ index 65e79a069..56ec2bab8 100644
174174
}
175175
}
176176

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

@@ -234,7 +234,7 @@ index 6ba0defe8..81959ba67 100644
234234

235235
mrproper: clean
236236
diff --git a/plugins/cuda/cuda_plugin.c b/plugins/cuda/cuda_plugin.c
237-
index 99e4caf74..b27e45852 100644
237+
index 9ccb04224..8a38bcd5c 100644
238238
--- a/plugins/cuda/cuda_plugin.c
239239
+++ b/plugins/cuda/cuda_plugin.c
240240
@@ -47,6 +47,12 @@ bool plugin_disabled = false;
@@ -250,7 +250,7 @@ index 99e4caf74..b27e45852 100644
250250
struct pid_info {
251251
int pid;
252252
char checkpointed;
253-
@@ -632,4 +638,3 @@ void cuda_plugin_fini(int stage, int ret)
253+
@@ -628,4 +634,3 @@ void cuda_plugin_fini(int stage, int ret)
254254
dealloc_pid_buffer(&cuda_pids);
255255
}
256256
}

0 commit comments

Comments
 (0)