From f33590430a47430d09a764aa7e4d2717a8068089 Mon Sep 17 00:00:00 2001 From: trli Date: Mon, 7 Oct 2024 21:39:21 +0800 Subject: [PATCH] update lxc --- utils/lxc/Makefile | 49 ++++++++++--------- .../lxc/patches/010-Remove-distro-check.patch | 44 ----------------- utils/lxc/patches/020-lxc-checkconfig.patch | 19 ++++--- .../025-remove-unsupported-option.patch | 21 +++++--- 4 files changed, 49 insertions(+), 84 deletions(-) delete mode 100644 utils/lxc/patches/010-Remove-distro-check.patch diff --git a/utils/lxc/Makefile b/utils/lxc/Makefile index 19fd00f5..1e51c0a2 100644 --- a/utils/lxc/Makefile +++ b/utils/lxc/Makefile @@ -9,22 +9,33 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lxc -PKG_VERSION:=4.0.12 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=6.0.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/ -PKG_HASH:=db242f8366fc63e8c7588bb2017b354173cf3c4b20abc18780debdc48b14d3ef +PKG_HASH:=1930aa10d892db8531d1353d15f7ebf5913e74a19e134423e4d074c07f2d6e8b PKG_MAINTAINER:=Marko Ratkaj PKG_LICENSE:=LGPL-2.1-or-later BSD-2-Clause GPL-2.0 - -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 +PKG_LICENSE_FILES:=COPYING LICENSE.GPL2 LICENSE.LGPL2.1 +PKG_CPE_ID:=cpe:/a:linuxcontainers:lxc +PKG_BUILD_FLAGS:=no-mips16 include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/meson.mk + +MESON_ARGS += \ + -Db_lto=$(if $(findstring mips,$(CONFIG_ARCH)),false,true) \ + -Dwerror=false \ + -Dinit-script=sysvinit \ + -Dman=false \ + -Dapparmor=false \ + -Dselinux=false \ + -Dseccomp=$(if $(CONFIG_LXC_SECCOMP),true,false) \ + -Dexamples=false \ + -Db_pie=true \ + -Druntime-path=/var/run LXC_APPLETS_BIN += \ attach autostart cgroup copy config console create destroy device \ @@ -61,6 +72,10 @@ define Package/lxc-auto DEPENDS+=+lxc-start +lxc-stop endef +define Package/lxc-auto/postinst +[ -n "$${IPKG_INSTROOT}" ] || [ "$${PKG_UPGRADE}" = 1 ] || /etc/init.d/lxc-auto boot +endef + define Package/lxc-auto/description LXC is the userspace control package for Linux Containers, a lightweight virtual system mechanism sometimes described as "chroot on steroids". @@ -122,7 +137,7 @@ define Package/liblxc SECTION:=libs CATEGORY:=Libraries TITLE:=LXC userspace library - DEPENDS+= +libcap +libpthread +LXC_SECCOMP:libseccomp +libopenssl + DEPENDS+= +libcap +libpthread +LXC_SECCOMP:libseccomp +libopenssl +libdbus endef define Package/lxc-init @@ -131,17 +146,6 @@ define Package/lxc-init DEPENDS+= +liblxc endef -CONFIGURE_ARGS += \ - --disable-werror \ - --disable-rpath \ - --disable-doc \ - --disable-api-docs \ - --disable-apparmor \ - --disable-selinux \ - --$(if $(CONFIG_LXC_SECCOMP),en,dis)able-seccomp \ - --enable-capabilities \ - --disable-examples - ifdef CONFIG_USE_MIPS16 TARGET_CFLAGS += -minterlink-mips16 endif @@ -258,7 +262,6 @@ define GenPlugin $$(eval $$(call BuildPackage,lxc-$(1))) endef - $(eval $(call BuildPackage,lxc)) $(eval $(call BuildPackage,lxc-common)) $(eval $(call BuildPackage,lxc-hooks)) @@ -269,5 +272,5 @@ $(eval $(call BuildPackage,lxc-init)) $(eval $(call BuildPackage,lxc-auto)) $(eval $(call BuildPackage,lxc-unprivileged)) $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin"))) -$(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc"))) -$(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin"))) +$(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/libexec/lxc"))) +$(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin"))) \ No newline at end of file diff --git a/utils/lxc/patches/010-Remove-distro-check.patch b/utils/lxc/patches/010-Remove-distro-check.patch deleted file mode 100644 index 262a9475..00000000 --- a/utils/lxc/patches/010-Remove-distro-check.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9f550ca53801b2b9c6c1c7a4d02ad525c704b145 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 14 May 2020 13:40:53 +0200 -Subject: [PATCH] Remove distro check - -Signed-off-by: Robert Marko ---- ---- a/configure.ac -+++ b/configure.ac -@@ -79,34 +79,6 @@ esac - 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]) --AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, redhatenterpriseserver, 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") -- 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/gentoo-release,with_distro="gentoo") -- 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/altlinux-release,with_distro="altlinux") -- AC_CHECK_FILE(/etc/pld-release,with_distro="pld") --fi --with_distro=$(echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]') -- - if test "z$with_distro" = "zforsparc"; then - with_distro="sparclinux" - fi diff --git a/utils/lxc/patches/020-lxc-checkconfig.patch b/utils/lxc/patches/020-lxc-checkconfig.patch index 682cf9ac..145645da 100644 --- a/utils/lxc/patches/020-lxc-checkconfig.patch +++ b/utils/lxc/patches/020-lxc-checkconfig.patch @@ -1,20 +1,19 @@ --- a/src/lxc/cmd/lxc-checkconfig.in +++ b/src/lxc/cmd/lxc-checkconfig.in -@@ -4,6 +4,17 @@ +@@ -7,6 +7,16 @@ export LANGUAGE=en # Allow environment variables to override config - : ${CONFIG:=/proc/config.gz} - : ${MODNAME:=configs} + : "${CONFIG:=/proc/config.gz}" + : "${MODNAME:=configs}" +: ${ZGREP:=zgrep} +: ${GUNZIP:=gunzip} + +if [ -z $(command -v $ZGREP) ] && ! [ -z $(command -v $GUNZIP) ] && [ -x $(command -v $GUNZIP) ] && [ -f $CONFIG ] && [ "$CONFIG" == "/proc/config.gz" ] ; then ++ CONFIG_NEW="/tmp/config-$(uname -r)" ++ $GUNZIP -c $CONFIG > $CONFIG_NEW ++ CONFIG=$CONFIG_NEW + -+ CONFIG_NEW="/tmp/config-$(uname -r)" -+ $GUNZIP -c $CONFIG > $CONFIG_NEW -+ CONFIG=$CONFIG_NEW -+ -+ GREP=grep ++ GREP=grep +fi - CAT="cat" - + GREP="grep" + \ No newline at end of file diff --git a/utils/lxc/patches/025-remove-unsupported-option.patch b/utils/lxc/patches/025-remove-unsupported-option.patch index 52492c4d..b869e130 100644 --- a/utils/lxc/patches/025-remove-unsupported-option.patch +++ b/utils/lxc/patches/025-remove-unsupported-option.patch @@ -1,13 +1,16 @@ --- a/templates/lxc-download.in +++ b/templates/lxc-download.in -@@ -384,20 +384,7 @@ fi - # Unpack the rootfs - echo "Unpacking the rootfs" +@@ -380,26 +380,10 @@ if tar --version | grep -sq "bsdtar"; th + IS_BSD_TAR="true" + fi -EXCLUDES="" -excludelist=$(relevant_file excludes) -if [ -f "${excludelist}" ]; then - while read -r line; do +- if [ ${IS_BSD_TAR} = "true" ]; then +- line="^${line}" +- fi - EXCLUDES="${EXCLUDES} --exclude=${line}" - done < "${excludelist}" -fi @@ -17,8 +20,12 @@ -# 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 "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" -+tar --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" - - mkdir -p "${LXC_ROOTFS}/dev/pts/" + if [ "${IS_BSD_TAR}" = "true" ]; then +- tar ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" ++ tar --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" + else +- tar --anchored ${EXCLUDES} --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" ++ tar --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}" + fi + mkdir -p "${LXC_ROOTFS}/dev/pts/" \ No newline at end of file