forked from kubernetes/minikube
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrio-bin.mk
74 lines (64 loc) · 2.23 KB
/
crio-bin.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
################################################################################
#
# cri-o
#
################################################################################
CRIO_BIN_VERSION = v1.16.0
CRIO_BIN_COMMIT = fa99ff4ae2aa45115bf3c6bb33db07191db2518e
CRIO_BIN_SITE = https://github.com/cri-o/cri-o/archive
CRIO_BIN_SOURCE = $(CRIO_BIN_VERSION).tar.gz
CRIO_BIN_DEPENDENCIES = host-go libgpgme
CRIO_BIN_GOPATH = $(@D)/_output
CRIO_BIN_ENV = \
CGO_ENABLED=1 \
GO111MODULE=off \
GOPATH="$(CRIO_BIN_GOPATH)" \
GOBIN="$(CRIO_BIN_GOPATH)/bin" \
PATH=$(CRIO_BIN_GOPATH)/bin:$(BR_PATH)
define CRIO_BIN_USERS
- -1 crio-admin -1 - - - - -
- -1 crio -1 - - - - -
endef
define CRIO_BIN_CONFIGURE_CMDS
mkdir -p $(CRIO_BIN_GOPATH)/src/github.com/cri-o
ln -sf $(@D) $(CRIO_BIN_GOPATH)/src/github.com/cri-o/cri-o
# disable the "automatic" go module detection
sed -e 's/go help mod/false/' -i $(@D)/Makefile
endef
define CRIO_BIN_BUILD_CMDS
mkdir -p $(@D)/bin
$(CRIO_BIN_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) GIT_COMMIT=$(CRIO_BIN_COMMIT) PREFIX=/usr binaries
endef
define CRIO_BIN_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/share/containers/oci/hooks.d
mkdir -p $(TARGET_DIR)/etc/containers/oci/hooks.d
$(INSTALL) -Dm755 \
$(@D)/bin/crio \
$(TARGET_DIR)/usr/bin/crio
$(INSTALL) -Dm755 \
$(@D)/bin/pause \
$(TARGET_DIR)/usr/libexec/crio/pause
$(INSTALL) -Dm644 \
$(CRIO_BIN_PKGDIR)/crio.conf \
$(TARGET_DIR)/etc/crio/crio.conf
$(INSTALL) -Dm644 \
$(CRIO_BIN_PKGDIR)/policy.json \
$(TARGET_DIR)/etc/containers/policy.json
$(INSTALL) -Dm644 \
$(CRIO_BIN_PKGDIR)/registries.conf \
$(TARGET_DIR)/etc/containers/registries.conf
mkdir -p $(TARGET_DIR)/etc/sysconfig
echo 'CRIO_OPTIONS="--log-level=debug"' > $(TARGET_DIR)/etc/sysconfig/crio
endef
define CRIO_BIN_INSTALL_INIT_SYSTEMD
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install.systemd DESTDIR=$(TARGET_DIR) PREFIX=$(TARGET_DIR)/usr
$(INSTALL) -Dm644 \
$(CRIO_BIN_PKGDIR)/crio.service \
$(TARGET_DIR)/usr/lib/systemd/system/crio.service
$(INSTALL) -Dm644 \
$(CRIO_BIN_PKGDIR)/crio-wipe.service \
$(TARGET_DIR)/usr/lib/systemd/system/crio-wipe.service
$(call link-service,crio.service)
$(call link-service,crio-shutdown.service)
endef
$(eval $(generic-package))