[yocto] [meta-virtualization] [recipes-containers] criu version 2.12.1
Federico Pietro Briata
federico at briata.org
Tue Jul 25 05:26:29 PDT 2017
Hi All,
in attach my recipes for Criu 2.12.1.
Best regards,
Federico Briata
---
recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0002-criu-Skip-documentation-install.patch
| 28 +++++++
recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Fix-toolchain-hardcode.patch
| 94 +++++++++++++++++++++++
recipes-containers/criu/criu_2.12.1.bb
| 79 +++++++++++++++++++
recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Change-libraries-install-directory.patch
| 24 ++++++
4 files changed, 225 insertions(+), 0 deletions(-)
diff --git a/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Change-libraries-install-directory.patch
b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Change-libraries-install-directory.patch
new file mode 100644
index 0000000..88efba3
--- /dev/null
+++ b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Change-libraries-install-directory.patch
@@ -0,0 +1,24 @@
+diff --git a/Makefile.install b/Makefile.install
+index 7f867cf..15b6065 100644
+--- a/Makefile.install
++++ b/Makefile.install
+@@ -8,19 +8,6 @@ LIBDIR := $(PREFIX)/lib
+ INCLUDEDIR := $(PREFIX)/include
+ LIBEXECDIR := $(PREFIX)/libexec
+
+-#
+-# 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
+ export LIBDIR INCLUDEDIR LIBEXECDIR
+
diff --git a/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Fix-toolchain-hardcode.patch
b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Fix-toolchain-hardcode.patch
new file mode 100644
index 0000000..1e1437d
--- /dev/null
+++ b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0001-criu-Fix-toolchain-hardcode.patch
@@ -0,0 +1,94 @@
+diff --git a/Makefile b/Makefile
+index 79490d0..1e421b1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,7 +54,7 @@ LDARCH ?= $(SRCARCH)
+
+ export SRCARCH LDARCH VDSO
+
+-UNAME-M := $(shell uname -m)
++UNAME-M ?= $(shell uname -m)
+ export UNAME-M
+
+ ifeq ($(ARCH),arm)
+diff --git a/criu/pie/Makefile b/criu/pie/Makefile
+index 141c018..09dbdc6 100644
+--- a/criu/pie/Makefile
++++ b/criu/pie/Makefile
+@@ -17,7 +17,7 @@ restorer-obj-e += ./$(ARCH_DIR)/syscalls.built-in.o
+ #
+ CFLAGS := $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS))
+ CFLAGS += -iquote $(SRC_DIR)/criu/pie/piegen
+-CFLAGS += -iquote $(SRC_DIR)/criu/arch/$(ARCH)/include
++CFLAGS += -iquote $(SRC_DIR)/criu/arch/$(SRCARCH)/include
+ CFLAGS += -iquote $(SRC_DIR)/criu/include
+ CFLAGS += -iquote $(SRC_DIR)/include
+ CFLAGS += -iquote $(SRC_DIR)
+diff --git a/scripts/nmk/scripts/include.mk b/scripts/nmk/scripts/include.mk
+index 711b9da..3d44624 100644
+--- a/scripts/nmk/scripts/include.mk
++++ b/scripts/nmk/scripts/include.mk
+@@ -20,7 +20,7 @@ SUBARCH := $(shell uname -m | sed \
+ -e s/aarch64.*/arm64/)
+
+ ARCH ?= $(SUBARCH)
+-SRCARCH := $(ARCH)
++SRCARCH ?= $(ARCH)
+
+ export SUBARCH ARCH SRCARCH
+
+diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk
+index 56dba84..1698821 100644
+--- a/scripts/nmk/scripts/tools.mk
++++ b/scripts/nmk/scripts/tools.mk
+@@ -2,30 +2,30 @@ ifndef ____nmk_defined__tools
+
+ #
+ # System tools shorthands
+-RM := rm -f
++RM ?= rm -f
+ HOSTLD ?= ld
+-LD := $(CROSS_COMPILE)$(HOSTLD)
++LD ?= $(CROSS_COMPILE)$(HOSTLD)
+ HOSTCC ?= gcc
+-CC := $(CROSS_COMPILE)$(HOSTCC)
+-CPP := $(CC) -E
+-AS := $(CROSS_COMPILE)as
+-AR := $(CROSS_COMPILE)ar
+-STRIP := $(CROSS_COMPILE)strip
+-OBJCOPY := $(CROSS_COMPILE)objcopy
+-OBJDUMP := $(CROSS_COMPILE)objdump
+-NM := $(CROSS_COMPILE)nm
+-MAKE := make
+-MKDIR := mkdir -p
+-AWK := awk
+-PERL := perl
+-PYTHON := python
+-FIND := find
+-SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
++CC ?= $(CROSS_COMPILE)$(HOSTCC)
++CPP ?= $(CC) -E
++AS ?= $(CROSS_COMPILE)as
++AR ?= $(CROSS_COMPILE)ar
++STRIP ?= $(CROSS_COMPILE)strip
++OBJCOPY ?= $(CROSS_COMPILE)objcopy
++OBJDUMP ?= $(CROSS_COMPILE)objdump
++NM ?= $(CROSS_COMPILE)nm
++MAKE ?= make
++MKDIR ?= mkdir -p
++AWK ?= awk
++PERL ?= perl
++PYTHON ?= python
++FIND ?= find
++SH ?= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+ else if [ -x /bin/bash ]; then echo /bin/bash; \
+ else echo sh; fi ; fi)
+-CSCOPE := cscope
+-ETAGS := etags
+-CTAGS := ctags
++CSCOPE ?= cscope
++ETAGS ?= etags
++CTAGS ?= ctags
+
+ export RM HOSTLD LD HOSTCC CC CPP AS AR STRIP OBJCOPY OBJDUMP
+ export NM SH MAKE MKDIR AWK PERL PYTHON SH CSCOPE
diff --git a/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0002-criu-Skip-documentation-install.patch
b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0002-criu-Skip-documentation-install.patch
new file mode 100644
index 0000000..ba414d9
--- /dev/null
+++ b/recipes-containers/criu/criu-2.12.1+gitAUTOINC+14e0bf7baf/0002-criu-Skip-documentation-install.patch
@@ -0,0 +1,28 @@
+From 07d9b3d0c372e45127dd51781d9564e8bee90dbe Mon Sep 17 00:00:00 2001
+From: Jianchuan Wang <jianchuan.wang at windriver.com>
+Date: Tue, 16 Aug 2016 09:42:24 +0800
+Subject: [PATCH 2/2] criu: Skip documentation install
+
+asciidoc is needed to generate CRIU documentation, so skip it in install.
+
+Signed-off-by: Jianchuan Wang <jianchuan.wang at windriver.com>
+---
+ Makefile.install | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.install b/Makefile.install
+index a30dc96..33143fb 100644
+--- a/Makefile.install
++++ b/Makefile.install
+@@ -22,7 +22,7 @@ install-tree:
+ .PHONY: install-tree
+
+ install-man:
+- $(Q) $(MAKE) -C Documentation install
++# $(Q) $(MAKE) -C Documentation install
+ .PHONY: install-man
+
+ install-lib: lib
+--
+2.7.4
+
diff --git a/recipes-containers/criu/criu_2.12.1.bb
b/recipes-containers/criu/criu_2.12.1.bb
new file mode 100644
index 0000000..a170b39
--- /dev/null
+++ b/recipes-containers/criu/criu_2.12.1.bb
@@ -0,0 +1,79 @@
+SUMMARY = "CRIU"
+DESCRIPTION = "Checkpoint/Restore In Userspace, or CRIU, is a
software tool for \
+Linux operating system. Using this tool, you can freeze a running application \
+(or part of it) and checkpoint it to a hard drive as a collection of files. \
+You can then use the files to restore and run the application from the point \
+it was frozen at. The distinctive feature of the CRIU project is that it is \
+mainly implemented in user space"
+HOMEPAGE = "http://criu.org"
+SECTION = "console/tools"
+LICENSE = "GPLv2"
+
+EXCLUDE_FROM_WORLD = "1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=412de458544c1cb6a2b512cd399286e2"
+
+SRCREV = "14e0bf7baf0f3a47acaf86ea880d312f608d2789"
+PR = "r0"
+PV = "2.12.1+git${SRCPV}"
+
+SRC_URI = "git://github.com/xemul/criu.git;branch=criu-2.x-stable;protocol=http
\
+ file://0001-criu-Fix-toolchain-hardcode.patch \
+ file://0002-criu-Skip-documentation-install.patch \
+ file://0001-criu-Change-libraries-install-directory.patch \
+ "
+
+COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
+
+DEPENDS += "libnet libnl libcap protobuf-c-native protobuf-c"
+
+S = "${WORKDIR}/git"
+
+#
+# CRIU just can be built on ARMv7 and ARMv6, so the Makefile check
+# if the ARCH is ARMv7 or ARMv6.
+# ARM BSPs need set CRIU_BUILD_ARCH variable for building CRIU.
+#
+EXTRA_OEMAKE_arm += "ARCH=arm WERROR=0"
+EXTRA_OEMAKE_x86-64 += "ARCH=${TARGET_ARCH} WERROR=0"
+EXTRA_OEMAKE_aarch64 += "ARCH=${TARGET_ARCH} WERROR=0"
+
+EXTRA_OEMAKE_append += "SBINDIR=${sbindir} LIBDIR=${libdir}
INCLUDEDIR=${includedir} PIEGEN=no"
+EXTRA_OEMAKE_append += "LOGROTATEDIR=${sysconfdir}
SYSTEMDUNITDIR=${systemd_unitdir}"
+
+CFLAGS += "-D__USE_GNU -D_GNU_SOURCE"
+
+CFLAGS += " -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3"
+
+# overide LDFLAGS to allow criu to build without:
"x86_64-poky-linux-ld: unrecognized option '-Wl,-O1'"
+export LDFLAGS=""
+
+export BUILD_SYS
+export HOST_SYS
+
+inherit setuptools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[selinux] = ",,libselinux"
+
+do_compile_prepend() {
+ rm -rf ${S}/images/google/protobuf/descriptor.proto
+ ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto
${S}/images/google/protobuf/descriptor.proto
+}
+
+do_compile () {
+ oe_runmake
+}
+
+do_install () {
+ oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" install
+}
+
+FILES_${PN} += "${systemd_unitdir}/ \
+ /etc/ \
+ /usr/sbin/ \
+ /usr/libexec \
+ ${libdir}/python2.7/site-packages/ \
+ ${libdir}/pycriu/ \
+ ${libdir}/crit-0.0.1-py2.7.egg-info \
+ "
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170725/ce069e15/attachment.html>
More information about the yocto
mailing list