]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
checkconfig: Handle missing kernel version 2693/head
authorStéphane Graber <stgraber@ubuntu.com>
Sat, 13 Oct 2018 02:32:08 +0000 (22:32 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Sat, 13 Oct 2018 02:32:17 +0000 (22:32 -0400)
https://github.com/lxc/lxd/issues/5151

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cmd/lxc-checkconfig.in [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index bb257f9..0342d89
@@ -93,6 +93,12 @@ KVER_MINOR=$($CAT $CONFIG | grep '^# Linux.*Kernel Configuration' | \
     sed -r 's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/')
 fi
 
+if [ -z "${KVER_MAJOR}" ]; then
+    echo "WARNING: Unable to detect version from configuration, assuming latest\n"
+    KVER_MAJOR="100"
+    KVER_MINOR="0"
+fi
+
 echo "--- Namespaces ---"
 echo -n "Namespaces: " && is_enabled CONFIG_NAMESPACES yes
 echo