[PATCH v1 1/1] initramfs: correct parameter reference in hook_error function

44 views
Skip to first unread message

Rakesh Kumar

unread,
Sep 3, 2024, 9:17:01 AM9/3/24
to isar-...@googlegroups.com, jan.k...@siemens.com, cedric.h...@siemens.com, Rakesh Kumar
Fixed an issue in the hook_error function where the second
parameter ($2) was incorrectly referenced in the error message output.
The correct first parameter ($1) is now used to ensure that the
specified argument to hook_error is correctly logged into the logfile.

Signed-off-by: Rakesh Kumar <kumar....@siemens.com>
---
.../initramfs-tee-supplicant-hook/files/tee-supplicant.hook | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook
index 3e6adbed..3e2f4016 100644
--- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook
+++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook
@@ -24,7 +24,7 @@ esac
. /usr/share/initramfs-tools/hook-functions

hook_error() {
- echo "(ERROR): $2" >&2
+ echo "(ERROR): $1" >&2
exit 1
}

--
2.39.2

Jan Kiszka

unread,
Sep 3, 2024, 9:23:19 AM9/3/24
to Rakesh Kumar, isar-...@googlegroups.com, cedric.h...@siemens.com
Reviewed-by: Jan Kiszka <jan.k...@siemens.com>

Thanks,
Jan

--
Siemens AG, Technology
Linux Expert Center

Kumar, Rakesh

unread,
Sep 4, 2024, 1:26:06 AM9/4/24
to Kiszka, Jan, isar-...@googlegroups.com, cedric.h...@siemens.com
Hi all,

If there are no concerns or comments, could we proceed with merging these changes.


Regards,
Rakesh
> +++ upplicant.hook

Uladzimir Bely

unread,
Sep 9, 2024, 10:44:54 AM9/9/24
to Rakesh Kumar, isar-...@googlegroups.com
On Tue, 2024-09-03 at 18:45 +0530, 'Rakesh Kumar' via isar-users wrote:
> Fixed an issue in the hook_error function where the second
> parameter ($2) was incorrectly referenced in the error message
> output.
> The correct first parameter ($1) is now used to ensure that the
> specified argument to hook_error is correctly logged into the
> logfile.
>
> Signed-off-by: Rakesh Kumar <kumar....@siemens.com>
> ---
>  .../initramfs-tee-supplicant-hook/files/tee-supplicant.hook     | 2
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-
> hook/files/tee-supplicant.hook b/meta/recipes-initramfs/initramfs-
> tee-supplicant-hook/files/tee-supplicant.hook
> index 3e6adbed..3e2f4016 100644
> --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-
> supplicant.hook
> +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-
> supplicant.hook
> @@ -24,7 +24,7 @@ esac
>  . /usr/share/initramfs-tools/hook-functions
>  
>  hook_error() {
> -    echo "(ERROR): $2" >&2
> +    echo "(ERROR): $1" >&2
>      exit 1
>  }
>  
> --
> 2.39.2
>

Applied to next, thanks.

--
Best regards,
Uladzimir.
Reply all
Reply to author
Forward
0 new messages