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,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):