From 0952ae9933ee22bbcd0827c7fc0e084434ec9f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 18 May 2023 12:45:11 +0200 Subject: [PATCH] mounts/org.osbuild.btrfs: add support for mounting subvolumes Co-authored-by: Christian Kellner --- mounts/org.osbuild.btrfs | 4 ++++ osbuild/mounts.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/mounts/org.osbuild.btrfs b/mounts/org.osbuild.btrfs index 987d184c..546d14fd 100755 --- a/mounts/org.osbuild.btrfs +++ b/mounts/org.osbuild.btrfs @@ -37,6 +37,10 @@ SCHEMA_2 = """ "description": "Don't load the journal on mounting", "type": "boolean", "default": false + }, + "subvol": { + "description": "Subvolume to be mounted", + "type": "string" } } } diff --git a/osbuild/mounts.py b/osbuild/mounts.py index 1d3cb5fd..c9ba073d 100644 --- a/osbuild/mounts.py +++ b/osbuild/mounts.py @@ -139,6 +139,8 @@ class FileSystemMountService(MountService): opts.append(f"umask={options['umask']}") if "shortname" in options: opts.append(f"shortname={options['shortname']}") + if "subvol" in options: + opts.append(f"subvol={options['subvol']}") if opts: return ["-o", ",".join(opts)] return []