From 846936357b6ff4ea298ae5443354bc7a2e2f985f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 15 Jun 2021 20:43:44 +0200 Subject: [PATCH] [mount] If no btrfs layout at all, use something reasonable This is related to https://invent.kde.org/neon/neon/calamares-settings/-/merge_requests/1 which adds .. the default things from the example configuration to the configuration file KDE neon ships. The default layout doesn't add any subvolumes at all, which seems to be non-functional. If nothing is configured, complain and use /@ as the lone subvolume. --- src/modules/mount/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 07166dd75..5e5233935 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -74,7 +74,14 @@ def mount_partition(root_mount_point, partition, partitions): # Special handling for btrfs subvolumes. Create the subvolumes listed in mount.conf if fstype == "btrfs" and partition["mountPoint"] == '/': # Root has been mounted to btrfs volume -> create subvolumes from configuration - btrfs_subvolumes = libcalamares.job.configuration.get("btrfsSubvolumes") or [] + btrfs_subvolumes = libcalamares.job.configuration.get("btrfsSubvolumes", None) + # Warn if there's no configuration at all, and empty configurations are + # replaced by a simple root-only layout. + if btrfs_subvolumes is None: + libcalamares.utils.warning("No configuration for btrfsSubvolumes") + if not btrfs_subvolumes: + btrfs_subvolumes = [ dict(mountPoint="/", subvolume="/@") ] + subvolume_mountpoints = [d['mountPoint'] for d in btrfs_subvolumes] # Check if listed mountpoints besides / are already present and don't create subvolume for those for p in partitions: