Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/1] package/crio: new package
@ 2023-05-12  1:40 Christian Stewart via buildroot
  2023-07-31 22:38 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Stewart via buildroot @ 2023-05-12  1:40 UTC (permalink / raw)
  To: buildroot
  Cc: Christian Stewart, Tian Yuanhao, Yann E . MORIN, Thomas Petazzoni

crio implements the Kubelet Container Runtime Interface (CRI) using OCI
conformant runtimes like runc or podman.

https://github.com/cri-o/cri-o/

Signed-off-by: Christian Stewart <christian@aperture.us>
---
 package/Config.in      |  1 +
 package/crio/Config.in | 54 ++++++++++++++++++++++++++++
 package/crio/crio.hash |  3 ++
 package/crio/crio.mk   | 82 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 140 insertions(+)
 create mode 100644 package/crio/Config.in
 create mode 100644 package/crio/crio.hash
 create mode 100644 package/crio/crio.mk

diff --git a/package/Config.in b/package/Config.in
index 420ebaa370..0b9d87470e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2635,6 +2635,7 @@ menu "System tools"
 	source "package/coreutils/Config.in"
 	source "package/cpulimit/Config.in"
 	source "package/cpuload/Config.in"
+	source "package/crio/Config.in"
 	source "package/crun/Config.in"
 	source "package/daemon/Config.in"
 	source "package/dc3dd/Config.in"
diff --git a/package/crio/Config.in b/package/crio/Config.in
new file mode 100644
index 0000000000..35a38c587e
--- /dev/null
+++ b/package/crio/Config.in
@@ -0,0 +1,54 @@
+config BR2_PACKAGE_CRIO
+	bool "crio"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # iproute2, __kernel_{u,}long_t
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # no fexecve
+	depends on BR2_USE_MMU # libgpgme, iproute2, fork()
+	select BR2_PACKAGE_IPROUTE2
+	select BR2_PACKAGE_IPTABLES
+	select BR2_PACKAGE_LIBGPGME
+	help
+	  crio implements the Kubelet Container Runtime Interface (CRI)
+	  using OCI conformant runtimes like runc or podman.
+
+	  https://github.com/cri-o/cri-o/
+
+if BR2_PACKAGE_CRIO
+
+config BR2_PACKAGE_CRIO_DRIVER_BTRFS
+	bool "btrfs filesystem driver"
+	depends on BR2_USE_MMU # btrfs-progs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # btrfs-progs
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Build the btrfs filesystem driver.
+
+config BR2_PACKAGE_CRIO_DRIVER_DEVICEMAPPER
+	bool "devicemapper filesystem driver"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
+	depends on BR2_USE_MMU # lvm2
+	depends on !BR2_STATIC_LIBS # lvm2
+	select BR2_PACKAGE_LVM2
+	help
+	  Build the devicemapper filesystem driver.
+
+config BR2_PACKAGE_CRIO_DRIVER_OSTREE
+	bool "ostree storage driver"
+	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libostree, libgpgme, libgpg-error
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libostree, libglib2
+	depends on BR2_USE_WCHAR # libostree, libglib2
+	depends on BR2_USE_MMU # libostree, e2fsprogs, libglib2, libgpgme
+	# doesn't build with musl due to lack of TEMP_FAILURE_RETRY()
+	depends on !BR2_TOOLCHAIN_USES_MUSL # libostree
+	select BR2_PACKAGE_LIBOSTREE
+	help
+	  Build the ostree storage driver.
+
+endif
+
+comment "crio needs a glibc or musl toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS && \
+		BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_UCLIBC
diff --git a/package/crio/crio.hash b/package/crio/crio.hash
new file mode 100644
index 0000000000..2cad8f8bb8
--- /dev/null
+++ b/package/crio/crio.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  8fd7c84ff74eff0a65e090bb9619f36508e461f6925f92a5b8886b759f2347d9  crio-1.27.0.tar.gz
+sha256  b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1  LICENSE
diff --git a/package/crio/crio.mk b/package/crio/crio.mk
new file mode 100644
index 0000000000..042c369799
--- /dev/null
+++ b/package/crio/crio.mk
@@ -0,0 +1,82 @@
+################################################################################
+#
+# crio
+#
+################################################################################
+
+CRIO_VERSION = 1.27.0
+CRIO_SITE = $(call github,cri-o,cri-o,v$(CRIO_VERSION))
+CRIO_LICENSE = Apache-2.0
+CRIO_LICENSE_FILES = LICENSE
+
+CRIO_CPE_ID_VENDOR = kubernetes
+CRIO_CPE_ID_PRODUCT = cri-o
+
+CRIO_BUILD_TARGETS = cmd/crio cmd/crio-status
+CRIO_DEPENDENCIES += libgpgme
+CRIO_LDFLAGS = \
+	-X $(CRIO_GOMOD)/internal/version.Version=$(CRIO_VERSION)
+CRIO_TAGS = exclude_graphdriver_zfs
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+CRIO_TAGS += systemd
+endif
+
+ifeq ($(BR2_PACKAGE_LIBAPPARMOR),y)
+CRIO_DEPENDENCIES += libapparmor
+CRIO_TAGS += apparmor
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+CRIO_TAGS += seccomp
+CRIO_DEPENDENCIES += libseccomp host-pkgconf
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+CRIO_TAGS += selinux
+CRIO_DEPENDENCIES += libselinux
+endif
+
+ifeq ($(BR2_PACKAGE_CRIO_DRIVER_BTRFS),y)
+CRIO_DEPENDENCIES += btrfs-progs
+else
+CRIO_TAGS += exclude_graphdriver_btrfs
+endif
+
+ifeq ($(BR2_PACKAGE_CRIO_DRIVER_DEVICEMAPPER),y)
+CRIO_DEPENDENCIES += lvm2
+else
+CRIO_TAGS += exclude_graphdriver_devicemapper
+endif
+
+ifeq ($(BR2_PACKAGE_CRIO_DRIVER_OSTREE),y)
+CRIO_DEPENDENCIES += libostree
+CRIO_TAGS += ostree
+endif
+
+define CRIO_BUILD_PINNS
+	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
+		LDFLAGS="$(TARGET_LDFLAGS)" STRIP="$(TARGET_STRIP)" \
+		-C $(@D)/pinns ../bin/pinns
+endef
+CRIO_POST_BUILD_HOOKS += CRIO_BUILD_PINNS
+
+define CRIO_INSTALL_TARGET_CMDS
+	$(HOST_GO_COMMON_ENV) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		DESTDIR=$(TARGET_DIR) PREFIX=$(TARGET_DIR)/usr ETCDIR=$(TARGET_DIR)/etc \
+		OPT_CNI_BIN_DIR=$(TARGET_DIR)/opt/cni/bin install.bin-nobuild
+	$(INSTALL) -d -m 700 $(TARGET_DIR)/etc/cni
+	$(INSTALL) -d -m 700 $(TARGET_DIR)/etc/cni/net.d
+	$(INSTALL) -D -m 644 $(@D)/contrib/cni/10-crio-bridge.conflist \
+		$(TARGET_DIR)/etc/cni/net.d/10-crio-bridge.conflist
+endef
+
+define CRIO_INSTALL_INIT_SYSTEMD
+	$(HOST_GO_COMMON_ENV) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		DESTDIR=$(TARGET_DIR) PREFIX=$(TARGET_DIR)/usr ETCDIR=$(TARGET_DIR)/etc \
+		OPT_CNI_BIN_DIR=$(TARGET_DIR)/opt/cni/bin install.systemd
+	$(SED) 's,/usr/local/bin,/usr/bin,g' \
+		$(TARGET_DIR)/usr/lib/systemd/system/{crio,crio-wipe}.service
+endef
+
+$(eval $(golang-package))
-- 
2.40.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-04 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12  1:40 [Buildroot] [PATCH v1 1/1] package/crio: new package Christian Stewart via buildroot
2023-07-31 22:38 ` Thomas Petazzoni via buildroot
2023-08-04 21:30   ` Julien Olivain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox