From a637294f2f703293d1029d3bee97b0803b532688 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 19 Nov 2014 12:18:00 +0000 Subject: [PATCH] Add kernel version check (close #185) _NOTE: You will need to satisfy kernel requirements for Docker._ It's currently recommended to use 3.10, although 3.8 works as well. We have done some additional testing on Ubuntu Preciese, and found that the oldest kernel that Ubuntu ships and weave happily runs on is 3.5, presumably some some of the issues had been fix since Docker docs were last updated. This is not to say that kernel version is good one to use, we do recommend to use the latest, but just in case if you have any specific reason why you cannot upgrade, then the 3.5 is the oldest we have tried. --- weave | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/weave b/weave index 270e3778..02c501f1 100755 --- a/weave +++ b/weave @@ -338,6 +338,19 @@ container_weave_addrs() { ip netns exec $NETNS ip addr show dev $CONTAINER_IFNAME } +uname_sys=`uname -s` +uname_rel_major=`uname -r | cut -d. -f1` +uname_rel_minor=`uname -r | cut -d. -f2` + +[ ! $uname_sys = 'Linux' ] && { + echo "ERROR: Operating systems other than Linux are not supported (you have $uname_sys)" >&2 + exit 1 +} + +(([ $uname_rel_major -eq 3 ] && [ $uname_rel_minor -ge 5 ]) || [ $uname_rel_major -gt 3 ]) || { + echo "WARNING: Linux kernel version 3.5 or newer is required (you have `uname -sr`)" >&2 +} + case "$COMMAND" in launch) check_not_running $CONTAINER_NAME $IMAGE