Enable lvmstrap to run under Linux 3.x
authorAlexander Schreiber <als@google.com>
Tue, 13 Mar 2012 16:34:52 +0000 (17:34 +0100)
committerIustin Pop <iustin@google.com>
Wed, 14 Mar 2012 10:50:18 +0000 (11:50 +0100)
Extend the kernel version check to also accept Linux 3.x as valid.

Signed-off-by: Alexander Schreiber <als@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

tools/lvmstrap

index 7278a78..6512477 100755 (executable)
@@ -272,9 +272,9 @@ def CheckPrereq():
     raise PrereqError("This tool only runs on Linux"
                       " (detected OS: %s)." % osname)
 
-  if not release.startswith("2.6."):
+  if not (release.startswith("2.6.") or release.startswith("3.")):
     raise PrereqError("Wrong major kernel version (detected %s, needs"
-                      " 2.6.*)" % release)
+                      " 2.6.* or 3.*)" % release)
 
   if not os.path.ismount("/sys"):
     raise PrereqError("Can't find a filesystem mounted at /sys."