d3d9a8 import criu-1.6.1-3.el7

Authored and Committed by centosrcm 9 years ago
    import criu-1.6.1-3.el7
    
        
file added
+1
.criu.metadata ADDED
@@ -0,0 +1 @@
1
+ 511205e8fb4b170e70e3e97073c7d886d382b088 SOURCES/criu-1.6.1.tar.bz2
file added
+1
.gitignore ADDED
@@ -0,0 +1 @@
1
+ SOURCES/criu-1.6.1.tar.bz2
file removed
-4
README.md DELETED
@@ -1,4 +0,0 @@
1
- The master branch has no content
2
-
3
- Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6
4
- If you find this file in a distro specific branch, it means that no content has been checked in yet
SOURCES/98c8e44f749dd7ed0aa8c540f566bda54d7adfa1.patch ADDED
@@ -0,0 +1,68 @@
1
+ From 98c8e44f749dd7ed0aa8c540f566bda54d7adfa1 Mon Sep 17 00:00:00 2001
2
+ From: Andrey Vagin <avagin@openvz.org>
3
+ Date: Thu, 2 Jul 2015 12:47:07 +0300
4
+ Subject: [PATCH] pipe: don't create a tranport descriptor for inhereted pipes
5
+
6
+ Otherwise we can get an error like this:
7
+ 1: \t\tCreate transport fd /crtools-fd-1-5
8
+ ...
9
+ 1: Found id pipe:[122747] (fd 8) in inherit fd list
10
+ 1: File pipe:[122747] will be restored from fd 9 duped from inherit
11
+
12
+ 1: Error (util.c:131): fd 5 already in use (called at files.c:872)
13
+ Signed-off-by: Andrey Vagin <avagin@openvz.org>
14
+ Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
15
+ ---
16
+ files.c | 3 +++
17
+ pipes.c | 20 ++++++++++++--------
18
+ 2 files changed, 15 insertions(+), 8 deletions(-)
19
+
20
+ diff --git a/files.c b/files.c
21
+ index 4eeb988..3e69be7 100644
22
+ --- a/files.c
23
+ +++ b/files.c
24
+ @@ -1394,6 +1394,9 @@ bool inherited_fd(struct file_desc *d, int *fd_p)
25
+ if (i_fd < 0)
26
+ return false;
27
+
28
+ + if (fd_p == NULL)
29
+ + return true;
30
+ +
31
+ *fd_p = dup(i_fd);
32
+ if (*fd_p < 0)
33
+ pr_perror("Inherit fd DUP failed");
34
+ diff --git a/pipes.c b/pipes.c
35
+ index 7590472..62f550c 100644
36
+ --- a/pipes.c
37
+ +++ b/pipes.c
38
+ @@ -393,18 +393,22 @@ static int collect_one_pipe(void *o, ProtobufCMessage *base)
39
+ pr_info("Collected pipe entry ID %#x PIPE ID %#x\n",
40
+ pi->pe->id, pi->pe->pipe_id);
41
+
42
+ - list_for_each_entry(tmp, &pipes, list)
43
+ - if (pi->pe->pipe_id == tmp->pe->pipe_id)
44
+ - break;
45
+ + if (file_desc_add(&pi->d, pi->pe->id, &pipe_desc_ops))
46
+ + return -1;
47
+
48
+ - if (&tmp->list == &pipes)
49
+ - INIT_LIST_HEAD(&pi->pipe_list);
50
+ - else
51
+ - list_add(&pi->pipe_list, &tmp->pipe_list);
52
+ + INIT_LIST_HEAD(&pi->pipe_list);
53
+ + if (!inherited_fd(&pi->d, NULL)) {
54
+ + list_for_each_entry(tmp, &pipes, list)
55
+ + if (pi->pe->pipe_id == tmp->pe->pipe_id)
56
+ + break;
57
+ +
58
+ + if (&tmp->list != &pipes)
59
+ + list_add(&pi->pipe_list, &tmp->pipe_list);
60
+ + }
61
+
62
+ list_add_tail(&pi->list, &pipes);
63
+ - return file_desc_add(&pi->d, pi->pe->id, &pipe_desc_ops);
64
+
65
+ + return 0;
66
+ }
67
+
68
+ struct collect_image_info pipe_cinfo = {
SOURCES/aio-fix.patch ADDED
@@ -0,0 +1,11 @@
1
+ --- a/aio.c 2015-07-01 11:02:50.360004543 -0400
2
+ +++ b/aio.c 2015-07-01 11:03:33.099757812 -0400
3
+ @@ -61,7 +61,7 @@
4
+ * up back to the k_max_reqs.
5
+ */
6
+
7
+ - return (k_max_reqs - 2) / 2;
8
+ + return (k_max_reqs - 2);
9
+ }
10
+
11
+ unsigned long aio_rings_args_size(struct vm_area_list *vmas)
SOURCES/criu-check-for-CLONE_NEWUSER-CLONE_NEWPID.patch ADDED
@@ -0,0 +1,65 @@
1
+ check: try to call clone with CLONE_NEWPID and CLONE_PARENT
2
+
3
+ This combination was forbidden in 3.12
4
+ commit 40a0d32d1eaffe6aac7324ca92604b6b3977eb0e :
5
+ "fork: unify and tighten up CLONE_NEWUSER/CLONE_NEWPID checks"
6
+
7
+ and then it was permited again in 3.13:
8
+ commit 1f7f4dde5c945f41a7abc2285be43d918029ecc5
9
+ fork: Allow CLONE_PARENT after setns(CLONE_NEWPID)
10
+
11
+ Cc: Adrian Reber <adrian@lisas.de>
12
+ Signed-off-by: Andrey Vagin <avagin@openvz.org>
13
+ ---
14
+ cr-check.c | 28 ++++++++++++++++++++++++++++
15
+ 1 file changed, 28 insertions(+)
16
+
17
+ diff --git a/cr-check.c b/cr-check.c
18
+ index 7cf796a..bf1b729 100644
19
+ --- a/cr-check.c
20
+ +++ b/cr-check.c
21
+ @@ -688,6 +688,33 @@ static int check_fdinfo_lock(void)
22
+ return 0;
23
+ }
24
+
25
+ +struct clone_arg {
26
+ + /*
27
+ + * Reserve some space for clone() to locate arguments
28
+ + * and retcode in this place
29
+ + */
30
+ + char stack[128] __attribute__((aligned (8)));
31
+ + char stack_ptr[0];
32
+ +};
33
+ +
34
+ +static int clone_cb(void *_arg) {
35
+ + exit(0);
36
+ +}
37
+ +
38
+ +static int check_clone_parent_vs_pid()
39
+ +{
40
+ + struct clone_arg ca;
41
+ + pid_t pid;
42
+ +
43
+ + pid = clone(clone_cb, ca.stack_ptr, CLONE_NEWPID | CLONE_PARENT, &ca);
44
+ + if (pid < 0) {
45
+ + pr_err("CLONE_PARENT | CLONE_NEWPID don't work together\n");
46
+ + return -1;
47
+ + }
48
+ +
49
+ + return 0;
50
+ +}
51
+ +
52
+ static int (*chk_feature)(void);
53
+
54
+ int cr_check(void)
55
+ @@ -741,6 +768,7 @@ int cr_check(void)
56
+ ret |= check_mnt_id();
57
+ ret |= check_aio_remap();
58
+ ret |= check_fdinfo_lock();
59
+ + ret |= check_clone_parent_vs_pid();
60
+
61
+ out:
62
+ if (!ret)
63
+ --
64
+ 2.1.0
65
+
SOURCES/tech-preview-info-bz1243521.patch ADDED
@@ -0,0 +1,29 @@
1
+ --- criu-1.6.1/crtools.c 2015-08-12 10:30:50.000000000 +0200
2
+ +++ crtools.c 2015-08-28 15:22:08.231877095 +0200
3
+ @@ -42,6 +42,8 @@
4
+
5
+ #include "setproctitle.h"
6
+
7
+ +#include<syslog.h>
8
+ +
9
+ struct cr_options opts;
10
+
11
+ void init_opts(void)
12
+ @@ -524,6 +526,17 @@
13
+ if (log_init(opts.output))
14
+ return 1;
15
+
16
+ + /*
17
+ + * Mark criu as tech preview for RHEL7.2
18
+ + */
19
+ + pr_msg("TECH PREVIEW: criu may not be fully supported.\n");
20
+ + pr_msg("Please review provided documentation for limitations.\n\n");
21
+ +
22
+ + openlog("criu", LOG_PID, LOG_USER);
23
+ + syslog(LOG_NOTICE, "TECH PREVIEW: criu may not be fully supported.");
24
+ + syslog(LOG_NOTICE, "Please review provided documentation for limitations.");
25
+ + closelog();
26
+ +
27
+ if (!list_empty(&opts.inherit_fds)) {
28
+ if (strcmp(argv[optind], "restore")) {
29
+ pr_err("--inherit-fd is restore-only option\n");
file added
+261
SPECS/criu.spec ADDED
@@ -0,0 +1,261 @@
1
+ Name: criu
2
+ Version: 1.6.1
3
+ Release: 3%{?dist}
4
+ Provides: crtools = %{version}-%{release}
5
+ Obsoletes: crtools <= 1.0-2
6
+ Summary: Tool for Checkpoint/Restore in User-space
7
+ Group: System Environment/Base
8
+ License: GPLv2
9
+ URL: http://criu.org/
10
+ Source0: http://download.openvz.org/criu/criu-%{version}.tar.bz2
11
+ # The patch aio-fix.patch is needed as RHEL7
12
+ # doesn't do "nr_events *= 2" in ioctx_alloc().
13
+ Patch0: aio-fix.patch
14
+ # This patch fixes criu check to correctly detect if
15
+ # the kernel supports all required clone arguments.
16
+ Patch1: criu-check-for-CLONE_NEWUSER-CLONE_NEWPID.patch
17
+ # This patches prints to the console and syslog
18
+ # that criu is still a tech preview and unsupported.
19
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1243521
20
+ Patch2: tech-preview-info-bz1243521.patch
21
+ Patch3: 98c8e44f749dd7ed0aa8c540f566bda54d7adfa1.patch
22
+
23
+ BuildRequires: systemd
24
+
25
+ BuildRequires: protobuf-devel protobuf-c-devel python2-devel
26
+ %if 0%{?fedora}
27
+ BuildRequires: asciidoc xmlto
28
+ %endif
29
+
30
+ # user-space and kernel changes are only available for x86_64 and ARM
31
+ # code is very architecture specific
32
+ # once imported in RCS it needs a bug openend explaining the ExclusiveArch
33
+ # https://bugzilla.redhat.com/show_bug.cgi?id=902875
34
+ ExclusiveArch: x86_64 %{arm}
35
+
36
+ %description
37
+ criu is the user-space part of Checkpoint/Restore in User-space
38
+ (CRIU), a project to implement checkpoint/restore functionality for
39
+ Linux in user-space.
40
+
41
+ %if 0%{?fedora}
42
+ %package devel
43
+ Summary: Header files and libraries for %{name}
44
+ Group: Development/Libraries
45
+ Requires: %{name} = %{version}-%{release}
46
+
47
+ %description devel
48
+ This package contains header files and libraries for %{name}.
49
+ %endif
50
+
51
+ %package -n python-%{name}
52
+ Summary: Python bindings for %{name}
53
+ Group: Development/Languages
54
+ Requires: %{name} = %{version}-%{release} python-ipaddr protobuf-python
55
+
56
+ %description -n python-%{name}
57
+ python-%{name} contains Python bindings for %{name}.
58
+
59
+ %package -n crit
60
+ Summary: CRIU image tool
61
+ Requires: python-%{name} = %{version}-%{release}
62
+
63
+ %description -n crit
64
+ crit is a tool designed to decode CRIU binary dump files and show
65
+ their content in human-readable form.
66
+
67
+
68
+ %prep
69
+ %setup -q -n criu-%{version}
70
+ %patch0 -p1
71
+ %patch1 -p1
72
+ %patch2 -p1
73
+ %patch3 -p1
74
+
75
+ %build
76
+ # %{?_smp_mflags} does not work
77
+ # -fstack-protector breaks build
78
+ CFLAGS+=`echo %{optflags} | sed -e 's,-fstack-protector\S*,,g'` make V=1 WERROR=0 PREFIX=%{_prefix}
79
+ %if 0%{?fedora}
80
+ make docs V=1
81
+ %endif
82
+
83
+
84
+ %install
85
+ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
86
+ %if 0%{?rhel}
87
+ # disable documentation as it requires asciidoc (which is not available on RHEL7)
88
+ sed -i -e 's,$(CRIU-LIB) install-man,$(CRIU-LIB),g' Makefile
89
+ %endif
90
+ make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} LIBDIR=%{_libdir} LOGROTATEDIR=%{_sysconfdir}/logrotate.d
91
+
92
+ %if 0%{?rhel}
93
+ # remove criu daemon related files
94
+ rm $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/criu-service
95
+ rm $RPM_BUILD_ROOT%{_unitdir}/criu.service
96
+ rm $RPM_BUILD_ROOT%{_unitdir}/criu.socket
97
+ # remove devel package
98
+ rm -rf $RPM_BUILD_ROOT%{_includedir}/criu
99
+ rm $RPM_BUILD_ROOT%{_libdir}/*.so*
100
+ rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig
101
+ %endif
102
+
103
+ %if 0%{?fedora}
104
+ # upstream renamed to binary to criu
105
+ ln -s %{_sbindir}/criu $RPM_BUILD_ROOT%{_sbindir}/crtools
106
+ %endif
107
+
108
+ %post -p /sbin/ldconfig
109
+ %postun -p /sbin/ldconfig
110
+
111
+ %files
112
+ %{_sbindir}/%{name}
113
+ %if 0%{?fedora}
114
+ %{_sbindir}/crtools
115
+ %doc %{_mandir}/man8/criu.8*
116
+ %{_unitdir}/criu.service
117
+ %{_unitdir}/criu.socket
118
+ %{_sysconfdir}/logrotate.d/%{name}-service
119
+ %{_libdir}/*.so.*
120
+ %endif
121
+ %doc README.md COPYING
122
+
123
+ %if 0%{?fedora}
124
+ %files devel
125
+ %{_includedir}/criu
126
+ %{_libdir}/*.so
127
+ %{_libdir}/pkgconfig/*.pc
128
+ %endif
129
+
130
+ %files -n python-%{name}
131
+ %{python2_sitelib}/pycriu/*
132
+ %{python2_sitelib}/*egg-info
133
+
134
+ %files -n crit
135
+ %{_bindir}/crit
136
+
137
+
138
+ %changelog
139
+ * Mon Aug 31 2015 Adrian Reber <areber@redhat.com> - 1.6.1-3
140
+ - added patch to fix broken docker checkpoint/restore (#1258539)
141
+
142
+ * Fri Aug 28 2015 Adrian Reber <areber@redhat.com> - 1.6.1-2
143
+ - removed criu.service (CVE-2015-5228, CVE-2015-5231)
144
+ - removed devel sub-package (related to above CVEs)
145
+
146
+ * Wed Aug 19 2015 Adrian Reber <areber@redhat.com> - 1.6.1-1.1
147
+ - fix release version number
148
+
149
+ * Thu Aug 13 2015 Adrian Reber <adrian@lisas.de> - 1.6.1-1
150
+ - Update to 1.6.1
151
+ - Merge changes for RHEL packaging
152
+
153
+ * Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2
154
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
155
+
156
+ * Tue Jun 09 2015 Adrian Reber <areber@redhat.com> - 1.6-1.1
157
+ - adapt to RHEL7
158
+
159
+ * Mon Jun 01 2015 Andrew Vagin <avagin@openvz.org> - 1.6-1
160
+ - Update to 1.6
161
+
162
+ * Thu Apr 30 2015 Andrew Vagin <avagin@openvz.org> - 1.5.2-2
163
+ - Require protobuf-python and python-ipaddr for python-criu
164
+
165
+ * Tue Apr 28 2015 Andrew Vagin <avagin@openvz.org> - 1.5.2
166
+ - Update to 1.5.2
167
+
168
+ * Sun Apr 19 2015 Nikita Spiridonov <nspiridonov@odin.com> - 1.5.1-2
169
+ - Create python-criu and crit subpackages
170
+
171
+ * Tue Mar 31 2015 Andrew Vagin <avagin@openvz.org> - 1.5.1
172
+ - Update to 1.5.1
173
+
174
+ * Sat Dec 06 2014 Adrian Reber <adrian@lisas.de> - 1.4-1
175
+ - Update to 1.4
176
+
177
+ * Tue Sep 23 2014 Adrian Reber <adrian@lisas.de> - 1.3.1-1
178
+ - Update to 1.3.1 (#1142896)
179
+
180
+ * Tue Sep 02 2014 Adrian Reber <adrian@lisas.de> - 1.3-1
181
+ - Update to 1.3
182
+ - Dropped all upstreamed patches
183
+ - included pkgconfig file in -devel
184
+
185
+ * Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5
186
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
187
+
188
+ * Thu Aug 07 2014 Andrew Vagin <avagin@openvz.org> - 1.2-4
189
+ - Include inttypes.h for PRI helpers
190
+
191
+ * Thu Aug 07 2014 Andrew Vagin <avagin@openvz.org> - 1.2-3
192
+ - Rebuilt for https://bugzilla.redhat.com/show_bug.cgi?id=1126751
193
+
194
+ * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-2
195
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
196
+
197
+ * Fri Feb 28 2014 Adrian Reber <adrian@lisas.de> - 1.2-1
198
+ - Update to 1.2
199
+ - Dropped all upstreamed patches
200
+
201
+ * Tue Feb 04 2014 Adrian Reber <adrian@lisas.de> - 1.1-4
202
+ - Create -devel subpackage
203
+
204
+ * Wed Dec 11 2013 Andrew Vagin <avagin@openvz.org> - 1.0-3
205
+ - Fix the epoch of crtools
206
+
207
+ * Tue Dec 10 2013 Andrew Vagin <avagin@openvz.org> - 1.0-2
208
+ - Rename crtools to criu #1034677
209
+
210
+ * Wed Nov 27 2013 Andrew Vagin <avagin@openvz.org> - 1.0-1
211
+ - Update to 1.0
212
+
213
+ * Thu Oct 24 2013 Andrew Vagin <avagin@openvz.org> - 0.8-1
214
+ - Update to 0.8
215
+
216
+ * Tue Sep 10 2013 Andrew Vagin <avagin@openvz.org> - 0.7-1
217
+ - Update to 0.7
218
+
219
+ * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-5
220
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
221
+
222
+ * Wed Jul 24 2013 Andrew Vagin <avagin@openvz.org> - 0.6-3
223
+ - Delete all kind of -fstack-protector gcc options
224
+
225
+ * Wed Jul 24 2013 Andrew Vagin <avagin@openvz.org> - 0.6-3
226
+ - Added arm macro to ExclusiveArch
227
+
228
+ * Wed Jul 03 2013 Andrew Vagin <avagin@openvz.org> - 0.6-2
229
+ - fix building on ARM
230
+ - fix null pointer dereference
231
+
232
+ * Tue Jul 02 2013 Adrian Reber <adrian@lisas.de> - 0.6-1
233
+ - updated to 0.6
234
+ - upstream moved binaries to sbin
235
+ - using upstream's make install
236
+
237
+ * Tue May 14 2013 Adrian Reber <adrian@lisas.de> - 0.5-1
238
+ - updated to 0.5
239
+
240
+ * Fri Feb 22 2013 Adrian Reber <adrian@lisas.de> - 0.4-1
241
+ - updated to 0.4
242
+
243
+ * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
244
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
245
+
246
+ * Tue Jan 22 2013 Adrian Reber <adrian@lisas.de> - 0.3-3
247
+ - added ExclusiveArch blocker bug
248
+
249
+ * Fri Jan 18 2013 Adrian Reber <adrian@lisas.de> - 0.3-2
250
+ - improved Summary and Description
251
+
252
+ * Mon Jan 14 2013 Adrian Reber <adrian@lisas.de> - 0.3-1
253
+ - updated to 0.3
254
+ - fix building Documentation/
255
+
256
+ * Tue Aug 21 2012 Adrian Reber <adrian@lisas.de> - 0.2-2
257
+ - remove macros like %%{__mkdir_p} and %%{__install}
258
+ - add comment why it is only x86_64
259
+
260
+ * Tue Aug 21 2012 Adrian Reber <adrian@lisas.de> - 0.2-1
261
+ - initial release