kumquat-buildroot/package/criu/criu.mk
Marcus Folkesson 3e4b479f39 package/criu: new package
Checkpoint/Restore In Userspace (CRIU), is a software tool for the
Linux operating system to make it possible to freeze a running
application and checkpoint it to persistent storage as a collection of files.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
[yann.morin.1998@free.fr:
  - BR2_ARM_CPU_ARMV8M does not exist
  - BR2_BR2_powerpc64le misspelled
  - move all arch dependencies to BR2_PACKAGE_CRIU_ARCH_SUPPORTS
  - comment hidden with arch dependencies
  - select host-python3, don't depend on it
  - extend legal-info: LPLG-2.1 for lib/, MIT for images/
  - PREFIX is also used at compile time for PLUGINDIR
  - copy .proto file, rather than symlinking
  - wrap long lines
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-11-01 18:27:13 +01:00

78 lines
1.8 KiB
Makefile

################################################################################
#
# CRIU
#
################################################################################
CRIU_VERSION = 3.18
CRIU_SITE = $(call github,checkpoint-restore,criu,v$(CRIU_VERSION))
CRIU_LICENSE = GPL-2.0, LGPL-2.1 (for lib/), MIT (for images/)
CRIU_LICENSE_FILES = COPYING images/LICENSE
CRIU_DEPENDENCIES =\
host-pkgconf \
host-protobuf-c \
host-python3 \
host-python-pip \
libaio \
libbsd \
libcap \
libnet \
libnl \
protobuf \
protobuf-c \
python3
CRIU_MAKE_ENV =\
$(TARGET_MAKE_ENV) \
$(TARGET_CONFIGURE_OPTS) \
CROSS_COMPILE=$(TARGET_CROSS) \
WERROR=0
# Remap to match the used in criu.
ifeq ($(BR2_NORMALIZED_ARCH),"x86_64")
CRIU_MAKE_ENV += ARCH=x86
else ifeq ($(BR2_NORMALIZED_ARCH),"powerpc")
CRIU_MAKE_ENV += ARCH=ppc64
else ifeq ($(BR2_NORMALIZED_ARCH),"arm64")
CRIU_MAKE_ENV += ARCH=aarch64
else
CRIU_MAKE_ENV += ARCH=$(BR2_NORMALIZED_ARCH)
endif
ifeq ($(BR2_ARM_CPU_ARMV6),y)
CRIU_MAKE_ENV += SUBARCH=armv6
else ifeq ($(BR2_ARM_CPU_ARMV7A),y)
CRIU_MAKE_ENV += SUBARCH=armv7
else ifeq ($(BR2_ARM_CPU_ARMV7M),y)
CRIU_MAKE_ENV += SUBARCH=armv7
else ifeq ($(BR2_ARM_CPU_ARMV8A),y)
CRIU_MAKE_ENV += SUBARCH=armv8
endif
# Criu needs Kernel Checkpoint/restore support which is not enabled
# by default.
define CRIU_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_CHECKPOINT_RESTORE)
endef
define CRIU_BUILD_CMDS
rm -rf $(@D)/images/google/protobuf/descriptor.proto
cp -a $(STAGING_DIR)/usr/include/google/protobuf/descriptor.proto \
$(@D)/images/google/protobuf/descriptor.proto
$(CRIU_MAKE_ENV) $(MAKE) -C $(@D) \
PREFIX=/usr
endef
define CRIU_INSTALL_TARGET_CMDS
$(CRIU_MAKE_ENV) $(MAKE) -C $(@D) \
PREFIX=/usr \
DESTDIR=$(TARGET_DIR) \
install-criu \
install-lib \
install-compel
endef
$(eval $(generic-package))