2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-26 11:57:52 +00:00

283 Commits

Author SHA1 Message Date
Tycho Andersen
cbf3a14ff2 travis: criu depends on libcap-dev too
https://travis-ci.org/xemul/criu/jobs/110616491

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:20:22 +03:00
Andrew Vagin
5594f14cc7 travis: execute tests from travis
We can't execute userns tests, because a kernel is too old there.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:17:44 +03:00
Andrew Vagin
46f3869ff6 dockerfile: add libcap-dev
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:13:15 +03:00
Dmitry Safonov
efe35aa39f build/nmk: rename $@-ldflags-y to LDFLAGS_$@
That will complement existing CFLAGS_ and ASFLAGS_.
As no one use it yet (I will use it, do not remove) - no need
for convert-everything patch.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-24 13:12:19 +03:00
Andrey Vagin
f400efb2b2 travis: use docker to build criu (v2)
v2: create a separate job for each arch
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 19:17:24 +03:00
Andrey Vagin
4322e4c35c dockerfile: add Dockerfile.tmpl
Fixes: afae962c668d ("dockerfile: extract a common part in one file")
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 19:17:20 +03:00
Dmitry Safonov
e6cc90bf73 build/feature-test: simplify adding a new feature
To add a new feature test - add it to FEATURES_LIST.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:38:43 +03:00
Dmitry Safonov
e85638fd38 build/nmk: define map and newline
map is very good at generating rules.
Just map gen function to array of it's parameters.
Don't forget to eval the result.

I'll use it in feature-tests generation and in someday coming
compat 32-bit mode - in x86 makefiles.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:38:26 +03:00
Andrew Vagin
afae962c66 dockerfile: extract a common part in one file
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:33:03 +03:00
Andrew Vagin
1621ba56ac dockerfile: download Packages.gz only once
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:32:55 +03:00
Andrei Vagin
2df0257f26 Dockerfile: don't fail if a binfmt-misc rule already exists
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:32:49 +03:00
Cyrill Gorcunov
b95bc0d1eb build: pycriu -- Move into lib/py
As was intended from the scratch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:32:19 +03:00
Cyrill Gorcunov
8e506041ef build: Bring install back to life
Fixes #114

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:31:42 +03:00
Dmitry Safonov
5f6c2eb92c nmk/build: separate msg-* printing from .mk files
Some places in criu need printing support, but do not need
common variables redefining, therefore separate msg printing
to msg.mk

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-18 14:12:10 +03:00
Cyrill Gorcunov
e5510d16f0 build: memfd -- Use SYS_memfd_create for libc sake
Just got a situation inside VM where pretty new
kernel with memfd has been installed (and as result
__NR_memfd_create shipped with kernel headers
is provided as well) but libc was old having no
SYS_memfd_create defined. Thus we've got an error
because we use exactly SYS_ number for calls.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-16 10:47:51 +03:00
Pavel Emelyanov
64cce1ccba nmk: Define FIND variable
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-16 10:43:18 +03:00
Andrei Vagin
1c2c1f45f7 crtools: add Dockerfile to build criu on armv7hf, aarch64, ppc64le
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:57 +03:00
Tycho Andersen
d45116ff8b build: crit -- Fix install target
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:53 +03:00
Cyrill Gorcunov
db6cb69394 build: Move everything criu related into criu directory
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:45 +03:00
Cyrill Gorcunov
d7016f1475 build: nmk -- Initial import
This is initial import of NMK engine which we gonna use for
CRIU and related tools building.

It's very tiny and while here we merge it as is in future
it gonna be rather a submodule from

	https://github.com/cyrillos/nmk

An idea is to have unified build engine for most tools
we're gonna use.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:20 +03:00
Cyrill Gorcunov
15850963f9 memfd: Fix typos in memfd tests
I manage to miss source refresh. Sorry.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-09 11:44:55 +03:00
Cyrill Gorcunov
ab5442de40 memfd: Test for __NR_memfd_create during building
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-08 22:14:38 +03:00
Andrew Vagin
46cf4edb60 travis: install libnl-3-dev
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-08 20:21:37 +03:00
Cyrill Gorcunov
4e5e106778 make: Don't forget to clean up obj-x
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-26 12:11:10 +03:00
Ruslan Kuprieiev
ee0c401a8a criu: scripts: remove logrotate
We don't need it without systemd configs.

Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-15 14:34:16 +03:00
Ruslan Kuprieiev
10d5e9a43e criu: scripts: remove criu service files
As it is not recomended to run criu as a root system service, lets
remove service file to stop encouraging people to do it.

Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-15 14:34:10 +03:00
Laurent Dufour
2f481f02fc Build pie objects separately
This patch change the build chain to not use pie objects in the crtools
executable.

This done by building the shared source files twice:
 1. for parasite/restorer as '<file>-pie-build.o'
 2. for crtools as '<file>.o'

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-14 15:53:07 +03:00
Andrey Vagin
ace699d763 travis: add libcap-dev for arm
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-24 18:57:35 +03:00
Tycho Andersen
209693d49b don't assume the kernel has CONFIG_SECCOMP
linux/seccomp.h may not be available, and the seccomp mode might not be
listed in /proc/pid/status, so let's not assume those two things are
present.

v2: add a seccomp.h with all the constants we use from linux/seccomp.h
v3: don't do a compile time check for PTRACE_O_SUSPEND_SECCOMP, just let
    ptrace return EINVAL for it; also add a checkskip to skip the
    seccomp_strict test if PTRACE_O_SUSPEND_SECCOMP or linux/seccomp.h
    aren't present.
v4: use criu check --feature instead of checkskip to check whether the
    kernel supports seccomp_suspend

Reported-by: Mr. Jenkins
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-13 14:50:35 +03:00
Tycho Andersen
0d8aec0c3a seccomp: add initial support for SECCOMP_MODE_STRICT
Unfortunately, SECCOMP_MODE_FILTER is not currently exposed to userspace,
so we can't checkpoint that. In any case, this is what we need to do for
SECCOMP_MODE_STRICT, so let's do it.

This patch works by first disabling seccomp for any processes who are going
to have seccomp filters restored, then restoring the process (including the
seccomp filters), and finally resuming the seccomp filters before detaching
from the process.

v2 changes:

* update for kernel patch v2
* use protobuf enum for seccomp type
* don't parse /proc/pid/status twice

v3 changes:

* get rid of extra CR_STAGE_SECCOMP_SUSPEND stage
* only suspend seccomp in finalize_restore(), just before the unmap
* restore the (same) seccomp state in threads too; also add a note about
  how this is slightly wrong, and that we should at least check for a
  mismatch

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-24 17:38:32 +03:00
Ruslan Kuprieiev
b197dbdae4 criu: systemd: allow enabling criu service
Currently it is not possible to enable criu service after "make install",
as it has no [Install] section in criu.service file.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-12 15:59:13 +03:00
Tycho Andersen
5fe3a138df lsm: add support for c/ring LSM profiles
This patch adds support for checkpoint and restore of two linux security
modules (apparmor and selinux). The actual checkpoint or restore code isn't
that interesting, other than that we have to do the LSM restore in the restorer
blob since it may block any number of things that we want to do as part of the
restore process.

I tried originally to get this to work using libraries in the restorer blob,
but I could _not_ get things to work correctly (I assume I was doing something
wrong with all the static linking, you can see my draft attempts here:
https://github.com/tych0/criu/commits/apparmor-using-libraries ). I can try to
resurrect this if it makes more sense, to do it that way, though.

v2: lsm_profile lives in creds.proto instead of the task core, look in a more
    canonical place for selinuxfs and don't try to special case any selinux
    profile names.
v3: only allow unconfined selinux profiles

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-08 15:31:05 +03:00
Cyrill Gorcunov
46a0e74d5f make: version -- Ensure that .gitid exist vefore read
In case if there is no .gitid file we might endup
with build error. Make sure it exist.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-07 18:38:26 +03:00
Cyrill Gorcunov
3d377863bf make: Introduce ldflags-y variable
We need a custom flags to build 32bit varian of criu
on 64bit host system, lets pass @ldflags-y here for
that.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:52:55 +03:00
Cyrill Gorcunov
1b406338d2 make: Rebuild version if git commit id is changed
Original message from Tycho:

This might be a slightly controversial change since it always causes crtools.h
to be rebuilt, which may be annoying. However, right now version.h is only
generated on the initial git build and never again touched, which is also
incorrect.

We could potentially do something fancy by monitoring .git/HEAD for changes,
but since it may not always exist if building from a tarball, it is a little
sticky.

CC: Andersen <tycho.andersen@canonical.com>
CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-21 16:07:23 +03:00
Tycho Andersen
3818d3b9d3 use git describe for GITID
`git describe` outputs slightly more useful git version info: v1.5-132-ga10f39e

The motivation for this is that we'd like to begin enforcing criu version in
liblxc, but we'd like to enable people to use the git version of 1.6 (since
that has stuff like --ext-mount-map auto), which reports its version as 1.5 but
doesn't tell us the patchlevel as git describe does.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-16 12:20:03 +03:00
Ruslan Kuprieiev
29673d42a9 travis: add python-ipaddr as a dep
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-02-09 14:07:07 +03:00
Ruslan Kuprieiev
90b56c882e travis: add libprotobuf-dev and protobuf-compiler packages for arm
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-28 13:51:49 +03:00
Ruslan Kuprieiev
def0f49177 crit: add scripts/crit-setup.py
This is a small python scipt that uses distutils to install crit script
and pycriu package.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:44:48 +04:00
Ruslan Kuprieiev
e7640ad635 scripts: add magic-gen.py
This script is needed to generate python module from
include/magic.h file, that contains dicts with magic
numbers that we put into our criu *.img files.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:44:45 +04:00
Andrew Vagin
769d527876 tests: add libaio to LDLIBS
Reported-by: Mr Travis
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-30 19:59:19 +03:00
Andrew Vagin
ea3e39450a scripts/travis.sh: add libaio-dev for ARM
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-30 16:30:11 +03:00
Andrey Vagin
e1072b935a travis: add compilation of tests
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-10-14 14:22:01 +04:00
Andrey Vagin
3bc0936ae7 criu: add .travis.yml (v3)
Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub
repository.[5]

Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests.
""" https://en.wikipedia.org/wiki/Travis_CI

Currently Travis CI builds criu for x86_64 and ARM

v2: move travis-ci.sh in scripts
v3: fix path to the script in the script
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-09-30 21:51:16 +04:00
Ruslan Kuprieiev
5e58a5dc9f crtools: check for setproctitle_init
Check for setproctitle_init, as old versions of libbsd don't have one.

Reported-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-09-02 16:14:39 +04:00
Chris J Arges
c05b7f4153 Ensure LDFLAGS is passed to CC not LD.
If we build with something like:
make LDFLAGS="-Wl,-Bsymbolic-functions"

We'll get an error because the LDFLAGS are being passed to LD when they
should be pased to CC.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-06-26 16:29:28 +04:00
Filipe Brandenburger
c1c7d8984c make: clean up obj-ext-src-y objects on "make clean"
This is needed for lib/rpc.pb-c.{d,o} to be removed by "make clean".

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-05-26 17:38:49 +04:00
Cyrill Gorcunov
0bae3bc181 make: config -- Add testing if we have libbsd installed
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-26 01:44:23 +04:00
Cyrill Gorcunov
5f00a9ca40 make: config -- Allow to pass libraries in try-cc
For libbsd testing.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-26 01:43:53 +04:00
Cyrill Gorcunov
fb67795a6d make: config -- Drop try-build helper
Don't need it, also add DEFINES into try-cc,
after all we define a number of things in
this variable and it's better to pass it
to tests for conditional compilation.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Ruslan Kuprieiv <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-03-24 20:15:52 +04:00