Support the already mounted loop fs (example in the blackPanther OS)

This commit is contained in:
hmikihth 2016-06-04 03:15:43 +01:00
parent 632b237950
commit 377a1c3a17

View File

@ -198,6 +198,9 @@ class UnpackOperation:
:param entry: :param entry:
:param imgmountdir: :param imgmountdir:
""" """
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"]) subprocess.check_call(["mount", entry.source, imgmountdir, "-t", entry.sourcefs, "-o", "loop"])
def unpack_image(self, entry, imgmountdir): def unpack_image(self, entry, imgmountdir):
@ -278,7 +281,8 @@ def run():
destination = os.path.abspath(root_mount_point + entry["destination"]) 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) return "Bad source", "source=\"{}\"".format(source)
if not os.path.isdir(destination): if not os.path.isdir(destination):