lxc: downgrade to 3.1.0 as newer versions may have issues

This commit is contained in:
Leonid Pliushch 2020-06-01 14:46:23 +03:00 committed by Yaksh Bariya
parent e8ca6738e6
commit 14bfbeb4c9
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
2 changed files with 64 additions and 51 deletions

View File

@ -1,18 +1,16 @@
TERMUX_PKG_HOMEPAGE=http://linuxcontainers.org/
TERMUX_PKG_DESCRIPTION="Linux Containers"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=4.0.1
TERMUX_PKG_SRCURL=https://linuxcontainers.org/downloads/lxc-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=70bbaac1df097f32ee5493a5e67a52365f7cdda28529f40197d6160bbec4139d
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
# v3.1.0 is the last version confirmed to work.
# Do not update it unless you tested it on your device.
TERMUX_PKG_VERSION=1:3.1.0
TERMUX_PKG_SRCURL=https://linuxcontainers.org/downloads/lxc-${TERMUX_PKG_VERSION:2}.tar.gz
TERMUX_PKG_SHA256=4d8772c25baeaea2c37a954902b88c05d1454c91c887cb6a0997258cfac3fdc5
TERMUX_PKG_DEPENDS="gnupg, libcap, libseccomp, rsync, wget"
TERMUX_PKG_BREAKS="lxc-dev"
TERMUX_PKG_REPLACES="lxc-dev"
# Do not build for ARM due to
# error: /home/builder/.termux-build/_cache/android-r20-api-24-v1/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb/libgcc_real.a(pr-support.o): multiple definition of '__gnu_unwind_frame'
TERMUX_PKG_BLACKLISTED_ARCHES="arm"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-distro=termux
--with-runtime-path=$TERMUX_PREFIX/var/run

View File

@ -1,53 +1,68 @@
--- ./src/lxc/cgroups/cgfsng.c.orig 2020-04-07 13:18:11.768499944 +0200
+++ ./src/lxc/cgroups/cgfsng.c 2020-04-07 13:22:05.304800371 +0200
@@ -348,7 +348,7 @@
ssize_t maxisol = 0, maxoffline = 0, maxposs = 0;
bool flipped_bit = false;
- fpath = must_make_path(parent_cgroup, "cpuset.cpus", NULL);
+ fpath = must_make_path(parent_cgroup, "cpus", NULL);
diff -uNr lxc-3.1.0/src/lxc/cgroups/cgfsng.c lxc-3.1.0.mod/src/lxc/cgroups/cgfsng.c
--- lxc-3.1.0/src/lxc/cgroups/cgfsng.c 2018-12-14 01:13:51.000000000 +0200
+++ lxc-3.1.0.mod/src/lxc/cgroups/cgfsng.c 2019-07-13 20:47:37.511164109 +0300
@@ -395,7 +395,7 @@
}
oldv = *lastslash;
*lastslash = '\0';
- fpath = must_make_path(path, "cpuset.cpus", NULL);
+ fpath = must_make_path(path, "cpus", NULL);
posscpus = read_file(fpath);
if (!posscpus)
return log_error_errno(false, errno, "Failed to read file \"%s\"", fpath);
@@ -439,10 +439,10 @@
if (!posscpus) {
SYSERROR("Failed to read file \"%s\"", fpath);
@@ -412,7 +412,7 @@
DEBUG("The path \""__ISOL_CPUS"\" to read isolated cpus from does not exist");
cpulist = posscpus;
/* No isolated cpus but we weren't already initialized by
- * someone. We should simply copy the parents cpuset.cpus
+ * someone. We should simply copy the parents cpus
* values.
*/
if (!am_initialized) {
@@ -434,7 +434,7 @@
TRACE("No isolated cpus detected");
cpulist = posscpus;
/* No isolated cpus but we weren't already initialized by
- * someone. We should simply copy the parents cpuset.cpus
+ * someone. We should simply copy the parents cpus
* values.
*/
if (!am_initialized) {
@@ -491,7 +491,7 @@
copy_parent:
if (!am_initialized) {
- ret = lxc_write_openat(child_cgroup, "cpuset.cpus", cpulist, strlen(cpulist));
+ ret = lxc_write_openat(child_cgroup, "cpus", cpulist, strlen(cpulist));
if (ret < 0)
return log_error_errno(false,
- errno, "Failed to write cpu list to \"%s/cpuset.cpus\"",
+ errno, "Failed to write cpu list to \"%s/cpus\"",
child_cgroup);
TRACE("Copied cpu settings of parent cgroup");
@@ -542,7 +542,7 @@
if (ret < 0)
return log_error_errno(-1, errno, "Failed to read file \"%s/cgroup.clone_children\"", child_cgroup);
*lastslash = oldv;
free(fpath);
- fpath = must_make_path(path, "cpuset.cpus", NULL);
+ fpath = must_make_path(path, "cpus", NULL);
ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false, 0666);
if (ret < 0) {
SYSERROR("Failed to write cpu list to \"%s\"", fpath);
@@ -606,7 +606,7 @@
return false;
}
- /* Make sure any isolated cpus are removed from cpuset.cpus. */
+ /* Make sure any isolated cpus are removed from cpus. */
if (!cg_legacy_filter_and_set_cpus(parent_cgroup, child_cgroup, v == '1'))
return log_error_errno(-1, errno, "Failed to remove isolated cpus");
@@ -551,8 +551,8 @@
TRACE("\"cgroup.clone_children\" was already set to \"1\"");
if (!cg_legacy_filter_and_set_cpus(cgpath, v == '1')) {
SYSERROR("Failed to remove isolated cpus");
free(clonechildrenpath);
@@ -623,8 +623,8 @@
}
/* copy parent's settings */
- if (!copy_parent_file(parent_cgroup, child_cgroup, "cpuset.mems"))
- return log_error_errno(-1, errno, "Failed to copy \"cpuset.mems\" settings");
+ if (!copy_parent_file(parent_cgroup, child_cgroup, "mems"))
+ return log_error_errno(-1, errno, "Failed to copy \"mems\" settings");
/* Set clone_children so children inherit our settings */
ret = lxc_writeat(cgroup_fd, "cgroup.clone_children", "1", 1);
@@ -653,7 +653,7 @@
- if (!copy_parent_file(cgpath, "cpuset.mems")) {
- SYSERROR("Failed to copy \"cpuset.mems\" settings");
+ if (!copy_parent_file(cgpath, "mems")) {
+ SYSERROR("Failed to copy \"mems\" settings");
free(cgpath);
free(clonechildrenpath);
return false;
@@ -742,7 +742,7 @@
* verify /sys/fs/cgroup/ in this field.
*/
if (strncmp(p, DEFAULT_CGROUP_MOUNTPOINT "/", 15) != 0)
- return log_error(NULL, "Found hierarchy not under " DEFAULT_CGROUP_MOUNTPOINT ": \"%s\"", p);
+ return log_warn(NULL, "Found hierarchy not under " DEFAULT_CGROUP_MOUNTPOINT ": \"%s\"", p);
if (strncmp(p, "/sys/fs/cgroup/", 15) != 0) {
- ERROR("Found hierarchy not under /sys/fs/cgroup: \"%s\"", p);
+ WARN("Found hierarchy not under /sys/fs/cgroup: \"%s\"", p);
return NULL;
}
p += 15;
p2 = strchr(p, ' ');