lxc: bump to 2.1.0 4973/head
authorMarko Ratkaj <marko.ratkaj@sartura.hr>
Wed, 18 Oct 2017 07:49:54 +0000 (09:49 +0200)
committerMarko Ratkaj <marko.ratkaj@sartura.hr>
Thu, 19 Oct 2017 15:09:25 +0000 (17:09 +0200)
Bump LXC package from 1.1.5 to 2.1.0. Version 2.x includes many
improvements and optimizations.

https://linuxcontainers.org/lxc/news/

Some tools like lxc-top are rewritten in C and are no longer broken and
dependent on lua.

Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
utils/lxc/Config.in
utils/lxc/Makefile
utils/lxc/patches/001-compile.patch [new file with mode: 0644]
utils/lxc/patches/002-compile.patch [new file with mode: 0644]
utils/lxc/patches/003-compile.patch [new file with mode: 0644]
utils/lxc/patches/010-compile.patch
utils/lxc/patches/015-getline.patch
utils/lxc/patches/020-lxc-checkconfig.patch
utils/lxc/patches/025-remove-unsupported-option.patch
utils/lxc/patches/030-lxc-download.patch [deleted file]
utils/lxc/patches/035-fix-undefined-lfd.patch [deleted file]

index 618fde0a03e105162c09f503e6ffa0ebaea3645f..bab69d159e6c3972fa35d703587ec045bb9c1b98 100644 (file)
@@ -7,6 +7,13 @@ config LXC_KERNEL_OPTIONS
        select KERNEL_CGROUPS
        select KERNEL_NAMESPACES
        select KERNEL_LXC_MISC
        select KERNEL_CGROUPS
        select KERNEL_NAMESPACES
        select KERNEL_LXC_MISC
+       select KERNEL_CGROUP_SCHED
+       select KERNEL_FAIR_GROUP_SCHED
+       select KERNEL_RT_GROUP_SCHED
+       select KERNEL_CGROUP_CPUACCT
+       select KERNEL_MEMCG
+       select KERNEL_MEMCG_KMEM
+       select KERNEL_CPUSETS
        help
          Select needed kernel options for LXC related utilities. Options
          include cgroups, namespaces and other miscellaneous options. These
        help
          Select needed kernel options for LXC related utilities. Options
          include cgroups, namespaces and other miscellaneous options. These
@@ -34,4 +41,12 @@ config LXC_SECCOMP
          Build LXC with support for seccomp filters.
          Select libseccomp which also pulls-in the needed kernel features.
 
          Build LXC with support for seccomp filters.
          Select libseccomp which also pulls-in the needed kernel features.
 
+config LXC_NETWORKING
+       bool "Enable networking support for LXC containers"
+       default n
+       select PACKAGE_kmod-veth
+       select PACKAGE_kmod-macvlan
+       help
+         Enable "veth pair device" and "macvlan"
+
 endmenu
 endmenu
index 0862cc30b1b6f5696eb32c5afa64cbf7e58b3834..53f52c3ea1a9566a2718262f8a110f2cb0eac831 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lxc
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lxc
-PKG_VERSION:=1.1.5
-PKG_RELEASE:=3
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
 
 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
 
 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
-PKG_HASH:=9588ad1b04e114ee7370f690c65131e28098b28d2521d97c73557d11897ed0be
+PKG_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/
+PKG_HASH:=394407305a409eb1f95fe06e7718acfe89b1d5df267b0c6aafb1d714e2038de2
 
 PKG_BUILD_DEPENDS:=lua
 PKG_BUILD_PARALLEL:=1
 
 PKG_BUILD_DEPENDS:=lua
 PKG_BUILD_PARALLEL:=1
@@ -27,24 +27,20 @@ PKG_FIXUP:=autoreconf
 include $(INCLUDE_DIR)/package.mk
 
 LXC_APPLETS_BIN += \
 include $(INCLUDE_DIR)/package.mk
 
 LXC_APPLETS_BIN += \
-       attach autostart cgroup clone config console create destroy device \
+       attach autostart cgroup copy config console create destroy device \
        execute freeze info monitor snapshot start stop unfreeze unshare \
        execute freeze info monitor snapshot start stop unfreeze unshare \
-       usernsexec wait
+       usernsexec wait top ls
 
 LXC_APPLETS_LIB += \
        monitord user-nic
 
 LXC_SCRIPTS += \
 
 LXC_APPLETS_LIB += \
        monitord user-nic
 
 LXC_SCRIPTS += \
-       checkconfig ls top
+       checkconfig
 
 DEPENDS_APPLETS = +libpthread +libcap +liblxc
 
 DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
 
 
 DEPENDS_APPLETS = +libpthread +libcap +liblxc
 
 DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
 
-DEPENDS_ls = +lxc-config
-DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
-
-
 define Package/lxc/Default
   SECTION:=utils
   CATEGORY:=Utilities
 define Package/lxc/Default
   SECTION:=utils
   CATEGORY:=Utilities
@@ -118,7 +114,7 @@ endef
 define Package/lxc-lua
   $(call Package/lxc/Default)
   TITLE:=LXC Lua bindings
 define Package/lxc-lua
   $(call Package/lxc/Default)
   TITLE:=LXC Lua bindings
-  DEPENDS:= lxc +liblua +liblxc +luafilesystem
+  DEPENDS:= lxc +liblua +liblxc
 endef
 
 define Package/lxc-init
 endef
 
 define Package/lxc-init
diff --git a/utils/lxc/patches/001-compile.patch b/utils/lxc/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..052a5dc
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lxc/storage/overlay.c
++++ b/src/lxc/storage/overlay.c
+@@ -747,7 +747,7 @@ int ovl_mkdir(const struct mntent *mntent, const struct lxc_rootfs *rootfs,
+       char lxcpath[MAXPATHLEN];
+       char **opts;
+       int ret;
+-      size_t arrlen, dirlen, i, len, rootfslen;
++      size_t arrlen, i, len, rootfslen, dirlen = 0;
+       int fret = -1;
+       char *rootfs_dir = NULL, *rootfs_path = NULL, *upperdir = NULL,
+            *workdir = NULL;
diff --git a/utils/lxc/patches/002-compile.patch b/utils/lxc/patches/002-compile.patch
new file mode 100644 (file)
index 0000000..9a98777
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/lxc/storage/aufs.h
++++ b/src/lxc/storage/aufs.h
+@@ -24,7 +24,6 @@
+ #ifndef __LXC_AUFS_H
+ #define __LXC_AUFS_H
+-#define _GNU_SOURCE
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdint.h>
diff --git a/utils/lxc/patches/003-compile.patch b/utils/lxc/patches/003-compile.patch
new file mode 100644 (file)
index 0000000..408d5e8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lxc/confile_utils.c
++++ b/src/lxc/confile_utils.c
+@@ -690,7 +690,7 @@ bool parse_limit_value(const char **value, unsigned long *res)
+       char *endptr = NULL;
+       if (strncmp(*value, "unlimited", sizeof("unlimited") - 1) == 0) {
+-              *res = RLIM_INFINITY;
++              *res = (unsigned long)RLIM_INFINITY;
+               *value += sizeof("unlimited") - 1;
+               return true;
+       }
index 6f12c382abc6a67ced413201aac50b6f4fedbea9..903e4cd7bd000396ee5369be969df699c629991a 100644 (file)
@@ -1,19 +1,20 @@
 --- a/configure.ac
 +++ b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -31,30 +31,6 @@ AC_CANONICAL_HOST
- AM_PROG_CC_C_O
- AC_GNU_SOURCE
+@@ -47,34 +47,6 @@ AC_GNU_SOURCE
+ LT_INIT
+ AC_SUBST([LIBTOOL_DEPS])
  
 -# Detect the distribution. This is used for the default configuration and
 -# for some distro-specific build options.
 -AC_MSG_CHECKING([host distribution])
  
 -# Detect the distribution. This is used for the default configuration and
 -# for some distro-specific build options.
 -AC_MSG_CHECKING([host distribution])
--AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, paldo, openmandriva or pardus.]))
+-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux, altlinux.]))
 -if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
 -      with_distro=`lsb_release -is`
 -fi
 -if test "z$with_distro" = "z"; then
 -      AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
 -      AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
 -if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
 -      with_distro=`lsb_release -is`
 -fi
 -if test "z$with_distro" = "z"; then
 -      AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
 -      AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
+-      AC_CHECK_FILE(/etc/sparclinux-release,with_distro="sparclinux")
 -      AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
 -      AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
 -      AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
 -      AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
 -      AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
 -      AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
 -      AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
 -      AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
 -      AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
 -      AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
 -      AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
 -      AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
+-      AC_CHECK_FILE(/etc/plamo-version,with_distro="plamo")
 -      AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
 -      AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
 -      AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
 -      AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
+-      AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
+-      AC_CHECK_FILE(/etc/pld-release,with_distro="pld")
 -fi
 -with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
 -
 -fi
 -with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
 -
- if test "z$with_distro" = "z"; then
-       with_distro="unknown"
+ if test "z$with_distro" = "zforsparc"; then
+       with_distro="sparclinux"
  fi
  fi
index 2dfaa9bea5a652cc708604ce3658bbd66828ed50..c91e010c5c58559cb6a8289fcef3781c932270df 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/lxc/utils.h
 +++ b/src/lxc/utils.h
 --- a/src/lxc/utils.h
 +++ b/src/lxc/utils.h
-@@ -41,11 +41,7 @@ extern int mkdir_p(const char *dir, mode
+@@ -59,11 +59,7 @@ extern int mkdir_p(const char *dir, mode_t mode);
  extern char *get_rundir(void);
  
  /* Define getline() if missing from the C library */
  extern char *get_rundir(void);
  
  /* Define getline() if missing from the C library */
index 272f76b052a11a62ffb4f6fdc33c853118b9f427..0e644ea47653b899fa7c3f185d76aaec2e13a937 100644 (file)
@@ -1,8 +1,8 @@
---- a/src/lxc/lxc-checkconfig.in
-+++ b/src/lxc/lxc-checkconfig.in
-@@ -4,6 +4,17 @@
+--- a/src/lxc/tools/lxc-checkconfig.in
++++ b/src/lxc/tools/lxc-checkconfig.in
+@@ -3,6 +3,17 @@
+ # Allow environment variables to override config
  : ${CONFIG:=/proc/config.gz}
  : ${CONFIG:=/proc/config.gz}
- : ${GREP:=zgrep}
  : ${MODNAME:=configs}
 +: ${ZGREP:=zgrep}
 +: ${GUNZIP:=gunzip}
  : ${MODNAME:=configs}
 +: ${ZGREP:=zgrep}
 +: ${GUNZIP:=gunzip}
@@ -16,5 +16,5 @@
 +      GREP=grep
 +fi
  
 +      GREP=grep
 +fi
  
SETCOLOR_SUCCESS="printf \\033[1;32m"
- SETCOLOR_FAILURE="printf \\033[1;31m"
CAT="cat"
index cb0a9f0d2a3084e72f2fc04b83079315e5555cd3..b20870890bb1ddc81fa8eca327870890a0cade36 100644 (file)
@@ -1,19 +1,24 @@
 --- a/templates/lxc-download.in
 +++ b/templates/lxc-download.in
 --- a/templates/lxc-download.in
 +++ b/templates/lxc-download.in
-@@ -494,15 +494,7 @@ fi
+@@ -505,20 +505,7 @@ fi
  # Unpack the rootfs
  echo "Unpacking the rootfs"
  
 -EXCLUDES=""
 -excludelist=$(relevant_file excludes)
 -if [ -f "${excludelist}" ]; then
  # Unpack the rootfs
  echo "Unpacking the rootfs"
  
 -EXCLUDES=""
 -excludelist=$(relevant_file excludes)
 -if [ -f "${excludelist}" ]; then
--    while read line; do
--        EXCLUDES="$EXCLUDES --exclude=$line"
--    done < $excludelist
+-    while read -r line; do
+-        EXCLUDES="${EXCLUDES} --exclude=${line}"
+-    done < "${excludelist}"
 -fi
 -
 -fi
 -
+-# Do not surround ${EXCLUDES} by quotes. This does not work. The solution could
+-# use array but this is not POSIX compliant. The only POSIX compliant solution
+-# is to use a function wrapper, but the latter can't be used here as the args
+-# are dynamic. We thus need to ignore the warning brought by shellcheck.
+-# shellcheck disable=SC2086
 -tar  --anchored ${EXCLUDES} --numeric-owner -xpJf \
 +tar --numeric-owner -xpJf \
 -tar  --anchored ${EXCLUDES} --numeric-owner -xpJf \
 +tar --numeric-owner -xpJf \
-     ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
+     "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}"
  
  
- mkdir -p ${LXC_ROOTFS}/dev/pts/
+ mkdir -p "${LXC_ROOTFS}/dev/pts/"
diff --git a/utils/lxc/patches/030-lxc-download.patch b/utils/lxc/patches/030-lxc-download.patch
deleted file mode 100644 (file)
index 295bae0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
---- a/templates/lxc-download.in
-+++ b/templates/lxc-download.in
-@@ -39,7 +39,7 @@ DOWNLOAD_LIST_IMAGES="false"
- DOWNLOAD_MODE="system"
- DOWNLOAD_READY_GPG="false"
- DOWNLOAD_RELEASE=
--DOWNLOAD_SERVER="images.linuxcontainers.org"
-+DOWNLOAD_SERVER="virtualwrt.org/containers/"
- DOWNLOAD_SHOW_GPG_WARNING="true"
- DOWNLOAD_SHOW_HTTP_WARNING="true"
- DOWNLOAD_TARGET="system"
-@@ -257,14 +257,6 @@ for bin in tar xz wget; do
-     fi
- done
--# Check for GPG
--if [ "$DOWNLOAD_VALIDATE" = "true" ]; then
--    if ! type gpg >/dev/null 2>&1; then
--        echo "ERROR: Missing recommended tool: gpg" 1>&2
--        echo "You can workaround this by using --no-validate." 1>&2
--        exit 1
--    fi
--fi
- # Check that we have all variables we need
- if [ -z "$LXC_NAME" ] || [ -z "$LXC_PATH" ] || [ -z "$LXC_ROOTFS" ]; then
-@@ -456,16 +448,9 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ];
-         echo "Downloading the rootfs"
-         download_file $DOWNLOAD_URL/rootfs.tar.xz \
-             ${DOWNLOAD_TEMP}/rootfs.tar.xz normal
--        download_sig  $DOWNLOAD_URL/rootfs.tar.xz.asc \
--             ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc normal
--        gpg_validate ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc
--
-         echo "Downloading the metadata"
-         download_file $DOWNLOAD_URL/meta.tar.xz \
-             ${DOWNLOAD_TEMP}/meta.tar.xz normal
--        download_sig  $DOWNLOAD_URL/meta.tar.xz.asc \
--            ${DOWNLOAD_TEMP}/meta.tar.xz.asc normal
--        gpg_validate ${DOWNLOAD_TEMP}/meta.tar.xz.asc
-         if [ -d $LXC_CACHE_PATH ]; then
-             rm -Rf $LXC_CACHE_PATH
diff --git a/utils/lxc/patches/035-fix-undefined-lfd.patch b/utils/lxc/patches/035-fix-undefined-lfd.patch
deleted file mode 100644 (file)
index 42e194c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/src/lxc/bdev.c
-+++ b/src/lxc/bdev.c
-@@ -1939,7 +1939,7 @@ static int find_free_loopdev(int *retfd,
- static int loop_mount(struct bdev *bdev)
- {
--      int lfd, ffd = -1, ret = -1;
-+      int lfd = -1, ffd = -1, ret = -1;
-       struct loop_info64 lo;
-       char loname[100];
-@@ -1977,7 +1977,7 @@ out:
-       if (ffd > -1)
-               close(ffd);
-       if (ret < 0) {
--              close(lfd);
-+              if (lfd > -1) close(lfd);
-               bdev->lofd = -1;
-       }
-       return ret;