From 613c9ca95b02ba6efd5cafe90a384344353b7e2c Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Thu, 12 Sep 2019 22:57:04 -0700 Subject: [PATCH] lxd: update to 3.19. --- srcpkgs/lxd/files/lxd/run | 4 +++ srcpkgs/lxd/patches/seccomp.patch | 41 ------------------------------- srcpkgs/lxd/template | 24 ++++++------------ 3 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 srcpkgs/lxd/patches/seccomp.patch diff --git a/srcpkgs/lxd/files/lxd/run b/srcpkgs/lxd/files/lxd/run index 147eb64e74d..c03a2c0d766 100755 --- a/srcpkgs/lxd/files/lxd/run +++ b/srcpkgs/lxd/files/lxd/run @@ -6,4 +6,8 @@ fi if ! mountpoint -q "${_systemd_cgrp}"; then mount -t cgroup -o none,name=systemd cgroup ${_systemd_cgrp} fi +# workaround lxc bug -- next release of lxc should obsolete this +if [ -e /sys/fs/cgroup/cpuset/cgroup.clone_children ]; then + echo 1 > /sys/fs/cgroup/cpuset/cgroup.clone_children 2>/dev/null || : +fi exec lxd --group lxd 2>&1 diff --git a/srcpkgs/lxd/patches/seccomp.patch b/srcpkgs/lxd/patches/seccomp.patch deleted file mode 100644 index e7b52a31931..00000000000 --- a/srcpkgs/lxd/patches/seccomp.patch +++ /dev/null @@ -1,41 +0,0 @@ -lxc/lxd@a181ed4 [PATCH] seccomp: define __NR_mknod if missing -lxc/lxd@c655ed5 [PATCH] seccomp: rework missing syscall number definitions ---- - lxd/seccomp.go | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/lxd/seccomp.go b/lxd/seccomp.go -index 0afad7cacc..32397b9729 100644 ---- lxd/seccomp.go -+++ lxd/seccomp.go -@@ -109,6 +109,14 @@ - return -EPERM; - } - -+#ifndef __NR_mknodat -+ #error missing kernel headers -+#else -+ #ifdef __NR_mknod -+ #define LXD_MUST_CHECK_MKNOD -+ #endif -+#endif -+ - static int seccomp_notify_mknod_set_response(int fd_mem, struct seccomp_notify_proxy_msg *msg, - char *buf, size_t size, - mode_t *mode, dev_t *dev, -@@ -124,6 +132,7 @@ static int seccomp_notify_mknod_set_response(int fd_mem, struct seccomp_notify_p - resp->val = 0; - - switch (req->data.nr) { -+#ifdef LXD_MUST_CHECK_MKNOD - case __NR_mknod: - resp->error = device_allowed(req->data.args[2], req->data.args[1]); - if (resp->error) { -@@ -143,6 +149,7 @@ static int seccomp_notify_mknod_set_response(int fd_mem, struct seccomp_notify_p - *pid = req->pid; - - break; -+#endif - case __NR_mknodat: - if (req->data.args[0] != AT_FDCWD) { - errno = EINVAL; diff --git a/srcpkgs/lxd/template b/srcpkgs/lxd/template index 2a9cf44d88d..626df9c3f4a 100644 --- a/srcpkgs/lxd/template +++ b/srcpkgs/lxd/template @@ -1,37 +1,29 @@ # Template file for 'lxd' pkgname=lxd -version=3.14 +version=3.19 revision=1 build_style=go go_import_path=github.com/lxc/lxd go_build_tags=libsqlite3 go_package="${go_import_path}/lxd ${go_import_path}/lxc ${go_import_path}/lxd-p2c ${go_import_path}/fuidshift" -hostmakedepends="pkg-config" +hostmakedepends="pkg-config git" makedepends="lxc-devel acl-devel dqlite-devel" depends="lxc acl acl-progs rsync squashfs-tools xz dnsmasq iptables" short_desc="Next generation system container manager" -maintainer="Cameron Nemo " +maintainer="Cameron Nemo " license="Apache-2.0" homepage="https://linuxcontainers.org/lxd" distfiles="https://linuxcontainers.org/downloads/lxd/lxd-${version}.tar.gz" -checksum=409e4758cbeb43b098d0265c4ce05aeeac5ae73f8914ceb1006e6a6d89fe1fe5 +checksum=afc0b0912e5fa977007cfd97805849a3a47564eaaaa1638948081665ad7224c8 system_groups="lxd" -do_configure() { - # the LXD tarball packages up the required dependencies - ln -s "$wrksrc/dist" "$GOPATH" -} - -do_build() { - # don't go-get the dependencies, just install with what's there - cd "$GOSRCPATH" - go_package=${go_package:-$go_import_path} - go install -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package} -} +_libdir="/usr/lib/sqlite-replication" +LDFLAGS="-L${XBPS_CROSS_BASE}${_libdir} -Wl,-R${_libdir}" +# whitelist libcap LDFLAGS (see: https://github.com/lxc/lxd/issues/6727) +export CGO_LDFLAGS_ALLOW='-Wl,-wrap,pthread_create' post_install() { vinstall scripts/bash/lxd-client 644 /usr/share/bash-completion/completions lxd - vlicense COPYING LICENSE vsv lxd }