From: Stéphane Graber Date: Sat, 13 Oct 2018 02:32:08 +0000 (-0400) Subject: checkconfig: Handle missing kernel version X-Git-Tag: lxc-3.1.0~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2693%2Fhead;p=thirdparty%2Flxc.git checkconfig: Handle missing kernel version https://github.com/lxc/lxd/issues/5151 Signed-off-by: Stéphane Graber --- diff --git a/src/lxc/cmd/lxc-checkconfig.in b/src/lxc/cmd/lxc-checkconfig.in old mode 100644 new mode 100755 index bb257f93b..0342d89ca --- a/src/lxc/cmd/lxc-checkconfig.in +++ b/src/lxc/cmd/lxc-checkconfig.in @@ -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