* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2023-10-13 17:22 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2023-10-13 17:22 UTC (permalink / raw
To: gentoo-commits
commit: 380968ba252854f366618716ca1b8d2f074d14b2
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 10 13:09:30 2023 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Oct 13 17:21:08 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=380968ba
app-containers/incus: new package, add 0.1
- incus is a fork from Canonical's LXD.
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/33278
app-containers/incus/Manifest | 2 +
app-containers/incus/files/incus-0.1.confd | 23 +++
app-containers/incus/files/incus-0.1.initd | 59 ++++++++
app-containers/incus/files/incus-0.1.service | 23 +++
app-containers/incus/files/incus-0.1.socket | 12 ++
.../incus/files/incus-containers-0.1.service | 16 ++
app-containers/incus/incus-0.1.ebuild | 162 +++++++++++++++++++++
app-containers/incus/metadata.xml | 31 ++++
8 files changed, 328 insertions(+)
diff --git a/app-containers/incus/Manifest b/app-containers/incus/Manifest
new file mode 100644
index 000000000000..77fd5375ef00
--- /dev/null
+++ b/app-containers/incus/Manifest
@@ -0,0 +1,2 @@
+DIST incus-0.1.tar.gz 21498887 BLAKE2B ea200f83922a2f23c8bbc8ce94ccf7df8b7e096adfe6697d94135a4c660a950411e2176f860a63dada12890cde474beb16fcd17a4c52419f1ab86d3625c426e5 SHA512 1cd5410b07ed44f05b19ca3c734a67bde6f85d0e4673e9b46100bb8f2d60889773bcde1a274e96b55651b95414c47abeb6c3f2b8ec8d500d22ef08e31d09d9e6
+DIST incus-0.1.tar.gz.asc 833 BLAKE2B 9e2ceedf246e7af20a6d8c0e597f59016a4040c10d547f724a0fa822387bb46c70d0467df583127bea874ded87115844e02191e93ddfd29fc64f3bc0262b7f10 SHA512 de14e530543d861ea3bdffe8d4b88a140f39646219c1494db81577f755d5d5ddc35f8e36f51cbfe38d8fcd4c3de95bb8d615db61530bbd507a55c6e07d3031b6
diff --git a/app-containers/incus/files/incus-0.1.confd b/app-containers/incus/files/incus-0.1.confd
new file mode 100644
index 000000000000..ec857143c2da
--- /dev/null
+++ b/app-containers/incus/files/incus-0.1.confd
@@ -0,0 +1,23 @@
+# Group which owns the shared socket
+INCUS_OPTIONS+=" --group incus"
+
+# Enable cpu profiling into the specified file
+#INCUS_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile"
+
+# Enable memory profiling into the specified file
+#INCUS_OPTIONS+=" --memprofile /tmp/lxc_mem_profile"
+
+# Enable debug mode
+#INCUS_OPTIONS+=" --debug"
+
+# For debugging, print a complete stack trace every n seconds
+#INCUS_OPTIONS+=" --print-goroutines-every 5"
+
+# Enable verbose mode
+#INCUS_OPTIONS+=" -v"
+
+# Logfile to log to
+#INCUS_OPTIONS+=" --logfile /var/log/incus/incus.log"
+
+# Enable syslog logging
+#INCUS_OPTIONS+=" --syslog"
diff --git a/app-containers/incus/files/incus-0.1.initd b/app-containers/incus/files/incus-0.1.initd
new file mode 100644
index 000000000000..d09ffe224d04
--- /dev/null
+++ b/app-containers/incus/files/incus-0.1.initd
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+DAEMON=/usr/sbin/incusd
+PIDFILE=/run/incusd.pid
+
+depend() {
+ need net
+ need lxcfs
+}
+
+start() {
+ ebegin "Starting incus service"
+
+ modprobe -f loop > /dev/null 2>&1
+
+ # Fix permissions on /var/lib/incus and make sure it exists.
+ # Create a log directory for incus with correct permissions.
+ install -d /var/lib/incus --group incus --owner root --mode 0775
+ install -d /var/log/incus --group incus --owner root
+
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON} \
+ --background \
+ --make-pidfile \
+ -- \
+ ${INCUS_OPTIONS}
+ eend ${?}
+
+ # Create necessary systemd paths in order for systemd containers to work on openrc host.
+ # /etc/rc.conf should have following values:
+ # rc_cgroup_mode="hybrid"
+ if [ -d /sys/fs/cgroup/unified ] &&
+ [ ! -d /sys/fs/cgroup/systemd ]; then
+ install -d /sys/fs/cgroup/systemd --group incus --owner root
+ mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd
+ fi
+}
+
+stop() {
+ if [ "${RC_CMD}" = restart ]; then
+ ebegin "Stopping incusd service (but not containers)"
+ # start-stop-daemon sends SIGTERM with a timeout of 5s by default.
+ # SIGTERM indicates to INCUS that it will be stopped temporarily.
+ # Instances will keep running.
+ start-stop-daemon --stop --quiet -p "${PIDFILE}"
+ eend ${?}
+ else
+ ebegin "Stopping incusd service and containers, waiting 40s"
+ # SIGPWR indicates to INCUS that the host is going down.
+ # LXD will do a clean shutdown of all instances.
+ # After 30s all remaining instances will be killed.
+ # We wait up to 40s for INCUS.
+ start-stop-daemon --stop --quiet -R SIGPWR/40 -p "${PIDFILE}"
+ eend ${?}
+ fi
+}
diff --git a/app-containers/incus/files/incus-0.1.service b/app-containers/incus/files/incus-0.1.service
new file mode 100644
index 000000000000..354a53122923
--- /dev/null
+++ b/app-containers/incus/files/incus-0.1.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=Incus - main daemon
+After=network-online.target lxcfs.service incus.socket
+Requires=network-online.target lxcfs.service incus.socket
+Documentation=man:incus(1)
+
+[Service]
+EnvironmentFile=-/etc/environment
+ExecStart=/usr/sbin/incusd --group incus --syslog
+ExecStartPost=/usr/sbin/incusd waitready --timeout=600
+ExecStartPre=/bin/mkdir -p /var/log/incus
+ExecStartPre=/bin/chown -R root:incus /var/log/incus
+KillMode=process
+PermissionsStartOnly=true
+TimeoutStartSec=600s
+TimeoutStopSec=30s
+Restart=on-failure
+LimitNOFILE=1048576
+LimitNPROC=infinity
+TasksMax=infinity
+
+[Install]
+Also=incus-containers.service incus.socket
diff --git a/app-containers/incus/files/incus-0.1.socket b/app-containers/incus/files/incus-0.1.socket
new file mode 100644
index 000000000000..864ebf19954e
--- /dev/null
+++ b/app-containers/incus/files/incus-0.1.socket
@@ -0,0 +1,12 @@
+[Unit]
+Description=incus - unix socket
+Documentation=man:incus(1)
+
+[Socket]
+ListenStream=/var/lib/incus/unix.socket
+SocketGroup=incus
+SocketMode=0660
+Service=incus.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/app-containers/incus/files/incus-containers-0.1.service b/app-containers/incus/files/incus-containers-0.1.service
new file mode 100644
index 000000000000..038d633a53d7
--- /dev/null
+++ b/app-containers/incus/files/incus-containers-0.1.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=incus - container startup/shutdown
+Documentation=man:incus(1)
+After=incus.socket incus.service
+Requires=incus.socket
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/incusd activateifneeded
+ExecStop=/usr/sbin/incusd shutdown
+TimeoutStartSec=600s
+TimeoutStopSec=600s
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-containers/incus/incus-0.1.ebuild b/app-containers/incus/incus-0.1.ebuild
new file mode 100644
index 000000000000..440af29096a6
--- /dev/null
+++ b/app-containers/incus/incus-0.1.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
+
+DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
+HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
+SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.gz
+ verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.gz.asc )"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="nls"
+
+# incus conflicts with lxd due to fuidshift binary. Even if you replace the package, containers will remain.
+DEPEND="acct-group/incus
+ app-arch/xz-utils
+ >=app-containers/lxc-5.0.0:=[seccomp(+)]
+ dev-db/sqlite:3
+ dev-libs/cowsql
+ dev-libs/lzo
+ >=dev-libs/raft-0.17.1:=[lz4]
+ >=dev-util/xdelta-3.0[lzma(+)]
+ net-dns/dnsmasq[dhcp]
+ sys-libs/libcap
+ virtual/udev"
+RDEPEND="${DEPEND}
+ !app-containers/lxd
+ net-firewall/ebtables
+ net-firewall/iptables
+ sys-apps/iproute2
+ sys-fs/fuse:*
+ >=sys-fs/lxcfs-5.0.0
+ sys-fs/squashfs-tools[lzma]
+ virtual/acl"
+BDEPEND="dev-lang/go
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+CONFIG_CHECK="
+ ~CGROUPS
+ ~IPC_NS
+ ~NET_NS
+ ~PID_NS
+
+ ~SECCOMP
+ ~USER_NS
+ ~UTS_NS
+
+ ~KVM
+ ~MACVTAP
+ ~VHOST_VSOCK
+"
+
+ERROR_IPC_NS="CONFIG_IPC_NS is required."
+ERROR_NET_NS="CONFIG_NET_NS is required."
+ERROR_PID_NS="CONFIG_PID_NS is required."
+ERROR_SECCOMP="CONFIG_SECCOMP is required."
+ERROR_UTS_NS="CONFIG_UTS_NS is required."
+
+WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
+WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
+WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
+
+# Go magic.
+QA_PREBUILT="/usr/bin/incus
+ /usr/bin/lxc-to-incus
+ /usr/bin/lxd-to-incus
+ /usr/bin/incus-agent
+ /usr/bin/incus-benchmark
+ /usr/bin/incus-migrate
+ /usr/sbin/incusd"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
+
+# The testsuite must be run as root.
+# make: *** [Makefile:156: check] Error 1
+RESTRICT="test"
+
+GOPATH="${S}/_dist"
+
+src_prepare() {
+ export GOPATH="${S}/_dist"
+
+ default
+
+ sed -i \
+ -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
+ -e "s:make:make ${MAKEOPTS}:g" \
+ Makefile || die
+
+ # Disable -Werror's from go modules.
+ find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
+}
+
+src_configure() { :; }
+
+src_compile() {
+ export GOPATH="${S}/_dist"
+ export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
+
+ # lxd-to-incus: this go module is packaged separately (0.1).
+ for k in fuidshift incus-benchmark incus-user incus lxc-to-incus ; do
+ go install -v -x "${S}/cmd/${k}" || die "failed compiling ${k}"
+ done
+
+ go install -v -x -tags libsqlite3 "${S}"/cmd/incusd || die "Failed to build the daemon"
+
+ # Needs to be built statically
+ CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
+ CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ export GOPATH="${S}/_dist"
+ local bindir="_dist/bin"
+
+ dosbin ${bindir}/incusd
+
+ for l in fuidshift incus-agent incus-benchmark incus-migrate incus-user incus lxc-to-incus ; do
+ dobin ${bindir}/${l}
+ done
+
+ dobashcomp scripts/bash/incus
+
+ newconfd "${FILESDIR}"/incus-0.1.confd incus
+ newinitd "${FILESDIR}"/incus-0.1.initd incus
+
+ systemd_newunit "${FILESDIR}"/incus-0.1.service incus.service
+ systemd_newunit "${FILESDIR}"/incus-containers-0.1.service incus-containers.service
+ systemd_newunit "${FILESDIR}"/incus-0.1.socket incus.socket
+
+ dodoc AUTHORS
+ dodoc -r doc/*
+ use nls && domo po/*.mo
+}
+
+pkg_postinst() {
+ elog
+ elog "Please see"
+ elog " https://linuxcontainers.org/incus/introduction/"
+ elog " https://linuxcontainers.org/incus/docs/main/tutorial/first_steps/"
+ elog "before a Gentoo Wiki page is made."
+ elog
+ optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
+ optfeature "btrfs storage backend" sys-fs/btrfs-progs
+ optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
+ optfeature "lvm2 storage backend" sys-fs/lvm2
+ optfeature "zfs storage backend" sys-fs/zfs
+ elog
+ elog "Be sure to add your local user to the incus group."
+ elog
+}
diff --git a/app-containers/incus/metadata.xml b/app-containers/incus/metadata.xml
new file mode 100644
index 000000000000..a7cc7908462b
--- /dev/null
+++ b/app-containers/incus/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>juippis@gentoo.org</email>
+ <name>Joonas Niilola</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>virtualization@gentoo.org</email>
+ <name>Gentoo Virtualization Project</name>
+ </maintainer>
+ <longdescription>
+ Incus is a modern, secure and powerful system container and virtual machine manager.
+ Incus is a community fork from Canonical's LXD.
+
+ It provides a unified experience for running and managing full Linux systems inside containers
+ or virtual machines. Incus supplies images for a wide number of Linux distributions and is built
+ around a very powerful, yet pretty simple, REST API. Incus scales from one instance on a single
+ machine to a cluster in a full data center rack, making it suitable for running workloads both
+ for development and in production.
+
+ Incus allows you to easily set up a system that feels like a small private cloud. You can run any
+ type of workload in an efficient way while keeping your resources optimized.
+
+ You should consider using Incus if you want to containerize different environments or run virtual
+ machines, or in general run and manage your infrastructure in a cost-effective way.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">canonical/lxd</remote-id>
+ </upstream>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2023-12-13 8:09 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2023-12-13 8:09 UTC (permalink / raw
To: gentoo-commits
commit: ede01cc9457106602b6f48aa9e76d06c07dd512e
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 13 08:08:05 2023 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Dec 13 08:09:19 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ede01cc9
app-containers/incus: add lxd-5.20 compatibility patch
- for lxd-to-incus tool.
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
.../files/incus-0.3-lxd-5.20-compatibility.patch | 26 +++
app-containers/incus/incus-0.3-r1.ebuild | 191 +++++++++++++++++++++
2 files changed, 217 insertions(+)
diff --git a/app-containers/incus/files/incus-0.3-lxd-5.20-compatibility.patch b/app-containers/incus/files/incus-0.3-lxd-5.20-compatibility.patch
new file mode 100644
index 000000000000..a20b40105119
--- /dev/null
+++ b/app-containers/incus/files/incus-0.3-lxd-5.20-compatibility.patch
@@ -0,0 +1,26 @@
+From 8bd2b3b3f889787de515eaea532ff728527a8788 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
+Date: Tue, 12 Dec 2023 23:12:41 -0500
+Subject: [PATCH] lxd-to-incus: Update for LXD 5.20
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
+---
+ cmd/lxd-to-incus/validate.go | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmd/lxd-to-incus/validate.go b/cmd/lxd-to-incus/validate.go
+index 8e8020ebf..0078f8793 100644
+--- a/cmd/lxd-to-incus/validate.go
++++ b/cmd/lxd-to-incus/validate.go
+@@ -13,7 +13,7 @@ import (
+ )
+
+ var minLXDVersion = &version.DottedVersion{4, 0, 0}
+-var maxLXDVersion = &version.DottedVersion{5, 19, 0}
++var maxLXDVersion = &version.DottedVersion{5, 20, 0}
+
+ func (c *cmdMigrate) validate(source Source, target Target) error {
+ srcClient, err := source.Connect()
diff --git a/app-containers/incus/incus-0.3-r1.ebuild b/app-containers/incus/incus-0.3-r1.ebuild
new file mode 100644
index 000000000000..3b29b5fe5570
--- /dev/null
+++ b/app-containers/incus/incus-0.3-r1.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
+
+DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
+HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
+SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.xz
+ verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.xz.asc )"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="apparmor nls"
+
+DEPEND="acct-group/incus
+ acct-group/incus-admin
+ app-arch/xz-utils
+ >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
+ dev-db/sqlite:3
+ dev-libs/cowsql
+ dev-libs/lzo
+ >=dev-libs/raft-0.17.1:=[lz4]
+ >=dev-util/xdelta-3.0[lzma(+)]
+ net-dns/dnsmasq[dhcp]
+ sys-libs/libcap
+ virtual/udev"
+RDEPEND="${DEPEND}
+ net-firewall/ebtables
+ net-firewall/iptables
+ sys-apps/iproute2
+ sys-fs/fuse:*
+ >=sys-fs/lxcfs-5.0.0
+ sys-fs/squashfs-tools[lzma]
+ virtual/acl"
+BDEPEND="dev-lang/go
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+CONFIG_CHECK="
+ ~CGROUPS
+ ~IPC_NS
+ ~NET_NS
+ ~PID_NS
+
+ ~SECCOMP
+ ~USER_NS
+ ~UTS_NS
+
+ ~KVM
+ ~MACVTAP
+ ~VHOST_VSOCK
+"
+
+ERROR_IPC_NS="CONFIG_IPC_NS is required."
+ERROR_NET_NS="CONFIG_NET_NS is required."
+ERROR_PID_NS="CONFIG_PID_NS is required."
+ERROR_SECCOMP="CONFIG_SECCOMP is required."
+ERROR_UTS_NS="CONFIG_UTS_NS is required."
+
+WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
+WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
+WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
+
+# Go magic.
+QA_PREBUILT="/usr/bin/incus
+ /usr/bin/lxc-to-incus
+ /usr/bin/incus-agent
+ /usr/bin/incus-benchmark
+ /usr/bin/incus-migrate
+ /usr/sbin/lxd-to-incus
+ /usr/sbin/incusd"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/linuxcontainers.asc
+
+# The testsuite must be run as root.
+# make: *** [Makefile:156: check] Error 1
+RESTRICT="test"
+
+GOPATH="${S}/_dist"
+
+PATCHES=( "${FILESDIR}"/incus-0.3-lxd-5.20-compatibility.patch )
+
+src_prepare() {
+ export GOPATH="${S}/_dist"
+
+ default
+
+ sed -i \
+ -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
+ -e "s:make:make ${MAKEOPTS}:g" \
+ Makefile || die
+
+ # Fix hardcoded ovmf file path, see bug 763180
+ sed -i \
+ -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
+ -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
+ doc/environment.md \
+ internal/server/apparmor/instance.go \
+ internal/server/apparmor/instance_qemu.go \
+ internal/server/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
+
+ # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
+ sed -i \
+ -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
+ internal/server/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
+
+ cp "${FILESDIR}"/incus-0.1.service "${T}"/incus.service || die
+ if use apparmor; then
+ sed -i \
+ '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
+ "${T}"/incus.service || die
+ fi
+
+ # Disable -Werror's from go modules.
+ find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
+}
+
+src_configure() { :; }
+
+src_compile() {
+ export GOPATH="${S}/_dist"
+ export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
+
+ # fuidshift should be packaged for incus-lts, making it conflict with lxd.
+ for k in incus-benchmark incus-user incus lxc-to-incus ; do
+ ego install -v -x "${S}/cmd/${k}"
+ done
+
+ ego install -v -x -tags libsqlite3 "${S}"/cmd/incusd
+
+ # Needs to be built statically
+ CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
+ CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
+
+ cd "${S}"/cmd/lxd-to-incus || die
+ ego build -v -x ./
+ cd "${S}" || die
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ export GOPATH="${S}/_dist"
+ local bindir="_dist/bin"
+
+ dosbin ${bindir}/incusd
+ dosbin cmd/lxd-to-incus/lxd-to-incus
+
+ for l in incus-agent incus-benchmark incus-migrate incus-user incus lxc-to-incus ; do
+ dobin ${bindir}/${l}
+ done
+
+ dobashcomp scripts/bash/incus
+
+ newconfd "${FILESDIR}"/incus-0.1.confd incus
+ newinitd "${FILESDIR}"/incus-0.1.initd incus
+
+ systemd_dounit "${T}"/incus.service
+ systemd_newunit "${FILESDIR}"/incus-containers-0.1.service incus-containers.service
+ systemd_newunit "${FILESDIR}"/incus-0.1.socket incus.socket
+
+ dodoc AUTHORS
+ dodoc -r doc/*
+ use nls && domo po/*.mo
+}
+
+pkg_postinst() {
+ elog
+ elog "Please see"
+ elog " https://linuxcontainers.org/incus/introduction/"
+ elog " https://linuxcontainers.org/incus/docs/main/tutorial/first_steps/"
+ elog " https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/"
+ elog "before a Gentoo Wiki page is made."
+ elog
+ optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
+ optfeature "btrfs storage backend" sys-fs/btrfs-progs
+ optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
+ optfeature "full incus-migrate support" net-misc/rsync
+ optfeature "lvm2 storage backend" sys-fs/lvm2
+ optfeature "zfs storage backend" sys-fs/zfs
+ elog
+ elog "Be sure to add your local user to the incus group."
+ elog
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2023-12-27 17:21 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2023-12-27 17:21 UTC (permalink / raw
To: gentoo-commits
commit: 8b444fdf558229dfaa8af62834399d594ca169c0
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 23 17:14:38 2023 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Dec 27 17:21:54 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b444fdf
app-containers/incus: add 0.4
- both openrc and systemd init.d / service files updated to match how
upstream intends them to be used
https://linuxcontainers.org/incus/docs/main/packaging/#init-scripts
- include fuidshift again, installed in /usr/sbin like it's supposed to.
Won't collide with lxd's fuidshift.
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/34449
app-containers/incus/Manifest | 2 +
app-containers/incus/files/incus-0.4.confd | 26 +++
app-containers/incus/files/incus-0.4.initd | 59 ++++++
app-containers/incus/files/incus-0.4.service | 22 +++
app-containers/incus/files/incus-0.4.socket | 11 ++
.../incus/files/incus-startup-0.4.service | 15 ++
app-containers/incus/files/incus-startup-0.4.sh | 21 +++
app-containers/incus/files/incus-user-0.4.initd | 37 ++++
app-containers/incus/files/incus-user-0.4.service | 12 ++
app-containers/incus/files/incus-user-0.4.socket | 11 ++
app-containers/incus/incus-0.4.ebuild | 199 +++++++++++++++++++++
11 files changed, 415 insertions(+)
diff --git a/app-containers/incus/Manifest b/app-containers/incus/Manifest
index 25ce019f4241..5d0775b6959f 100644
--- a/app-containers/incus/Manifest
+++ b/app-containers/incus/Manifest
@@ -1,2 +1,4 @@
DIST incus-0.3.tar.xz 13344380 BLAKE2B 8160843df4ff419ef8890fcdd6b6b7e2c3cdec509ae072ec195c2b2c44e61ab3dc20a0488e9023d891b7ee2f2c700cfb8206ebe29236c29705a7121e5436d64f SHA512 d3f3141f72a8ecf007faca8c2f2d1465d766d12f763e714d296fd28acd7e3095dd49834d428f42bf142e301cf1af7ee00ef74005d128c49aa147fb4d9348dbde
DIST incus-0.3.tar.xz.asc 833 BLAKE2B 532ee90f3ed1d4798a19dcc9df8fe6587ab5ab93d18accae7aae8e44cb8c8086c77702a572a371a966eee4ebed84a2d7941f52001152a1894e1d74aa235a06e0 SHA512 afd2aab52a19b618d194eab71974f84d1d3eb9639b2672d8e94153ac23b05764667374504b5f1355238341c4194de282d3bc7635335375fd347ba513eb66e685
+DIST incus-0.4.tar.xz 13544656 BLAKE2B 19f6dd9a0707d60e60b42fd586ed2a041a4ac66b071b8a8dc2f11e9fa6f11c3d4c464d4763babc22aa4e58e3964d079bdc3028848c460a5ebaed41573a4b3f65 SHA512 2d31f0dfa5408db9408946b4f872a051c792a2a47fb80962e62e6b6691c9c52c4532935f6d5bcbef05b80a1bc66f6cf68b1e61d148d8964569df0a98360c582e
+DIST incus-0.4.tar.xz.asc 833 BLAKE2B 7d78d6808f8bbab78427ddc41925bde68a965e1594e0a90a56471c81f5f71798e286031caabb50ecf8a8b7b084660eefaf7644f2753d3810903e2f5194cf70fe SHA512 ce5bf32f7007a4dcf339b549da14ce9094ebe031311bd77707155d90e6ab05d1b56841910b934c96d9fed941815ce47ee746222100cee42d28bcc7c312c25bfb
diff --git a/app-containers/incus/files/incus-0.4.confd b/app-containers/incus/files/incus-0.4.confd
new file mode 100644
index 000000000000..b0f7e0e212ae
--- /dev/null
+++ b/app-containers/incus/files/incus-0.4.confd
@@ -0,0 +1,26 @@
+# Group which owns the shared socket
+INCUS_OPTIONS+=" --group incus-admin"
+
+# Enable cpu profiling into the specified file
+#INCUS_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile"
+
+# Enable memory profiling into the specified file
+#INCUS_OPTIONS+=" --memprofile /tmp/lxc_mem_profile"
+
+# Enable debug mode
+#INCUS_OPTIONS+=" --debug"
+
+# For debugging, print a complete stack trace every n seconds
+#INCUS_OPTIONS+=" --print-goroutines-every 5"
+
+# Enable verbose mode
+#INCUS_OPTIONS+=" -v"
+
+# Logfile to log to
+#INCUS_OPTIONS+=" --logfile /var/log/incus/incus.log"
+
+# Enable syslog logging
+#INCUS_OPTIONS+=" --syslog"
+
+# Increase ulimits to allow more open files on OpenRC.
+rc_ulimit="-n 1048576 -l unlimited"
diff --git a/app-containers/incus/files/incus-0.4.initd b/app-containers/incus/files/incus-0.4.initd
new file mode 100644
index 000000000000..34e1f07a8921
--- /dev/null
+++ b/app-containers/incus/files/incus-0.4.initd
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+DAEMON=/usr/sbin/incusd
+PIDFILE=/run/incus.pid
+
+depend() {
+ need net
+ need lxcfs
+}
+
+start() {
+ ebegin "Starting incus daemon service"
+
+ modprobe -f loop > /dev/null 2>&1
+
+ # Fix permissions on /var/lib/incus and make sure it exists.
+ # Create a log directory for incus with correct permissions.
+ install -d /var/lib/incus --group incus-admin --owner root --mode 0775
+ install -d /var/log/incus --group incus-admin --owner root
+
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON} \
+ --background \
+ --make-pidfile \
+ -- \
+ ${INCUS_OPTIONS}
+ eend ${?}
+
+ # Create necessary systemd paths in order for systemd containers to work on openrc host.
+ # /etc/rc.conf should have following values:
+ # rc_cgroup_mode="hybrid"
+ if [ -d /sys/fs/cgroup/unified ] &&
+ [ ! -d /sys/fs/cgroup/systemd ]; then
+ install -d /sys/fs/cgroup/systemd --group incus-admin --owner root
+ mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd
+ fi
+}
+
+stop() {
+ if [ "${RC_CMD}" = restart ]; then
+ ebegin "Stopping incus daemon service (but not containers)"
+ # start-stop-daemon sends SIGTERM with a timeout of 5s by default.
+ # SIGTERM indicates to INCUS that it will be stopped temporarily.
+ # Instances will keep running.
+ start-stop-daemon --stop --quiet -p "${PIDFILE}"
+ eend ${?}
+ else
+ ebegin "Stopping incus daemon service and containers, waiting 40s"
+ # SIGPWR indicates to INCUS that the host is going down.
+ # LXD will do a clean shutdown of all instances.
+ # After 30s all remaining instances will be killed.
+ # We wait up to 40s for INCUS.
+ start-stop-daemon --stop --quiet -R SIGPWR/40 -p "${PIDFILE}"
+ eend ${?}
+ fi
+}
diff --git a/app-containers/incus/files/incus-0.4.service b/app-containers/incus/files/incus-0.4.service
new file mode 100644
index 000000000000..17aea1de12b9
--- /dev/null
+++ b/app-containers/incus/files/incus-0.4.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Incus - main daemon
+After=network-online.target lxcfs.service incus.socket
+Requires=network-online.target lxcfs.service incus.socket
+
+[Service]
+EnvironmentFile=-/etc/environment
+ExecStart=/usr/sbin/incusd --group incus-admin --syslog
+ExecStartPost=/usr/sbin/incusd waitready --timeout=600
+ExecStartPre=/bin/mkdir -p /var/log/incus
+ExecStartPre=/bin/chown -R root:incus-admin /var/log/incus
+KillMode=process
+PermissionsStartOnly=true
+TimeoutStartSec=600s
+TimeoutStopSec=30s
+Restart=on-failure
+LimitNOFILE=1048576
+LimitNPROC=infinity
+TasksMax=infinity
+
+[Install]
+Also=incus-startup.service incus.socket
diff --git a/app-containers/incus/files/incus-0.4.socket b/app-containers/incus/files/incus-0.4.socket
new file mode 100644
index 000000000000..741fadd0309d
--- /dev/null
+++ b/app-containers/incus/files/incus-0.4.socket
@@ -0,0 +1,11 @@
+[Unit]
+Description=Incus - Daemon (unix socket)
+
+[Socket]
+ListenStream=/var/lib/incus/unix.socket
+SocketGroup=incus-admin
+SocketMode=0660
+Service=incus.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/app-containers/incus/files/incus-startup-0.4.service b/app-containers/incus/files/incus-startup-0.4.service
new file mode 100644
index 000000000000..8838bdc4949d
--- /dev/null
+++ b/app-containers/incus/files/incus-startup-0.4.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Incus - Startup check
+After=incus.socket incus.service
+Requires=incus.socket
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/incus-startup start
+ExecStop=/usr/sbin/incus-startup stop
+TimeoutStartSec=600s
+TimeoutStopSec=600s
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-containers/incus/files/incus-startup-0.4.sh b/app-containers/incus/files/incus-startup-0.4.sh
new file mode 100644
index 000000000000..6b19f22e4cb5
--- /dev/null
+++ b/app-containers/incus/files/incus-startup-0.4.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ start)
+ systemctl is-active incus -q && exit 0
+ exec incusd activateifneeded
+ ;;
+
+ stop)
+ systemctl is-active incus -q || exit 0
+ exec incusd shutdown
+ ;;
+
+ *)
+ echo "unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/app-containers/incus/files/incus-user-0.4.initd b/app-containers/incus/files/incus-user-0.4.initd
new file mode 100644
index 000000000000..7d81d298f584
--- /dev/null
+++ b/app-containers/incus/files/incus-user-0.4.initd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="incus-user socket daemon"
+description="incus-user socket daemon"
+
+DAEMON=/usr/sbin/incus-user
+PIDFILE=/run/incus-user.pid
+
+depend() {
+ need incus
+ need net
+}
+
+start() {
+ ebegin "Starting incus-user socket daemon"
+
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON} \
+ --background \
+ --make-pidfile \
+ -- \
+ --group incus
+ eend ${?}
+}
+
+stop() {
+ if [ "${RC_CMD}" = restart ]; then
+ start-stop-daemon --stop --quiet -p "${PIDFILE}"
+ eend ${?}
+ else
+ start-stop-daemon --stop --quiet -p "${PIDFILE}"
+ eend ${?}
+ fi
+}
diff --git a/app-containers/incus/files/incus-user-0.4.service b/app-containers/incus/files/incus-user-0.4.service
new file mode 100644
index 000000000000..4cb4d44263cb
--- /dev/null
+++ b/app-containers/incus/files/incus-user-0.4.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Incus - User daemon
+After=incus-user.socket incus.service
+Requires=incus-user.socket
+
+[Service]
+EnvironmentFile=-/etc/environment
+ExecStart=/usr/sbin/incus-user --group incus
+Restart=on-failure
+
+[Install]
+Also=incus-user.socket
diff --git a/app-containers/incus/files/incus-user-0.4.socket b/app-containers/incus/files/incus-user-0.4.socket
new file mode 100644
index 000000000000..5c14276fc6c6
--- /dev/null
+++ b/app-containers/incus/files/incus-user-0.4.socket
@@ -0,0 +1,11 @@
+[Unit]
+Description=Incus - Daemon (user unix socket)
+
+[Socket]
+ListenStream=/var/lib/incus/unix.socket.user
+SocketGroup=incus
+SocketMode=0660
+Service=incus-user.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/app-containers/incus/incus-0.4.ebuild b/app-containers/incus/incus-0.4.ebuild
new file mode 100644
index 000000000000..7396bf70e77a
--- /dev/null
+++ b/app-containers/incus/incus-0.4.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
+
+DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
+HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
+SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.xz
+ verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.xz.asc )"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="apparmor nls"
+
+DEPEND="acct-group/incus
+ acct-group/incus-admin
+ app-arch/xz-utils
+ >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
+ dev-db/sqlite:3
+ dev-libs/cowsql
+ dev-libs/lzo
+ >=dev-libs/raft-0.18.3:=[lz4]
+ >=dev-util/xdelta-3.0[lzma(+)]
+ net-dns/dnsmasq[dhcp]
+ sys-libs/libcap
+ virtual/udev"
+RDEPEND="${DEPEND}
+ net-firewall/ebtables
+ net-firewall/iptables
+ sys-apps/iproute2
+ sys-fs/fuse:*
+ >=sys-fs/lxcfs-5.0.0
+ sys-fs/squashfs-tools[lzma]
+ virtual/acl"
+BDEPEND="dev-lang/go
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+CONFIG_CHECK="
+ ~CGROUPS
+ ~IPC_NS
+ ~NET_NS
+ ~PID_NS
+
+ ~SECCOMP
+ ~USER_NS
+ ~UTS_NS
+
+ ~KVM
+ ~MACVTAP
+ ~VHOST_VSOCK
+"
+
+ERROR_IPC_NS="CONFIG_IPC_NS is required."
+ERROR_NET_NS="CONFIG_NET_NS is required."
+ERROR_PID_NS="CONFIG_PID_NS is required."
+ERROR_SECCOMP="CONFIG_SECCOMP is required."
+ERROR_UTS_NS="CONFIG_UTS_NS is required."
+
+WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
+WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
+WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
+
+# Go magic.
+QA_PREBUILT="/usr/bin/incus
+ /usr/bin/lxc-to-incus
+ /usr/bin/incus-agent
+ /usr/bin/incus-benchmark
+ /usr/bin/incus-migrate
+ /usr/sbin/fuidshift
+ /usr/sbin/lxd-to-incus
+ /usr/sbin/incusd"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/linuxcontainers.asc
+
+# The testsuite must be run as root.
+# make: *** [Makefile:156: check] Error 1
+RESTRICT="test"
+
+GOPATH="${S}/_dist"
+
+src_prepare() {
+ export GOPATH="${S}/_dist"
+
+ default
+
+ sed -i \
+ -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
+ -e "s:make:make ${MAKEOPTS}:g" \
+ Makefile || die
+
+ # Fix hardcoded ovmf file path, see bug 763180
+ sed -i \
+ -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
+ -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
+ doc/environment.md \
+ internal/server/apparmor/instance.go \
+ internal/server/apparmor/instance_qemu.go \
+ internal/server/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
+
+ # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
+ sed -i \
+ -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
+ internal/server/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
+
+ cp "${FILESDIR}"/incus-0.4.service "${T}"/incus.service || die
+ if use apparmor; then
+ sed -i \
+ '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
+ "${T}"/incus.service || die
+ fi
+
+ # Disable -Werror's from go modules.
+ find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
+}
+
+src_configure() { :; }
+
+src_compile() {
+ export GOPATH="${S}/_dist"
+ export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
+
+ # fuidshift should be packaged for incus-lts, making it conflict with lxd.
+ for k in fuidshift incus-benchmark incus-user incus lxc-to-incus ; do
+ ego install -v -x "${S}/cmd/${k}"
+ done
+
+ ego install -v -x -tags libsqlite3 "${S}"/cmd/incusd
+
+ # Needs to be built statically
+ CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
+ CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
+
+ cd "${S}"/cmd/lxd-to-incus || die
+ ego build -v -x ./
+ cd "${S}" || die
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ export GOPATH="${S}/_dist"
+ local bindir="_dist/bin"
+
+ newsbin "${FILESDIR}"/incus-startup-0.4.sh incus-startup
+
+ # Admin tools
+ for l in incusd incus-user fuidshift ; do
+ dosbin ${bindir}/${l}
+ done
+ dosbin cmd/lxd-to-incus/lxd-to-incus
+
+ # User tools
+ for m in incus-agent incus-benchmark incus-migrate incus lxc-to-incus ; do
+ dobin ${bindir}/${m}
+ done
+
+ newconfd "${FILESDIR}"/incus-0.4.confd incus
+ newinitd "${FILESDIR}"/incus-0.4.initd incus
+ newinitd "${FILESDIR}"/incus-user-0.4.initd incus-user
+
+ systemd_dounit "${T}"/incus.service
+ systemd_newunit "${FILESDIR}"/incus-0.4.socket incus.socket
+ systemd_newunit "${FILESDIR}"/incus-startup-0.4.service incus-startup.service
+ systemd_newunit "${FILESDIR}"/incus-user-0.4.service incus-user.service
+ systemd_newunit "${FILESDIR}"/incus-user-0.4.socket incus-user.socket
+
+ dobashcomp scripts/bash/incus
+
+ dodoc AUTHORS
+ dodoc -r doc/*
+ use nls && domo po/*.mo
+}
+
+pkg_postinst() {
+ elog
+ elog "Please see"
+ elog " https://linuxcontainers.org/incus/introduction/"
+ elog " https://linuxcontainers.org/incus/docs/main/tutorial/first_steps/"
+ elog " https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/"
+ elog "before a Gentoo Wiki page is made."
+ elog
+ optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
+ optfeature "btrfs storage backend" sys-fs/btrfs-progs
+ optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
+ optfeature "full incus-migrate support" net-misc/rsync
+ optfeature "lvm2 storage backend" sys-fs/lvm2
+ optfeature "zfs storage backend" sys-fs/zfs
+ elog
+ elog "Be sure to add your local user to the incus group."
+ elog
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2024-01-31 7:37 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2024-01-31 7:37 UTC (permalink / raw
To: gentoo-commits
commit: 9fc8db26611825de182020e86f5b00db65f8f58b
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 31 07:35:48 2024 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Jan 31 07:35:48 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fc8db26
app-containers/incus: add an upstream patch to fix some VM issues
- upstream issue #455.
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
...ncus-0.5.1-handle-legacy-lxd-agent-loader.patch | 30 +++
app-containers/incus/incus-0.5.1-r1.ebuild | 208 +++++++++++++++++++++
2 files changed, 238 insertions(+)
diff --git a/app-containers/incus/files/incus-0.5.1-handle-legacy-lxd-agent-loader.patch b/app-containers/incus/files/incus-0.5.1-handle-legacy-lxd-agent-loader.patch
new file mode 100644
index 000000000000..472cf57cf273
--- /dev/null
+++ b/app-containers/incus/files/incus-0.5.1-handle-legacy-lxd-agent-loader.patch
@@ -0,0 +1,30 @@
+From aebcd59a3400f255aa9da97d271ec4c2b9ba4eb2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
+Date: Tue, 30 Jan 2024 11:32:45 -0500
+Subject: [PATCH] incusd/instance/qemu/agent-loader: Handle legacy
+ lxd-agent-loader
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
+---
+ internal/server/instance/drivers/agent-loader/incus-agent | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/internal/server/instance/drivers/agent-loader/incus-agent b/internal/server/instance/drivers/agent-loader/incus-agent
+index 6ed5ece1ac..b0ebc25b68 100644
+--- a/internal/server/instance/drivers/agent-loader/incus-agent
++++ b/internal/server/instance/drivers/agent-loader/incus-agent
+@@ -1,5 +1,11 @@
+ #!/bin/sh
+ PREFIX="/run/incus_agent"
++
++# Legacy handling
++if [ ! -e "${PREFIX}" ] && [ -d "/run/lxd_agent" ]; then
++ ln -s "/run/lxd_agent" "${PREFIX}"
++fi
++
+ mkdir -p "${PREFIX}/.mnt"
+
+ # Functions.
diff --git a/app-containers/incus/incus-0.5.1-r1.ebuild b/app-containers/incus/incus-0.5.1-r1.ebuild
new file mode 100644
index 000000000000..6060e5a3b598
--- /dev/null
+++ b/app-containers/incus/incus-0.5.1-r1.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
+
+DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
+HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
+SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.xz
+ verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.xz.asc )"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="apparmor fuidshift nls"
+
+DEPEND="acct-group/incus
+ acct-group/incus-admin
+ app-arch/xz-utils
+ >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
+ dev-db/sqlite:3
+ dev-libs/cowsql
+ dev-libs/lzo
+ >=dev-libs/raft-0.18.3:=[lz4]
+ >=dev-util/xdelta-3.0[lzma(+)]
+ net-dns/dnsmasq[dhcp]
+ sys-libs/libcap
+ virtual/udev"
+RDEPEND="${DEPEND}
+ fuidshift? ( !app-containers/lxd )
+ net-firewall/ebtables
+ net-firewall/iptables
+ sys-apps/iproute2
+ sys-fs/fuse:*
+ >=sys-fs/lxcfs-5.0.0
+ sys-fs/squashfs-tools[lzma]
+ virtual/acl"
+BDEPEND="dev-lang/go
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+CONFIG_CHECK="
+ ~CGROUPS
+ ~IPC_NS
+ ~NET_NS
+ ~PID_NS
+
+ ~SECCOMP
+ ~USER_NS
+ ~UTS_NS
+
+ ~KVM
+ ~MACVTAP
+ ~VHOST_VSOCK
+"
+
+ERROR_IPC_NS="CONFIG_IPC_NS is required."
+ERROR_NET_NS="CONFIG_NET_NS is required."
+ERROR_PID_NS="CONFIG_PID_NS is required."
+ERROR_SECCOMP="CONFIG_SECCOMP is required."
+ERROR_UTS_NS="CONFIG_UTS_NS is required."
+
+WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
+WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
+WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
+
+# Go magic.
+QA_PREBUILT="/usr/bin/incus
+ /usr/bin/lxc-to-incus
+ /usr/bin/incus-agent
+ /usr/bin/incus-benchmark
+ /usr/bin/incus-migrate
+ /usr/sbin/fuidshift
+ /usr/sbin/lxd-to-incus
+ /usr/sbin/incusd"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/linuxcontainers.asc
+
+# The testsuite must be run as root.
+# make: *** [Makefile:156: check] Error 1
+RESTRICT="test"
+
+GOPATH="${S}/_dist"
+
+PATCHES=( "${FILESDIR}"/incus-0.5.1-handle-legacy-lxd-agent-loader.patch )
+
+src_prepare() {
+ export GOPATH="${S}/_dist"
+
+ default
+
+ sed -i \
+ -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
+ -e "s:make:make ${MAKEOPTS}:g" \
+ Makefile || die
+
+ # Fix hardcoded ovmf file path, see bug 763180
+ sed -i \
+ -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
+ -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
+ doc/environment.md \
+ internal/server/apparmor/instance.go \
+ internal/server/apparmor/instance_qemu.go \
+ internal/server/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
+
+ # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
+ sed -i \
+ -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
+ internal/server/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
+
+ cp "${FILESDIR}"/incus-0.4.service "${T}"/incus.service || die
+ if use apparmor; then
+ sed -i \
+ '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
+ "${T}"/incus.service || die
+ fi
+
+ # Disable -Werror's from go modules.
+ find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
+}
+
+src_configure() { :; }
+
+src_compile() {
+ export GOPATH="${S}/_dist"
+ export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
+
+ for k in incus-benchmark incus-user incus lxc-to-incus ; do
+ ego install -v -x "${S}/cmd/${k}"
+ done
+
+ if use fuidshift ; then
+ ego install -v -x "${S}/cmd/fuidshift"
+ fi
+
+ ego install -v -x -tags libsqlite3 "${S}"/cmd/incusd
+
+ # Needs to be built statically
+ CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
+ CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
+
+ cd "${S}"/cmd/lxd-to-incus || die
+ ego build -v -x ./
+ cd "${S}" || die
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ export GOPATH="${S}/_dist"
+ local bindir="_dist/bin"
+
+ newsbin "${FILESDIR}"/incus-startup-0.4.sh incus-startup
+
+ # Admin tools
+ for l in incusd incus-user ; do
+ dosbin ${bindir}/${l}
+ done
+ dosbin cmd/lxd-to-incus/lxd-to-incus
+
+ # User tools
+ for m in incus-agent incus-benchmark incus-migrate incus lxc-to-incus ; do
+ dobin ${bindir}/${m}
+ done
+
+ # fuidshift, should be moved under admin tools at some point
+ if use fuidshift ; then
+ dosbin ${bindir}/fuidshift
+ fi
+
+ newconfd "${FILESDIR}"/incus-0.4.confd incus
+ newinitd "${FILESDIR}"/incus-0.4.initd incus
+ newinitd "${FILESDIR}"/incus-user-0.4.initd incus-user
+
+ systemd_dounit "${T}"/incus.service
+ systemd_newunit "${FILESDIR}"/incus-0.4.socket incus.socket
+ systemd_newunit "${FILESDIR}"/incus-startup-0.4.service incus-startup.service
+ systemd_newunit "${FILESDIR}"/incus-user-0.4.service incus-user.service
+ systemd_newunit "${FILESDIR}"/incus-user-0.4.socket incus-user.socket
+
+ dobashcomp scripts/bash/incus
+
+ dodoc AUTHORS
+ dodoc -r doc/*
+ use nls && domo po/*.mo
+}
+
+pkg_postinst() {
+ elog
+ elog "Please see"
+ elog " https://wiki.gentoo.org/wiki/Incus"
+ elog " https://wiki.gentoo.org/wiki/Incus#Migrating_from_LXD"
+ elog
+ optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
+ optfeature "btrfs storage backend" sys-fs/btrfs-progs
+ optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
+ optfeature "full incus-migrate support" net-misc/rsync
+ optfeature "lvm2 storage backend" sys-fs/lvm2
+ optfeature "zfs storage backend" sys-fs/zfs
+ elog
+ elog "Be sure to add your local user to the incus group."
+ elog
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2024-04-29 8:18 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2024-04-29 8:18 UTC (permalink / raw
To: gentoo-commits
commit: 72b47b4006a738b0e0916cb8abec7a1bb023f2d5
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 29 08:13:28 2024 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Apr 29 08:18:37 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72b47b40
app-containers/incus: drop 0.6-r1, 0.7
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-containers/incus/Manifest | 4 -
...0.6-fix-column-handling-with-all-projects.patch | 41 ----
app-containers/incus/incus-0.6-r1.ebuild | 208 ---------------------
app-containers/incus/incus-0.7.ebuild | 205 --------------------
4 files changed, 458 deletions(-)
diff --git a/app-containers/incus/Manifest b/app-containers/incus/Manifest
index 4dba74aab158..93b9a2078ab7 100644
--- a/app-containers/incus/Manifest
+++ b/app-containers/incus/Manifest
@@ -1,6 +1,2 @@
-DIST incus-0.6.tar.xz 11749212 BLAKE2B 6cf607f13f0dd14e04b49e97e718d6f11612193a6f27515988c9d12383e3655147edd1120a2b030c9b77f3f72c0c73ae3ec960090b4d76f59930ac0256c2a5c8 SHA512 c90251be777963c437c8f5a3f6a9e448d41f58ec2f2fb7bafbdc241f32234edd50a82a4c6d4a19e822a3d090282e8ea220842a27b17d17bce8691c1549209f7f
-DIST incus-0.6.tar.xz.asc 833 BLAKE2B 47d80cbf92961d03e8a96eb313213960b02730d21d0a36c37e22bd1ea238bee72b94f2f98f49574b4ae07d847099db760a253f3bf69ff2658bcba65bc6a61315 SHA512 7504f74bf1659f06c40b9ae04853bb993988ae704f2b46c39a744bfa7b179383b5377851b6514b368826d6b3beb930188f3cf73b51c99a1b4cb90f8f03a60b5c
-DIST incus-0.7.tar.xz 11829696 BLAKE2B 9e7dd7b196e538a4eb47d158d7c3d5459eace38431dfbe91d5f28f5b9dfc174e485b44f6b8c0f87a054e11f40d29d754f05fc6835034e4131bd8d6b948d720fa SHA512 79e389be3fa094c6c82c1e06b9f2a7e5181dc91db40cdcae4b28593a3e9e53f4f5705b5d6566b48689dbdaec9a277704df0c1b396455aca5f4c5ab93e74dc4d7
-DIST incus-0.7.tar.xz.asc 833 BLAKE2B afb20ff942a4497e895d0cf40b4de260ea32d4cb40284e317188c6aef5e100836ac434038aa931a2ee733abce3569a6ef8bbc162afdcf4dfc542e5c6b55e7d6b SHA512 0ace5c060e1222220858814fb55ecd48ccb0f51d902e6ef29f32d715e185a8c3dcbd29f556453fdc19ad23b1eea7b39db06786cc73373d881d0137d3ebf3af9a
DIST incus-6.0.0.tar.xz 11839792 BLAKE2B 135574e6f19262992bb068a3c0a0045c192699503e417eb861e00a974e631fd869485eb96238d1dbe4712e789367d31afae1c62bade2a8b75f7e9a7620547e74 SHA512 eb6d784a535d487bd85b3e8272d7cddc23f2ed98ca2b3e2f19c038b4a6f910d4030822424154489adef7a688757905927309d25f6d1ff621d99d678fe6aeae2b
DIST incus-6.0.0.tar.xz.asc 833 BLAKE2B f35c38f886290ff08e017cd54e8019c43bfbf1f9c84b26ede2cfa78acbe4047af4314465e77d6e900f296552d5ac8f8c07d26a11920bff937fbb8a0a910efb0d SHA512 0360520752fad3e95807d09e4fd6d60c96a202d0dbb61621925abd75aa801b6d573abbece3179a8906bdc47e96ddec4a746607ce2d10dcc1a76d0afd459cbf81
diff --git a/app-containers/incus/files/incus-0.6-fix-column-handling-with-all-projects.patch b/app-containers/incus/files/incus-0.6-fix-column-handling-with-all-projects.patch
deleted file mode 100644
index 75e85331f776..000000000000
--- a/app-containers/incus/files/incus-0.6-fix-column-handling-with-all-projects.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From bbc4b946355775606da35557e5404ca83a586c67 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber@stgraber.org>
-Date: Thu, 22 Feb 2024 22:41:15 -0500
-Subject: [PATCH] incus/image: Fix column handling with --all-projects
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
----
- cmd/incus/image.go | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/cmd/incus/image.go b/cmd/incus/image.go
-index 5ee2b74709..d5a1126855 100644
---- a/cmd/incus/image.go
-+++ b/cmd/incus/image.go
-@@ -1134,11 +1134,6 @@ func (c *cmdImageList) parseColumns() ([]imageColumn, error) {
- columnList := strings.Split(c.flagColumns, ",")
-
- columns := []imageColumn{}
-- // Add project column if --all-projects flag specified and
-- // no --c was passed
-- if c.flagAllProjects && c.flagColumns == defaultImagesColumns {
-- c.flagColumns = defaultImagesColumnsAllProjects
-- }
-
- for _, columnEntry := range columnList {
- if columnEntry == "" {
-@@ -1321,6 +1316,11 @@ func (c *cmdImageList) Run(cmd *cobra.Command, args []string) error {
- return err
- }
-
-+ // Add project column if --all-projects flag specified and no -c was passed.
-+ if c.flagAllProjects && c.flagColumns == defaultImagesColumns {
-+ c.flagColumns = defaultImagesColumnsAllProjects
-+ }
-+
- // Parse remote
- remote := ""
- if len(args) > 0 {
diff --git a/app-containers/incus/incus-0.6-r1.ebuild b/app-containers/incus/incus-0.6-r1.ebuild
deleted file mode 100644
index ccbc40adf773..000000000000
--- a/app-containers/incus/incus-0.6-r1.ebuild
+++ /dev/null
@@ -1,208 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
-
-DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
-HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
-SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.xz
- verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.xz.asc )"
-
-LICENSE="Apache-2.0 BSD LGPL-3 MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64"
-IUSE="apparmor fuidshift nls"
-
-DEPEND="acct-group/incus
- acct-group/incus-admin
- app-arch/xz-utils
- >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
- dev-db/sqlite:3
- dev-libs/cowsql
- dev-libs/lzo
- >=dev-libs/raft-0.22.0:=[lz4]
- >=dev-util/xdelta-3.0[lzma(+)]
- net-dns/dnsmasq[dhcp]
- sys-libs/libcap
- virtual/udev"
-RDEPEND="${DEPEND}
- fuidshift? ( !app-containers/lxd )
- net-firewall/ebtables
- net-firewall/iptables
- sys-apps/iproute2
- sys-fs/fuse:*
- >=sys-fs/lxcfs-5.0.0
- sys-fs/squashfs-tools[lzma]
- virtual/acl"
-BDEPEND=">=dev-lang/go-1.21
- nls? ( sys-devel/gettext )
- verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
-
-CONFIG_CHECK="
- ~CGROUPS
- ~IPC_NS
- ~NET_NS
- ~PID_NS
-
- ~SECCOMP
- ~USER_NS
- ~UTS_NS
-
- ~KVM
- ~MACVTAP
- ~VHOST_VSOCK
-"
-
-ERROR_IPC_NS="CONFIG_IPC_NS is required."
-ERROR_NET_NS="CONFIG_NET_NS is required."
-ERROR_PID_NS="CONFIG_PID_NS is required."
-ERROR_SECCOMP="CONFIG_SECCOMP is required."
-ERROR_UTS_NS="CONFIG_UTS_NS is required."
-
-WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
-WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
-WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
-
-# Go magic.
-QA_PREBUILT="/usr/bin/incus
- /usr/bin/lxc-to-incus
- /usr/bin/incus-agent
- /usr/bin/incus-benchmark
- /usr/bin/incus-migrate
- /usr/sbin/fuidshift
- /usr/sbin/lxd-to-incus
- /usr/sbin/incusd"
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/linuxcontainers.asc
-
-# The testsuite must be run as root.
-# make: *** [Makefile:156: check] Error 1
-RESTRICT="test"
-
-GOPATH="${S}/_dist"
-
-PATCHES=( "${FILESDIR}"/incus-0.6-fix-column-handling-with-all-projects.patch )
-
-src_prepare() {
- export GOPATH="${S}/_dist"
-
- default
-
- sed -i \
- -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
- -e "s:make:make ${MAKEOPTS}:g" \
- Makefile || die
-
- # Fix hardcoded ovmf file path, see bug 763180
- sed -i \
- -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
- -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
- doc/environment.md \
- internal/server/apparmor/instance.go \
- internal/server/apparmor/instance_qemu.go \
- internal/server/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
-
- # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
- sed -i \
- -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
- internal/server/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
-
- cp "${FILESDIR}"/incus-0.4.service "${T}"/incus.service || die
- if use apparmor; then
- sed -i \
- '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
- "${T}"/incus.service || die
- fi
-
- # Disable -Werror's from go modules.
- find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
-}
-
-src_configure() { :; }
-
-src_compile() {
- export GOPATH="${S}/_dist"
- export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
-
- for k in incus-benchmark incus-user incus lxc-to-incus ; do
- ego install -v -x "${S}/cmd/${k}"
- done
-
- if use fuidshift ; then
- ego install -v -x "${S}/cmd/fuidshift"
- fi
-
- ego install -v -x -tags libsqlite3 "${S}"/cmd/incusd
-
- # Needs to be built statically
- CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
- CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
-
- cd "${S}"/cmd/lxd-to-incus || die
- ego build -v -x ./
- cd "${S}" || die
-
- use nls && emake build-mo
-}
-
-src_test() {
- emake check
-}
-
-src_install() {
- export GOPATH="${S}/_dist"
- local bindir="_dist/bin"
-
- newsbin "${FILESDIR}"/incus-startup-0.4.sh incus-startup
-
- # Admin tools
- for l in incusd incus-user ; do
- dosbin ${bindir}/${l}
- done
- dosbin cmd/lxd-to-incus/lxd-to-incus
-
- # User tools
- for m in incus-agent incus-benchmark incus-migrate incus lxc-to-incus ; do
- dobin ${bindir}/${m}
- done
-
- # fuidshift, should be moved under admin tools at some point
- if use fuidshift ; then
- dosbin ${bindir}/fuidshift
- fi
-
- newconfd "${FILESDIR}"/incus-0.4.confd incus
- newinitd "${FILESDIR}"/incus-0.4.initd incus
- newinitd "${FILESDIR}"/incus-user-0.4.initd incus-user
-
- systemd_dounit "${T}"/incus.service
- systemd_newunit "${FILESDIR}"/incus-0.4.socket incus.socket
- systemd_newunit "${FILESDIR}"/incus-startup-0.4.service incus-startup.service
- systemd_newunit "${FILESDIR}"/incus-user-0.4.service incus-user.service
- systemd_newunit "${FILESDIR}"/incus-user-0.4.socket incus-user.socket
-
- dobashcomp scripts/bash/incus
-
- dodoc AUTHORS
- dodoc -r doc/*
- use nls && domo po/*.mo
-}
-
-pkg_postinst() {
- elog
- elog "Please see"
- elog " https://wiki.gentoo.org/wiki/Incus"
- elog " https://wiki.gentoo.org/wiki/Incus#Migrating_from_LXD"
- elog
- optfeature "virtual machine support" app-cdr/cdrtools app-emulation/qemu[spice,usbredir,virtfs]
- optfeature "btrfs storage backend" sys-fs/btrfs-progs
- optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
- optfeature "full incus-migrate support" net-misc/rsync
- optfeature "lvm2 storage backend" sys-fs/lvm2
- optfeature "zfs storage backend" sys-fs/zfs
- elog
- elog "Be sure to add your local user to the incus group."
- elog
-}
diff --git a/app-containers/incus/incus-0.7.ebuild b/app-containers/incus/incus-0.7.ebuild
deleted file mode 100644
index be2cf6ac0037..000000000000
--- a/app-containers/incus/incus-0.7.ebuild
+++ /dev/null
@@ -1,205 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit go-module linux-info optfeature systemd verify-sig
-
-DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
-HOMEPAGE="https://linuxcontainers.org/incus/introduction/ https://github.com/lxc/incus"
-SRC_URI="https://linuxcontainers.org/downloads/incus/${P}.tar.xz
- verify-sig? ( https://linuxcontainers.org/downloads/incus/${P}.tar.xz.asc )"
-
-LICENSE="Apache-2.0 BSD LGPL-3 MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64"
-IUSE="apparmor fuidshift nls"
-
-DEPEND="acct-group/incus
- acct-group/incus-admin
- app-arch/xz-utils
- >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
- dev-db/sqlite:3
- dev-libs/cowsql
- dev-libs/lzo
- >=dev-libs/raft-0.22.0:=[lz4]
- >=dev-util/xdelta-3.0[lzma(+)]
- net-dns/dnsmasq[dhcp]
- sys-libs/libcap
- virtual/udev"
-RDEPEND="${DEPEND}
- fuidshift? ( !app-containers/lxd )
- net-firewall/ebtables
- net-firewall/iptables
- sys-apps/iproute2
- sys-fs/fuse:*
- >=sys-fs/lxcfs-5.0.0
- sys-fs/squashfs-tools[lzma]
- virtual/acl"
-BDEPEND=">=dev-lang/go-1.21
- nls? ( sys-devel/gettext )
- verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
-
-CONFIG_CHECK="
- ~CGROUPS
- ~IPC_NS
- ~NET_NS
- ~PID_NS
-
- ~SECCOMP
- ~USER_NS
- ~UTS_NS
-
- ~KVM
- ~MACVTAP
- ~VHOST_VSOCK
-"
-
-ERROR_IPC_NS="CONFIG_IPC_NS is required."
-ERROR_NET_NS="CONFIG_NET_NS is required."
-ERROR_PID_NS="CONFIG_PID_NS is required."
-ERROR_SECCOMP="CONFIG_SECCOMP is required."
-ERROR_UTS_NS="CONFIG_UTS_NS is required."
-
-WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
-WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
-WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
-
-# Go magic.
-QA_PREBUILT="/usr/bin/incus
- /usr/bin/lxc-to-incus
- /usr/bin/incus-agent
- /usr/bin/incus-benchmark
- /usr/bin/incus-migrate
- /usr/sbin/fuidshift
- /usr/sbin/lxd-to-incus
- /usr/sbin/incusd"
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/linuxcontainers.asc
-
-# The testsuite must be run as root.
-# make: *** [Makefile:156: check] Error 1
-RESTRICT="test"
-
-GOPATH="${S}/_dist"
-
-src_prepare() {
- export GOPATH="${S}/_dist"
-
- default
-
- sed -i \
- -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/incus:g" \
- -e "s:make:make ${MAKEOPTS}:g" \
- Makefile || die
-
- # Fix hardcoded ovmf file path, see bug 763180
- sed -i \
- -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
- -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
- doc/environment.md \
- internal/server/apparmor/instance.go \
- internal/server/apparmor/instance_qemu.go \
- internal/server/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
-
- # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
- sed -i \
- -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
- internal/server/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
-
- cp "${FILESDIR}"/incus-0.4.service "${T}"/incus.service || die
- if use apparmor; then
- sed -i \
- '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
- "${T}"/incus.service || die
- fi
-
- # Disable -Werror's from go modules.
- find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
-}
-
-src_configure() { :; }
-
-src_compile() {
- export GOPATH="${S}/_dist"
- export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
-
- for k in incus-benchmark incus-simplestreams incus-user incus lxc-to-incus lxd-to-incus ; do
- ego install -v -x "${S}/cmd/${k}"
- done
-
- if use fuidshift ; then
- ego install -v -x "${S}/cmd/fuidshift"
- fi
-
- ego install -v -x -tags libsqlite3 "${S}"/cmd/incusd
-
- # Needs to be built statically
- CGO_ENABLED=0 go install -v -tags netgo "${S}"/cmd/incus-migrate
- CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/cmd/incus-agent
-
- use nls && emake build-mo
-}
-
-src_test() {
- emake check
-}
-
-src_install() {
- export GOPATH="${S}/_dist"
- local bindir="_dist/bin"
-
- newsbin "${FILESDIR}"/incus-startup-0.4.sh incus-startup
-
- # Admin tools
- for l in incusd incus-user lxd-to-incus ; do
- dosbin ${bindir}/${l}
- done
-
- # User tools
- for m in incus-agent incus-benchmark incus-migrate incus-simplestreams incus lxc-to-incus ; do
- dobin ${bindir}/${m}
- done
-
- # fuidshift, should be moved under admin tools at some point
- if use fuidshift ; then
- dosbin ${bindir}/fuidshift
- fi
-
- newconfd "${FILESDIR}"/incus-0.4.confd incus
- newinitd "${FILESDIR}"/incus-0.4.initd incus
- newinitd "${FILESDIR}"/incus-user-0.4.initd incus-user
-
- systemd_dounit "${T}"/incus.service
- systemd_newunit "${FILESDIR}"/incus-0.4.socket incus.socket
- systemd_newunit "${FILESDIR}"/incus-startup-0.4.service incus-startup.service
- systemd_newunit "${FILESDIR}"/incus-user-0.4.service incus-user.service
- systemd_newunit "${FILESDIR}"/incus-user-0.4.socket incus-user.socket
-
- # Generate and install shell completion files.
- mkdir -p "${D}"/usr/share/{bash-completion/completions/,fish/vendor_completions.d/,zsh/site-functions/} || die
- "${bindir}"/incus completion bash > "${D}"/usr/share/bash-completion/completions/incus || die
- "${bindir}"/incus completion fish > "${D}"/usr/share/fish/vendor_completions.d/incus.fish || die
- "${bindir}"/incus completion zsh > "${D}"/usr/share/zsh/site-functions/_incus || die
-
- dodoc AUTHORS
- dodoc -r doc/*
- use nls && domo po/*.mo
-}
-
-pkg_postinst() {
- elog
- elog "Please see"
- elog " https://wiki.gentoo.org/wiki/Incus"
- elog " https://wiki.gentoo.org/wiki/Incus#Migrating_from_LXD"
- elog
- optfeature "virtual machine support" app-cdr/cdrtools app-emulation/qemu[spice,usbredir,virtfs]
- optfeature "btrfs storage backend" sys-fs/btrfs-progs
- optfeature "ipv6 support" net-dns/dnsmasq[ipv6]
- optfeature "full incus-migrate support" net-misc/rsync
- optfeature "lvm2 storage backend" sys-fs/lvm2
- optfeature "zfs storage backend" sys-fs/zfs
- elog
- elog "Be sure to add your local user to the incus group."
- elog
-}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/
@ 2024-07-12 19:28 Joonas Niilola
0 siblings, 0 replies; 6+ messages in thread
From: Joonas Niilola @ 2024-07-12 19:28 UTC (permalink / raw
To: gentoo-commits
commit: b05fe66cb10d75cc17f9998db5fc98eee0e9a049
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 12 19:27:12 2024 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Jul 12 19:28:01 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b05fe66c
app-containers/incus: update the prlimit syntax in 6.3
Bug: https://bugs.gentoo.org/929138
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-containers/incus/files/incus-6.0.initd | 2 +-
app-containers/incus/{incus-6.3.ebuild => incus-6.3-r1.ebuild} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/app-containers/incus/files/incus-6.0.initd b/app-containers/incus/files/incus-6.0.initd
index 933badb8a074..fb0d80ee7987 100644
--- a/app-containers/incus/files/incus-6.0.initd
+++ b/app-containers/incus/files/incus-6.0.initd
@@ -17,7 +17,7 @@ start() {
# Call prlimit from the init.d file instead of ulimit through rc_ulimit,
# bgo#929138
- prlimit -n 1048576 -l unlimited --pid=$$
+ prlimit --nofile=1048576 --memlock=unlimited --pid=$$
# Fix permissions on /var/lib/incus and make sure it exists.
# Create a log directory for incus with correct permissions.
diff --git a/app-containers/incus/incus-6.3.ebuild b/app-containers/incus/incus-6.3-r1.ebuild
similarity index 100%
rename from app-containers/incus/incus-6.3.ebuild
rename to app-containers/incus/incus-6.3-r1.ebuild
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-12 19:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13 17:22 [gentoo-commits] repo/gentoo:master commit in: app-containers/incus/, app-containers/incus/files/ Joonas Niilola
-- strict thread matches above, loose matches on Subject: below --
2023-12-13 8:09 Joonas Niilola
2023-12-27 17:21 Joonas Niilola
2024-01-31 7:37 Joonas Niilola
2024-04-29 8:18 Joonas Niilola
2024-07-12 19:28 Joonas Niilola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox