diff --git a/mounts/org.osbuild.btrfs b/mounts/org.osbuild.btrfs index 546d14fd..4a5bff9f 100755 --- a/mounts/org.osbuild.btrfs +++ b/mounts/org.osbuild.btrfs @@ -41,6 +41,9 @@ SCHEMA_2 = """ "subvol": { "description": "Subvolume to be mounted", "type": "string" + }, + "compress": { + "type": "string" } } } diff --git a/osbuild/mounts.py b/osbuild/mounts.py index c9ba073d..d22d0ee9 100644 --- a/osbuild/mounts.py +++ b/osbuild/mounts.py @@ -141,6 +141,8 @@ class FileSystemMountService(MountService): opts.append(f"shortname={options['shortname']}") if "subvol" in options: opts.append(f"subvol={options['subvol']}") + if "compress" in options: + opts.append(f"compress={options['compress']}") if opts: return ["-o", ",".join(opts)] return [] diff --git a/test/data/manifests/fedora-boot-btrfs.json b/test/data/manifests/fedora-boot-btrfs.json index befdf6f7..a6f5b3c7 100644 --- a/test/data/manifests/fedora-boot-btrfs.json +++ b/test/data/manifests/fedora-boot-btrfs.json @@ -949,7 +949,7 @@ "uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75", "vfs_type": "btrfs", "path": "/", - "options": "subvol=root" + "options": "subvol=root,compress=zstd:1" }, { "uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8", @@ -969,7 +969,7 @@ "vfs_type": "btrfs", "path": "/home", "passno": 3, - "options": "subvol=home" + "options": "subvol=home,compress=zstd:1" } ] } @@ -1204,7 +1204,8 @@ "source": "root", "target": "/", "options": { - "subvol": "root" + "subvol": "root", + "compress": "zstd:1" } }, { @@ -1213,7 +1214,8 @@ "source": "root", "target": "/home", "options": { - "subvol": "home" + "subvol": "home", + "compress": "zstd:1" } }, { diff --git a/test/data/manifests/fedora-boot-btrfs.mpp.yaml b/test/data/manifests/fedora-boot-btrfs.mpp.yaml index 74ca41d2..bea6acd4 100644 --- a/test/data/manifests/fedora-boot-btrfs.mpp.yaml +++ b/test/data/manifests/fedora-boot-btrfs.mpp.yaml @@ -64,7 +64,7 @@ pipelines: - uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75 vfs_type: btrfs path: / - options: subvol=root + options: subvol=root,compress=zstd:1 - uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 vfs_type: ext4 path: /boot @@ -78,7 +78,7 @@ pipelines: vfs_type: btrfs path: /home passno: 3 - options: subvol=home + options: subvol=home,compress=zstd:1 - type: org.osbuild.grub2 options: root_fs_uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75 @@ -230,12 +230,14 @@ pipelines: target: / options: subvol: root + compress: zstd:1 - name: home type: org.osbuild.btrfs source: root target: /home options: subvol: home + compress: zstd:1 - name: boot type: org.osbuild.ext4 source: boot