2025-02-04 15:56:27 +00:00
|
|
|
## Building CRIU from source code
|
|
|
|
|
|
|
|
First, you need to install compile-time dependencies. Check [Installation dependencies](https://criu.org/Installation#Dependencies) for more info.
|
|
|
|
|
|
|
|
To compile CRIU, run:
|
|
|
|
```
|
|
|
|
make
|
|
|
|
```
|
|
|
|
This should create the `./criu/criu` executable.
|
|
|
|
|
|
|
|
To change the default behaviour of CRIU, the following variables can be passed
|
|
|
|
to the make command:
|
|
|
|
|
|
|
|
* **NETWORK_LOCK_DEFAULT**, can be set to one of the following
|
|
|
|
values: `NETWORK_LOCK_IPTABLES`, `NETWORK_LOCK_NFTABLES`,
|
|
|
|
`NETWORK_LOCK_SKIP`. CRIU defaults to `NETWORK_LOCK_IPTABLES`
|
|
|
|
if nothing is specified. If another network locking backend is
|
|
|
|
needed, `make` can be called like this:
|
|
|
|
`make NETWORK_LOCK_DEFAULT=NETWORK_LOCK_NFTABLES`
|
|
|
|
|
2016-04-22 18:45:52 +03:00
|
|
|
## Installing CRIU from source code
|
|
|
|
|
|
|
|
Once CRIU is built one can easily setup the complete CRIU package
|
|
|
|
(which includes executable itself, CRIT tool, libraries, manual
|
|
|
|
and etc) simply typing
|
2025-02-04 15:57:47 +00:00
|
|
|
```
|
|
|
|
make install
|
|
|
|
```
|
2016-04-22 18:45:52 +03:00
|
|
|
this command accepts the following variables:
|
|
|
|
|
2016-12-14 05:19:00 +03:00
|
|
|
* **DESTDIR**, to specify global root where all components will be placed under (empty by default);
|
2016-04-22 18:45:52 +03:00
|
|
|
* **PREFIX**, to specify additional prefix for path of every component installed (`/usr/local` by default);
|
|
|
|
* **BINDIR**, to specify where to put CRIT tool (`$(PREFIX)/bin` by default);
|
|
|
|
* **SBINDIR**, to specify where to put CRIU executable (`$(PREFIX)/sbin` by default);
|
|
|
|
* **MANDIR**, to specify directory for manual pages (`$(PREFIX)/share/man` by default);
|
Makefile.install: cure LIBDIR guessing logic
Commit 6a51c7e ("make: Allow to install in custom dirs") replaced
all := assignments with ?=, effectively disabling the LIBDIR guessing
logic (as once a variable is assigned, further ?= make no sense).
That commit description says that setting PREFIX from make command line
didn't work. I can't find the original bug report but according to
GNU make documentation (see [1], [2]) as well as to my best knowledge,
any variable set in Makefile can be overridden from the command line,
unless "override VAR = value" is used in the Makefile.
The result of this patch is LIBDIR is correctly set for distros such as
Fedora and Debian, so "make install" works more correct. Surely, any
variable can still be overriden from the command line.
I have also checked the build of Fedora package from criu.spec with this
change -- it works fine.
Now, I am not sure why it was not working for the original bug reporter.
The only hypothesis I have is he tried to do something like
PREFIX=/usr make
instead of
make PREFIX=/usr
If this was the case, it was not a bug but wrong usage.
While at it, fix LIBDIR description in INSTALL.md.
[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html
[2] https://www.gnu.org/software/make/manual/html_node/Override-Directive.html
travis-ci: success for Makefile.install fixes
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-06 15:36:05 -08:00
|
|
|
* **LIBDIR**, to specify directory where to put libraries (guess the correct path by default).
|
2016-04-22 18:45:52 +03:00
|
|
|
|
|
|
|
Thus one can type
|
2025-02-04 15:57:47 +00:00
|
|
|
```
|
|
|
|
make DESTDIR=/some/new/place install
|
|
|
|
```
|
2016-04-22 18:45:52 +03:00
|
|
|
and get everything installed under `/some/new/place`.
|
|
|
|
|
|
|
|
## Uninstalling CRIU
|
|
|
|
|
|
|
|
To clean up previously installed CRIU instance one can type
|
2025-02-04 15:57:47 +00:00
|
|
|
```
|
|
|
|
make uninstall
|
|
|
|
```
|
2016-04-22 18:45:52 +03:00
|
|
|
and everything should be removed. Note though that if some variable (**DESTDIR**, **BINDIR**
|
|
|
|
and such) has been used during installation procedure, the same *must* be passed with
|
|
|
|
uninstall action.
|