diff mbox series

[isar-cip-core] initramfs-crypt-hook: allow to run before mounting all overlays

Message ID 20250203155221.342136-1-Quirin.Gylstorff@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core] initramfs-crypt-hook: allow to run before mounting all overlays | expand

Commit Message

Quirin Gylstorff Feb. 3, 2025, 8:47 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

The overlay hook does not work with encrypted partitions
therefore it must run after the crypt mount script.

The crypt mount script run last to mount all encrypted partitions
which are not mount by other scripts.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 .../initramfs-crypt-hook/files/local-bottom-complete        | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jan Kiszka Feb. 3, 2025, 5:38 p.m. UTC | #1
On 03.02.25 09:47, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> The overlay hook does not work with encrypted partitions
> therefore it must run after the crypt mount script.
> 
> The crypt mount script run last to mount all encrypted partitions
> which are not mount by other scripts.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  .../initramfs-crypt-hook/files/local-bottom-complete        | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> index f47219b..b991cb4 100644
> --- a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> +++ b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> @@ -12,10 +12,14 @@
>  prereqs()
>  {
>  	# Make sure that this script is run last in local-top
> +	# but before overlay
> +	# This script mounts all encrypted partition, which are
> +	# not mounted previously
>  	local req
>  	for req in "${0%/*}"/*; do
>  		script="${req##*/}"
> -		if [ "$script" != "${0##*/}" ]; then
> +		if [ "$script" != "${0##*/}" ] &&
> +			[ "$script" != "overlay" ] ; then
>  			printf '%s\n' "$script"
>  		fi
>  	done

Thanks, applied.

Jan
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
index f47219b..b991cb4 100644
--- a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
+++ b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
@@ -12,10 +12,14 @@ 
 prereqs()
 {
 	# Make sure that this script is run last in local-top
+	# but before overlay
+	# This script mounts all encrypted partition, which are
+	# not mounted previously
 	local req
 	for req in "${0%/*}"/*; do
 		script="${req##*/}"
-		if [ "$script" != "${0##*/}" ]; then
+		if [ "$script" != "${0##*/}" ] &&
+			[ "$script" != "overlay" ] ; then
 			printf '%s\n' "$script"
 		fi
 	done