diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-02-03 17:40:29 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-04-14 16:32:36 +0000 |
commit | 177d8ff42e9201b3e06c02e25406dd74c10236c8 (patch) | |
tree | 14c9b8dae0aed4ff4c5b881f3dde8e9e746d4f88 | |
parent | fd4d6afc778f633b0e4d3df3c478599d7cc1f7fe (diff) | |
download | morph-177d8ff42e9201b3e06c02e25406dd74c10236c8.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.
Change-Id: Ic190784353ef8c841a1cd9ff632a7996351b436c
-rw-r--r-- | morphlib/fsutils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/morphlib/fsutils.py b/morphlib/fsutils.py index a3b73bf6..87b4cf3b 100644 --- a/morphlib/fsutils.py +++ b/morphlib/fsutils.py @@ -46,14 +46,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 |