Skip to contentSkip to conversation

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

PATCH In review Aaron Thompson 4 participants 4 messages Oct 4, 2024 – Oct 6, 2024 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: deb-pkg: Remove blank first line from maint scripts

From: Aaron Thompson <[email protected]>

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")
---
 scripts/package/builddeb | 1 -
 1 file changed, 1 deletion(-)
scripts/package/builddeb +0 -1
index c1757db6aa8a..404587fc71fe 100755
@@ -74,7 +74,6 @@ install_linux_image () {
 
 		mkdir -p "${pdir}/DEBIAN"
 		cat <<-EOF > "${pdir}/DEBIAN/${script}"
-
 		#!/bin/sh
 
 		set -e

base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc

Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Aaron Thompson

From: Aaron Thompson <[email protected]>

The blank line causes execve() to fail:

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

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")
Quoted 21 lines
---
 scripts/package/builddeb | 1 -
 1 file changed, 1 deletion(-)
scripts/package/builddeb +0 -1
index c1757db6aa8a..404587fc71fe 100755
@@ -74,7 +74,6 @@ install_linux_image () {
 
 		mkdir -p "${pdir}/DEBIAN"
 		cat <<-EOF > "${pdir}/DEBIAN/${script}"
-
 		#!/bin/sh
 
 		set -e

base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc

Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#2 lore raw
In reply to Aaron Thompson
Quoted 32 lines · Aaron Thompson

From: Aaron Thompson <[email protected]>

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")
---
 scripts/package/builddeb | 1 -
 1 file changed, 1 deletion(-)
scripts/package/builddeb +0 -1
index c1757db6aa8a..404587fc71fe 100755
@@ -74,7 +74,6 @@ install_linux_image () {
 
 		mkdir -p "${pdir}/DEBIAN"
 		cat <<-EOF > "${pdir}/DEBIAN/${script}"
-
 		#!/bin/sh
 
 		set -e
Quoted 4 lines

base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc

Signature · 1 line
2.39.5

Thanks.

#3 lore raw
In reply to Aaron Thompson
Quoted 10 lines · Aaron Thompson

From: Aaron Thompson <[email protected]>

The blank line causes execve() to fail:

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

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")

---

Applied to linux-kbuild.
Thanks.

Quoted 21 lines
 scripts/package/builddeb | 1 -
 1 file changed, 1 deletion(-)
scripts/package/builddeb +0 -1
index c1757db6aa8a..404587fc71fe 100755
@@ -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

Signature · 2 lines
Best Regards
Masahiro Yamada