summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-03-18 17:13:59 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-03-18 17:57:22 +0000
commitd7e9e092aee7d607be48dc99b0fe2275575df4fb (patch)
tree3c0c37efb7a230a2ad992493eceb5367bbc42718
parent86cb3fb50a8d04911f5191eb80edb2295350e120 (diff)
downloadmorph-d7e9e092aee7d607be48dc99b0fe2275575df4fb.tar.gz
Extend morphlib.fsutils.mount to take a fstype
-rw-r--r--morphlib/fsutils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/morphlib/fsutils.py b/morphlib/fsutils.py
index 0212b987..751f73f6 100644
--- a/morphlib/fsutils.py
+++ b/morphlib/fsutils.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 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,10 +47,14 @@ def create_fs(runcmd, partition): # pragma: no cover
runcmd(['mkfs.btrfs', '-L', 'baserock', partition])
-def mount(runcmd, partition, mount_point): # pragma: no cover
+def mount(runcmd, partition, mount_point, fstype=None): # pragma: no cover
if not os.path.exists(mount_point):
os.mkdir(mount_point)
- runcmd(['mount', partition, mount_point])
+ if not fstype:
+ fstype = []
+ else:
+ fstype = ['-t', fstype]
+ runcmd(['mount', partition, mount_point] + fstype)
def unmount(runcmd, mount_point): # pragma: no cover