criu/Makefile.install
Pavel Emelyanov 07a00662ad kdat: Cache kdat object into /run/criu.kdat (v4)
Doing kerndat checks on every criu start is way too slow. We
need some way to speed this checks up on a particular box.

As suggested by Andre, Dima and Mike let's try to keep the
collected kdat bits into some tmpfs file. Keeping it on
tmpfs would invaludate this cache on every machine reboot.

There have been many suggestions how to generate this file,
my proposal is to create it once the kdat object is filled
by criu, w/o any explicit command. Optionally we can add
'criu kdat --save|--drop' actions to manage this file.

v2:
* don't ignore return code of write() (some glibcs complain)
* unlink tmp file in case rename failed

v3:
* add one more magic into kerndat_s which is the 'date +%s'
* ignore any errors opening or saving cache. Only size/magic
  mismatch matters (and result in dropping the cache)
* cache file path is Makefile-configurable (RUNDIR)
* don't save cache if kerndat auto-detection failed

v4:
* Use ?= for RUNDIR definition.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-10 04:34:43 +03:00

54 lines
1.3 KiB
Text

#
# Installation paths.
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
SBINDIR := $(PREFIX)/sbin
MANDIR := $(PREFIX)/share/man
LIBDIR := $(PREFIX)/lib
INCLUDEDIR := $(PREFIX)/include
LIBEXECDIR := $(PREFIX)/libexec
RUNDIR ?= /run
#
# For recent Debian/Ubuntu with multiarch support.
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
ifneq "$(DEB_HOST_MULTIARCH)" ""
LIBDIR := $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
else
#
# For most other systems
ifeq "$(shell uname -m)" "x86_64"
LIBDIR := $(PREFIX)/lib64
endif
endif
export PREFIX BINDIR SBINDIR MANDIR RUNDIR
export LIBDIR INCLUDEDIR LIBEXECDIR
install-man:
$(Q) $(MAKE) -C Documentation install
.PHONY: install-man
install-lib: lib
$(Q) $(MAKE) $(build)=lib install
.PHONY: install-lib
install-criu: criu
$(Q) $(MAKE) $(build)=criu install
.PHONY: install-criu
install-compel: $(compel-install-targets)
$(Q) $(MAKE) $(build)=compel install
$(Q) $(MAKE) $(build)=compel/plugins install
.PHONY: install-compel
install: install-man install-lib install-criu install-compel ;
.PHONY: install
uninstall:
$(Q) $(MAKE) -C Documentation $@
$(Q) $(MAKE) $(build)=lib $@
$(Q) $(MAKE) $(build)=criu $@
$(Q) $(MAKE) $(build)=compel $@
$(Q) $(MAKE) $(build)=compel/plugins $@
.PHONY: uninstall