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

Message ID 20240903131559.802498-1-kumar.rakesh@siemens.com
State Accepted, archived
Headers show
Series [v1,1/1] initramfs: correct parameter reference in hook_error function | expand

Commit Message

Rakesh Kumar Sept. 3, 2024, 1:15 p.m. UTC
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.rakesh@siemens.com>
---
 .../initramfs-tee-supplicant-hook/files/tee-supplicant.hook     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kiszka Sept. 3, 2024, 1:23 p.m. UTC | #1
On 03.09.24 15:15, Rakesh Kumar 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.rakesh@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
>  }
>  

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Thanks,
Jan
Rakesh Kumar Sept. 4, 2024, 5:26 a.m. UTC | #2
Hi all,

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


Regards,
Rakesh

-----Original Message-----
From: Kiszka, Jan (T CED) <jan.kiszka@siemens.com> 
Sent: 03 September 2024 18:53
To: Kumar, Rakesh (DI CTO FDS CES LX PBU 1) <kumar.rakesh@siemens.com>; isar-users@googlegroups.com
Cc: Hombourger, Cedric (DI CTO FDS CES LX) <cedric.hombourger@siemens.com>
Subject: Re: [PATCH v1 1/1] initramfs: correct parameter reference in hook_error function

On 03.09.24 15:15, Rakesh Kumar 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.rakesh@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-suppl
> icant.hook 
> b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-suppl
> icant.hook
> index 3e6adbed..3e2f4016 100644
> --- 
> a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-suppl
> icant.hook
> +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-s
> +++ upplicant.hook
> @@ -24,7 +24,7 @@ esac
>  . /usr/share/initramfs-tools/hook-functions
>  
>  hook_error() {
> -    echo "(ERROR): $2" >&2
> +    echo "(ERROR): $1" >&2
>      exit 1
>  }
>  

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Thanks,
Jan

--
Siemens AG, Technology
Linux Expert Center
Uladzimir Bely Sept. 9, 2024, 2:44 p.m. UTC | #3
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.rakesh@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.

Patch

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
 }