summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/bins.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/bins.py b/morphlib/bins.py
index 23e3b812..d1a90657 100644
--- a/morphlib/bins.py
+++ b/morphlib/bins.py
@@ -91,6 +91,16 @@ def create_chunk(rootdir, f, include, dump_memory_profile=None):
dump_memory_profile('after removing in create_chunks')
+def create_system(rootdir, f, name=None, filter=None):
+ '''Create a system artifact from the contents of a directory.
+
+ '''
+
+ tar = tarfile.open(fileobj=f, mode="w", name=name)
+ tar.add(rootdir, recursive=True, filter=filter)
+ tar.close()
+
+
def unpack_binary_from_file(f, dirname): # pragma: no cover
'''Unpack a binary into a directory.