Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.3-devel' into 3.3-release
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechtrefny committed Feb 18, 2021
2 parents 0cb854e + 724855f commit 3fe3fdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blivet/devices/btrfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,18 @@ def _set_format(self, fmt):

# propagate mount options specified for members via kickstart
opts = "subvol=%s" % self.name
has_compress = False
if self.volume.format.mountopts:
for opt in self.volume.format.mountopts.split(","):
# do not add members subvol spec
if not opt.startswith("subvol"):
opts += ",%s" % opt
if opt.startswith("compress"):
has_compress = True

# add default compression settings
if flags.btrfs_compression and not has_compress:
opts += ",compress=%s" % flags.btrfs_compression

self.format.mountopts = opts

Expand Down
4 changes: 4 additions & 0 deletions blivet/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def __init__(self):

self.update_from_boot_cmdline()
self.allow_imperfect_devices = True

# compression option for btrfs filesystems
self.btrfs_compression = None

self.debug_threads = False

def get_boot_cmdline(self):
Expand Down

0 comments on commit 3fe3fdd

Please sign in to comment.