From 10a427caddb31d919c9e50373e4f7d940147dcd3 Mon Sep 17 00:00:00 2001 From: Zheng Ruoqin Date: Mon, 16 Jul 2018 09:32:48 +0800 Subject: criu: upgrade to 3.9 1) Upgrade criu from 3.4 to 3.9. 2) Delete fix-building-on-newest-glibc-and-kernel.patch for it has been merged in upstream. 3) Add CFLAGS_arm += "-D__WORDSIZE" add this CFLAGS to solve the compile problem for arm. The log is as following: | ....../tmp/work/armv5e-poky-linux-gnueabi/criu/3.9+gitAUTOINC+202b7745bd-r0/recipe-sysroot/usr/include/bits/wordsize.h:36:2: error: #error "__WORDSIZE is not defined" | #error "__WORDSIZE is not defined" | ^ | ....../tmp/work/armv5e-poky-linux-gnueabi/criu/3.9+gitAUTOINC+202b7745bd-r0/recipe-sysroot/usr/include/bits/wordsize.h:59:2: error: # 4) Add export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3" add C_INCLUDE_PATH to solve the compile problem for arm. which is libnetlink.c can't find head file. | In file included from criu/libnetlink.c:5: | ....../tmp/work/armv5e-p | oky-linux-gnueabi/criu/3.9+gitAUTOINC+202b7745bd-r0/recipe-sysroot/usr/include/libnl3/netlink/attr.h:15:10: fatal error: netlink/netlink.h: No such file or directory #include Signed-off-by: Zheng Ruoqin Signed-off-by: Bruce Ashfield --- recipes-containers/criu/criu_3.9.bb | 87 +++++++++++++++++++++++++++++++++++++ recipes-containers/criu/criu_git.bb | 86 ------------------------------------ 2 files changed, 87 insertions(+), 86 deletions(-) create mode 100644 recipes-containers/criu/criu_3.9.bb delete mode 100644 recipes-containers/criu/criu_git.bb diff --git a/recipes-containers/criu/criu_3.9.bb b/recipes-containers/criu/criu_3.9.bb new file mode 100644 index 00000000..36c356db --- /dev/null +++ b/recipes-containers/criu/criu_3.9.bb @@ -0,0 +1,87 @@ +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 = "202b7745bd0c37a1732ebe2fb009a157d338bf95" +PV = "3.9+git${SRCPV}" + +SRC_URI = "git://github.com/xemul/criu.git;protocol=git \ + file://0001-criu-Fix-toolchain-hardcode.patch \ + file://0002-criu-Skip-documentation-install.patch \ + file://0001-criu-Change-libraries-install-directory.patch \ + file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ + " + +COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" + +DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet" +RDEPENDS_${PN} = "bash" + +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 UNAME-M=${CRIU_BUILD_ARCH} WERROR=0" +EXTRA_OEMAKE_x86-64 += "ARCH=x86 WERROR=0" +EXTRA_OEMAKE_aarch64 += "ARCH=arm64 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" +CFLAGS_arm += "-D__WORDSIZE" + +# overide LDFLAGS to allow criu to build without: "x86_64-poky-linux-ld: unrecognized option '-Wl,-O1'" +export LDFLAGS="" +export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3" + +export BUILD_SYS +export HOST_SYS + +inherit setuptools + +PACKAGECONFIG ??= "" +PACKAGECONFIG[selinux] = ",,libselinux" + +CLEANBROKEN = "1" + +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 () { + export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages" + oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" install +} + +FILES_${PN} += "${systemd_unitdir}/ \ + ${libdir}/python2.7/site-packages/ \ + ${libdir}/pycriu/ \ + ${libdir}/crit-0.0.1-py2.7.egg-info \ + " + +FILES_${PN}-staticdev += " \ + ${libexecdir}/compel/std.lib.a \ + ${libexecdir}/compel/fds.lib.a \ + " diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb deleted file mode 100644 index 7d62f354..00000000 --- a/recipes-containers/criu/criu_git.bb +++ /dev/null @@ -1,86 +0,0 @@ -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 = "a31c1854e10580a09621e539c3ec052b875a8e06" -PV = "3.4+git${SRCPV}" - -SRC_URI = "git://github.com/xemul/criu.git;protocol=git \ - file://0001-criu-Fix-toolchain-hardcode.patch \ - file://0002-criu-Skip-documentation-install.patch \ - file://0001-criu-Change-libraries-install-directory.patch \ - file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ - file://fix-building-on-newest-glibc-and-kernel.patch \ - " - -COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" - -DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet" -RDEPENDS_${PN} = "bash" - -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 UNAME-M=${CRIU_BUILD_ARCH} WERROR=0" -EXTRA_OEMAKE_x86-64 += "ARCH=x86 WERROR=0" -EXTRA_OEMAKE_aarch64 += "ARCH=arm64 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" - -CLEANBROKEN = "1" - -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 () { - export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages" - oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" install -} - -FILES_${PN} += "${systemd_unitdir}/ \ - ${libdir}/python2.7/site-packages/ \ - ${libdir}/pycriu/ \ - ${libdir}/crit-0.0.1-py2.7.egg-info \ - " - -FILES_${PN}-staticdev += " \ - ${libexecdir}/compel/std.lib.a \ - ${libexecdir}/compel/fds.lib.a \ - " -- cgit v1.2.3-54-g00ecf