From a5283e117d3c33f495a1ae728e27e794886da4b3 Mon Sep 17 00:00:00 2001 From: mao xiaojuan Date: Mon, 9 Apr 2018 19:27:12 +0800 Subject: Apply btrfs mount options "--fsoptions=compress". Change-Id: Ic286b0c43dd9fb376ab643170e9a3387156c4d96 --- mic/imager/loop.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100755 => 100644 mic/imager/loop.py diff --git a/mic/imager/loop.py b/mic/imager/loop.py old mode 100755 new mode 100644 index 268ba84..04abd0a --- 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: -- cgit v1.2.3