summaryrefslogtreecommitdiffstats
path: root/recipes-extended/rootlesskit/rootlesskit_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/rootlesskit/rootlesskit_git.bb')
-rw-r--r--recipes-extended/rootlesskit/rootlesskit_git.bb81
1 files changed, 81 insertions, 0 deletions
diff --git a/recipes-extended/rootlesskit/rootlesskit_git.bb b/recipes-extended/rootlesskit/rootlesskit_git.bb
new file mode 100644
index 00000000..f8dd55af
--- /dev/null
+++ b/recipes-extended/rootlesskit/rootlesskit_git.bb
@@ -0,0 +1,81 @@
1HOMEPAGE = "https://github.com/rootless-containers/rootlesskit"
2SUMMARY = "RootlessKit: Linux-native fakeroot using user namespaces"
3DESCRIPTION = "RootlessKit is a Linux-native implementation of 'fake root' using user_namespaces(7). \
4The purpose of RootlessKit is to run Docker and Kubernetes as an unprivileged user (known as 'Rootless mode'),\
5so as to protect the real root on the host from potential container-breakout attacks. \
6"
7
8# generated with:
9# scripts/oe-go-mod-autogen.py --repo https://github.com/rootless-containers/rootlesskit --rev c784875ba4ba4c5aaa256f98675fd543b087c900
10
11DEPENDS = " \
12 go-md2man \
13 rsync-native \
14"
15# Specify the first two important SRCREVs as the format
16SRCREV_FORMAT = "rootless"
17SRCREV_rootless = "530859a92629689c0c17c96d9ab145f4d04b5b5a"
18
19SRC_URI = "git://github.com/rootless-containers/rootlesskit;name=rootless;branch=master;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}"
20
21include src_uri.inc
22
23# patches and config
24SRC_URI += "file://modules.txt \
25 "
26
27LICENSE = "Apache-2.0"
28LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
29
30GO_IMPORT = "import"
31
32S = "${WORKDIR}/git"
33
34PV = "v2.3.4+git"
35
36ROOTLESS_PKG = "github.com/rootless-containers/rootlesskit"
37
38inherit go goarch
39inherit systemd pkgconfig
40
41do_configure[noexec] = "1"
42
43EXTRA_OEMAKE = " \
44 PREFIX=${prefix} BINDIR=${bindir} LIBEXECDIR=${libexecdir} \
45 ETCDIR=${sysconfdir} TMPFILESDIR=${nonarch_libdir}/tmpfiles.d \
46 SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_unitdir}/user \
47"
48
49PACKAGECONFIG ?= ""
50
51include relocation.inc
52
53do_compile() {
54
55 cd ${S}/src/import
56
57 export GOPATH="$GOPATH:${S}/src/import/.gopath"
58
59 # Pass the needed cflags/ldflags so that cgo
60 # can find the needed headers files and libraries
61 export GOARCH=${TARGET_GOARCH}
62 export CGO_ENABLED="1"
63 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
64 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
65
66 export GOFLAGS="-mod=vendor -trimpath ${PIEFLAG}"
67
68 # our copied .go files are to be used for the build
69 ln -sf vendor.copy vendor
70 # inform go that we know what we are doing
71 cp ${UNPACKDIR}/modules.txt vendor/
72
73 oe_runmake GO=${GO} BUILDTAGS="${BUILDTAGS}" all
74}
75
76do_install() {
77 install -d "${D}${BIN_PREFIX}${base_bindir}"
78 for b in rootlessctl rootlesskit rootlesskit-docker-proxy; do
79 install -m 755 "${S}/src/import/bin/$b" "${D}${BIN_PREFIX}${base_bindir}"
80 done
81}