Skip to content

Commit 6d93d42

Browse files
authored
[3.0] dracut: patch for systemd-cryptsetup module to be included (#12827)
1 parent 75c2a47 commit 6d93d42

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

SPECS/dracut/dracut.spec

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: dracut to create initramfs
55
Name: dracut
66
Version: 102
7-
Release: 11%{?dist}
7+
Release: 12%{?dist}
88
# The entire source code is GPLv2+
99
# except install/* which is LGPLv2+
1010
License: GPLv2+ AND LGPLv2+
@@ -56,6 +56,16 @@ Patch: 0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include
5656
Patch: 0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch
5757
Patch: 0016-Handle-SELinux-configuration-for-overlayfs-folders.patch
5858
Patch: avoid-mktemp-collisions-with-find-not-path.patch
59+
# fix-dracut-systemd-include-systemd-cryptsetup.patch has been introduced
60+
# by the Azure Linux team to ensure that the systemd-cryptsetup module is included
61+
# in the initramfs when needed.
62+
# In dracut 102, systemd-cryptsetup was split from the crypt module and is no longer
63+
# included by default, causing encrypted volumes in crypttab to be skipped in initrd.
64+
# This patch modifies dracut-systemd to explicitly include systemd-cryptsetup.
65+
# The patch can be removed if Dracut is upgraded to 104+.
66+
# - References: https://github.com/dracut-ng/dracut-ng/pull/262
67+
# https://github.com/dracut-ng/dracut-ng/commit/e0e5424a7b5e387ccb70e47ffea5a59716bf7b76
68+
Patch: fix-dracut-systemd-include-systemd-cryptsetup.patch
5969

6070
BuildRequires: bash
6171
BuildRequires: kmod-devel
@@ -315,6 +325,9 @@ ln -srv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_sbindir}/%{name}
315325
%dir %{_sharedstatedir}/%{name}/overlay
316326

317327
%changelog
328+
* Tue Mar 11 2025 Archana Choudhary <archana1@microsoft.com> - 102-12
329+
- Add fix for systemd-cryptsetup module to be included in initramfs when needed
330+
318331
* Mon Mar 05 2025 George Mileka <gmileka@microsoft.com> - 102-11
319332
- Update overlayfs selinux handling with the full path of chcon
320333

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From e0e5424a7b5e387ccb70e47ffea5a59716bf7b76 Mon Sep 17 00:00:00 2001
2+
From: Jo Zzsi <jozzsicsataban@gmail.com>
3+
Date: Wed, 28 Aug 2024 23:06:08 -0400
4+
Subject: [PATCH] fix(dracut-systemd): include systemd-cryptsetup module when
5+
needed
6+
7+
---
8+
modules.d/98dracut-systemd/module-setup.sh | 12 +++++++++++-
9+
1 file changed, 11 insertions(+), 1 deletion(-)
10+
11+
diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh
12+
index 0ea26d425..6b8f42ae3 100755
13+
--- a/modules.d/98dracut-systemd/module-setup.sh
14+
+++ b/modules.d/98dracut-systemd/module-setup.sh
15+
@@ -12,7 +12,17 @@ check() {
16+
17+
# called by dracut
18+
depends() {
19+
- echo "systemd-initrd systemd-ask-password"
20+
+ local deps
21+
+ deps="systemd-initrd systemd-ask-password"
22+
+
23+
+ # when systemd and crypt are both included
24+
+ # systemd-cryptsetup is mandatory dependency
25+
+ # see https://github.com/dracut-ng/dracut-ng/issues/563
26+
+ if dracut_module_included "crypt"; then
27+
+ deps+=" systemd-cryptsetup"
28+
+ fi
29+
+
30+
+ echo "$deps"
31+
return 0
32+
}
33+

0 commit comments

Comments
 (0)