]> git.pld-linux.org Git - packages/lxc.git/commitdiff
- up to 4.0.12 auto/th/lxc-4.0.12-1
authormis <mistoo@gmail.com>
Mon, 21 Nov 2022 23:36:09 +0000 (00:36 +0100)
committermis <mistoo@gmail.com>
Mon, 21 Nov 2022 23:36:09 +0000 (00:36 +0100)
glibc2_36.patch [new file with mode: 0644]
lxc-net.patch
lxc.spec

diff --git a/glibc2_36.patch b/glibc2_36.patch
new file mode 100644 (file)
index 0000000..e18a3c2
--- /dev/null
@@ -0,0 +1,142 @@
+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] build: detect where struct mount_attr is declared
+
+Fixes: #4176
+Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
+[Retrieved from:
+https://github.com/lxc/lxc/commit/c1115e1503bf955c97f4cf3b925a6a9f619764c3]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ 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/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);
+ }
+--- a/configure.ac     2022-11-21 22:26:58.649999866 +0100
++++ b/configure.ac     2022-11-21 23:13:32.826666552 +0100
+@@ -701,7 +701,8 @@
+ # Check for some syscalls functions
+ AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create move_mount open_tree execveat clone3 fsopen fspick fsconfig fsmount openat2 close_range statvfs mount_setattr sigdescr_np])
+ AC_CHECK_TYPES([__aligned_u64], [], [], [[#include <linux/types.h>]])
+-AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]])
++AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <sys/mount.h>]])
++AC_CHECK_TYPES([struct mount_attr], AC_DEFINE(HAVE_UAPI_STRUCT_MOUNT_ATTR,1,[mount_attr from <linux/mount.h>]), [], [[#include <linux/mount.h>]])
+ AC_CHECK_TYPES([struct open_how], [], [], [[#include <linux/openat2.h>]])
+ AC_CHECK_TYPES([struct clone_args], [], [], [[#include <linux/sched.h>]])
+ AC_CHECK_MEMBERS([struct clone_args.set_tid],[],[],[[#include <linux/sched.h>]])
index bf1b00eaa6dfb0f147527392aec08037cfe141cd..073624ce037b246519a711d7861ce593d9eeb7fa 100644 (file)
@@ -1,7 +1,6 @@
-diff -urNp -x '*.orig' lxc-4.0.8.org/config/init/common/lxc-net.in lxc-4.0.8/config/init/common/lxc-net.in
---- lxc-4.0.8.org/config/init/common/lxc-net.in        2021-04-30 20:16:25.000000000 +0200
-+++ lxc-4.0.8/config/init/common/lxc-net.in    2021-05-02 22:01:52.309594885 +0200
-@@ -26,6 +26,17 @@ LXC_IPV6_NAT="false"
+--- a/config/init/common/lxc-net.in    2022-11-21 23:35:46.490227758 +0100
++++ b/config/init/common/lxc-net.in    2022-11-21 23:36:44.836896223 +0100
+@@ -27,6 +27,16 @@
  
  [ ! -f $distrosysconfdir/lxc ] || . $distrosysconfdir/lxc
  
@@ -15,21 +14,18 @@ diff -urNp -x '*.orig' lxc-4.0.8.org/config/init/common/lxc-net.in lxc-4.0.8/con
 +[ ! -f $distrosysconfdir/lxc_macvlan ] || . $distrosysconfdir/lxc_macvlan
 +[ ! -f $macvlan ] || . $macvlan
 +
-+
- use_iptables_lock="-w"
- iptables -w -L -n > /dev/null 2>&1 || use_iptables_lock=""
-@@ -51,7 +62,9 @@ _ifup() {
-     ip link set dev ${LXC_BRIDGE} up
+ use_nft() {
+     [ -n "$NFT" ] && nft list ruleset > /dev/null 2>&1 && [ "$LXC_USE_NFT" = "true" ]
+ }
+@@ -112,6 +122,7 @@
  }
  
-+
  start() {
 +    [ "x$USE_LXC_MACVLAN" = "xtrue" ] && { macvlan_start; exit $?; }
      [ "x$USE_LXC_BRIDGE" = "xtrue" ] || { exit 0; }
  
      [ ! -f "${varrun}/network_up" ] || { echo "lxc-net is already running"; exit 1; }
-@@ -145,6 +158,7 @@ start() {
+@@ -222,6 +233,7 @@
  }
  
  stop() {
index 41de09e93783fdbed5b3e953e204b97a94c1738a..abb4682b263aa2595f541151c72c3e302eb793ba 100644 (file)
--- a/lxc.spec
+++ b/lxc.spec
 Summary:       Linux Containers userspace tools
 Summary(pl.UTF-8):     Narzędzia do kontenerów linuksowych (LXC)
 Name:          lxc
-Version:       4.0.8
-Release:       3
+Version:       4.0.12
+Release:       1
 License:       LGPL v2.1+
 Group:         Applications/System
 Source0:       https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
-# Source0-md5: d70039fe415ff3f9acbb6d1a78a12c52
+# Source0-md5: 4818cb60b1418ca97a8d7c159f9f872b
 Source1:       %{name}-pld.in.sh
 # lxc-net based on bridge, macvlan is an alternative/supported lxc network
 Source2:       %{name}_macvlan.sysconfig
@@ -26,6 +26,7 @@ Source3:      %{name}_macvlan
 Patch1:                %{name}-net.patch
 Patch2:                x32.patch
 Patch3:                no-Werror.patch
+Patch4:                glibc2_36.patch
 URL:           https://www.linuxcontainers.org/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -159,6 +160,7 @@ bashowe uzupełnianie nazw dla LXC.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 cp -p %{SOURCE1} templates/lxc-pld.in
 
@@ -390,3 +392,4 @@ fi
 %files -n bash-completion-%{name}
 %defattr(644,root,root,755)
 %{bash_compdir}/lxc
+%{bash_compdir}/lxc-*
This page took 0.068646 seconds and 4 git commands to generate.