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-02-06 10:51:42 +0000
commit2a2b15bf3b8e471ce8b2e61f49f2ad3b8879ef93 (patch)
tree2aa9a335e72b7733ec30b4244a3f1dff12192749
parentf6745f6d35daf8d4d465203f380798195fe74c61 (diff)
downloadmorph-2a2b15bf3b8e471ce8b2e61f49f2ad3b8879ef93.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