anaconda/files/0004-Revert-storage-Remove-support-for-the-btrfs-command-.patch

55 lines
1.7 KiB
Diff

From 97723cd95779e09d448bae6f0d3eb0313fc875d1 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa@centosproject.org>
Date: Sat, 25 Jan 2025 17:14:07 -0500
Subject: [PATCH 4/5] Revert "storage: Remove support for the btrfs command on
RHEL10"
Restore Btrfs support so system installations can use Btrfs and
images can be built using Lorax with Btrfs as the filesystem.
This reverts commit d426413bb7bae72a7f4f6770a567998c75d62a23.
---
pyanaconda/modules/storage/kickstart.py | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/modules/storage/kickstart.py b/pyanaconda/modules/storage/kickstart.py
index f435dd7f4c..e154c79a79 100644
--- a/pyanaconda/modules/storage/kickstart.py
+++ b/pyanaconda/modules/storage/kickstart.py
@@ -100,6 +100,23 @@ class AutoPart(COMMANDS.AutoPart):
return retval
+class BTRFS(COMMANDS.BTRFS):
+ """The btrfs kickstart command."""
+
+ def parse(self, args):
+ """Parse the command."""
+ retval = super().parse(args)
+
+ # Check the file system type.
+ fmt = get_format("btrfs")
+
+ if not fmt.supported or not fmt.formattable:
+ msg = _("Btrfs file system is not supported.")
+ raise KickstartParseError(msg, lineno=self.lineno)
+
+ return retval
+
+
class ClearPart(COMMANDS.ClearPart):
"""The clearpart kickstart command."""
@@ -295,7 +312,7 @@ class StorageKickstartSpecification(KickstartSpecification):
commands = {
"autopart": AutoPart,
"bootloader": COMMANDS.Bootloader,
- "btrfs": COMMANDS.BTRFS,
+ "btrfs": BTRFS,
"clearpart": ClearPart,
"fcoe": Fcoe,
"ignoredisk": IgnoreDisk,
--
2.49.0