From 377a1c3a1705c850830abdd979a32dc4a093a782 Mon Sep 17 00:00:00 2001 From: hmikihth Date: Sat, 4 Jun 2016 03:15:43 +0100 Subject: [PATCH] Support the already mounted loop fs (example in the blackPanther OS) --- src/modules/unpackfs/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 0d7827f84..317127cec 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -198,7 +198,10 @@ class UnpackOperation: :param entry: :param imgmountdir: """ - subprocess.check_call(["mount", entry.source, imgmountdir, "-t", entry.sourcefs, "-o", "loop"]) + if os.path.isdir(entry.source): + subprocess.check_call(["mount", "--bind", entry.source, imgmountdir]) + else: + subprocess.check_call(["mount", entry.source, imgmountdir, "-t", entry.sourcefs, "-o", "loop"]) def unpack_image(self, entry, imgmountdir): """ Unpacks image. @@ -278,7 +281,8 @@ def run(): destination = os.path.abspath(root_mount_point + entry["destination"]) - if not os.path.exists(source) or os.path.isdir(source): + # Modified for blackPanther OS support (www.blackpantheros.eu) + if not os.path.exists(source): return "Bad source", "source=\"{}\"".format(source) if not os.path.isdir(destination):