From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8FB40158089 for ; Mon, 30 Oct 2023 12:45:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C61DC2BC015; Mon, 30 Oct 2023 12:45:27 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AC87A2BC015 for ; Mon, 30 Oct 2023 12:45:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D3C9B335C29 for ; Mon, 30 Oct 2023 12:45:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 335AF12A1 for ; Mon, 30 Oct 2023 12:45:25 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1698669850.7469a09067036c4887f0a7babdbe0a04123fe068.juippis@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/files/, app-containers/incus/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-containers/incus/files/incus-0.2-lxd-to-incus-openrc-support.patch app-containers/incus/incus-0.2-r1.ebuild app-containers/incus/incus-0.2.ebuild X-VCS-Directories: app-containers/incus/ app-containers/incus/files/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: 7469a09067036c4887f0a7babdbe0a04123fe068 X-VCS-Branch: master Date: Mon, 30 Oct 2023 12:45:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e3df2213-0564-4fca-bfa3-c4a23ca89a81 X-Archives-Hash: fad72fb6fe0bbfd746085f10157ca6c8 commit: 7469a09067036c4887f0a7babdbe0a04123fe068 Author: Joonas Niilola gentoo org> AuthorDate: Mon Oct 30 12:44:10 2023 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Mon Oct 30 12:44:10 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7469a090 app-containers/incus: lxd-to-incus: add upstream openrc patch Signed-off-by: Joonas Niilola gentoo.org> .../incus-0.2-lxd-to-incus-openrc-support.patch | 71 ++++++++++++++++++++++ .../{incus-0.2.ebuild => incus-0.2-r1.ebuild} | 6 +- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/app-containers/incus/files/incus-0.2-lxd-to-incus-openrc-support.patch b/app-containers/incus/files/incus-0.2-lxd-to-incus-openrc-support.patch new file mode 100644 index 000000000000..9ab26752f9f8 --- /dev/null +++ b/app-containers/incus/files/incus-0.2-lxd-to-incus-openrc-support.patch @@ -0,0 +1,71 @@ +From 73f22c10770ba07ffe55e37480c5d50beb3c0c35 Mon Sep 17 00:00:00 2001 +From: xsoalokinx +Date: Sun, 29 Oct 2023 07:42:02 +0000 +Subject: [PATCH] cmd/lxd-to-incus: Add OpenRC target support + +Signed-off-by: xsoalokinx +--- + cmd/lxd-to-incus/targets.go | 46 ++++++++++++++++++++++++++++++++++++- + 1 file changed, 45 insertions(+), 1 deletion(-) + +diff --git a/cmd/lxd-to-incus/targets.go b/cmd/lxd-to-incus/targets.go +index ed84d3ebc..0940e1597 100644 +--- a/cmd/lxd-to-incus/targets.go ++++ b/cmd/lxd-to-incus/targets.go +@@ -16,7 +16,7 @@ type Target interface { + Paths() (*DaemonPaths, error) + } + +-var targets = []Target{&targetSystemd{}} ++var targets = []Target{&targetSystemd{}, &targetOpenRC{}} + + type targetSystemd struct{} + +@@ -61,3 +61,47 @@ func (s *targetSystemd) Paths() (*DaemonPaths, error) { + Cache: "/var/cache/incus/", + }, nil + } ++ ++type targetOpenRC struct{} ++ ++func (s *targetOpenRC) Present() bool { ++ if !util.PathExists("/var/lib/incus/") { ++ return false ++ } ++ ++ _, err := subprocess.RunCommand("rc-service", "--exists", "incus") ++ if err != nil { ++ return false ++ } ++ ++ return true ++} ++ ++func (s *targetOpenRC) Stop() error { ++ _, err := subprocess.RunCommand("rc-service", "incus", "stop") ++ return err ++} ++ ++func (s *targetOpenRC) Start() error { ++ _, err := subprocess.RunCommand("rc-service", "incus", "start") ++ if err != nil { ++ return err ++ } ++ ++ // Wait for the socket to become available. ++ time.Sleep(5 * time.Second) ++ ++ return nil ++} ++ ++func (s *targetOpenRC) Connect() (incus.InstanceServer, error) { ++ return incus.ConnectIncusUnix("/var/lib/incus/unix.socket", nil) ++} ++ ++func (s *targetOpenRC) Paths() (*DaemonPaths, error) { ++ return &DaemonPaths{ ++ Daemon: "/var/lib/incus/", ++ Logs: "/var/log/incus/", ++ Cache: "/var/cache/incus/", ++ }, nil ++} diff --git a/app-containers/incus/incus-0.2.ebuild b/app-containers/incus/incus-0.2-r1.ebuild similarity index 96% rename from app-containers/incus/incus-0.2.ebuild rename to app-containers/incus/incus-0.2-r1.ebuild index 1ca35cc10b96..1adaedd82ad8 100644 --- a/app-containers/incus/incus-0.2.ebuild +++ b/app-containers/incus/incus-0.2-r1.ebuild @@ -81,6 +81,8 @@ RESTRICT="test" GOPATH="${S}/_dist" +PATCHES=( "${FILESDIR}"/incus-0.2-lxd-to-incus-openrc-support.patch ) + src_prepare() { export GOPATH="${S}/_dist" @@ -174,10 +176,8 @@ pkg_postinst() { elog "Please see" elog " https://linuxcontainers.org/incus/introduction/" elog " https://linuxcontainers.org/incus/docs/main/tutorial/first_steps/" - elog " https://github.com/lxc/incus/blob/main/doc/howto/server_migrate_lxd.md" + elog " https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/" elog "before a Gentoo Wiki page is made." - elog "Note that lxd-to-incus doesn't currently fully work on Gentoo, and doesn't" - elog "work at all on OpenRC systems." elog optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs] optfeature "btrfs storage backend" sys-fs/btrfs-progs