1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 12:23:59 +02:00

lxc: bump to 2.1.0

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>
This commit is contained in:
Marko Ratkaj 2017-10-18 09:49:54 +02:00
parent 9b9ef2375d
commit 9672b88d2a
11 changed files with 84 additions and 95 deletions

View File

@ -7,6 +7,13 @@ config LXC_KERNEL_OPTIONS
select KERNEL_CGROUPS select KERNEL_CGROUPS
select KERNEL_NAMESPACES select KERNEL_NAMESPACES
select KERNEL_LXC_MISC 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 help
Select needed kernel options for LXC related utilities. Options Select needed kernel options for LXC related utilities. Options
include cgroups, namespaces and other miscellaneous options. These include cgroups, namespaces and other miscellaneous options. These
@ -34,4 +41,12 @@ config LXC_SECCOMP
Build LXC with support for seccomp filters. Build LXC with support for seccomp filters.
Select libseccomp which also pulls-in the needed kernel features. 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

View File

@ -8,15 +8,15 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=lxc PKG_NAME:=lxc
PKG_VERSION:=1.1.5 PKG_VERSION:=2.1.0
PKG_RELEASE:=3 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_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/
PKG_HASH:=9588ad1b04e114ee7370f690c65131e28098b28d2521d97c73557d11897ed0be PKG_HASH:=394407305a409eb1f95fe06e7718acfe89b1d5df267b0c6aafb1d714e2038de2
PKG_BUILD_DEPENDS:=lua PKG_BUILD_DEPENDS:=lua
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
@ -27,24 +27,20 @@ PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
LXC_APPLETS_BIN += \ 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 += \ LXC_APPLETS_LIB += \
monitord user-nic monitord user-nic
LXC_SCRIPTS += \ LXC_SCRIPTS += \
checkconfig ls top checkconfig
DEPENDS_APPLETS = +libpthread +libcap +liblxc DEPENDS_APPLETS = +libpthread +libcap +liblxc
DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
DEPENDS_ls = +lxc-config
DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
define Package/lxc/Default define Package/lxc/Default
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
@ -118,7 +114,7 @@ endef
define Package/lxc-lua define Package/lxc-lua
$(call Package/lxc/Default) $(call Package/lxc/Default)
TITLE:=LXC Lua bindings TITLE:=LXC Lua bindings
DEPENDS:= lxc +liblua +liblxc +luafilesystem DEPENDS:= lxc +liblua +liblxc
endef endef
define Package/lxc-init define Package/lxc-init

View File

@ -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;

View File

@ -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>

View File

@ -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;
}

View File

@ -1,19 +1,20 @@
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -31,30 +31,6 @@ AC_CANONICAL_HOST @@ -47,34 +47,6 @@ AC_GNU_SOURCE
AM_PROG_CC_C_O LT_INIT
AC_GNU_SOURCE AC_SUBST([LIBTOOL_DEPS])
-# Detect the distribution. This is used for the default configuration and -# Detect the distribution. This is used for the default configuration and
-# for some distro-specific build options. -# for some distro-specific build options.
-AC_MSG_CHECKING([host distribution]) -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 -if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
- with_distro=`lsb_release -is` - with_distro=`lsb_release -is`
-fi -fi
-if test "z$with_distro" = "z"; then -if test "z$with_distro" = "z"; then
- AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") - AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
- AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle") - 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/centos-release,with_distro="centos")
- AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora") - AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
- AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") - AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
@ -21,13 +22,16 @@
- AC_CHECK_FILE(/etc/debian_version,with_distro="debian") - AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
- AC_CHECK_FILE(/etc/arch-release,with_distro="arch") - AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
- AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") - 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/frugalware-release,with_distro="frugalware")
- AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") - AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
- AC_CHECK_FILE(/etc/mandriva-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/pardus-release,with_distro="pardus")
- AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
- AC_CHECK_FILE(/etc/pld-release,with_distro="pld")
-fi -fi
-with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'` -with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
- -
if test "z$with_distro" = "z"; then if test "z$with_distro" = "zforsparc"; then
with_distro="unknown" with_distro="sparclinux"
fi fi

View File

@ -1,6 +1,6 @@
--- a/src/lxc/utils.h --- a/src/lxc/utils.h
+++ b/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); extern char *get_rundir(void);
/* Define getline() if missing from the C library */ /* Define getline() if missing from the C library */

View File

@ -1,8 +1,8 @@
--- a/src/lxc/lxc-checkconfig.in --- a/src/lxc/tools/lxc-checkconfig.in
+++ b/src/lxc/lxc-checkconfig.in +++ b/src/lxc/tools/lxc-checkconfig.in
@@ -4,6 +4,17 @@ @@ -3,6 +3,17 @@
# Allow environment variables to override config
: ${CONFIG:=/proc/config.gz} : ${CONFIG:=/proc/config.gz}
: ${GREP:=zgrep}
: ${MODNAME:=configs} : ${MODNAME:=configs}
+: ${ZGREP:=zgrep} +: ${ZGREP:=zgrep}
+: ${GUNZIP:=gunzip} +: ${GUNZIP:=gunzip}
@ -16,5 +16,5 @@
+ GREP=grep + GREP=grep
+fi +fi
SETCOLOR_SUCCESS="printf \\033[1;32m" CAT="cat"
SETCOLOR_FAILURE="printf \\033[1;31m"

View File

@ -1,19 +1,24 @@
--- a/templates/lxc-download.in --- a/templates/lxc-download.in
+++ b/templates/lxc-download.in +++ b/templates/lxc-download.in
@@ -494,15 +494,7 @@ fi @@ -505,20 +505,7 @@ fi
# Unpack the rootfs # Unpack the rootfs
echo "Unpacking the rootfs" echo "Unpacking the rootfs"
-EXCLUDES="" -EXCLUDES=""
-excludelist=$(relevant_file excludes) -excludelist=$(relevant_file excludes)
-if [ -f "${excludelist}" ]; then -if [ -f "${excludelist}" ]; then
- while read line; do - while read -r line; do
- EXCLUDES="$EXCLUDES --exclude=$line" - EXCLUDES="${EXCLUDES} --exclude=${line}"
- done < $excludelist - 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 --anchored ${EXCLUDES} --numeric-owner -xpJf \
+tar --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/"

View File

@ -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

View File

@ -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;