summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormao xiaojuan <xiaojuan.mao@samsung.com>2018-04-09 19:27:12 +0800
committerXiaojuan Mao <xiaojuan.mao@samsung.com>2018-04-09 12:43:49 +0000
commita5283e117d3c33f495a1ae728e27e794886da4b3 (patch)
treec04b27ed1e05b9a01e09a94a052487936eab1a3d
parent886f39f0cf6c0f958ef534f53f3f7c8db8f001c7 (diff)
downloadmic-a5283e117d3c33f495a1ae728e27e794886da4b3.tar.gz
mic-a5283e117d3c33f495a1ae728e27e794886da4b3.tar.bz2
mic-a5283e117d3c33f495a1ae728e27e794886da4b3.zip
Apply btrfs mount options "--fsoptions=compress".
Change-Id: Ic286b0c43dd9fb376ab643170e9a3387156c4d96
-rw-r--r--[-rwxr-xr-x]mic/imager/loop.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mic/imager/loop.py b/mic/imager/loop.py
index 268ba84..04abd0a 100755..100644
--- a/mic/imager/loop.py
+++ b/mic/imager/loop.py
@@ -160,6 +160,7 @@ class LoopImageCreator(BaseImageCreator):
'name': imgname,
'size': part.size or 4096L * 1024 * 1024,
'fstype': part.fstype or 'ext3',
+ 'fsopts': part.fsopts or None,
'aft_fstype': aft_fstype or None,
'extopts': part.extopts or None,
'vdfsopts': part.vdfsopts or None,
@@ -336,7 +337,6 @@ class LoopImageCreator(BaseImageCreator):
# Actual implementation
#
def _mount_instroot(self, base_on=None):
-
if base_on and os.path.isfile(base_on):
self._imgdir = os.path.dirname(base_on)
imgname = os.path.basename(base_on)
@@ -361,6 +361,7 @@ class LoopImageCreator(BaseImageCreator):
for loop in self._instloops:
fstype = loop['fstype']
+ fsopt = loop['fsopts']
mp = os.path.join(self._instroot, loop['mountpoint'].lstrip('/'))
size = loop['size'] * 1024L * 1024L
imgname = loop['name']
@@ -381,6 +382,7 @@ class LoopImageCreator(BaseImageCreator):
fstype,
self._blocksize,
loop['label'],
+ fsopt,
fsuuid = loop['uuid'])
if fstype in ("ext2", "ext3", "ext4"):
@@ -389,7 +391,7 @@ class LoopImageCreator(BaseImageCreator):
try:
msger.verbose('Mounting image "%s" on "%s"' % (imgname, mp))
fs.makedirs(mp)
- loop['loop'].mount(init_expand=loop['init_expand'])
+ loop['loop'].mount(fsopt, init_expand=loop['init_expand'])
# Make an autogenerated uuid avaialble in _get_post_scripts_env()
if loop['kspart'] and loop['kspart'].uuid is None and \
loop['loop'].uuid: