mounts/org.osbuild.btrfs: add support for compression

Also, add it to the sample manifest.
This commit is contained in:
Ondřej Budai 2023-06-16 14:05:41 +02:00 committed by Ondřej Budai
parent 3bbded4607
commit b94048dfd4
4 changed files with 15 additions and 6 deletions

View file

@ -41,6 +41,9 @@ SCHEMA_2 = """
"subvol": { "subvol": {
"description": "Subvolume to be mounted", "description": "Subvolume to be mounted",
"type": "string" "type": "string"
},
"compress": {
"type": "string"
} }
} }
} }

View file

@ -141,6 +141,8 @@ class FileSystemMountService(MountService):
opts.append(f"shortname={options['shortname']}") opts.append(f"shortname={options['shortname']}")
if "subvol" in options: if "subvol" in options:
opts.append(f"subvol={options['subvol']}") opts.append(f"subvol={options['subvol']}")
if "compress" in options:
opts.append(f"compress={options['compress']}")
if opts: if opts:
return ["-o", ",".join(opts)] return ["-o", ",".join(opts)]
return [] return []

View file

@ -949,7 +949,7 @@
"uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75", "uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
"vfs_type": "btrfs", "vfs_type": "btrfs",
"path": "/", "path": "/",
"options": "subvol=root" "options": "subvol=root,compress=zstd:1"
}, },
{ {
"uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8", "uuid": "0194fdc2-fa2f-4cc0-81d3-ff12045b73c8",
@ -969,7 +969,7 @@
"vfs_type": "btrfs", "vfs_type": "btrfs",
"path": "/home", "path": "/home",
"passno": 3, "passno": 3,
"options": "subvol=home" "options": "subvol=home,compress=zstd:1"
} }
] ]
} }
@ -1204,7 +1204,8 @@
"source": "root", "source": "root",
"target": "/", "target": "/",
"options": { "options": {
"subvol": "root" "subvol": "root",
"compress": "zstd:1"
} }
}, },
{ {
@ -1213,7 +1214,8 @@
"source": "root", "source": "root",
"target": "/home", "target": "/home",
"options": { "options": {
"subvol": "home" "subvol": "home",
"compress": "zstd:1"
} }
}, },
{ {

View file

@ -64,7 +64,7 @@ pipelines:
- uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75 - uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
vfs_type: btrfs vfs_type: btrfs
path: / path: /
options: subvol=root options: subvol=root,compress=zstd:1
- uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 - uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8
vfs_type: ext4 vfs_type: ext4
path: /boot path: /boot
@ -78,7 +78,7 @@ pipelines:
vfs_type: btrfs vfs_type: btrfs
path: /home path: /home
passno: 3 passno: 3
options: subvol=home options: subvol=home,compress=zstd:1
- type: org.osbuild.grub2 - type: org.osbuild.grub2
options: options:
root_fs_uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75 root_fs_uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
@ -230,12 +230,14 @@ pipelines:
target: / target: /
options: options:
subvol: root subvol: root
compress: zstd:1
- name: home - name: home
type: org.osbuild.btrfs type: org.osbuild.btrfs
source: root source: root
target: /home target: /home
options: options:
subvol: home subvol: home
compress: zstd:1
- name: boot - name: boot
type: org.osbuild.ext4 type: org.osbuild.ext4
source: boot source: boot