Skip to content

Commit 1fe9831

Browse files
d4nuu8t-8ch
authored andcommitted
elbepack: hdimg: pass mount options
For some use cases, like compression, it's essential to apply the mount options not only during runtime, but also during creation of the images. Signed-off-by: Daniel Braunwarth <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 98a0c58 commit 1fe9831

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

elbepack/hdimg.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ def install(self, target, user_args):
164164

165165
for entry in self.fs.depthlist():
166166
stack.enter_context(
167-
mount(f'{loopdev}p{entry.partnum}', imagemntfs.fname(entry.mountpoint)))
167+
mount(f'{loopdev}p{entry.partnum}',
168+
imagemntfs.fname(entry.mountpoint),
169+
options=entry.options))
168170

169171
for bindmnt in ['/dev', '/proc', '/sys']:
170172
stack.enter_context(
@@ -215,7 +217,9 @@ def install(self, target, user_args):
215217
bootentry_label = entry.label
216218
bootentry = int(entry.partnum)
217219
stack.enter_context(
218-
mount(f'{loopdev}p{entry.partnum}', imagemntfs.fname(entry.mountpoint)))
220+
mount(f'{loopdev}p{entry.partnum}',
221+
imagemntfs.fname(entry.mountpoint),
222+
options=entry.options))
219223

220224
if not bootentry:
221225
bootentry_label = entry.label
@@ -308,7 +312,7 @@ def create_label(disk, part, ppart, fslabel, target, grub):
308312

309313
mount_path = Path(target, 'imagemnt')
310314

311-
with mount(loopdev, mount_path):
315+
with mount(loopdev, mount_path, options=entry.options):
312316
_execute_fs_commands(entry.fs_path_commands, dict(path=mount_path))
313317
do([
314318
'cp', '-a',

elbepack/imgutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, device, target, *, bind=False, type=None, options=None, log_o
5858
cmd.append('--bind')
5959

6060
if options is not None:
61-
cmd.extend(['-o', ','.join(options)])
61+
cmd.extend(['-o', options])
6262

6363
if type is not None:
6464
cmd.extend(['-t', type])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Always use custom mount options when mounting. These might be necessary for compression for example.

0 commit comments

Comments
 (0)