From 1bf72492d381aacb5c488f1a87ac7665b9ddc6c7 Mon Sep 17 00:00:00 2001
From: Alexander Schreiber <als@google.com>
Date: Tue, 13 Mar 2012 17:34:52 +0100
Subject: [PATCH] Enable lvmstrap to run under Linux 3.x

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lvmstrap b/tools/lvmstrap
index 7278a7834..6512477c9 100755
--- a/tools/lvmstrap
+++ b/tools/lvmstrap
@@ -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."
-- 
GitLab