dracut/SOURCES/0107.patch
2026-03-30 11:20:35 -04:00

46 lines
1.7 KiB
Diff

From 2b145a4b9a3b74ce422071c8d43a18d9923963a2 Mon Sep 17 00:00:00 2001
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: Fri, 20 Jun 2025 08:38:27 -0400
Subject: [PATCH] fix(systemd-repart): allow partition format
systemd-repart is capable not only of creating a partition, but also of
formatting it. According with repart.d, it is able to create the
following filesystems: ext4, btrfs, xfs, vfat, erofs and squashfs.
Add support in the systemd-repart module for the underlying tools to
allow systemd-repart to format the partition.
Failure to do so would make systemd-repart initramfs unit fail, if
Format= option is provided in a repart.d config file.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
(cherry picked from commit d960ff4ba12a077b49f0cb3f5492b7c467a7738a)
Resolves: RHEL-103385
---
modules.d/01systemd-repart/module-setup.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/modules.d/01systemd-repart/module-setup.sh b/modules.d/01systemd-repart/module-setup.sh
index ed1ddcfd..b95d7640 100755
--- a/modules.d/01systemd-repart/module-setup.sh
+++ b/modules.d/01systemd-repart/module-setup.sh
@@ -30,6 +30,16 @@ install() {
"$systemdsystemunitdir"/initrd-root-fs.target.wants/systemd-repart.service \
systemd-repart
+ # Systemd-repart is capable of also formatting the created partition.
+ # Support all filesystems that repart.d supports.
+ inst_multiple -o \
+ "mkfs.ext4" \
+ "mkfs.btrfs" \
+ "mkfs.xfs" \
+ "mkfs.vfat" \
+ "mkfs.erofs" \
+ "mksquashfs"
+
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \