diff options
author | Kai Kang <kai.kang@windriver.com> | 2022-09-29 16:51:41 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-10-04 16:42:07 -0400 |
commit | f8c8b9024421d5d2e434ed598a81d78928ae43d1 (patch) | |
tree | 922cc8129ba97d0611e6cf1f84d67941be0fe64e /recipes-containers/criu | |
parent | 5bc9ecc2a706a726e6b9460ae3fd17af5172b263 (diff) | |
download | meta-virtualization-f8c8b9024421d5d2e434ed598a81d78928ae43d1.tar.gz |
criu: 3.17 -> 3.17.1
Update criu from 3.17 to 3.17.1:
* update file path and remove __pycache__ directory in do_install
* rebase 0002-criu-Change-libraries-install-directory.patch
* backport patches to fix build errors with glibc 2.36.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/criu')
4 files changed, 411 insertions, 5 deletions
diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb index 46401f9a..733e9119 100644 --- a/recipes-containers/criu/criu_git.bb +++ b/recipes-containers/criu/criu_git.bb | |||
@@ -13,14 +13,16 @@ EXCLUDE_FROM_WORLD = "1" | |||
13 | 13 | ||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=412de458544c1cb6a2b512cd399286e2" | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=412de458544c1cb6a2b512cd399286e2" |
15 | 15 | ||
16 | SRCREV = "4f8f295e57e68740699479d12c1ad251e6dd859f" | 16 | SRCREV = "d46f40f4ff0c724e0b9f0f8a2e8c043806897e94" |
17 | PV = "3.17+git${SRCPV}" | 17 | PV = "3.17.1+git${SRCPV}" |
18 | 18 | ||
19 | SRC_URI = "git://github.com/checkpoint-restore/criu.git;branch=master;protocol=https \ | 19 | SRC_URI = "git://github.com/checkpoint-restore/criu.git;branch=master;protocol=https \ |
20 | file://0001-criu-Skip-documentation-install.patch \ | 20 | file://0001-criu-Skip-documentation-install.patch \ |
21 | file://0002-criu-Change-libraries-install-directory.patch \ | 21 | file://0002-criu-Change-libraries-install-directory.patch \ |
22 | file://0003-lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ | 22 | file://0003-lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ |
23 | " | 23 | file://0004-criu-fix-conflicting-headers.patch \ |
24 | file://0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch \ | ||
25 | " | ||
24 | 26 | ||
25 | COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" | 27 | COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" |
26 | 28 | ||
@@ -81,7 +83,9 @@ do_install () { | |||
81 | # scripts. 'crit' is one of those scripts. The "executable" or "e" option to the | 83 | # scripts. 'crit' is one of those scripts. The "executable" or "e" option to the |
82 | # setup call should fix it, but it is being ignored. So to avoid getting our native | 84 | # setup call should fix it, but it is being ignored. So to avoid getting our native |
83 | # intepreter replaced in the script, we'll do an explicit update ourselves. | 85 | # intepreter replaced in the script, we'll do an explicit update ourselves. |
84 | sed -i 's%^\#\!.*%\#\!/usr/bin/env python3%' ${D}/usr/bin/crit ${D}${libdir}/python3*/site-packages/crit-0.0.1-py3*.egg/EGG-INFO/scripts/crit | 86 | sed -i 's%^\#\!.*%\#\!/usr/bin/env python3%' ${D}/usr/bin/crit ${D}${libdir}/python3*/site-packages/crit-*-py3*.egg/EGG-INFO/scripts/crit |
87 | |||
88 | rm -rf ${D}/__pycache__ | ||
85 | } | 89 | } |
86 | 90 | ||
87 | FILES:${PN} += "${systemd_unitdir}/ \ | 91 | FILES:${PN} += "${systemd_unitdir}/ \ |
diff --git a/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch b/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch index 453be131..ad8c9f18 100644 --- a/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch +++ b/recipes-containers/criu/files/0002-criu-Change-libraries-install-directory.patch | |||
@@ -7,6 +7,10 @@ Install the libraries into /usr/lib(or /usr/lib64) | |||
7 | 7 | ||
8 | Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> | 8 | Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> |
9 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | 9 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> |
10 | |||
11 | Rebase for criu 3.17.1. | ||
12 | |||
13 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | --- | 14 | --- |
11 | Makefile.install | 13 ------------- | 15 | Makefile.install | 13 ------------- |
12 | 1 file changed, 13 deletions(-) | 16 | 1 file changed, 13 deletions(-) |
@@ -17,7 +21,7 @@ index 1b02b70af..2839ef5fe 100644 | |||
17 | +++ b/Makefile.install | 21 | +++ b/Makefile.install |
18 | @@ -9,19 +9,6 @@ LIBEXECDIR ?= $(PREFIX)/libexec | 22 | @@ -9,19 +9,6 @@ LIBEXECDIR ?= $(PREFIX)/libexec |
19 | RUNDIR ?= /run | 23 | RUNDIR ?= /run |
20 | PLUGINDIR ?= /var/lib/criu | 24 | PLUGINDIR ?= $(PREFIX)/lib/criu |
21 | 25 | ||
22 | -# | 26 | -# |
23 | -# For recent Debian/Ubuntu with multiarch support. | 27 | -# For recent Debian/Ubuntu with multiarch support. |
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..fa4cecd6 --- /dev/null +++ b/recipes-containers/criu/files/0004-criu-fix-conflicting-headers.patch | |||
@@ -0,0 +1,288 @@ | |||
1 | Backport patch to fix criu compile error with glibc 2.36. Update context | ||
2 | for Makefile.config. | ||
3 | |||
4 | Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/commit/4c86d6a7] | ||
5 | |||
6 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
7 | |||
8 | From 4c86d6a7d54abb64fc5a15131f3351224e8c071b Mon Sep 17 00:00:00 2001 | ||
9 | From: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
10 | Date: Sun, 31 Jul 2022 16:07:30 +0000 | ||
11 | Subject: [PATCH] criu: fix conflicting headers | ||
12 | |||
13 | There are several changes in glibc 2.36 that make sys/mount.h header | ||
14 | incompatible with kernel headers: | ||
15 | |||
16 | https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E | ||
17 | |||
18 | This patch removes conflicting includes for `<linux/mount.h>` and | ||
19 | updates the content of `criu/include/linux/mount.h` to match | ||
20 | `/usr/include/sys/mount.h`. In addition, inline definitions sys_*() | ||
21 | functions have been moved from "linux/mount.h" to "syscall.h" to | ||
22 | avoid conflicts with `uapi/compel/plugins/std/syscall.h` and | ||
23 | `<unistd.h>`. The include for `<linux/aio_abi.h>` has been replaced | ||
24 | with local include to avoid conflicts with `<sys/mount.h>`. | ||
25 | |||
26 | Fixes: #1949 | ||
27 | |||
28 | Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
29 | --- | ||
30 | Makefile.config | 2 +- | ||
31 | criu/cgroup.c | 1 + | ||
32 | criu/cr-check.c | 2 +- | ||
33 | criu/cr-restore.c | 3 ++- | ||
34 | criu/include/aio.h | 2 +- | ||
35 | criu/include/linux/aio_abi.h | 14 +++++++++++ | ||
36 | criu/include/linux/mount.h | 48 +++++++++++++++++++----------------- | ||
37 | criu/include/syscall.h | 17 +++++++++++++ | ||
38 | criu/pie/parasite.c | 2 +- | ||
39 | criu/util.c | 1 + | ||
40 | scripts/feature-tests.mak | 13 ---------- | ||
41 | 11 files changed, 64 insertions(+), 41 deletions(-) | ||
42 | create mode 100644 criu/include/linux/aio_abi.h | ||
43 | create mode 100644 criu/include/syscall.h | ||
44 | |||
45 | diff --git a/Makefile.config b/Makefile.config | ||
46 | index d113e2246..270ec61c0 100644 | ||
47 | --- a/Makefile.config | ||
48 | +++ b/Makefile.config | ||
49 | @@ -78,7 +78,7 @@ export DEFINES += $(FEATURE_DEFINES) | ||
50 | export CFLAGS += $(FEATURE_DEFINES) | ||
51 | |||
52 | FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \ | ||
53 | - SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW FSCONFIG MEMFD_CREATE OPENAT2 | ||
54 | + SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW MEMFD_CREATE OPENAT2 | ||
55 | |||
56 | # $1 - config name | ||
57 | define gen-feature-test | ||
58 | diff --git a/criu/cgroup.c b/criu/cgroup.c | ||
59 | index e05b0832e..325df6a1d 100644 | ||
60 | --- a/criu/cgroup.c | ||
61 | +++ b/criu/cgroup.c | ||
62 | @@ -27,6 +27,7 @@ | ||
63 | #include "images/cgroup.pb-c.h" | ||
64 | #include "kerndat.h" | ||
65 | #include "linux/mount.h" | ||
66 | +#include "syscall.h" | ||
67 | |||
68 | /* | ||
69 | * This structure describes set of controller groups | ||
70 | diff --git a/criu/cr-check.c b/criu/cr-check.c | ||
71 | index f589a91da..0ca80192c 100644 | ||
72 | --- a/criu/cr-check.c | ||
73 | +++ b/criu/cr-check.c | ||
74 | @@ -21,7 +21,6 @@ | ||
75 | #include <sys/prctl.h> | ||
76 | #include <sched.h> | ||
77 | #include <sys/mount.h> | ||
78 | -#include <linux/aio_abi.h> | ||
79 | |||
80 | #include "../soccr/soccr.h" | ||
81 | |||
82 | @@ -52,6 +51,7 @@ | ||
83 | #include "net.h" | ||
84 | #include "restorer.h" | ||
85 | #include "uffd.h" | ||
86 | +#include "linux/aio_abi.h" | ||
87 | |||
88 | #include "images/inventory.pb-c.h" | ||
89 | |||
90 | diff --git a/criu/cr-restore.c b/criu/cr-restore.c | ||
91 | index 279246c19..d11d28173 100644 | ||
92 | --- a/criu/cr-restore.c | ||
93 | +++ b/criu/cr-restore.c | ||
94 | @@ -22,7 +22,6 @@ | ||
95 | #include <compel/ptrace.h> | ||
96 | #include "common/compiler.h" | ||
97 | |||
98 | -#include "linux/mount.h" | ||
99 | #include "linux/rseq.h" | ||
100 | |||
101 | #include "clone-noasan.h" | ||
102 | @@ -86,6 +85,8 @@ | ||
103 | #include <compel/plugins/std/syscall-codes.h> | ||
104 | #include "compel/include/asm/syscall.h" | ||
105 | |||
106 | +#include "linux/mount.h" | ||
107 | + | ||
108 | #include "protobuf.h" | ||
109 | #include "images/sa.pb-c.h" | ||
110 | #include "images/timer.pb-c.h" | ||
111 | diff --git a/criu/include/aio.h b/criu/include/aio.h | ||
112 | index d1655739d..38e704020 100644 | ||
113 | --- a/criu/include/aio.h | ||
114 | +++ b/criu/include/aio.h | ||
115 | @@ -1,7 +1,7 @@ | ||
116 | #ifndef __CR_AIO_H__ | ||
117 | #define __CR_AIO_H__ | ||
118 | |||
119 | -#include <linux/aio_abi.h> | ||
120 | +#include "linux/aio_abi.h" | ||
121 | #include "images/mm.pb-c.h" | ||
122 | unsigned int aio_estimate_nr_reqs(unsigned int size); | ||
123 | int dump_aio_ring(MmEntry *mme, struct vma_area *vma); | ||
124 | diff --git a/criu/include/linux/aio_abi.h b/criu/include/linux/aio_abi.h | ||
125 | new file mode 100644 | ||
126 | index 000000000..d9ce78720 | ||
127 | --- /dev/null | ||
128 | +++ b/criu/include/linux/aio_abi.h | ||
129 | @@ -0,0 +1,14 @@ | ||
130 | +#ifndef __LINUX__AIO_ABI_H | ||
131 | +#define __LINUX__AIO_ABI_H | ||
132 | + | ||
133 | +typedef __kernel_ulong_t aio_context_t; | ||
134 | + | ||
135 | +/* read() from /dev/aio returns these structures. */ | ||
136 | +struct io_event { | ||
137 | + __u64 data; /* the data field from the iocb */ | ||
138 | + __u64 obj; /* what iocb this event came from */ | ||
139 | + __s64 res; /* result code for this event */ | ||
140 | + __s64 res2; /* secondary result */ | ||
141 | +}; | ||
142 | + | ||
143 | +#endif /* __LINUX__AIO_ABI_H */ | ||
144 | diff --git a/criu/include/linux/mount.h b/criu/include/linux/mount.h | ||
145 | index 9a3a28b10..0d55a588c 100644 | ||
146 | --- a/criu/include/linux/mount.h | ||
147 | +++ b/criu/include/linux/mount.h | ||
148 | @@ -4,32 +4,34 @@ | ||
149 | #include "common/config.h" | ||
150 | #include "compel/plugins/std/syscall-codes.h" | ||
151 | |||
152 | -#ifdef CONFIG_HAS_FSCONFIG | ||
153 | -#include <linux/mount.h> | ||
154 | -#else | ||
155 | +/* Copied from /usr/include/sys/mount.h */ | ||
156 | + | ||
157 | +#ifndef FSCONFIG_CMD_CREATE | ||
158 | +/* The type of fsconfig call made. */ | ||
159 | enum fsconfig_command { | ||
160 | - FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
161 | - FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
162 | - FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
163 | - FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
164 | - FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
165 | - FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
166 | - FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
167 | + FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
168 | +#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG | ||
169 | + FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
170 | +#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING | ||
171 | + FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
172 | +#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY | ||
173 | + FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
174 | +#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH | ||
175 | + FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
176 | +#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY | ||
177 | + FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
178 | +#define FSCONFIG_SET_FD FSCONFIG_SET_FD | ||
179 | + FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
180 | +#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE | ||
181 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
182 | +#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE | ||
183 | }; | ||
184 | -#endif | ||
185 | +#endif // FSCONFIG_CMD_CREATE | ||
186 | |||
187 | -static inline int sys_fsopen(const char *fsname, unsigned int flags) | ||
188 | -{ | ||
189 | - return syscall(__NR_fsopen, fsname, flags); | ||
190 | -} | ||
191 | -static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux) | ||
192 | -{ | ||
193 | - return syscall(__NR_fsconfig, fd, cmd, key, value, aux); | ||
194 | -} | ||
195 | -static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags) | ||
196 | -{ | ||
197 | - return syscall(__NR_fsmount, fd, flags, attr_flags); | ||
198 | -} | ||
199 | +#ifndef MS_MGC_VAL | ||
200 | +/* Magic mount flag number. Has to be or-ed to the flag values. */ | ||
201 | +#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */ | ||
202 | +#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */ | ||
203 | +#endif | ||
204 | |||
205 | #endif | ||
206 | diff --git a/criu/include/syscall.h b/criu/include/syscall.h | ||
207 | new file mode 100644 | ||
208 | index 000000000..c38d6d971 | ||
209 | --- /dev/null | ||
210 | +++ b/criu/include/syscall.h | ||
211 | @@ -0,0 +1,17 @@ | ||
212 | +#ifndef __CR_SYSCALL_H__ | ||
213 | +#define __CR_SYSCALL_H__ | ||
214 | + | ||
215 | +static inline int sys_fsopen(const char *fsname, unsigned int flags) | ||
216 | +{ | ||
217 | + return syscall(__NR_fsopen, fsname, flags); | ||
218 | +} | ||
219 | +static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux) | ||
220 | +{ | ||
221 | + return syscall(__NR_fsconfig, fd, cmd, key, value, aux); | ||
222 | +} | ||
223 | +static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags) | ||
224 | +{ | ||
225 | + return syscall(__NR_fsmount, fd, flags, attr_flags); | ||
226 | +} | ||
227 | + | ||
228 | +#endif /* __CR_SYSCALL_H__ */ | ||
229 | \ No newline at end of file | ||
230 | diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c | ||
231 | index e7eb1fcb6..f75fe13bb 100644 | ||
232 | --- a/criu/pie/parasite.c | ||
233 | +++ b/criu/pie/parasite.c | ||
234 | @@ -3,7 +3,6 @@ | ||
235 | #include <signal.h> | ||
236 | #include <linux/limits.h> | ||
237 | #include <linux/capability.h> | ||
238 | -#include <sys/mount.h> | ||
239 | #include <stdarg.h> | ||
240 | #include <sys/ioctl.h> | ||
241 | #include <sys/uio.h> | ||
242 | @@ -14,6 +13,7 @@ | ||
243 | #include "int.h" | ||
244 | #include "types.h" | ||
245 | #include <compel/plugins/std/syscall.h> | ||
246 | +#include "linux/mount.h" | ||
247 | #include "parasite.h" | ||
248 | #include "fcntl.h" | ||
249 | #include "prctl.h" | ||
250 | diff --git a/criu/util.c b/criu/util.c | ||
251 | index 5f69465b4..060ca3bd4 100644 | ||
252 | --- a/criu/util.c | ||
253 | +++ b/criu/util.c | ||
254 | @@ -40,6 +40,7 @@ | ||
255 | #include "mem.h" | ||
256 | #include "namespaces.h" | ||
257 | #include "criu-log.h" | ||
258 | +#include "syscall.h" | ||
259 | |||
260 | #include "clone-noasan.h" | ||
261 | #include "cr_options.h" | ||
262 | diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak | ||
263 | index 014e893a8..fb5d2ef7a 100644 | ||
264 | --- a/scripts/feature-tests.mak | ||
265 | +++ b/scripts/feature-tests.mak | ||
266 | @@ -137,19 +137,6 @@ ENTRY(main) | ||
267 | END(main) | ||
268 | endef | ||
269 | |||
270 | -define FEATURE_TEST_FSCONFIG | ||
271 | - | ||
272 | -#include <linux/mount.h> | ||
273 | - | ||
274 | -int main(void) | ||
275 | -{ | ||
276 | - if (FSCONFIG_CMD_CREATE > 0) | ||
277 | - return 0; | ||
278 | - return 0; | ||
279 | -} | ||
280 | - | ||
281 | -endef | ||
282 | - | ||
283 | define FEATURE_TEST_NFTABLES_LIB_API_0 | ||
284 | |||
285 | #include <string.h> | ||
286 | -- | ||
287 | 2.34.1 | ||
288 | |||
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..dc41d368 --- /dev/null +++ b/recipes-containers/criu/files/0005-mount-add-definition-for-FSOPEN_CLOEXEC.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/commit/517c0947] | ||
2 | |||
3 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
4 | |||
5 | From 517c0947050e63aac72f63a3bf373d76264723b9 Mon Sep 17 00:00:00 2001 | ||
6 | From: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
7 | Date: Wed, 24 Aug 2022 21:20:30 +0200 | ||
8 | Subject: [PATCH 2/2] mount: add definition for FSOPEN_CLOEXEC | ||
9 | |||
10 | A recent change in glibc introduced `enum fsconfig_command` [1] and as a | ||
11 | result the compilation of criu fails with the following errors | ||
12 | |||
13 | In file included from criu/pie/util.c:3: | ||
14 | /usr/include/sys/mount.h:240:6: error: redeclaration of 'enum fsconfig_command' | ||
15 | 240 | enum fsconfig_command | ||
16 | | ^~~~~~~~~~~~~~~~ | ||
17 | In file included from /usr/include/sys/mount.h:32: | ||
18 | criu/include/linux/mount.h:11:6: note: originally defined here | ||
19 | 11 | enum fsconfig_command { | ||
20 | | ^~~~~~~~~~~~~~~~ | ||
21 | /usr/include/sys/mount.h:242:3: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG' | ||
22 | 242 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
23 | | ^~~~~~~~~~~~~~~~~ | ||
24 | criu/include/linux/mount.h:12:9: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command' | ||
25 | 12 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
26 | | ^~~~~~~~~~~~~~~~~ | ||
27 | /usr/include/sys/mount.h:244:3: error: redeclaration of enumerator 'FSCONFIG_SET_STRING' | ||
28 | 244 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
29 | | ^~~~~~~~~~~~~~~~~~~ | ||
30 | criu/include/linux/mount.h:14:9: note: previous definition of 'FSCONFIG_SET_STRING' with type 'enum fsconfig_command' | ||
31 | 14 | FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */ | ||
32 | | ^~~~~~~~~~~~~~~~~~~ | ||
33 | /usr/include/sys/mount.h:246:3: error: redeclaration of enumerator 'FSCONFIG_SET_BINARY' | ||
34 | 246 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
35 | | ^~~~~~~~~~~~~~~~~~~ | ||
36 | criu/include/linux/mount.h:16:9: note: previous definition of 'FSCONFIG_SET_BINARY' with type 'enum fsconfig_command' | ||
37 | 16 | FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */ | ||
38 | | ^~~~~~~~~~~~~~~~~~~ | ||
39 | /usr/include/sys/mount.h:248:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH' | ||
40 | 248 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
41 | | ^~~~~~~~~~~~~~~~~ | ||
42 | criu/include/linux/mount.h:18:9: note: previous definition of 'FSCONFIG_SET_PATH' with type 'enum fsconfig_command' | ||
43 | 18 | FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */ | ||
44 | | ^~~~~~~~~~~~~~~~~ | ||
45 | /usr/include/sys/mount.h:250:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH_EMPTY' | ||
46 | 250 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
47 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
48 | criu/include/linux/mount.h:20:9: note: previous definition of 'FSCONFIG_SET_PATH_EMPTY' with type 'enum fsconfig_command' | ||
49 | 20 | FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */ | ||
50 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
51 | /usr/include/sys/mount.h:252:3: error: redeclaration of enumerator 'FSCONFIG_SET_FD' | ||
52 | 252 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
53 | | ^~~~~~~~~~~~~~~ | ||
54 | criu/include/linux/mount.h:22:9: note: previous definition of 'FSCONFIG_SET_FD' with type 'enum fsconfig_command' | ||
55 | 22 | FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */ | ||
56 | | ^~~~~~~~~~~~~~~ | ||
57 | /usr/include/sys/mount.h:254:3: error: redeclaration of enumerator 'FSCONFIG_CMD_CREATE' | ||
58 | 254 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
59 | | ^~~~~~~~~~~~~~~~~~~ | ||
60 | criu/include/linux/mount.h:24:9: note: previous definition of 'FSCONFIG_CMD_CREATE' with type 'enum fsconfig_command' | ||
61 | 24 | FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */ | ||
62 | | ^~~~~~~~~~~~~~~~~~~ | ||
63 | /usr/include/sys/mount.h:256:3: error: redeclaration of enumerator 'FSCONFIG_CMD_RECONFIGURE' | ||
64 | 256 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
65 | | ^~~~~~~~~~~~~~~~~~~~~~~~ | ||
66 | criu/include/linux/mount.h:26:9: note: previous definition of 'FSCONFIG_CMD_RECONFIGURE' with type 'enum fsconfig_command' | ||
67 | 26 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
68 | |||
69 | This patch adds definition for FSOPEN_CLOEXEC to solve this problem. In particular, | ||
70 | sys/mount.h includes ifndef check for FSOPEN_CLOEXEC surrounding `enum fsconfig_command`. | ||
71 | |||
72 | [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=7eae6a91e9b1670330c9f15730082c91c0b1d570 | ||
73 | |||
74 | Reported-by: Younes Manton (@ymanton) | ||
75 | Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> | ||
76 | --- | ||
77 | criu/include/linux/mount.h | 10 ++++++++-- | ||
78 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
79 | |||
80 | diff --git a/criu/include/linux/mount.h b/criu/include/linux/mount.h | ||
81 | index 0d55a588c..fefafa89e 100644 | ||
82 | --- a/criu/include/linux/mount.h | ||
83 | +++ b/criu/include/linux/mount.h | ||
84 | @@ -6,7 +6,7 @@ | ||
85 | |||
86 | /* Copied from /usr/include/sys/mount.h */ | ||
87 | |||
88 | -#ifndef FSCONFIG_CMD_CREATE | ||
89 | +#ifndef FSOPEN_CLOEXEC | ||
90 | /* The type of fsconfig call made. */ | ||
91 | enum fsconfig_command { | ||
92 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ | ||
93 | @@ -26,7 +26,13 @@ enum fsconfig_command { | ||
94 | FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */ | ||
95 | #define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE | ||
96 | }; | ||
97 | -#endif // FSCONFIG_CMD_CREATE | ||
98 | + | ||
99 | +#endif // FSOPEN_CLOEXEC | ||
100 | + | ||
101 | +/* fsopen flags. With the redundant definition, we check if the kernel, | ||
102 | + * glibc value and our value still match. | ||
103 | + */ | ||
104 | +#define FSOPEN_CLOEXEC 0x00000001 | ||
105 | |||
106 | #ifndef MS_MGC_VAL | ||
107 | /* Magic mount flag number. Has to be or-ed to the flag values. */ | ||
108 | -- | ||
109 | 2.34.1 | ||
110 | |||