diff options
author | Joonas Niilola <juippis@gentoo.org> | 2023-02-22 09:11:49 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2023-02-22 09:11:49 +0200 |
commit | f565998a51b1e190e4595d726873e1775b2bc4c8 (patch) | |
tree | 217e0ae4d073d5b2f94ea63bf379ce8b076447f1 /app-containers/lxc | |
parent | app-containers/lxd: stabilize 5.0.2-r1 for amd64 (diff) | |
download | gentoo-f565998a51b1e190e4595d726873e1775b2bc4c8.tar.gz gentoo-f565998a51b1e190e4595d726873e1775b2bc4c8.tar.bz2 gentoo-f565998a51b1e190e4595d726873e1775b2bc4c8.zip |
app-containers/lxc: drop 5.0.1-r2
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-containers/lxc')
-rw-r--r-- | app-containers/lxc/Manifest | 2 | ||||
-rw-r--r-- | app-containers/lxc/files/lxc-5.0.1-glibc-2.36.patch | 383 | ||||
-rw-r--r-- | app-containers/lxc/files/lxc-5.0.1-use-sd_bus_call_method_async-insteaf-of-asyncv.patch | 44 | ||||
-rw-r--r-- | app-containers/lxc/lxc-5.0.1-r2.ebuild | 171 |
4 files changed, 0 insertions, 600 deletions
diff --git a/app-containers/lxc/Manifest b/app-containers/lxc/Manifest index 94adb342d397..42ff946b34f8 100644 --- a/app-containers/lxc/Manifest +++ b/app-containers/lxc/Manifest @@ -1,4 +1,2 @@ -DIST lxc-5.0.1.tar.gz 973206 BLAKE2B 6d5cb1a03eb2612d0f8cb59783a64ec42bedd560cacfebf76383d9599dfc153e381f0e584a1c8c9a0b5b18a46bfb01863649dc5a019546e9ded6079b5ec69ddd SHA512 c87563b556aec83c93a7c62932217791e92da950cc76983f0d5e1d603fe1ae298a63fb5e88ec9ef5173846d579babb5acd0836679b915de00844bb9edf9c8d7e -DIST lxc-5.0.1.tar.gz.asc 833 BLAKE2B f85df5fc5bd88a738042f622ee4191b99e0a8e07db7ceb5824d634bc451f4bf93c8b64d1c72d4899f639ad30bbc9ee82be292dbe310218fa20566ee00f9bb752 SHA512 09de4e74d174b54cf9240ca4ef4793b9f63355c65f610abffb40e6dc2dc9130380761a50725e4dcee39b421e4b51c874d141fe22d5ecfd7ad3af35f7ebec09a0 DIST lxc-5.0.2.tar.gz 973977 BLAKE2B e6017406b96f53525b576528814922a017a7d65fb04724046236307f4e85219b3c8ac725678e57ae3f77a4e817f718748e8c61fbc8147160e4ac87d3146b6567 SHA512 2e8800875e9c91cc0cbfdfc33c43d84bad9471d8a1b8ccd52d7d9c6fe44f280f9f701b8ccc2e0f5319a3e4c50d8c4331722f0dd9c0347575eb4f7b4ed110bef3 DIST lxc-5.0.2.tar.gz.asc 833 BLAKE2B 3d78f8a87b2f45d2b91a9a6595d286e2fc1dcfc7d28f3c1d86e968860a7e346506ab28d4dafffede8acf1f82e8b12f90eda2e6210cd6bdec702f59bad97295c6 SHA512 9bd1ef117cf256841b75d409e8f14b88ed54fdfc9c8c472b6baa5e9695e39cdb8c1f47ce612dc8263abb65511df0812554cc9a5820cdd6c1539a07283a4cd08f diff --git a/app-containers/lxc/files/lxc-5.0.1-glibc-2.36.patch b/app-containers/lxc/files/lxc-5.0.1-glibc-2.36.patch deleted file mode 100644 index e186c7fbb282..000000000000 --- a/app-containers/lxc/files/lxc-5.0.1-glibc-2.36.patch +++ /dev/null @@ -1,383 +0,0 @@ -From c1115e1503bf955c97f4cf3b925a6a9f619764c3 Mon Sep 17 00:00:00 2001 -From: Christian Brauner <brauner@kernel.org> -Date: Tue, 9 Aug 2022 16:14:25 +0200 -Subject: [PATCH 1/3] build: detect where struct mount_attr is declared - -Fixes: #4176 -Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com> ---- - meson.build | 30 ++++++++++++++++++++++++++++-- - src/lxc/conf.c | 6 +++--- - src/lxc/conf.h | 2 +- - src/lxc/mount_utils.c | 6 +++--- - src/lxc/syscall_wrappers.h | 12 ++++++++++-- - 5 files changed, 45 insertions(+), 11 deletions(-) - -diff --git a/meson.build b/meson.build -index a145faf069..f679aabbc8 100644 ---- a/meson.build -+++ b/meson.build -@@ -590,7 +590,6 @@ decl_headers = ''' - foreach decl: [ - '__aligned_u64', - 'struct clone_args', -- 'struct mount_attr', - 'struct open_how', - 'struct rtnl_link_stats64', - ] -@@ -610,7 +609,6 @@ foreach tuple: [ - ['struct seccomp_notif_sizes'], - ['struct clone_args'], - ['__aligned_u64'], -- ['struct mount_attr'], - ['struct open_how'], - ['struct rtnl_link_stats64'], - ] -@@ -630,6 +628,34 @@ foreach tuple: [ - endif - endforeach - -+## Types. -+decl_headers = ''' -+#include <sys/mount.h> -+''' -+ -+# We get -1 if the size cannot be determined -+if cc.sizeof('struct mount_attr', prefix: decl_headers, args: '-D_GNU_SOURCE') > 0 -+ srcconf.set10('HAVE_' + 'struct mount_attr'.underscorify().to_upper(), true) -+ found_types += 'struct mount_attr (sys/mount.h)' -+else -+ srcconf.set10('HAVE_' + 'struct mount_attr'.underscorify().to_upper(), false) -+ missing_types += 'struct mount_attr (sys/mount.h)' -+endif -+ -+## Types. -+decl_headers = ''' -+#include <linux/mount.h> -+''' -+ -+# We get -1 if the size cannot be determined -+if cc.sizeof('struct mount_attr', prefix: decl_headers, args: '-D_GNU_SOURCE') > 0 -+ srcconf.set10('HAVE_UAPI_' + 'struct mount_attr'.underscorify().to_upper(), true) -+ found_types += 'struct mount_attr (linux/mount.h)' -+else -+ srcconf.set10('HAVE_UAPI_' + 'struct mount_attr'.underscorify().to_upper(), false) -+ missing_types += 'struct mount_attr (linux/mount.h)' -+endif -+ - ## Headers. - foreach ident: [ - ['bpf', '''#include <sys/syscall.h> -diff --git a/src/lxc/conf.c b/src/lxc/conf.c -index ffbe74c2f6..4193cd07f5 100644 ---- a/src/lxc/conf.c -+++ b/src/lxc/conf.c -@@ -2885,7 +2885,7 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f) - struct lxc_mount_options opts = {}; - int dfd_from; - const char *source_relative, *target_relative; -- struct lxc_mount_attr attr = {}; -+ struct mount_attr attr = {}; - - ret = parse_lxc_mount_attrs(&opts, mntent.mnt_opts); - if (ret < 0) -@@ -3005,7 +3005,7 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f) - - /* Set propagation mount options. */ - if (opts.attr.propagation) { -- attr = (struct lxc_mount_attr) { -+ attr = (struct mount_attr) { - .propagation = opts.attr.propagation, - }; - -@@ -4109,7 +4109,7 @@ int lxc_idmapped_mounts_parent(struct lxc_handler *handler) - - for (;;) { - __do_close int fd_from = -EBADF, fd_userns = -EBADF; -- struct lxc_mount_attr attr = {}; -+ struct mount_attr attr = {}; - struct lxc_mount_options opts = {}; - ssize_t ret; - -diff --git a/src/lxc/conf.h b/src/lxc/conf.h -index 7dc2f15b60..772479f9e1 100644 ---- a/src/lxc/conf.h -+++ b/src/lxc/conf.h -@@ -223,7 +223,7 @@ struct lxc_mount_options { - unsigned long mnt_flags; - unsigned long prop_flags; - char *data; -- struct lxc_mount_attr attr; -+ struct mount_attr attr; - char *raw_options; - }; - -diff --git a/src/lxc/mount_utils.c b/src/lxc/mount_utils.c -index bba75f933c..88dd73ee36 100644 ---- a/src/lxc/mount_utils.c -+++ b/src/lxc/mount_utils.c -@@ -31,7 +31,7 @@ lxc_log_define(mount_utils, lxc); - * setting in @attr_set, but must also specify MOUNT_ATTR__ATIME in the - * @attr_clr field. - */ --static inline void set_atime(struct lxc_mount_attr *attr) -+static inline void set_atime(struct mount_attr *attr) - { - switch (attr->attr_set & MOUNT_ATTR__ATIME) { - case MOUNT_ATTR_RELATIME: -@@ -272,7 +272,7 @@ int create_detached_idmapped_mount(const char *path, int userns_fd, - { - __do_close int fd_tree_from = -EBADF; - unsigned int open_tree_flags = OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC; -- struct lxc_mount_attr attr = { -+ struct mount_attr attr = { - .attr_set = MOUNT_ATTR_IDMAP | attr_set, - .attr_clr = attr_clr, - .userns_fd = userns_fd, -@@ -335,7 +335,7 @@ int __fd_bind_mount(int dfd_from, const char *path_from, __u64 o_flags_from, - __u64 attr_clr, __u64 propagation, int userns_fd, - bool recursive) - { -- struct lxc_mount_attr attr = { -+ struct mount_attr attr = { - .attr_set = attr_set, - .attr_clr = attr_clr, - .propagation = propagation, -diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h -index a5e98b565c..c8a7d0c7b7 100644 ---- a/src/lxc/syscall_wrappers.h -+++ b/src/lxc/syscall_wrappers.h -@@ -18,6 +18,12 @@ - #include "macro.h" - #include "syscall_numbers.h" - -+#if HAVE_STRUCT_MOUNT_ATTR -+#include <sys/mount.h> -+#elif HAVE_UAPI_STRUCT_MOUNT_ATTR -+#include <linux/mount.h> -+#endif -+ - #ifdef HAVE_LINUX_MEMFD_H - #include <linux/memfd.h> - #endif -@@ -210,16 +216,18 @@ extern int fsmount(int fs_fd, unsigned int flags, unsigned int attr_flags); - /* - * mount_setattr() - */ --struct lxc_mount_attr { -+#if !HAVE_STRUCT_MOUNT_ATTR && !HAVE_UAPI_STRUCT_MOUNT_ATTR -+struct mount_attr { - __u64 attr_set; - __u64 attr_clr; - __u64 propagation; - __u64 userns_fd; - }; -+#endif - - #if !HAVE_MOUNT_SETATTR - static inline int mount_setattr(int dfd, const char *path, unsigned int flags, -- struct lxc_mount_attr *attr, size_t size) -+ struct mount_attr *attr, size_t size) - { - return syscall(__NR_mount_setattr, dfd, path, flags, attr, size); - } - -From ef1e0607b82e27350c2d677d649c6a0a9693fd40 Mon Sep 17 00:00:00 2001 -From: Christian Brauner <brauner@kernel.org> -Date: Tue, 9 Aug 2022 16:27:40 +0200 -Subject: [PATCH 2/3] build: detect sys/pidfd.h availability - -Fixes: #4176 -Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com> ---- - meson.build | 1 + - src/lxc/process_utils.h | 6 ++++++ - 2 files changed, 7 insertions(+) - -diff --git a/meson.build b/meson.build -index f679aabbc8..e999542336 100644 ---- a/meson.build -+++ b/meson.build -@@ -735,6 +735,7 @@ foreach tuple: [ - ['sys/resource.h'], - ['sys/memfd.h'], - ['sys/personality.h'], -+ ['sys/pidfd.h'], - ['sys/signalfd.h'], - ['sys/timerfd.h'], - ['pty.h'], -diff --git a/src/lxc/process_utils.h b/src/lxc/process_utils.h -index 9c15b15741..ed84741d0e 100644 ---- a/src/lxc/process_utils.h -+++ b/src/lxc/process_utils.h -@@ -15,6 +15,10 @@ - #include <sys/syscall.h> - #include <unistd.h> - -+#if HAVE_SYS_PIDFD_H -+#include <sys/pidfd.h> -+#endif -+ - #include "compiler.h" - #include "syscall_numbers.h" - -@@ -136,9 +140,11 @@ - #endif - - /* waitid */ -+#if !HAVE_SYS_PIDFD_H - #ifndef P_PIDFD - #define P_PIDFD 3 - #endif -+#endif - - #ifndef CLONE_ARGS_SIZE_VER0 - #define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */ - -From cbabe8abf11e7e7fb49c123bae31efdd9bc8f1e8 Mon Sep 17 00:00:00 2001 -From: Christian Brauner <brauner@kernel.org> -Date: Tue, 9 Aug 2022 17:19:40 +0200 -Subject: [PATCH 3/3] build: check for FS_CONFIG_* header symbol in sys/mount.h - -Fixes: #4176 -Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com> ---- - meson.build | 59 +++++++++++++++++++++++++++++++++++++++++-- - src/lxc/mount_utils.h | 16 ++++++++++++ - 2 files changed, 73 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index e999542336..9f8a5de60c 100644 ---- a/meson.build -+++ b/meson.build -@@ -639,8 +639,7 @@ if cc.sizeof('struct mount_attr', prefix: decl_headers, args: '-D_GNU_SOURCE') > - found_types += 'struct mount_attr (sys/mount.h)' - else - srcconf.set10('HAVE_' + 'struct mount_attr'.underscorify().to_upper(), false) -- missing_types += 'struct mount_attr (sys/mount.h)' --endif -+ missing_types += 'struct mount_attr (sys/mount.h)' endif - - ## Types. - decl_headers = ''' -@@ -656,6 +655,62 @@ else - missing_types += 'struct mount_attr (linux/mount.h)' - endif - -+if cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG') -+ srcconf.set10('HAVE_' + 'FSCONFIG_SET_FLAG'.underscorify().to_upper(), true) -+ found_types += 'FSCONFIG_SET_FLAG' -+else -+ srcconf.set10('HAVE_' + 'FSCONFIG_SET_FLAG'.underscorify().to_upper(), false) -+ missing_types += 'FSCONFIG_SET_FLAG' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_STRING') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_STRING'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_STRING' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_STRING'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_STRING' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_BINARY') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_BINARY'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_BINARY' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_BINARY'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_BINARY' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_EMPTY') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_EMPTY'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_PATH_EMPTY' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_EMPTY'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_PATH_EMPTY' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_FD') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_FD'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_PATH_FD' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_FD'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_PATH_FD' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_CREATE') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_CREATE'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_CMD_CREATE' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_CREATE'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_CMD_CREATE' -+endif -+ -+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_RECONFIGURE') -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_RECONFIGURE'.underscorify().to_upper(), true) -+ found_types += 'FS_CONFIG_SET_CMD_RECONFIGURE' -+else -+ srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_RECONFIGURE'.underscorify().to_upper(), false) -+ missing_types += 'FS_CONFIG_SET_CMD_RECONFIGURE' -+endif -+ - ## Headers. - foreach ident: [ - ['bpf', '''#include <sys/syscall.h> -diff --git a/src/lxc/mount_utils.h b/src/lxc/mount_utils.h -index ea392672d8..fd34739459 100644 ---- a/src/lxc/mount_utils.h -+++ b/src/lxc/mount_utils.h -@@ -82,37 +82,53 @@ struct lxc_rootfs; - #endif - - /* fsconfig() commands */ -+#if !HAVE_FSCONFIG_SET_FLAG - #ifndef FSCONFIG_SET_FLAG - #define FSCONFIG_SET_FLAG 0 /* Set parameter, supplying no value */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_SET_STRING - #ifndef FSCONFIG_SET_STRING - #define FSCONFIG_SET_STRING 1 /* Set parameter, supplying a string value */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_SET_BINARY - #ifndef FSCONFIG_SET_BINARY - #define FSCONFIG_SET_BINARY 2 /* Set parameter, supplying a binary blob value */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_SET_PATH - #ifndef FSCONFIG_SET_PATH - #define FSCONFIG_SET_PATH 3 /* Set parameter, supplying an object by path */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_SET_PATH_EMPTY - #ifndef FSCONFIG_SET_PATH_EMPTY - #define FSCONFIG_SET_PATH_EMPTY 4 /* Set parameter, supplying an object by (empty) path */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_SET_FD - #ifndef FSCONFIG_SET_FD - #define FSCONFIG_SET_FD 5 /* Set parameter, supplying an object by fd */ - #endif -+#endif - -+#if !HAVE_FSCONFIG_CMD_CREATE - #ifndef FSCONFIG_CMD_CREATE - #define FSCONFIG_CMD_CREATE 6 /* Invoke superblock creation */ - #endif -+#endif - -+#if !FSCONFIG_CMD_RECONFIGURE - #ifndef FSCONFIG_CMD_RECONFIGURE - #define FSCONFIG_CMD_RECONFIGURE 7 /* Invoke superblock reconfiguration */ - #endif -+#endif - - /* fsmount() flags */ - #ifndef FSMOUNT_CLOEXEC diff --git a/app-containers/lxc/files/lxc-5.0.1-use-sd_bus_call_method_async-insteaf-of-asyncv.patch b/app-containers/lxc/files/lxc-5.0.1-use-sd_bus_call_method_async-insteaf-of-asyncv.patch deleted file mode 100644 index fe218ea0c3e6..000000000000 --- a/app-containers/lxc/files/lxc-5.0.1-use-sd_bus_call_method_async-insteaf-of-asyncv.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b0abedf60b40adf0f2fb3cf9dfee4bc601f7b39f Mon Sep 17 00:00:00 2001 -From: Chen Qi <Qi.Chen@windriver.com> -Date: Thu, 25 Aug 2022 05:45:53 -0700 -Subject: [PATCH] use sd_bus_call_method_async to replace the asyncv one - -The sd_bus_call_method_asyncv's 10th parameter is of type -va_list and supplying NULL when invoking it causes compilation -error. Just replace it with the async one. - -Signed-off-by: Chen Qi <Qi.Chen@windriver.com> ---- - meson.build | 4 ++-- - src/lxc/cgroups/cgfsng.c | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 21955a0504..f8bdcf4e83 100644 ---- a/meson.build -+++ b/meson.build -@@ -295,9 +295,9 @@ if not want_sd_bus.disabled() - has_sd_bus = false - endif - -- if not cc.has_function('sd_bus_call_method_asyncv', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd) -+ if not cc.has_function('sd_bus_call_method_async', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd) - if not sd_bus_optional -- error('libsystemd misses required sd_bus_call_method_asyncv function') -+ error('libsystemd misses required sd_bus_call_method_async function') - endif - - has_sd_bus = false -diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c -index 8a3615893f..d90e5385e1 100644 ---- a/src/lxc/cgroups/cgfsng.c -+++ b/src/lxc/cgroups/cgfsng.c -@@ -1232,7 +1232,7 @@ static int unpriv_systemd_create_scope(struct cgroup_ops *ops, struct lxc_conf * - if (r < 0) - return log_error(SYSTEMD_SCOPE_FAILED, "Failed to connect to user bus: %s", strerror(-r)); - -- r = sd_bus_call_method_asyncv(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL, NULL); -+ r = sd_bus_call_method_async(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL); - if (r < 0) - return log_error(SYSTEMD_SCOPE_FAILED, "Failed to subscribe to signals: %s", strerror(-r)); - diff --git a/app-containers/lxc/lxc-5.0.1-r2.ebuild b/app-containers/lxc/lxc-5.0.1-r2.ebuild deleted file mode 100644 index 5abe3f257413..000000000000 --- a/app-containers/lxc/lxc-5.0.1-r2.ebuild +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit bash-completion-r1 linux-info meson optfeature systemd toolchain-funcs verify-sig - -DESCRIPTION="A userspace interface for the Linux kernel containment features" -HOMEPAGE="https://linuxcontainers.org/ https://github.com/lxc/lxc" -SRC_URI="https://linuxcontainers.org/downloads/lxc/${P}.tar.gz - verify-sig? ( https://linuxcontainers.org/downloads/lxc/${P}.tar.gz.asc )" - -LICENSE="GPL-2 LGPL-2.1 LGPL-3" -SLOT="0" -KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv x86" -IUSE="apparmor +caps examples io-uring lto man pam seccomp selinux ssl systemd test +tools" - -RDEPEND="acct-group/lxc - acct-user/lxc - apparmor? ( sys-libs/libapparmor ) - caps? ( sys-libs/libcap[static-libs] ) - io-uring? ( >=sys-libs/liburing-2:= ) - pam? ( sys-libs/pam ) - seccomp? ( sys-libs/libseccomp ) - selinux? ( sys-libs/libselinux ) - ssl? ( dev-libs/openssl:0= ) - systemd? ( sys-apps/systemd:= ) - tools? ( sys-libs/libcap[static-libs] )" -DEPEND="${RDEPEND} - sys-kernel/linux-headers" -BDEPEND="virtual/pkgconfig - man? ( app-text/docbook2X ) - verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )" - -RESTRICT="!test? ( test )" - -CONFIG_CHECK="~!NETPRIO_CGROUP - ~CGROUPS - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - - ~MEMCG - ~NAMESPACES - ~NET_NS - ~PID_NS - - ~POSIX_MQUEUE - ~USER_NS - ~UTS_NS - ~VETH" - -ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers" -ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking" -ERROR_MEMCG="CONFIG_MEMCG: needed for memory resource control in containers" -ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network" -ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command" -ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info" -ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking" - -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc - -DOCS=( AUTHORS CONTRIBUTING MAINTAINERS README.md doc/FAQ.txt ) - -PATCHES=( "${FILESDIR}"/lxc-5.0.1-glibc-2.36.patch - "${FILESDIR}"/lxc-5.0.1-use-sd_bus_call_method_async-insteaf-of-asyncv.patch ) - -pkg_setup() { - linux-info_pkg_setup -} - -src_configure() { - local emesonargs=( - --localstatedir "${EPREFIX}/var" - - -Dcoverity-build=false - -Doss-fuzz=false - - -Dcommands=true - -Dmemfd-rexec=true - -Dthread-safety=true - - $(meson_use apparmor) - $(meson_use caps capabilities) - $(meson_use examples) - $(meson_use io-uring io-uring-event-loop) - $(meson_use lto b_lto) - $(meson_use man) - $(meson_use pam pam-cgroup) - $(meson_use seccomp) - $(meson_use selinux) - $(meson_use ssl openssl) - $(meson_use test tests) - $(meson_use tools) - - -Ddata-path=/var/lib/lxc - -Ddoc-path=/usr/share/doc/${PF} - -Dlog-path=/var/log/lxc - -Drootfs-mount-path=/var/lib/lxc/rootfs - -Druntime-path=/run - ) - - if use systemd; then - local emesonargs+=( -Dinit-script="systemd" ) - local emesonargs+=( -Dsd-bus=enabled ) - else - local emesonargs+=( -Dinit-script="sysvinit" ) - local emesonargs+=( -Dsd-bus=disabled ) - fi - - use tools && local emesonargs+=( -Dcapabilities=true ) - - if $(tc-ld-is-gold) || $(tc-ld-is-lld); then - local emesonargs+=( -Db_lto_mode=thin ) - else - local emesonargs+=( -Db_lto_mode=default ) - fi - - meson_src_configure -} - -src_install() { - meson_src_install - - # The main bash-completion file will collide with lxd, need to relocate and update symlinks. - mkdir -p "${ED}"/$(get_bashcompdir) || die "Failed to create bashcompdir." - - if use tools; then - bashcomp_alias lxc-start lxc-{attach,autostart,cgroup,checkpoint,config,console,copy,create,destroy,device,execute,freeze,info,ls,monitor,snapshot,stop,top,unfreeze,unshare,usernsexec,wait} - else - bashcomp_alias lxc-start lxc-usernsexec - fi - - keepdir /var/lib/cache/lxc /var/lib/lib/lxc - - find "${ED}" -name '*.la' -delete -o -name '*.a' -delete || die - - # Replace upstream sysvinit/systemd files. - if use systemd; then - rm -r "${D}$(systemd_get_systemunitdir)" || die "Failed to remove systemd lib dir" - else - rm "${ED}"/etc/init.d/lxc-{containers,net} || die "Failed to remove sysvinit scripts" - fi - - newinitd "${FILESDIR}/${PN}.initd.8" ${PN} - systemd_newunit "${FILESDIR}"/lxc-monitord.service.5.0.0 lxc-monitord.service - systemd_newunit "${FILESDIR}"/lxc-net.service.5.0.0 lxc-net.service - systemd_newunit "${FILESDIR}"/lxc.service-5.0.0 lxc.service - systemd_newunit "${FILESDIR}"/lxc_at.service.5.0.0 "lxc@.service" - - if ! use apparmor; then - sed -i '/lxc-apparmor-load/d' "${D}$(systemd_get_systemunitdir)/lxc.service" || die "Failed to remove apparmor references from lxc.service systemd unit." - fi -} - -pkg_postinst() { - elog "Please refer to " - elog "https://wiki.gentoo.org/wiki/LXC for introduction and usage guide." - elog - elog "Run 'lxc-checkconfig' to see optional kernel features." - elog - - optfeature "automatic template scripts" app-containers/lxc-templates - optfeature "Debian-based distribution container image support" dev-util/debootstrap - optfeature "snapshot & restore functionality" sys-process/criu -} |