diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-01-07 18:14:11 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-01-07 18:14:11 +0000 |
commit | 7a027cd18c60d9abad83a60c98ccf27db26be067 (patch) | |
tree | 905c5e3c3ec66d8d756a71db384bdd7abf7a50f9 /app-containers | |
parent | d4d70691ab58dfcbd58e0863f3e64d59765533e3 (diff) |
gentoo auto-resync : 07:01:2023 - 18:14:11
Diffstat (limited to 'app-containers')
-rw-r--r-- | app-containers/Manifest.gz | bin | 7548 -> 7545 bytes | |||
-rw-r--r-- | app-containers/lxd/Manifest | 2 | ||||
-rw-r--r-- | app-containers/lxd/files/lxd-5.0.2-r1.initd | 60 | ||||
-rw-r--r-- | app-containers/lxd/lxd-5.0.1-r4.ebuild | 215 |
4 files changed, 277 insertions, 0 deletions
diff --git a/app-containers/Manifest.gz b/app-containers/Manifest.gz Binary files differindex 2cc7b65eb685..3d4bf424cc84 100644 --- a/app-containers/Manifest.gz +++ b/app-containers/Manifest.gz diff --git a/app-containers/lxd/Manifest b/app-containers/lxd/Manifest index 4db8fa2a8e09..ec4789f50d0b 100644 --- a/app-containers/lxd/Manifest +++ b/app-containers/lxd/Manifest @@ -2,6 +2,7 @@ AUX lxd-4.0.0.confd 582 BLAKE2B 88ce8ec99eb50174bffea7d3b8bddc67b50fe6677d54df11 AUX lxd-4.0.0.socket 197 BLAKE2B 8c0d2dee71c14ee5f34b2bd0804adfa06ab3ae2a73bcf8d122184434c42b7f91f66fe610bddda93c458e0f171b505fe79a4f268d8243aabdf226f47e95027e71 SHA512 d70dc867b2e92b69928c83fc5feca4e387808adbc267b9fe4ecf0c8befdf3ca13366b229c6eefcb5667e51405fb0aa4e6bb8f59a0b5b5fb3895c46b4aaab0661 AUX lxd-4.0.9-r1.service 612 BLAKE2B e44029b6f615afc0daf8abfccd7d2e472291d9b1f8530b64f5c9b7d96aeda605a0dd0ec9b74f0a79f68992a45607e4362a7c30c711b34ac106b9377610f97ad6 SHA512 68800d9952e865eeffe1c05ecf111c49e6b137c6f7af7c7b02daf180c3a794a670ddbe7140e97d187f1b9a803ca84e132303808ed8b6ae49760246c01d7c60d4 AUX lxd-4.0.9.initd 1333 BLAKE2B 72a27d38527b4f0dcca3b111ae0d112bd128cf83ff6261561c5a3bf1c619a2e36672b5eb06ff643660d3cee05a545991ed565be257a56452cbd498a202e1b197 SHA512 933a09e72dbf3bbab8e2148549b6bc08ac0caf2088bd44c3e378ac6041fa861845bfae351c83fcd0920655ceb29ea6ca8023163c52a2fb7499c9bf2958d4dc86 +AUX lxd-5.0.2-r1.initd 1739 BLAKE2B 0713033f39fdeafea5c1c130f49b720ee08b183a257b73d315cb26173d23e5be744d92fc048b8881fd7678a5e740a32f390a2bbbc1d2785afeac41ecdeb9ec1f SHA512 0375cc1214321006060b7b5eb91920098d0392fd6e748e47e50b6fa0deb4d2f364de78d1e5f59ec93e2e832df9ac5801500325bf2b4fa09f5f6e5ae99bf3eac1 AUX lxd-5.0.2.initd 1553 BLAKE2B 6f230eecda849486e8734e6cff7ae5779f1d25d198d29eee1dd6fc60f75b5b7d81e7c002a2a1cc7f6b61d34243953deca15b7ea2027f4af1a5d418c7bd316b06 SHA512 2369731b7227aa16b012fe6ea6f5deadd9451949ea293a8226ebcbb34581783f54dbd603a26949374459f0a2ff251965bf5398ae7878b10885bdc02b74c0febc AUX lxd-containers-4.0.0.service 322 BLAKE2B a38cffd4b5809946abdac858564dcab2c2967c295d671df0d315d790df1849e25f0bc052e20cd0d9e4c23403289050b4538f5a52437ab8ae9ca3b40c6a9a1571 SHA512 a55f2c1a367c5c3c5eb6880e01893977de18c6e9463949236ee3247715fbf53641bbe1b69404362dd6cb6ba2a30ac6539fd362b21059e529dc4dac4ec5ca6718 DIST lxd-5.0.1.tar.gz 14640923 BLAKE2B 81bdf3301c0eecc719864cd8e18fd886113f83d1980e13ee4d4ccb6641ee4a7e33f0b859a21abd8a0a9956d1c2f3dfa6e7eb1ae454fbb580c23b5558ef51168e SHA512 b04b7329bdeb17ca384cc2d931a1510d5f03521fd247eab93904bbcb6139cc0daf28f9aeb6416268ccf15affdd15b26598f3e280fb5eefe5c59be6918f092bed @@ -10,4 +11,5 @@ DIST lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch 882 BLAKE DIST lxd-5.8-add-tcp-keepalives-to-exec-channels.patch 15702 BLAKE2B ee834b86284e36f87ad3e54df04eb2968dc0fefdf81b116bd640e611ac4ca2eb93763ed2c2f3cfd1e9473da1a3e66bd90858eb4bab08a47f86306a0903a19e6e SHA512 5e7c56f5ffbc8cecb27c6916abbbf4bb3d268c0936b9fdb2b80b4b306c911bdcf782059290243988feb49c9209e55de9ea168ea7041636bf9ae1b7d88ff541c9 EBUILD lxd-5.0.1-r2.ebuild 5268 BLAKE2B b0d0d8601fe9dfda083f98078aa404e04cc4c82098583bc3b8bcee76b4f46f1eadd097a05ffb62111ab929a42f3af2377de9302f3acaeeca5056d85ef460715f SHA512 540ef775bc0558a59dad52220d1f8d9de6f0dd4aa57eff7e18beefefc2263651d9edf5fb0e993d724b4e03145f0250efa074cfb11d0e5e9997dcd5b968a2997c EBUILD lxd-5.0.1-r3.ebuild 5807 BLAKE2B 502565c333bf5603953b0b683e1ecb5383ee3cd40926e8db3d042a74df7b59b2e5f7640b0c2c6ebec202f7079de2fa6f190a4225d05db41d5dc21c97fe4ab0b3 SHA512 7922dca61538e02a0a3f219c9f27ded3b4762855f5073eb4cfdbbfd7e3c1d4f7fe3e72af65722e627f6b8a6811b08ac1590af91258f8f30cb853be98873e34e4 +EBUILD lxd-5.0.1-r4.ebuild 6167 BLAKE2B 4c333bb05d113db43b7c9b9917ff96737599fe9a36492e777339a47eeee86efa07baf9736dbbd4f9f19179939da6b3fb196cf29b607bc72a6535fe673d6f2a0f SHA512 04c20b5b7c0095f60f0cc1b49e98336426de6fad703432167882020829660ab696c6c9a004c5b881036927f3ce6cb116e517afcf026df647ef388b47e33d743f MISC metadata.xml 1403 BLAKE2B 4bff140bc9282b41631293b9cc28a5f85bec2b0f923c762c6572e75b752aba113632747142bd3b3a87322ce8d2ba10fd15afe3f1a7c1384e49c408ca176f267d SHA512 38fb2faa661a8473d0221117299baea01c06f46e5fbf5bd7e32f26b7d0a433ab35c5e0e5dde42c7478b7118489d619fdacca29b3a9b0e89cf432c5bccd3ffba3 diff --git a/app-containers/lxd/files/lxd-5.0.2-r1.initd b/app-containers/lxd/files/lxd-5.0.2-r1.initd new file mode 100644 index 000000000000..85b27a45e448 --- /dev/null +++ b/app-containers/lxd/files/lxd-5.0.2-r1.initd @@ -0,0 +1,60 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +DAEMON=/usr/sbin/lxd +PIDFILE=/run/lxd.pid + +depend() { + need net + need lxcfs +} + +start() { + ebegin "Starting lxd service" + + modprobe -f loop > /dev/null 2>&1 + + # Fix permissions on /var/lib/lxd and make sure it exists. + # Create a log directory for lxd with correct permissions. + install -d /var/lib/lxd --group lxd --owner root --mode 0775 + install -d /var/log/lxd --group lxd --owner root + + start-stop-daemon --start \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} \ + --background \ + --make-pidfile \ + -- \ + ${LXD_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" + # rc_cgroup_controllers="yes" + if [ -d /sys/fs/cgroup/unified ] && + [ ! -d /sys/fs/cgroup/systemd ]; then + install -d /sys/fs/cgroup/systemd --group lxd --owner root + mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd + fi +} + +stop() { + if [ "${RC_CMD}" = restart ]; then + ebegin "Stopping lxd service (but not containers)" + # start-stop-daemon sends SIGTERM with a timeout of 5s by default. + # SIGTERM indicates to LXD that it will be stopped temporarily. + # Instances will keep running. + start-stop-daemon --stop --quiet -p "${PIDFILE}" + eend ${?} + else + ebegin "Stopping lxd service and containers, waiting 40s" + # SIGPWR indicates to LXD 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 LXD. + start-stop-daemon --stop --quiet -R SIGPWR/40 -p "${PIDFILE}" + eend ${?} + fi +} diff --git a/app-containers/lxd/lxd-5.0.1-r4.ebuild b/app-containers/lxd/lxd-5.0.1-r4.ebuild new file mode 100644 index 000000000000..9f824c73165d --- /dev/null +++ b/app-containers/lxd/lxd-5.0.1-r4.ebuild @@ -0,0 +1,215 @@ +# 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/lxd/introduction/ https://github.com/lxc/lxd" +SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz + https://github.com/lxc/lxd/commit/d55a590ea50a75c3cb2ea67894be8253074d6093.patch -> lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch + https://patch-diff.githubusercontent.com/raw/lxc/lxd/pull/11011.patch -> lxd-5.8-add-tcp-keepalives-to-exec-channels.patch + verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="apparmor nls" + +DEPEND="acct-group/lxd + app-arch/xz-utils + >=app-containers/lxc-3.0.0[apparmor?,seccomp(+)] + dev-db/sqlite:3 + dev-libs/dqlite:= + dev-libs/lzo + dev-libs/raft[lz4] + >=dev-util/xdelta-3.0[lzma(+)] + net-dns/dnsmasq[dhcp,ipv6(+)] + sys-libs/libcap + virtual/udev" +RDEPEND="${DEPEND} + net-firewall/ebtables + net-firewall/iptables[ipv6(+)] + sys-apps/iproute2[ipv6(+)] + 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/fuidshift + /usr/bin/lxc + /usr/bin/lxc-to-lxd + /usr/bin/lxd-agent + /usr/bin/lxd-benchmark + /usr/bin/lxd-migrate + /usr/sbin/lxd" + +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" + +PATCHES=( "${DISTDIR}"/lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch + "${DISTDIR}"/lxd-5.8-add-tcp-keepalives-to-exec-channels.patch ) + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} + fi + + default +} + +src_prepare() { + export GOPATH="${S}/_dist" + + default + + sed -i \ + -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd: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 \ + lxd/apparmor/instance.go \ + lxd/apparmor/instance_qemu.go \ + lxd/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" \ + lxd/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path." + + cp "${FILESDIR}"/lxd-4.0.9-r1.service "${T}"/lxd.service || die + if use apparmor; then + sed -i \ + '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \ + "${T}"/lxd.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 fuidshift lxd-benchmark lxc lxc-to-lxd; do + go install -v -x "${S}/${k}" || die "failed compiling ${k}" + done + + go install -v -x -tags libsqlite3 "${S}"/lxd || die "Failed to build the daemon" + + # Needs to be built statically + CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate + CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/lxd-agent + + use nls && emake build-mo +} + +src_test() { + emake check +} + +src_install() { + export GOPATH="${S}/_dist" + local bindir="_dist/bin" + + dosbin ${bindir}/lxd + + for l in fuidshift lxd-agent lxd-benchmark lxd-migrate lxc lxc-to-lxd; do + dobin ${bindir}/${l} + done + + newbashcomp scripts/bash/lxd-client lxc + + newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd + newinitd "${FILESDIR}"/lxd-5.0.2-r1.initd lxd + + systemd_dounit "${T}"/lxd.service + systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service + systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket + + dodoc AUTHORS + dodoc -r doc/* + use nls && domo po/*.mo +} + +pkg_postinst() { + elog + elog "Consult https://wiki.gentoo.org/wiki/LXD for more information," + elog "including a Quick Start." + elog "For virtual machine support, see:" + elog "https://wiki.gentoo.org/wiki/LXD#Virtual_machines" + elog + elog "Please run 'lxc-checkconfig' to see all optional kernel features." + elog + optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs] + optfeature "btrfs storage backend" sys-fs/btrfs-progs + 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 lxd group." + + if [[ ${REPLACING_VERSIONS} ]] && + ver_test ${REPLACING_VERSIONS} -lt 5.0.1 && + has_version app-emulation/qemu[spice,usbredir,virtfs]; then + ewarn "" + ewarn "You're updating from <5.0.1. Due to incompatible API updates in the lxd-agent" + ewarn "product, you'll have to restart any running virtual machines before they work" + ewarn "properly." + ewarn "" + ewarn "Run: 'lxc restart your-vm' after the update for your vm's managed by lxd." + ewarn "" + fi + + if [[ ${REPLACING_VERSIONS} ]] && + has_version "sys-apps/openrc"; then + elog "" + elog "The new init.d script will attempt to mount " + elog " /sys/fs/cgroup/systemd" + elog "by default, which is needed to run systemd containers with openrc host." + elog "See the /etc/init.d/lxd file for requirements." + elog "" + fi +} |