diff options
Diffstat (limited to 'external/meta-virtualization/recipes-containers/cri-o')
3 files changed, 83 insertions, 52 deletions
diff --git a/external/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb b/external/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb index 822c57ff..ebf5bab3 100644 --- a/external/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb +++ b/external/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb @@ -14,9 +14,9 @@ At a high level, we expect the scope of cri-o to be restricted to the following - Resource isolation as required by the CRI \ " -SRCREV_cri-o = "774a29ecf6855f2dff266dc2aa2fe81d7d964465" +SRCREV_cri-o = "6d0ffae63b9b7d8f07e7f9cf50736a67fb31faf3" SRC_URI = "\ - git://github.com/kubernetes-sigs/cri-o.git;nobranch=1;name=cri-o \ + git://github.com/kubernetes-sigs/cri-o.git;branch=release-1.17;name=cri-o \ file://0001-Makefile-force-symlinks.patch \ file://crio.conf \ " @@ -27,7 +27,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c2 GO_IMPORT = "import" -PV = "1.12.0+git${SRCREV_cri-o}" +PV = "1.17.0+git${SRCREV_cri-o}" DEPENDS = " \ glib-2.0 \ @@ -35,15 +35,34 @@ DEPENDS = " \ gpgme \ ostree \ libdevmapper \ + libseccomp \ + libselinux \ " RDEPENDS_${PN} = " \ cni \ + libdevmapper \ " +python __anonymous() { + msg = "" + # ERROR: Nothing PROVIDES 'libseccomp' (but /buildarea/layers/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb DEPENDS on or otherwise requires it). + # ERROR: Required build target 'meta-world-pkgdata' has no buildable providers. + # Missing or unbuildable dependency chain was: ['meta-world-pkgdata', 'cri-o', 'libseccomp'] + if 'security' not in d.getVar('BBFILE_COLLECTIONS').split(): + msg += "Make sure meta-security should be present as it provides 'libseccomp'" + raise bb.parse.SkipRecipe(msg) + # ERROR: Nothing PROVIDES 'libselinux' (but /buildarea/layers/meta-virtualization/recipes-containers/cri-o/cri-o_git.bb DEPENDS on or otherwise requires it). + # ERROR: Required build target 'meta-world-pkgdata' has no buildable providers. + # Missing or unbuildable dependency chain was: ['meta-world-pkgdata', 'cri-o', 'libselinux'] + elif 'selinux' not in d.getVar('BBFILE_COLLECTIONS').split(): + msg += "Make sure meta-selinux should be present as it provides 'libselinux'" + raise bb.parse.SkipRecipe(msg) +} + PACKAGES =+ "${PN}-config" RDEPENDS_${PN} += " virtual/containerd virtual/runc" -RDEPENDS_${PN} += " e2fsprogs-mke2fs" +RDEPENDS_${PN} += " e2fsprogs-mke2fs conmon util-linux iptables conntrack-tools" inherit systemd inherit go @@ -53,46 +72,11 @@ inherit pkgconfig EXTRA_OEMAKE="BUILDTAGS=''" do_compile() { - export GOARCH="${TARGET_GOARCH}" - export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" - export GOPATH="${S}/src/import:${S}/src/import/vendor" - - # Pass the needed cflags/ldflags so that cgo - # can find the needed headers files and libraries - export CGO_ENABLED="1" - export CFLAGS="" - export LDFLAGS="" - export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" - export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" - - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - ln -sf ./ ${S}/src/import/vendor/src - - mkdir -p ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o - ln -sf ../../../../cmd ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/cmd - ln -sf ../../../../test ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/test - ln -sf ../../../../oci ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/oci - ln -sf ../../../../server ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/server - ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/pkg - ln -sf ../../../../libpod ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/libpod - ln -sf ../../../../libkpod ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/libkpod - ln -sf ../../../../utils ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/utils - ln -sf ../../../../types ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/types - ln -sf ../../../../version ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/version - ln -sf ../../../../lib ${S}/src/import/vendor/github.com/kubernetes-sigs/cri-o/lib - - export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" - export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" - - # Pass the needed cflags/ldflags so that cgo - # can find the needed headers files and libraries - export CGO_ENABLED="1" - export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" - export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" + set +e cd ${S}/src/import + oe_runmake local-cross oe_runmake binaries } @@ -101,12 +85,14 @@ SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','crio. SYSTEMD_AUTO_ENABLE_${PN} = "enable" do_install() { + set +e localbindir="/usr/local/bin" install -d ${D}${localbindir} install -d ${D}/${libexecdir}/crio install -d ${D}/${sysconfdir}/crio install -d ${D}${systemd_unitdir}/system/ + install -d ${D}/usr/share/containers/oci/hooks.d install ${WORKDIR}/crio.conf ${D}/${sysconfdir}/crio/crio.conf @@ -114,22 +100,25 @@ do_install() { install -d ${D}/${sysconfdir}/crio/config/ install -m 755 -D ${S}/src/import/test/testdata/* ${D}/${sysconfdir}/crio/config/ - install ${S}/src/import/bin/crio ${D}/${localbindir} - install ${S}/src/import/bin/crio-config ${D}/${localbindir} - - install ${S}/src/import/bin/conmon ${D}/${localbindir}/crio - install ${S}/src/import/bin/pause ${D}/${localbindir}/crio + install ${S}/src/import/bin/crio.cross.linux* ${D}/${localbindir}/crio + install ${S}/src/import/bin/crio-status ${D}/${localbindir}/ + install ${S}/src/import/bin/pinns ${D}/${localbindir}/ install -m 0644 ${S}/src/import/contrib/systemd/crio.service ${D}${systemd_unitdir}/system/ install -m 0644 ${S}/src/import/contrib/systemd/crio-shutdown.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${S}/src/import/contrib/systemd/crio-wipe.service ${D}${systemd_unitdir}/system/ } FILES_${PN}-config = "${sysconfdir}/crio/config/*" FILES_${PN} += "${systemd_unitdir}/system/*" FILES_${PN} += "/usr/local/bin/*" +FILES_${PN} += "/usr/share/containers/oci/hooks.d" + +# don't clobber hooks.d +ALLOW_EMPTY_${PN} = "1" -INHIBIT_PACKAGE_STRIP = "1" INSANE_SKIP_${PN} += "ldflags already-stripped" deltask compile_ptest_base +COMPATIBLE_HOST = "^(?!(qemu)?mips).*" diff --git a/external/meta-virtualization/recipes-containers/cri-o/files/Makefile-skip-install-when-generating-the-config.h.patch b/external/meta-virtualization/recipes-containers/cri-o/files/Makefile-skip-install-when-generating-the-config.h.patch new file mode 100644 index 00000000..24c7e9d7 --- /dev/null +++ b/external/meta-virtualization/recipes-containers/cri-o/files/Makefile-skip-install-when-generating-the-config.h.patch @@ -0,0 +1,43 @@ +From 3822e834d2dbd87a4dc8cdd36e7fe3b0e9020c4f Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <mark.asselstine@windriver.com> +Date: Tue, 9 Apr 2019 13:52:59 -0400 +Subject: [PATCH] Makefile: skip install when generating the config.h + +When running 'go build' "The -i flag installs the packages that are +dependencies of the target." The Makefile makes use of this since many +of the dependencies needed to complete this rule will be used to by +other rules in the Makefile, thus speeding the overall build time +(avoiding redoing work). + +In our case the crio-config tool and its dependencies are not being +cross-compiled as they have to run locally to produce the +conmon/config.h file and thus installing them is not useful. In this +case there are no savings and can actually result in errors during the +build or if the build ARCH and target ARCH are the same, a potential +for host contamination. + +So we drop the use of '-i'. + +Upstream-Status: Inappropriate [cross compile issue] + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/import/Makefile b/src/import/Makefile +index b9fa97f..8336a5b 100644 +--- a/src/import/Makefile ++++ b/src/import/Makefile +@@ -109,7 +109,7 @@ release-note: + @$(GOPATH)/bin/release-tool -n $(release) + + conmon/config.h: cmd/crio-config/config.go oci/oci.go +- $(GO) build -i $(LDFLAGS) -o bin/crio-config $(PROJECT)/cmd/crio-config ++ $(GO) build $(LDFLAGS) -o bin/crio-config $(PROJECT)/cmd/crio-config + ( cd conmon && $(CURDIR)/bin/crio-config ) + + clean: +-- +2.7.4 + diff --git a/external/meta-virtualization/recipes-containers/cri-o/files/crio.conf b/external/meta-virtualization/recipes-containers/cri-o/files/crio.conf index 51d7f404..899d255b 100644 --- a/external/meta-virtualization/recipes-containers/cri-o/files/crio.conf +++ b/external/meta-virtualization/recipes-containers/cri-o/files/crio.conf @@ -24,7 +24,7 @@ storage_option = [ [crio.api] # listen is the path to the AF_LOCAL socket on which crio will listen. -listen = "/var/run/crio.sock" +listen = "/var/run/crio/crio.sock" # stream_address is the IP address on which the stream server will listen stream_address = "" @@ -69,7 +69,7 @@ runtime_untrusted_workload = "" default_workload_trust = "trusted" # conmon is the path to conmon binary, used for managing the runtime. -conmon = "/usr/libexec/crio/conmon" +conmon = "/usr/bin/conmon" # conmon_env is the environment variable list for conmon process, # used for passing necessary environment variable to conmon or runtime. @@ -132,8 +132,7 @@ insecure_registries = [ # registries is used to specify a comma separated list of registries to be used # when pulling an unqualified image (e.g. fedora:rawhide). -registries = [ -] +registries = ['docker.io', 'registry.fedoraproject.org', 'registry.access.redhat.com'] # The "crio.network" table contains settings pertaining to the # management of CNI plugins. @@ -144,4 +143,4 @@ registries = [ network_dir = "/etc/cni/net.d/" # plugin_dir is is where CNI plugin binaries are stored. -plugin_dir = "/opt/cni/bin/" +plugin_dir = "/opt/cni/bin" |