Skip to content

Commit

Permalink
package/crio: new package
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
paralin committed May 12, 2023
1 parent ae5a7ba commit b8b53d7
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
1 change: 1 addition & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2780,6 +2780,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/criu/Config.in"
source "package/crun/Config.in"
source "package/daemon/Config.in"
Expand Down
54 changes: 54 additions & 0 deletions package/crio/Config.in
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions package/crio/crio.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Locally computed
sha256 8fd7c84ff74eff0a65e090bb9619f36508e461f6925f92a5b8886b759f2347d9 crio-1.27.0.tar.gz
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
82 changes: 82 additions & 0 deletions package/crio/crio.mk
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit b8b53d7

Please sign in to comment.