Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crun: add package crun #15306

Merged
merged 4 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/libseccomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ endef
define Package/libseccomp
$(call Package/libseccomp/Default)
TITLE+= (library)
DEPENDS+= @!arc
endef

define Package/scmp_sys_resolver
Expand Down
2 changes: 1 addition & 1 deletion utils/cni-plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define Package/cni-plugins
CATEGORY:=Utilities
TITLE:=cni-plugins
URL:=https://github.com/containernetworking/cni-plugins
DEPENDS:=$(GO_ARCH_DEPENDS) +ip-full
DEPENDS:=$(GO_ARCH_DEPENDS) +ip-full +kmod-veth
endef

define Package/cni-plugins/description
Expand Down
82 changes: 82 additions & 0 deletions utils/crun/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=crun
PKG_VERSION:=0.18
PKG_RELEASE:=$(AUTORELEASE)

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/containers/crun.git
PKG_SOURCE_DATE:=2021-03-18
PKG_SOURCE_VERSION:=496e81bdd69f117f10e4477e4204e4611a94b68f
PKG_MIRROR_HASH:=26941b0d84bbeabeb5e982af48d131f55d0aa16f4a2f2ca3279a5c812cdeea8b

PKG_BUILD_DEPENDS:=argp-standalone
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

PKG_MAINTAINER:=Oskari Rauta <[email protected]>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING

include $(INCLUDE_DIR)/package.mk

define Package/crun
SECTION:=utils
CATEGORY:=Utilities
TITLE:=crun
URL:=https://github.com/containers/crun
DEPENDS:=+libseccomp +libcap
endef

define Package/crun/description
A fast and low-memory footprint OCI Container Runtime fully written in C.
endef

CONFIGURE_ARGS+= \
--disable-systemd \
--enable-embedded-yajl \
--enable-caps \
--enable-dl \
--enable-seccomp \
--enable-bpf

define Build/Prepare
$(call Build/Prepare/Default)
$(SED) '/#include <git-version.h>/d' $(PKG_BUILD_DIR)/src/crun.c
endef

define Build/Configure
$(call Build/Configure/Default)

$(SED) '/#define PACKAGE \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define VERSION \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define GIT_VERSION \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define PACKAGE_BUGREPORT \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define PACKAGE_NAME \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define PACKAGE_STRING \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define PACKAGE_TARNAME \"/d' $(PKG_BUILD_DIR)/config.h
$(SED) '/#define PACKAGE_VERSION \"/d' $(PKG_BUILD_DIR)/config.h

echo "#define PACKAGE \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define PACKAGE_NAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define PACKAGE_VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define PACKAGE_STRING \"$(PKG_NAME) $(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define PACKAGE_TARNAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define PACKAGE_BUGREPORT \"[email protected]\"" >> $(PKG_BUILD_DIR)/config.h
echo "#define GIT_VERSION \"$(PKG_SOURCE_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
endef

define Package/crun/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrun.* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,crun))
7 changes: 6 additions & 1 deletion utils/podman/files/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ network_config_dir="/etc/cni/net.d/"
default_network="podman"

[engine]
runtime="/usr/sbin/runc"
runtime="/usr/sbin/crun"
# runtime="/usr/sbin/runc"
# runtime="/sbin/uxc"
# runtime_supports_nocgroups = ["crun", "uxc"]
# runtime_supports_json = ["crun", "runc", "kata", "uxc"]
Expand All @@ -17,6 +18,10 @@ runc = [
"/usr/sbin/runc",
]

crun = [
"/usr/bin/crun",
]

uxc = [
"/sbin/uxc",
]