diff mbox series

[isar-cip-core] initramfs-abrootfs/crypt-hook: Ensure that cryptroot is always last in local-top

Message ID e5b6c72c-15fd-4b9a-93bc-bf5499a9bfa5@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core] initramfs-abrootfs/crypt-hook: Ensure that cryptroot is always last in local-top | expand

Commit Message

Jan Kiszka March 4, 2025, 11:45 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

This breaks a circular dependency that is otherwise created when
cryptsetup-initramfs is installed. In case of isar-cip-core's initramfs
setup, this hook is unneeded. However, buster dependencies still pull it
in, causing the loop to surface - and the boot with abrootfs to break.
The dm-verity based setup was not affected.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../initramfs-abrootfs-hook/files/local-top-complete          | 4 +++-
 .../initramfs-crypt-hook/files/local-top-complete             | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-abrootfs-hook/files/local-top-complete b/recipes-initramfs/initramfs-abrootfs-hook/files/local-top-complete
index 848e8294..7048ced4 100644
--- a/recipes-initramfs/initramfs-abrootfs-hook/files/local-top-complete
+++ b/recipes-initramfs/initramfs-abrootfs-hook/files/local-top-complete
@@ -12,10 +12,12 @@ 
 prereqs()
 {
     # Make sure that this script is run last in local-top
+    # If the script cryptroot is installed this script
+    # should be second to last
     local req
     for req in "${0%/*}"/*; do
         script="${req##*/}"
-        if [ "$script" != "${0##*/}" ]; then
+        if [ "$script" != "${0##*/}" ] && [ "$script" != "cryptroot" ]; then
             printf '%s\n' "$script"
         fi
     done
diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
index 502fcc16..3b3ac069 100644
--- a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
+++ b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
@@ -18,7 +18,8 @@  prereqs()
 	for req in "${0%/*}"/*; do
 		script="${req##*/}"
 		if [ "$script" != "${0##*/}" ] &&
-		   [ "$script" != "abrootfs" ] && [ "$script" != "verity" ]; then
+		   [ "$script" != "abrootfs" ] && [ "$script" != "verity" ] &&
+		   [ "$script" != "cryptroot" ]; then
 			printf '%s\n' "$script"
 		fi
 	done