]> git.pld-linux.org Git - packages/lxc.git/commitdiff
fix parsing kernel version when kernel is vserver patched
authorElan Ruusamäe <glen@delfi.ee>
Tue, 17 Sep 2013 09:52:35 +0000 (12:52 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 17 Sep 2013 09:53:29 +0000 (12:53 +0300)
checkconfig-vserver-config.patch [new file with mode: 0644]
lxc.spec

diff --git a/checkconfig-vserver-config.patch b/checkconfig-vserver-config.patch
new file mode 100644 (file)
index 0000000..5716e9a
--- /dev/null
@@ -0,0 +1,51 @@
+the variables get assigned as:
+KVER_MAJOR="3\n# Linux VServer"
+KVER_MINOR="10\n# Linux VServer"
+
+which causes parse errors:
+
+Cgroup memory controller: 
++ '[' 3 '#' Linux VServer -ge 3 -a 10 '#' Linux VServer -ge 6 ']'
+/usr/bin/lxc-checkconfig[98]: [: #: unexpected operator/operand
++ is_enabled CONFIG_CGROUP_MEM_RES_CTLR
+
+in this code:
+if [ $KVER_MAJOR -ge 3 -a $KVER_MINOR -ge 6 ]; then
+    is_enabled CONFIG_MEMCG
+else
+    is_enabled CONFIG_CGROUP_MEM_RES_CTLR
+fi
+
+
+---
+$ zgrep '^# Linux' /proc/config.gz | sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/'
+3
+# Linux VServer
+---
+
+$ zcat /proc/config.gz |grep '^# Linux'
+---
+# Linux/x86_64 3.10.10 Kernel Configuration
+# Linux VServer
+---
+
+
+--- lxc-0.9.0/src/lxc/lxc-checkconfig.in       2013-09-17 12:00:03.486888314 +0300
++++ lxc-0.9.0/lxc-checkconfig  2013-09-17 12:47:12.000000000 +0300
+@@ -78,13 +68,13 @@
+ }
+ CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
+-KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
++KVER_MAJOR=$($GREP '^# Linux.*Kernel Configuration' $CONFIG | \
+     sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
+ if [ "$KVER_MAJOR" = "2" ]; then
+-KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
++KVER_MINOR=$($GREP '^# Linux.*Kernel Configuration' $CONFIG | \
+     sed -r 's/.* 2.6.([0-9]{2}).*/\1/')
+ else
+-KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
++KVER_MINOR=$($GREP '^# Linux.*Kernel Configuration' $CONFIG | \
+     sed -r 's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/')
+ fi
index f2c71315ab711e4129daa778ab2ba03c02b61604..fc5718b8ad90bc602dac2e51831cd18db867c232 100644 (file)
--- a/lxc.spec
+++ b/lxc.spec
@@ -8,7 +8,7 @@ Summary:        Linux Container Tools
 Summary(pl.UTF-8):     Narzędzia do kontenerów linuksowych (LXC)
 Name:          lxc
 Version:       0.9.0
-Release:       3
+Release:       4
 License:       LGPL v2.1+
 Group:         Applications/System
 Source0:       http://lxc.sourceforge.net/download/lxc/%{name}-%{version}.tar.gz
@@ -17,6 +17,7 @@ Patch0:               %{name}-devpts.patch
 Patch1:                %{name}-pld.patch
 Patch2:                am-1.14.patch
 Patch3:                checkconfig-module.patch
+Patch4:                checkconfig-vserver-config.patch
 URL:           http://lxc.sourceforge.net/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -100,6 +101,7 @@ Wiązanie Pythona (3.x) do LXC.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__aclocal} -I config
This page took 0.064893 seconds and 4 git commands to generate.