Lines Matching +full:- +full:- +full:strip +full:- +full:components
21 # Example string: '-j -q -i 8192 -b 4096'. There may be extra whitespaces.
24 for item in opt_string.split('-'):
25 item = item.strip()
28 opt_dict['-%s' % opt] = value
30 opt_dict['-%s' % item] = None
48 if '[defaults]' == line.strip():
50 elif '[fs_types]' == line.strip():
53 components = line.split('=', 1)
54 if len(components) == 2:
55 default_opt[components[0].strip()] = components[1].strip()
61 components = line.split('=', 1)
62 if len(components) == 2 and current_fs_type == fs_type:
63 default_opt[components[0].strip()] = components[1].strip()
79 conf_opt_mapping = {'blocksize': '-b',
80 'inode_ratio': '-i',
81 'inode_size': '-I'}
87 mkfs_opt['-O'] = default_opt['base_features']
89 mkfs_opt['-O'] += ',%s' % default_opt['default_features']
91 mkfs_opt['-O'] += ',%s' % default_opt['features']
97 if '-O' in mkfs_opt:
98 mkfs_opt['-O'] = mkfs_opt['-O'].split(',')
125 """Call tune2fs -l and parse the result."""
126 cmd = 'tune2fs -l %s' % dev
131 cmd = '%s/tune2fs.ext4dev -l %s' % (tools_dir, dev)
136 components = line.split(':', 1)
137 if len(components) == 2:
138 value = components[1].strip()
139 option = components[0]
165 ext_mapping = {'Blocks per group': '-g',
166 'Block size': '-b',
167 'Filesystem features': '-O',
168 'Filesystem OS type': '-o',
169 'Filesystem revision #': '-r',
170 'Filesystem volume name': '-L',
171 'Flex block group size': '-G',
172 'Fragment size': '-f',
173 'Inode count': '-i',
174 'Inode size': '-I',
175 'Journal inode': '-j',
176 'Reserved block count': '-m'}
196 """Call xfs_grow -n to get filesystem tunables."""
202 cmd = '%s -n %s' % (xfs_growfs, dev)
212 ## "meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n"
213 ## " =%-22s sectsz=%-5u attr=%u\n"
214 ## "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
215 ## " =%-22s sunit=%-6u swidth=%u blks\n"
216 ## "naming =version %-14u bsize=%-6u\n"
217 ## "log =%-22s bsize=%-6u blocks=%u, version=%u\n"
218 ## " =%-22s sectsz=%-5u sunit=%u blks, lazy-count=%u\n"
219 ## "realtime =%-22s extsz=%-6u blocks=%llu, rtextents=%llu\n"
225 m = re.search('^([-\w]+)', line)
245 if re.match('[0-9]+', value):
257 xfs_mapping = {'meta-data: isize': '-i size',
258 'meta-data: agcount': '-d agcount',
259 'meta-data: sectsz': '-s size',
260 'meta-data: attr': '-i attr',
261 'data: bsize': '-b size',
262 'data: imaxpct': '-i maxpct',
263 'data: sunit': '-d sunit',
264 'data: swidth': '-d swidth',
265 'data: unwritten': '-d unwritten',
266 'naming: version': '-n version',
267 'naming: bsize': '-n size',
268 'log: version': '-l version',
269 'log: sectsz': '-l sectsize',
270 'log: sunit': '-l sunit',
271 'log: lazy-count': '-l lazy-count',
272 'realtime: extsz': '-r extsize',
273 'realtime: blocks': '-r size',
274 'realtime: rtextents': '-r rtdev'}
276 mkfs_option['-l size'] = tune2fs_dict['log: bsize'] * (
302 ignored_option = ['-c', '-q', '-E', '-F']
310 if key == '-N' or key == '-T':
311 raise Exception('-N/T is not allowed.')
312 elif key == '-O':
317 # '-j' option will add 'has_journal' feature.
318 if '-j' in needed_opt and 'has_journal' not in needed_opt['-O']:
319 needed_opt['-O'].append('has_journal')
321 if 'extents' in needed_opt['-O']:
322 needed_opt['-O'].append('extent')
323 needed_opt['-O'].remove('extents')
325 if 'large_file' not in needed_opt['-O'] and (
326 'resize_inode' in needed_opt['-O']):
327 needed_opt['-O'].append('large_file')
335 if key == '-O':
349 cmd = '%s -n %s' % (xfs_growfs, dev)
358 # '-N' has the same effect as '-n' in mkfs.ext*. Man mkfs.xfs for details.
359 cmd = 'mkfs.xfs %s -N -f %s' % (needed_options, dev)
361 # 'mkfs.xfs -N' produces slightly different result than 'xfs_growfs -n'