]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-checkconfig: Fix parsing on vserver kernels
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 18 Feb 2014 22:09:14 +0000 (17:09 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 18 Feb 2014 22:09:14 +0000 (17:09 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-checkconfig.in

index 5e35a8173dea03c06a51add471b9912a2a7528f6..61824540fe64f5cdfc732840c4e7445091bcfcf1 100644 (file)
@@ -78,13 +78,13 @@ print_cgroups() {
 }
 
 CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -n 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