From nobody Sat Jun 11 11:29:00 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EF0BE85960F; Sat, 11 Jun 2022 11:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LKwZh6HgGz4YGG; Sat, 11 Jun 2022 11:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654946940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsIPB+lVjAs6dgqqq0Z3XbOyxFi+Lpyh9l9+fvGVEeQ=; b=A/pLod5+kc9qhJ32dCoZtUr5wYliG0/fG1d1DbO/Lx/99olDya7u0afNRNDUDUXNBd1L2H Hx6xQuCaGxYmG+yZxhiKkwdaCBatryffLwl5jCV1L9gGu9o6IdnnxB212492gcui5E3Iiw /Q+76hJnXi+Tk63xDUvMc9Q4cQUFc0pcMkjwgOK1/5ooo1YSoP69NcQ1pq8SggGv7rgcTm pAoK0GhwEZnW+kWEnlWgYdFzQJ4uS7dtLSqOkpEMEObCnxl2/UMxbF/xe/krwQzk+Jm7ql uzkRnbzhfb53JdVEus/F6XA8oe8kMjnEiHoOQst9qq5nrBMNoiYsHCVktSTFvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B79F14435; Sat, 11 Jun 2022 11:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25BBT0bq080000; Sat, 11 Jun 2022 11:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25BBT0kh079999; Sat, 11 Jun 2022 11:29:00 GMT (envelope-from git) Date: Sat, 11 Jun 2022 11:29:00 GMT Message-Id: <202206111129.25BBT0kh079999@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Bernhard Froehlich Subject: git: fa5e3e54593d - main - sysutils/containerd: Add patch to support Linux containers on FreeBSD List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: decke X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa5e3e54593d8dcd8df442f956b874e3013b10e7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654946940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsIPB+lVjAs6dgqqq0Z3XbOyxFi+Lpyh9l9+fvGVEeQ=; b=UucSBm3t9UnNI5G1aH/mBShFhnMAgaO8rzV8tpDNifKX8XM0GQRSandqy9a1eMe5B3m0YZ IBI/71P48jowH5V6Xmbea9qTzzIgZ0cOO1YRDdtnfv9rtrfdJcT1rJeaX4IOkQGV6WfUvN We8s3Od0LNAz718Gk1qfcMNIRPzfNiHbjPf7khWzKjEZwIl596PHGuLjdqZ5QGXcbXTSFN iDNE6CImGo5kQrv6DYSsllB+LR1GoNGYhYLIPlzFH+LvtA8mSsEpanQY+KpbJddEbUc1aH ML+L/5SpQQhHqrrcxy7a8XoxNZI1AReIH93Ciw9J16Bm9iCelIyuGxdG18Ikrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654946940; a=rsa-sha256; cv=none; b=qfY96WJT3L3PUXubIjDcotFLkNdpHeNEIoxOePfAxPWfHS4Q4pAFKOtPgJHQCJ1zKaRHhs VDbswwHPE4HgJ56LqZZ/vIhUWUy90J5zxDP8RaufE6wU86g6fLKM79NYYktsUvGMmgTxAD hK0eSL7kUE0q8CNwj+p9OPtqHwUJaS2PXEMBkFEMaYTjtJn/omTvgDl/GYXga0el1YuTRQ V7CE4kBw22Tb31NxRI9SBQzhHTKsEKgf44YMVY3rUU5fUsdTHcV1yGvSInsYVeEu7YNpBC Yzzw173OBGyvaWyGFxEWzeK68qjug2OJHPivvBCusX+QarBDkAlZ3TRvQtRgyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by decke: URL: https://cgit.FreeBSD.org/ports/commit/?id=fa5e3e54593d8dcd8df442f956b874e3013b10e7 commit fa5e3e54593d8dcd8df442f956b874e3013b10e7 Author: Bernhard Froehlich AuthorDate: 2022-06-11 11:27:56 +0000 Commit: Bernhard Froehlich CommitDate: 2022-06-11 11:27:56 +0000 sysutils/containerd: Add patch to support Linux containers on FreeBSD Obtained from: https://github.com/containerd/containerd/pull/7000 --- sysutils/containerd/Makefile | 2 +- .../files/patch-LinuxContainersOnFreeBSD | 155 +++++++++++++++++++++ 2 files changed, 156 insertions(+), 1 deletion(-) diff --git a/sysutils/containerd/Makefile b/sysutils/containerd/Makefile index 39a16d0a0e72..510929e00546 100644 --- a/sysutils/containerd/Makefile +++ b/sysutils/containerd/Makefile @@ -1,7 +1,7 @@ PORTNAME= containerd DISTVERSIONPREFIX=v DISTVERSION= 1.6.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MAINTAINER= decke@FreeBSD.org diff --git a/sysutils/containerd/files/patch-LinuxContainersOnFreeBSD b/sysutils/containerd/files/patch-LinuxContainersOnFreeBSD new file mode 100644 index 000000000000..876c8527e4c5 --- /dev/null +++ b/sysutils/containerd/files/patch-LinuxContainersOnFreeBSD @@ -0,0 +1,155 @@ +Linux containers on FreeBSD + +Obtained from: https://github.com/containerd/containerd/pull/7000 +--- oci/spec_opts.go.orig 2022-06-06 17:19:23 UTC ++++ oci/spec_opts.go +@@ -365,6 +365,7 @@ func WithImageConfigArgs(image Image, args []string) S + return fmt.Errorf("unknown image config media type %s", ic.MediaType) + } + ++ appendOSMounts(s, ociimage.OS) + setProcess(s) + if s.Linux != nil { + defaults := config.Env +--- oci/spec_opts_darwin.go.orig 2022-06-11 11:16:33 UTC ++++ oci/spec_opts_darwin.go +@@ -0,0 +1,21 @@ ++/* ++ Copyright The containerd Authors. ++ ++ Licensed under the Apache License, Version 2.0 (the "License"); ++ you may not use this file except in compliance with the License. ++ You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++ Unless required by applicable law or agreed to in writing, software ++ distributed under the License is distributed on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ See the License for the specific language governing permissions and ++ limitations under the License. ++*/ ++ ++package oci ++ ++func appendOSMounts(s *Spec, os string) error { ++ return nil ++} +--- oci/spec_opts_freebsd.go.orig 2022-06-11 11:16:33 UTC ++++ oci/spec_opts_freebsd.go +@@ -0,0 +1,50 @@ ++/* ++ Copyright The containerd Authors. ++ ++ Licensed under the Apache License, Version 2.0 (the "License"); ++ you may not use this file except in compliance with the License. ++ You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++ Unless required by applicable law or agreed to in writing, software ++ distributed under the License is distributed on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ See the License for the specific language governing permissions and ++ limitations under the License. ++*/ ++ ++package oci ++ ++import ( ++ specs "github.com/opencontainers/runtime-spec/specs-go" ++) ++ ++// appendOSMounts modifies the mount spec to mount emulated Linux filesystems on FreeBSD, ++// as per: https://wiki.freebsd.org/LinuxJails ++func appendOSMounts(s *Spec, os string) error { ++ // No-op for FreeBSD containers ++ if os != "linux" { ++ return nil ++ } ++ /* The nosuid noexec options are for consistency with Linux mounts: on FreeBSD it is ++ by default impossible to execute anything from these filesystems. ++ */ ++ var mounts = []specs.Mount{ ++ { ++ Destination: "/proc", ++ Type: "linprocfs", ++ Source: "linprocfs", ++ Options: []string{"nosuid", "noexec"}, ++ }, ++ { ++ Destination: "/sys", ++ Type: "linsysfs", ++ Source: "linsysfs", ++ Options: []string{"nosuid", "noexec", "nodev"}, ++ }, ++ } ++ ++ s.Mounts = append(mounts, s.Mounts...) ++ return nil ++} +--- oci/spec_opts_linux.go.orig 2022-06-06 17:19:23 UTC ++++ oci/spec_opts_linux.go +@@ -153,3 +153,7 @@ func WithRdt(closID, l3CacheSchema, memBwSchema string + return nil + } + } ++ ++func appendOSMounts(s *Spec, os string) error { ++ return nil ++} +--- platforms/defaults_freebsd.go.orig 2022-06-11 11:16:33 UTC ++++ platforms/defaults_freebsd.go +@@ -0,0 +1,42 @@ ++/* ++ Copyright The containerd Authors. ++ ++ Licensed under the Apache License, Version 2.0 (the "License"); ++ you may not use this file except in compliance with the License. ++ You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++ Unless required by applicable law or agreed to in writing, software ++ distributed under the License is distributed on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ See the License for the specific language governing permissions and ++ limitations under the License. ++*/ ++ ++package platforms ++ ++import ( ++ specs "github.com/opencontainers/image-spec/specs-go/v1" ++ "runtime" ++) ++ ++// DefaultSpec returns the current platform's default platform specification. ++func DefaultSpec() specs.Platform { ++ return specs.Platform{ ++ OS: runtime.GOOS, ++ Architecture: runtime.GOARCH, ++ // The Variant field will be empty if arch != ARM. ++ Variant: cpuVariant(), ++ } ++} ++ ++// Default returns the default matcher for the platform. ++func Default() MatchComparer { ++ return Ordered(DefaultSpec(), specs.Platform{ ++ OS: "linux", ++ Architecture: runtime.GOARCH, ++ // The Variant field will be empty if arch != ARM. ++ Variant: cpuVariant(), ++ }) ++} +--- platforms/defaults_unix.go.orig 2022-06-06 17:19:23 UTC ++++ platforms/defaults_unix.go +@@ -1,5 +1,5 @@ +-//go:build !windows && !darwin +-// +build !windows,!darwin ++//go:build !windows && !darwin && !freebsd ++// +build !windows,!darwin,!freebsd + + /* + Copyright The containerd Authors.