[PATCH] kbuild: deb-pkg: Remove blank first line from maint scripts

Aaron Thompson posted 1 patch 1 month, 3 weeks ago
scripts/package/builddeb | 1 -
1 file changed, 1 deletion(-)
[PATCH] kbuild: deb-pkg: Remove blank first line from maint scripts
Posted by Aaron Thompson 1 month, 3 weeks ago
From: Aaron Thompson <dev@aaront.org>

The blank line causes execve() to fail:

  # strace ./postinst
  execve("./postinst", ...) = -1 ENOEXEC (Exec format error)
  strace: exec: Exec format error
  +++ exited with 1 +++

However running the scripts via shell does work (at least with bash)
because the shell attempts to execute the file as a shell script when
execve() fails.

Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions")
Signed-off-by: Aaron Thompson <dev@aaront.org>
---
 scripts/package/builddeb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index c1757db6aa8a..404587fc71fe 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -74,7 +74,6 @@ install_linux_image () {
 
 		mkdir -p "${pdir}/DEBIAN"
 		cat <<-EOF > "${pdir}/DEBIAN/${script}"
-
 		#!/bin/sh
 
 		set -e

base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
-- 
2.39.5
Re: [PATCH] kbuild: deb-pkg: Remove blank first line from maint scripts
Posted by Masahiro Yamada 1 month, 3 weeks ago
On Fri, Oct 4, 2024 at 4:54 PM Aaron Thompson <dev@aaront.org> wrote:
>
> From: Aaron Thompson <dev@aaront.org>
>
> The blank line causes execve() to fail:
>
>   # strace ./postinst
>   execve("./postinst", ...) = -1 ENOEXEC (Exec format error)
>   strace: exec: Exec format error
>   +++ exited with 1 +++
>
> However running the scripts via shell does work (at least with bash)
> because the shell attempts to execute the file as a shell script when
> execve() fails.
>
> Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions")
> Signed-off-by: Aaron Thompson <dev@aaront.org>
> ---

Applied to linux-kbuild.
Thanks.


>  scripts/package/builddeb | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index c1757db6aa8a..404587fc71fe 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -74,7 +74,6 @@ install_linux_image () {
>
>                 mkdir -p "${pdir}/DEBIAN"
>                 cat <<-EOF > "${pdir}/DEBIAN/${script}"
> -
>                 #!/bin/sh
>
>                 set -e
>
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> --
> 2.39.5
>
>


-- 
Best Regards
Masahiro Yamada
Re: [PATCH] kbuild: deb-pkg: Remove blank first line from maint scripts
Posted by Nicolas Schier 1 month, 3 weeks ago
On Fri, Oct 04, 2024 at 07:52:45AM +0000, Aaron Thompson wrote:
> From: Aaron Thompson <dev@aaront.org>
> 
> The blank line causes execve() to fail:
> 
>   # strace ./postinst
>   execve("./postinst", ...) = -1 ENOEXEC (Exec format error)
>   strace: exec: Exec format error
>   +++ exited with 1 +++
> 
> However running the scripts via shell does work (at least with bash)
> because the shell attempts to execute the file as a shell script when
> execve() fails.
> 
> Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions")
> Signed-off-by: Aaron Thompson <dev@aaront.org>
> ---
>  scripts/package/builddeb | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index c1757db6aa8a..404587fc71fe 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -74,7 +74,6 @@ install_linux_image () {
>  
>  		mkdir -p "${pdir}/DEBIAN"
>  		cat <<-EOF > "${pdir}/DEBIAN/${script}"
> -
>  		#!/bin/sh
>  
>  		set -e
> 
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> -- 
> 2.39.5
> 

Thanks.

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Re: [PATCH] kbuild: deb-pkg: Remove blank first line from maint scripts
Posted by Nathan Chancellor 1 month, 3 weeks ago
On Fri, Oct 04, 2024 at 07:52:45AM +0000, Aaron Thompson wrote:
> From: Aaron Thompson <dev@aaront.org>
> 
> The blank line causes execve() to fail:
> 
>   # strace ./postinst
>   execve("./postinst", ...) = -1 ENOEXEC (Exec format error)
>   strace: exec: Exec format error
>   +++ exited with 1 +++
> 
> However running the scripts via shell does work (at least with bash)
> because the shell attempts to execute the file as a shell script when
> execve() fails.
> 
> Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions")
> Signed-off-by: Aaron Thompson <dev@aaront.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  scripts/package/builddeb | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index c1757db6aa8a..404587fc71fe 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -74,7 +74,6 @@ install_linux_image () {
>  
>  		mkdir -p "${pdir}/DEBIAN"
>  		cat <<-EOF > "${pdir}/DEBIAN/${script}"
> -
>  		#!/bin/sh
>  
>  		set -e
> 
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> -- 
> 2.39.5
>