From 7ea67688526ac61e373dcf66fba5b7f3a9fbef29 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Jul 2021 12:39:56 +0200 Subject: [PATCH 01/12] [partition] Pick slightly more sensible defaults for FS selection --- src/modules/partition/partition.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/partition.conf b/src/modules/partition/partition.conf index 3213e0d33..899eb6269 100644 --- a/src/modules/partition/partition.conf +++ b/src/modules/partition/partition.conf @@ -147,7 +147,10 @@ defaultFileSystemType: "ext4" # # The value *defaultFileSystemType* is added to this list (with a warning) # if not present; the default pick is the *defaultFileSystemType*. -availableFileSystemTypes: ["ext4", "btrfs", "f2fs"] +# +# If not specified at all, uses *defaultFileSystemType* without a +# warning (this matches traditional no-choice-available behavior best). +# availableFileSystemTypes: ["ext4","f2fs"] # Show/hide LUKS related functionality in automated partitioning modes. # Disable this if you choose not to deploy early unlocking support in GRUB2 From 1a542d3afee65a70e99647ea4bade196440208b1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Jul 2021 13:11:00 +0200 Subject: [PATCH 02/12] [partition] Write out type rather than aliasing to T --- src/modules/partition/PartitionViewStep.cpp | 9 ++- .../partition/core/PartitionLayout.cpp | 74 +++++++++---------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index fc6b3e50c..3f57050aa 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -432,14 +432,15 @@ PartitionViewStep::onLeave() { if ( PartUtils::isEfiSystem() ) { - QString espMountPoint + const QString espMountPoint = Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString(); + const QString espFlagName = PartitionTable::flagName( #ifdef WITH_KPMCORE4API - auto espFlag = PartitionTable::Flag::Boot; + PartitionTable::Flag::Boot #else - auto espFlag = PartitionTable::FlagEsp; + PartitionTable::FlagEsp #endif - QString espFlagName = PartitionTable::flagName( espFlag ); + ); Partition* esp = m_core->findPartitionByMountPoint( espMountPoint ); QString message; diff --git a/src/modules/partition/core/PartitionLayout.cpp b/src/modules/partition/core/PartitionLayout.cpp index a8ed206d8..61e7d2fdc 100644 --- a/src/modules/partition/core/PartitionLayout.cpp +++ b/src/modules/partition/core/PartitionLayout.cpp @@ -140,55 +140,55 @@ PartitionLayout::init( FileSystem::Type defaultFsType, const QVariantList& confi void PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) { - using T = FileSystem::Type; + using FileSystem = FileSystem::Type; switch ( defaultFsType ) { - case T::Unknown: - case T::Unformatted: - case T::Extended: - case T::LinuxSwap: - case T::Luks: - case T::Ocfs2: - case T::Lvm2_PV: - case T::Udf: - case T::Iso9660: - case T::Luks2: - case T::LinuxRaidMember: - case T::BitLocker: + case FileSystem::Unknown: + case FileSystem::Unformatted: + case FileSystem::Extended: + case FileSystem::LinuxSwap: + case FileSystem::Luks: + case FileSystem::Ocfs2: + case FileSystem::Lvm2_PV: + case FileSystem::Udf: + case FileSystem::Iso9660: + case FileSystem::Luks2: + case FileSystem::LinuxRaidMember: + case FileSystem::BitLocker: // bad bad cWarning() << "The selected default FS" << defaultFsType << "is not suitable." << "Using ext4 instead."; - defaultFsType = T::Ext4; + defaultFsType = FileSystem::Ext4; break; - case T::Ext2: - case T::Ext3: - case T::Ext4: - case T::Fat32: - case T::Ntfs: - case T::Reiser4: - case T::ReiserFS: - case T::Xfs: - case T::Jfs: - case T::Btrfs: - case T::Exfat: - case T::F2fs: + case FileSystem::Ext2: + case FileSystem::Ext3: + case FileSystem::Ext4: + case FileSystem::Fat32: + case FileSystem::Ntfs: + case FileSystem::Reiser4: + case FileSystem::ReiserFS: + case FileSystem::Xfs: + case FileSystem::Jfs: + case FileSystem::Btrfs: + case FileSystem::Exfat: + case FileSystem::F2fs: // ok break; - case T::Fat12: - case T::Fat16: - case T::Hfs: - case T::HfsPlus: - case T::Ufs: - case T::Hpfs: - case T::Zfs: - case T::Nilfs2: - case T::Apfs: - case T::Minix: + case FileSystem::Fat12: + case FileSystem::Fat16: + case FileSystem::Hfs: + case FileSystem::HfsPlus: + case FileSystem::Ufs: + case FileSystem::Hpfs: + case FileSystem::Zfs: + case FileSystem::Nilfs2: + case FileSystem::Apfs: + case FileSystem::Minix: // weird cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; break; default: cWarning() << "The selected default FS" << defaultFsType << "is not known to Calamares." << "Using ext4 instead."; - defaultFsType = T::Ext4; + defaultFsType = FileSystem::Ext4; } m_defaultFsType = defaultFsType; From b5c56fd579f0ed5577f516b2a2a11b5781b96fb0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 5 Jul 2021 13:33:09 +0200 Subject: [PATCH 03/12] [partition] Clarify comments on boot-flags --- src/modules/partition/core/PartUtils.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 2f269d37f..22e84a09c 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -451,13 +451,12 @@ isEfiBootable( const Partition* candidate ) { const auto flags = PartitionInfo::flags( candidate ); - // TODO: with KPMCore 4, this comment is wrong: the flags - // are remapped, and the ESP flag is the same as Boot. #if defined( WITH_KPMCORE4API ) + // In KPMCore4, the flags are remapped, and the ESP flag is the same as Boot. static_assert( KPM_PARTITION_FLAG_ESP == KPM_PARTITION_FLAG( Boot ), "KPMCore API enum changed" ); return flags.testFlag( KPM_PARTITION_FLAG_ESP ); #else - /* If bit 17 is set, old-style Esp flag, it's OK */ + // In KPMCore3, bit 17 is the old-style Esp flag, and it's OK if ( flags.testFlag( KPM_PARTITION_FLAG_ESP ) ) { return true; From a4fadcd9be71fec09b5de17f5d12ec46dd25cd5e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 12:54:25 +0200 Subject: [PATCH 04/12] [partition] Introduce check for EFI partition type-and-size Re-use the existing message about partition type and size, since I don't want to introduce another message with all the specifics; give a works-always message instead. The check itself is also straightforward, avoiding all of the nuances and technically-this-might-work cases: FAT32, 300MiB+. FIXES #607 --- src/modules/partition/PartitionViewStep.cpp | 2 +- src/modules/partition/core/PartUtils.cpp | 28 +++++++++++++++++++++ src/modules/partition/core/PartUtils.h | 6 +++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index 3f57050aa..015aab2ce 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -445,7 +445,7 @@ PartitionViewStep::onLeave() QString message; QString description; - if ( !esp ) + if ( !esp || ( esp && !PartUtils::isEfiFilesystemSuitable( esp ) ) ) { message = tr( "No EFI system partition configured" ); description = tr( "An EFI system partition is necessary to start %1." diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 22e84a09c..5b8572189 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -446,6 +446,34 @@ isEfiSystem() return QDir( "/sys/firmware/efi/efivars" ).exists(); } +bool +isEfiFilesystemSuitable(const Partition* candidate) +{ + auto type = candidate->fileSystem().type(); + auto size = candidate->capacity(); // bytes + + using CalamaresUtils::Units::operator""_MiB; + + switch( type ) + { + case FileSystem::Type::Fat32: + if ( size >= 300_MiB ) + { + return true; + } + cWarning() << "FAT32 filesystem is too small (" << size << "bytes)"; + return false; + case FileSystem::Type::Fat12: + case FileSystem::Type::Fat16: + cWarning() << "FAT12 and FAT16 are probably not supported by EFI"; + return false; + default: + cWarning() << "EFI boot partition must be FAT32"; + return false; + } +} + + bool isEfiBootable( const Partition* candidate ) { diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index 5e84e379b..6bf223921 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -82,6 +82,12 @@ OsproberEntryList runOsprober( DeviceModel* dm ); */ bool isEfiSystem(); +/** + * @brief Is the @p partition suitable as an EFI boot partition? + * Checks for filesystem type (FAT32) and size (300MiB at least). + */ +bool isEfiFilesystemSuitable( const Partition* candidate ); + /** * @brief Is the given @p partition bootable in EFI? Depending on * the partition table layout, this may mean different flags. From 96c2c624707c6d84a9074d2eb7620cc5e504bc99 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 12:59:01 +0200 Subject: [PATCH 05/12] [partition] Fix build on older KPMCore --- src/modules/partition/core/PartUtils.cpp | 2 ++ src/modules/partition/core/PartitionLayout.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 5b8572189..4beac0db8 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -463,7 +463,9 @@ isEfiFilesystemSuitable(const Partition* candidate) } cWarning() << "FAT32 filesystem is too small (" << size << "bytes)"; return false; +#ifdef WITH_KPMCORE4API case FileSystem::Type::Fat12: +#endif case FileSystem::Type::Fat16: cWarning() << "FAT12 and FAT16 are probably not supported by EFI"; return false; diff --git a/src/modules/partition/core/PartitionLayout.cpp b/src/modules/partition/core/PartitionLayout.cpp index 61e7d2fdc..233f5117a 100644 --- a/src/modules/partition/core/PartitionLayout.cpp +++ b/src/modules/partition/core/PartitionLayout.cpp @@ -152,9 +152,11 @@ PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) case FileSystem::Lvm2_PV: case FileSystem::Udf: case FileSystem::Iso9660: +#ifdef WITH_KPMCORE4API case FileSystem::Luks2: case FileSystem::LinuxRaidMember: case FileSystem::BitLocker: +#endif // bad bad cWarning() << "The selected default FS" << defaultFsType << "is not suitable." << "Using ext4 instead."; defaultFsType = FileSystem::Ext4; @@ -173,7 +175,6 @@ PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) case FileSystem::F2fs: // ok break; - case FileSystem::Fat12: case FileSystem::Fat16: case FileSystem::Hfs: case FileSystem::HfsPlus: @@ -181,8 +182,11 @@ PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) case FileSystem::Hpfs: case FileSystem::Zfs: case FileSystem::Nilfs2: +#ifdef WITH_KPMCORE4API + case FileSystem::Fat12: case FileSystem::Apfs: case FileSystem::Minix: +#endif // weird cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; break; From 3531896892da84a60723fb98ca1d58805505d290 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 15:31:00 +0200 Subject: [PATCH 06/12] [mount] Factor out the default btrfs configuration --- src/modules/mount/main.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 5e5233935..8f019f1a3 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -29,6 +29,24 @@ _ = gettext.translation("calamares-python", def pretty_name(): return _("Mounting partitions.") + +def get_btrfs_subvolumes(): + """ + Gets the job-configuration for btrfs subvolumes, or if there is + none given, returns a default configuration that matches + the setup (/ and /home) from before configurability was introduced. + """ + 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="/@") ] + + return btrfs_subvolumes + + def mount_partition(root_mount_point, partition, partitions): """ Do a single mount of @p partition inside @p root_mount_point. @@ -74,13 +92,7 @@ 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", 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="/@") ] + btrfs_subvolumes = get_btrfs_subvolumes() subvolume_mountpoints = [d['mountPoint'] for d in btrfs_subvolumes] # Check if listed mountpoints besides / are already present and don't create subvolume for those From 6b2088c94e72d739862606060d48ba122bcb54c4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 15:34:13 +0200 Subject: [PATCH 07/12] [mount] Restore @home subvolume In 942221c764a8622c9b23d29b1db291404af0f63b the fixed-setup (with /@ and /@home) was replaced by the configurable btrfs layout, but the default went away. Restore the two-subvolume layout if nothing is configured. --- src/modules/mount/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 8f019f1a3..50eba72cb 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -42,7 +42,7 @@ def get_btrfs_subvolumes(): if btrfs_subvolumes is None: libcalamares.utils.warning("No configuration for btrfsSubvolumes") if not btrfs_subvolumes: - btrfs_subvolumes = [ dict(mountPoint="/", subvolume="/@") ] + btrfs_subvolumes = [ dict(mountPoint="/", subvolume="/@"), dict(mountPoint="/home", subvolume="/@home") ] return btrfs_subvolumes From cc357140e569d7ea9293d1ceb6a73a51dd491518 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 16:43:56 +0200 Subject: [PATCH 08/12] [mount] Factor out the subvolume-filtering for partitions --- src/modules/mount/main.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 50eba72cb..1a97718b0 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -30,11 +30,16 @@ def pretty_name(): return _("Mounting partitions.") -def get_btrfs_subvolumes(): +def get_btrfs_subvolumes(partitions): """ Gets the job-configuration for btrfs subvolumes, or if there is none given, returns a default configuration that matches the setup (/ and /home) from before configurability was introduced. + + @param partitions + The partitions (from the partitioning module) that will exist on disk. + This is used to filter out subvolumes that don't need to be created + because they get a dedicated partition instead. """ btrfs_subvolumes = libcalamares.job.configuration.get("btrfsSubvolumes", None) # Warn if there's no configuration at all, and empty configurations are @@ -44,6 +49,10 @@ def get_btrfs_subvolumes(): if not btrfs_subvolumes: btrfs_subvolumes = [ dict(mountPoint="/", subvolume="/@"), dict(mountPoint="/home", subvolume="/@home") ] + # Filter out the subvolumes which have a dedicated partition + non_root_partition_mounts = [ m for m in [ p.get("mountPoint", None) for p in partitions ] if m is not None and m != '/' ] + btrfs_subvolumes = filter(lambda s : s["mountPoint"] in non_root_partition_mounts, btrfs_subvolumes) + return btrfs_subvolumes @@ -92,15 +101,8 @@ 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 = get_btrfs_subvolumes() + btrfs_subvolumes = get_btrfs_subvolumes(partitions) - 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: - if "mountPoint" not in p or not p["mountPoint"]: - continue - if p["mountPoint"] in subvolume_mountpoints and p["mountPoint"] != '/': - btrfs_subvolumes = [d for d in btrfs_subvolumes if d['mountPoint'] != p["mountPoint"]] # Check if we need a subvolume for swap file swap_choice = global_storage.value( "partitionChoices" ) if swap_choice: From e800b2da2d35c6720973fc0437c6160340baf577 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 6 Jul 2021 16:48:46 +0200 Subject: [PATCH 09/12] [mount] Factor out swap-subvolume setting --- src/modules/mount/main.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 1a97718b0..f5faad7d1 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -53,6 +53,11 @@ def get_btrfs_subvolumes(partitions): non_root_partition_mounts = [ m for m in [ p.get("mountPoint", None) for p in partitions ] if m is not None and m != '/' ] btrfs_subvolumes = filter(lambda s : s["mountPoint"] in non_root_partition_mounts, btrfs_subvolumes) + # If we have a swap **file**, give it a separate subvolume. + swap_choice = libcalamares.globalstorage.value( "partitionChoices" ) + if swap_choice and swap_choice.get( "swap", None ) == "file": + btrfs_subvolumes.append({'mountPoint': '/swap', 'subvolume': '/@swap'}) + return btrfs_subvolumes @@ -62,7 +67,6 @@ def mount_partition(root_mount_point, partition, partitions): """ # Create mount point with `+` rather than `os.path.join()` because # `partition["mountPoint"]` starts with a '/'. - global_storage = libcalamares.globalstorage raw_mount_point = partition["mountPoint"] if not raw_mount_point: return @@ -103,12 +107,6 @@ def mount_partition(root_mount_point, partition, partitions): # Root has been mounted to btrfs volume -> create subvolumes from configuration btrfs_subvolumes = get_btrfs_subvolumes(partitions) - # Check if we need a subvolume for swap file - swap_choice = global_storage.value( "partitionChoices" ) - if swap_choice: - swap_choice = swap_choice.get( "swap", None ) - if swap_choice and swap_choice == "file": - btrfs_subvolumes.append({'mountPoint': '/swap', 'subvolume': '/@swap'}) # Store created list in global storage so it can be used in the fstab module libcalamares.globalstorage.insert("btrfsSubvolumes", btrfs_subvolumes) # Create the subvolumes that are in the completed list From 995646936ff357bdaeab1d3f297c40b607823ddc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 7 Jul 2021 12:38:41 +0200 Subject: [PATCH 10/12] [mount] Add test exercising refactored btrfs code --- src/modules/mount/tests/3.global | 8 ++++++++ src/modules/mount/tests/3.job | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 src/modules/mount/tests/3.global create mode 100644 src/modules/mount/tests/3.job diff --git a/src/modules/mount/tests/3.global b/src/modules/mount/tests/3.global new file mode 100644 index 000000000..9dae421df --- /dev/null +++ b/src/modules/mount/tests/3.global @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +partitions: + - device: "/dev/sdb1" + mountPoint: "/" + fs: "btrfs" +partitionChoices: + swap: file diff --git a/src/modules/mount/tests/3.job b/src/modules/mount/tests/3.job new file mode 100644 index 000000000..94b3a1492 --- /dev/null +++ b/src/modules/mount/tests/3.job @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +bogus: true + +# No configuration needed because the partitions are +# all filesystems that require no special handling. From eb4ffe737e55240759ff69c2ffb0108bb4a52d47 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 7 Jul 2021 12:57:08 +0200 Subject: [PATCH 11/12] [mount] Fix logic - filter() returns the items for which the predicate is True; we want to keep the subvolumes that do not have an explicit partition already associated. - need list() to hammer it back into a list for appending swap subvol. --- src/modules/mount/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index f5faad7d1..2e96b6036 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -51,7 +51,7 @@ def get_btrfs_subvolumes(partitions): # Filter out the subvolumes which have a dedicated partition non_root_partition_mounts = [ m for m in [ p.get("mountPoint", None) for p in partitions ] if m is not None and m != '/' ] - btrfs_subvolumes = filter(lambda s : s["mountPoint"] in non_root_partition_mounts, btrfs_subvolumes) + btrfs_subvolumes = list(filter(lambda s : s["mountPoint"] not in non_root_partition_mounts, btrfs_subvolumes)) # If we have a swap **file**, give it a separate subvolume. swap_choice = libcalamares.globalstorage.value( "partitionChoices" ) From 6b9a1530f82f2be9477ba9e4fe63c6daa4c35d8f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 7 Jul 2021 13:08:06 +0200 Subject: [PATCH 12/12] [mount] Add test exercising partial-filtering --- src/modules/mount/tests/4.global | 11 +++++++++++ src/modules/mount/tests/4.job | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/modules/mount/tests/4.global create mode 100644 src/modules/mount/tests/4.job diff --git a/src/modules/mount/tests/4.global b/src/modules/mount/tests/4.global new file mode 100644 index 000000000..1856c9dc3 --- /dev/null +++ b/src/modules/mount/tests/4.global @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +partitions: + - device: "/dev/sdb1" + mountPoint: "/" + fs: "btrfs" + - device: "/dev/sdb2" + mountPoint: "/home" + fs: "ext4" +partitionChoices: + swap: file diff --git a/src/modules/mount/tests/4.job b/src/modules/mount/tests/4.job new file mode 100644 index 000000000..dac758227 --- /dev/null +++ b/src/modules/mount/tests/4.job @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 + +btrfsSubvolumes: + - mountPoint: / + subvolume: /@ + - mountPoint: /home + subvolume: /@home + - mountPoint: /var/cache + subvolume: /@cache + - mountPoint: /var/log + subvolume: /@log