summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-02-03 17:40:29 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-03 18:41:48 +0000
commit8f8fbdc2ef078a401b7dba7dd8eb0ee3e0c7a553 (patch)
treefda450b4ecd8d4c24b119f025c2640a52de41027
parent563ed13a1064dcf89745ce7b9bbabe8626302c83 (diff)
downloadmorph-8f8fbdc2ef078a401b7dba7dd8eb0ee3e0c7a553.tar.gz
Allow the passing of options to fsutils.mount
In order to mount using overlayfs, fsutils.mount needs to take a string of options to pass to the mount command.
-rw-r--r--morphlib/fsutils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/morphlib/fsutils.py b/morphlib/fsutils.py
index 8a4128d9..97a7a8f2 100644
--- a/morphlib/fsutils.py
+++ b/morphlib/fsutils.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014 Codethink Limited
+# Copyright (C) 2012-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,14 +47,17 @@ def create_fs(runcmd, partition): # pragma: no cover
runcmd(['mkfs.btrfs', '-L', 'baserock', partition])
-def mount(runcmd, partition, mount_point, fstype=None): # pragma: no cover
+def mount(runcmd, partition, mount_point,
+ fstype=None, options=[]): # pragma: no cover
if not os.path.exists(mount_point):
os.mkdir(mount_point)
if not fstype:
fstype = []
else:
fstype = ['-t', fstype]
- runcmd(['mount', partition, mount_point] + fstype)
+ if not type(options) == list:
+ options = [options]
+ runcmd(['mount', partition, mount_point] + fstype + options)
def unmount(runcmd, mount_point): # pragma: no cover