summaryrefslogtreecommitdiffstats
path: root/recipes-extended/rootlesskit
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/rootlesskit')
-rw-r--r--recipes-extended/rootlesskit/relocation.inc37
-rw-r--r--recipes-extended/rootlesskit/rootlesskit/modules.txt83
-rw-r--r--recipes-extended/rootlesskit/rootlesskit_git.bb81
-rw-r--r--recipes-extended/rootlesskit/src_uri.inc100
4 files changed, 301 insertions, 0 deletions
diff --git a/recipes-extended/rootlesskit/relocation.inc b/recipes-extended/rootlesskit/relocation.inc
new file mode 100644
index 00000000..6c64233d
--- /dev/null
+++ b/recipes-extended/rootlesskit/relocation.inc
@@ -0,0 +1,37 @@
1export sites = "gotest.tools/v3:gotest.tools/v3:force \
2 golang.org/x/sys:golang.org/x/sys:force \
3 golang.org/x/net:golang.org/x/net:force \
4 github.com/gofrs/flock:github.com/gofrs/flock:force \
5 github.com/google/uuid:github.com/google/uuid:force \
6 github.com/gorilla/mux:github.com/gorilla/mux:force \
7 github.com/moby/vpnkit:github.com/moby/vpnkit:force \
8 github.com/u-root/uio:github.com/u-root/uio:force \
9 github.com/songgao/water:github.com/songgao/water:force \
10 github.com/urfave/cli/v2:github.com/urfave/cli/v2:force \
11 github.com/google/go-cmp:github.com/google/go-cmp:force \
12 github.com/pierrec/lz4/v4:github.com/pierrec/lz4/v4:force \
13 github.com/xrash/smetrics:github.com/xrash/smetrics:force \
14 github.com/sirupsen/logrus:github.com/sirupsen/logrus:force \
15 github.com/insomniacslk/dhcp:github.com/insomniacslk/dhcp:force \
16 github.com/Masterminds/semver/v3:github.com/Masterminds/semver/v3:force \
17 github.com/cpuguy83/go-md2man/v2:github.com/cpuguy83/go-md2man/v2:force \
18 github.com/moby/sys/mountinfo:github.com/moby/sys/mountinfo/mountinfo:force \
19 github.com/russross/blackfriday/v2:github.com/russross/blackfriday/v2:force \
20 github.com/containernetworking/plugins:github.com/containernetworking/plugins:force"
21
22do_compile:prepend() {
23 cd ${S}/src/import
24 for s in $sites; do
25 site_dest=$(echo $s | cut -d: -f1)
26 site_source=$(echo $s | cut -d: -f2)
27 force_flag=$(echo $s | cut -d: -f3)
28 mkdir -p vendor.copy/$site_dest
29 if [ -n "$force_flag" ]; then
30 echo "[INFO] $site_dest: force copying .go files"
31 rm -rf vendor.copy/$site_dest
32 rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest
33 else
34 [ -n "$(ls -A vendor.copy/$site_dest/*.go 2> /dev/null)" ] && { echo "[INFO] vendor.fetch/$site_source -> $site_dest: go copy skipped (files present)" ; true ; } || { echo "[INFO] $site_dest: copying .go files" ; rsync -a --exclude='vendor/' --exclude='.git/' vendor.fetch/$site_source/ vendor.copy/$site_dest ; }
35 fi
36 done
37}
diff --git a/recipes-extended/rootlesskit/rootlesskit/modules.txt b/recipes-extended/rootlesskit/rootlesskit/modules.txt
new file mode 100644
index 00000000..29954c7c
--- /dev/null
+++ b/recipes-extended/rootlesskit/rootlesskit/modules.txt
@@ -0,0 +1,83 @@
1# github.com/Masterminds/semver/v3 v3.3.1
2## explicit; go 1.21
3github.com/Masterminds/semver/v3
4# github.com/containernetworking/plugins v1.6.2
5## explicit; go 1.23
6github.com/containernetworking/plugins/pkg/ns
7# github.com/cpuguy83/go-md2man/v2 v2.0.5
8## explicit; go 1.11
9github.com/cpuguy83/go-md2man/v2/md2man
10# github.com/gofrs/flock v0.12.1
11## explicit; go 1.21.0
12github.com/gofrs/flock
13# github.com/google/go-cmp v0.6.0
14## explicit; go 1.13
15github.com/google/go-cmp/cmp
16github.com/google/go-cmp/cmp/internal/diff
17github.com/google/go-cmp/cmp/internal/flags
18github.com/google/go-cmp/cmp/internal/function
19github.com/google/go-cmp/cmp/internal/value
20# github.com/google/uuid v1.6.0
21## explicit
22github.com/google/uuid
23# github.com/gorilla/mux v1.8.1
24## explicit; go 1.20
25github.com/gorilla/mux
26# github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905
27## explicit; go 1.20
28github.com/insomniacslk/dhcp/dhcpv4
29github.com/insomniacslk/dhcp/dhcpv4/client4
30github.com/insomniacslk/dhcp/iana
31github.com/insomniacslk/dhcp/interfaces
32github.com/insomniacslk/dhcp/rfc1035label
33# github.com/moby/sys/mountinfo v0.7.2
34## explicit; go 1.17
35github.com/moby/sys/mountinfo
36# github.com/moby/vpnkit v0.5.0
37## explicit
38github.com/moby/vpnkit/go/pkg/vmnet
39# github.com/pierrec/lz4/v4 v4.1.21
40## explicit; go 1.14
41github.com/pierrec/lz4/v4
42github.com/pierrec/lz4/v4/internal/lz4block
43github.com/pierrec/lz4/v4/internal/lz4errors
44github.com/pierrec/lz4/v4/internal/lz4stream
45github.com/pierrec/lz4/v4/internal/xxh32
46# github.com/russross/blackfriday/v2 v2.1.0
47## explicit
48github.com/russross/blackfriday/v2
49# github.com/sirupsen/logrus v1.9.3
50## explicit; go 1.13
51github.com/sirupsen/logrus
52# github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
53## explicit
54github.com/songgao/water
55# github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701
56## explicit; go 1.21
57github.com/u-root/uio/rand
58github.com/u-root/uio/uio
59# github.com/urfave/cli/v2 v2.27.6
60## explicit; go 1.18
61github.com/urfave/cli/v2
62# github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1
63## explicit; go 1.15
64github.com/xrash/smetrics
65# golang.org/x/net v0.36.0
66## explicit; go 1.23.0
67golang.org/x/net/bpf
68golang.org/x/net/internal/iana
69golang.org/x/net/internal/socket
70golang.org/x/net/ipv4
71# golang.org/x/sys v0.31.0
72## explicit; go 1.23.0
73golang.org/x/sys/unix
74golang.org/x/sys/windows
75golang.org/x/sys/windows/registry
76# gotest.tools/v3 v3.5.2
77## explicit; go 1.17
78gotest.tools/v3/assert
79gotest.tools/v3/assert/cmp
80gotest.tools/v3/internal/assert
81gotest.tools/v3/internal/difflib
82gotest.tools/v3/internal/format
83gotest.tools/v3/internal/source
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}
diff --git a/recipes-extended/rootlesskit/src_uri.inc b/recipes-extended/rootlesskit/src_uri.inc
new file mode 100644
index 00000000..c7a8b693
--- /dev/null
+++ b/recipes-extended/rootlesskit/src_uri.inc
@@ -0,0 +1,100 @@
1# gotest.tools/v3 v3.5.2
2# [1] git ls-remote https://github.com/gotestyourself/gotest.tools 0b81523ff268a1f1b0baf4a5da67e42fbb86880b
3SRCREV_gotest.tools-v3 = "0b81523ff268a1f1b0baf4a5da67e42fbb86880b"
4SRC_URI += "git://github.com/gotestyourself/gotest.tools;name=gotest.tools-v3;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/gotest.tools/v3"
5
6# golang.org/x/sys v0.31.0
7# [1] git ls-remote https://github.com/golang/sys 74cfc93a99be6ca6f193856132e6799065b071af
8SRCREV_sys = "74cfc93a99be6ca6f193856132e6799065b071af"
9SRC_URI += "git://github.com/golang/sys;name=sys;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/sys"
10
11# golang.org/x/net v0.36.0
12# [1] git ls-remote https://go.googlesource.com/net 85d1d54551b68719346cb9fec24b911da4e452a1
13SRCREV_net = "85d1d54551b68719346cb9fec24b911da4e452a1"
14SRC_URI += "git://go.googlesource.com/net;name=net;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/net"
15
16# github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701
17# [1] git ls-remote https://github.com/u-root/uio d2acac8f37018c514adec45c51f58eace3795df4
18SRCREV_uio = "d2acac8f37018c514adec45c51f58eace3795df4"
19SRC_URI += "git://github.com/u-root/uio;name=uio;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/u-root/uio"
20
21# github.com/gofrs/flock v0.12.1
22# [1] git ls-remote https://github.com/gofrs/flock 9de625d921bf362f81e0760056fdff11c8542435
23SRCREV_flock = "9de625d921bf362f81e0760056fdff11c8542435"
24SRC_URI += "git://github.com/gofrs/flock;name=flock;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/gofrs/flock"
25
26# github.com/google/uuid v1.6.0
27# [1] git ls-remote https://github.com/google/uuid 0f11ee6918f41a04c201eceeadf612a377bc7fbc
28SRCREV_uuid = "0f11ee6918f41a04c201eceeadf612a377bc7fbc"
29SRC_URI += "git://github.com/google/uuid;name=uuid;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/google/uuid"
30
31# github.com/gorilla/mux v1.8.1
32# [1] git ls-remote https://github.com/gorilla/mux b4617d0b9670ad14039b2739167fd35a60f557c5
33SRCREV_mux = "b4617d0b9670ad14039b2739167fd35a60f557c5"
34SRC_URI += "git://github.com/gorilla/mux;name=mux;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/gorilla/mux"
35
36# github.com/moby/vpnkit v0.5.0
37# [1] git ls-remote https://github.com/moby/vpnkit 7f0eff0dd99b576c5474de53b4454a157c642834
38SRCREV_vpnkit = "7f0eff0dd99b576c5474de53b4454a157c642834"
39SRC_URI += "git://github.com/moby/vpnkit;name=vpnkit;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/moby/vpnkit"
40
41# github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
42# [1] git ls-remote https://github.com/songgao/water 2b4b6d7c09d80835e5f13f6b040d69f00a158b24
43SRCREV_water = "2b4b6d7c09d80835e5f13f6b040d69f00a158b24"
44SRC_URI += "git://github.com/songgao/water;name=water;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/songgao/water"
45
46# github.com/urfave/cli/v2 v2.27.6
47# [1] git ls-remote https://github.com/urfave/cli 9d76d15e478af5e952fffc872597c47b69ec7ee7
48SRCREV_v2 = "9d76d15e478af5e952fffc872597c47b69ec7ee7"
49SRC_URI += "git://github.com/urfave/cli;name=v2;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/urfave/cli/v2"
50
51# github.com/google/go-cmp v0.6.0
52# [1] git ls-remote https://github.com/google/go-cmp c3ad8435e7bef96af35732bc0789e5a2278c6d5f
53SRCREV_go-cmp = "c3ad8435e7bef96af35732bc0789e5a2278c6d5f"
54SRC_URI += "git://github.com/google/go-cmp;name=go-cmp;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/google/go-cmp"
55
56# github.com/pierrec/lz4/v4 v4.1.21
57# [1] git ls-remote https://github.com/pierrec/lz4 294e7659e17723306ebf3a44cd7ad2c11f456c37
58SRCREV_v4 = "294e7659e17723306ebf3a44cd7ad2c11f456c37"
59SRC_URI += "git://github.com/pierrec/lz4;name=v4;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/pierrec/lz4/v4"
60
61# github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1
62# [1] git ls-remote https://github.com/xrash/smetrics 686a1a2994c11fac124829fadcb683a24ab8d25f
63SRCREV_smetrics = "686a1a2994c11fac124829fadcb683a24ab8d25f"
64SRC_URI += "git://github.com/xrash/smetrics;name=smetrics;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/xrash/smetrics"
65
66# github.com/sirupsen/logrus v1.9.3
67# [1] git ls-remote https://github.com/sirupsen/logrus d40e25cd45ed9c6b2b66e6b97573a0413e4c23bd
68SRCREV_logrus = "d40e25cd45ed9c6b2b66e6b97573a0413e4c23bd"
69SRC_URI += "git://github.com/sirupsen/logrus;name=logrus;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/sirupsen/logrus"
70
71# github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905
72# [1] git ls-remote https://github.com/insomniacslk/dhcp 8abf58130905b866076c8002e77aac6cb2e26d0e
73SRCREV_dhcp = "8abf58130905b866076c8002e77aac6cb2e26d0e"
74SRC_URI += "git://github.com/insomniacslk/dhcp;name=dhcp;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/insomniacslk/dhcp"
75
76# github.com/moby/sys/mountinfo v0.7.2
77# [1] git ls-remote https://github.com/moby/sys cafbe42351600ca9b363e220722f66d96f6e71f4
78SRCREV_mountinfo = "cafbe42351600ca9b363e220722f66d96f6e71f4"
79SRC_URI += "git://github.com/moby/sys;name=mountinfo;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/moby/sys/mountinfo"
80
81# github.com/Masterminds/semver/v3 v3.3.1
82# [1] git ls-remote https://github.com/Masterminds/semver 1558ca3488226e3490894a145e831ad58a5ff958
83SRCREV_v3 = "1558ca3488226e3490894a145e831ad58a5ff958"
84SRC_URI += "git://github.com/Masterminds/semver;name=v3;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/Masterminds/semver/v3"
85
86# github.com/cpuguy83/go-md2man/v2 v2.0.5
87# [1] git ls-remote https://github.com/cpuguy83/go-md2man b14773d4db11046c50d0d1c05955839604aae991
88SRCREV_go-md2man-v2 = "b14773d4db11046c50d0d1c05955839604aae991"
89SRC_URI += "git://github.com/cpuguy83/go-md2man;name=go-md2man-v2;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/cpuguy83/go-md2man/v2"
90
91# github.com/russross/blackfriday/v2 v2.1.0
92# [1] git ls-remote https://github.com/russross/blackfriday 4c9bf9512682b995722660a4196c0013228e2049
93SRCREV_blackfriday-v2 = "4c9bf9512682b995722660a4196c0013228e2049"
94SRC_URI += "git://github.com/russross/blackfriday;name=blackfriday-v2;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/russross/blackfriday/v2"
95
96# github.com/containernetworking/plugins v1.6.2
97# [1] git ls-remote https://github.com/containernetworking/plugins 7f756b411efc3d3730c707e2cc1f2baf1a66e28c
98SRCREV_plugins = "7f756b411efc3d3730c707e2cc1f2baf1a66e28c"
99SRC_URI += "git://github.com/containernetworking/plugins;name=plugins;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/containernetworking/plugins"
100