mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] kernel: fix modules.builtin.modinfo being executable
@ 2025-12-10 16:22 Fabian Pfitzner
  2025-12-12 14:52 ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 10+ messages in thread
From: Fabian Pfitzner @ 2025-12-10 16:22 UTC (permalink / raw)
  To: ptxdist; +Cc: Fabian Pfitzner

Since kernel commit a26a6c93edfe ("kbuild: Strip trailing padding bytes from
modules.builtin.modinfo") [1], the resulting modules.builtin.modinfo file gets
copied by objcopy resulting in an executable file.

It seems, that objcopy detects this file as executable even though
the file is not executable at all.

Fix this problem by removing the execution bit afterwards.

I also send a patch upstream to the kernel [2].

[1] https://lore.kernel.org/all/20251105-kbuild-fix-builtin-modinfo-for-kmod-v1-1-b419d8ad4606@kernel.org
[2] https://lore.kernel.org/all/20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de/#t

Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
---
 rules/kernel.make | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rules/kernel.make b/rules/kernel.make
index 9cdc95a91b8b19bc1b5c19e9790bd9eb1c8c6d7c..e974304043f634add332dce10c7c2553f56b30a4 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -274,6 +274,7 @@ $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
+	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
 endif
 	@$(call world/dtb, KERNEL)
 	@$(call world/dtbo, KERNEL)

---
base-commit: fd0dc47b258aac09ab961199a3c00ecddf98f244
change-id: 20251210-modinfo-executable-c6985ef6da30

Best regards,
-- 
Fabian Pfitzner <f.pfitzner@pengutronix.de>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2025-12-10 16:22 [ptxdist] [PATCH] kernel: fix modules.builtin.modinfo being executable Fabian Pfitzner
@ 2025-12-12 14:52 ` Michael Olbrich
  2026-01-12 15:30   ` ruggero rossi via ptxdist
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Olbrich @ 2025-12-12 14:52 UTC (permalink / raw)
  To: ptxdist; +Cc: Fabian Pfitzner

Thanks, applied as 844408110d046a967ec1d588dd038d95a6065514.

Michael

[sent from post-receive hook]

On Fri, 12 Dec 2025 15:52:10 +0100, Fabian Pfitzner <f.pfitzner@pengutronix.de> wrote:
> Since kernel commit a26a6c93edfe ("kbuild: Strip trailing padding bytes from
> modules.builtin.modinfo") [1], the resulting modules.builtin.modinfo file gets
> copied by objcopy resulting in an executable file.
> 
> It seems, that objcopy detects this file as executable even though
> the file is not executable at all.
> 
> Fix this problem by removing the execution bit afterwards.
> 
> I also send a patch upstream to the kernel [2].
> 
> [1] https://lore.kernel.org/all/20251105-kbuild-fix-builtin-modinfo-for-kmod-v1-1-b419d8ad4606@kernel.org
> [2] https://lore.kernel.org/all/20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de/#t
> 
> Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
> Message-Id: <20251210-modinfo-executable-v1-1-23c6f3fc999e@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/kernel.make b/rules/kernel.make
> index 9cdc95a91b8b..e974304043f6 100644
> --- a/rules/kernel.make
> +++ b/rules/kernel.make
> @@ -274,6 +274,7 @@ $(STATEDIR)/kernel.install:
>  	@$(call targetinfo)
>  ifdef PTXCONF_KERNEL_MODULES_INSTALL
>  	@$(call world/install, KERNEL)
> +	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
>  endif
>  	@$(call world/dtb, KERNEL)
>  	@$(call world/dtbo, KERNEL)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2025-12-12 14:52 ` [ptxdist] [APPLIED] " Michael Olbrich
@ 2026-01-12 15:30   ` ruggero rossi via ptxdist
  2026-01-13  9:05     ` Michael Olbrich
  2026-01-13 14:57     ` [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable Uwe Kleine-König
  0 siblings, 2 replies; 10+ messages in thread
From: ruggero rossi via ptxdist @ 2026-01-12 15:30 UTC (permalink / raw)
  To: ptxdist; +Cc: ruggero rossi, Michael Olbrich, Fabian Pfitzner

Hello Everybody,

migrating to PTXDIST 2026.01.0, I found a problem compiling the kernel.
In my (quite old) kernel, there are no modules.builtin.modinfo files,
and ptxdist install fails.

It seems that the reason is this patch.

The following patch solved my problem:

--- /usr/local/lib/ptxdist-2026.01.0/rules/kernel.make	2025-12-12
09:44:06.000000000 +0100 +++ kernel.make	2026-01-12
16:14:44.223920509 +0100 @@ -285,7 +285,11 @@
 	@$(call targetinfo)
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
-	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
+	@for fileName in
$(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo; do \
+        if "$fileName" ; then \
+            chmod -x "$filename" ; \
+        fi ;\
+    done
 endif
 	@$(call world/dtb, KERNEL)
 	@$(call world/dtbo, KERNEL)

Best regards,

Ruggero Rossi


On Fri, 12 Dec 2025 15:52:10 +0100
Michael Olbrich <m.olbrich@pengutronix.de> wrote:

> Thanks, applied as 844408110d046a967ec1d588dd038d95a6065514.
> 
> Michael
> 
> [sent from post-receive hook]
> 
> On Fri, 12 Dec 2025 15:52:10 +0100, Fabian Pfitzner
> <f.pfitzner@pengutronix.de> wrote:
> > Since kernel commit a26a6c93edfe ("kbuild: Strip trailing padding
> > bytes from modules.builtin.modinfo") [1], the resulting
> > modules.builtin.modinfo file gets copied by objcopy resulting in an
> > executable file.
> > 
> > It seems, that objcopy detects this file as executable even though
> > the file is not executable at all.
> > 
> > Fix this problem by removing the execution bit afterwards.
> > 
> > I also send a patch upstream to the kernel [2].
> > 
> > [1]
> > https://lore.kernel.org/all/20251105-kbuild-fix-builtin-modinfo-for-kmod-v1-1-b419d8ad4606@kernel.org
> > [2]
> > https://lore.kernel.org/all/20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de/#t
> > 
> > Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
> > Message-Id:
> > <20251210-modinfo-executable-v1-1-23c6f3fc999e@pengutronix.de>
> > Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> > 
> > diff --git a/rules/kernel.make b/rules/kernel.make
> > index 9cdc95a91b8b..e974304043f6 100644
> > --- a/rules/kernel.make
> > +++ b/rules/kernel.make
> > @@ -274,6 +274,7 @@ $(STATEDIR)/kernel.install:
> >  	@$(call targetinfo)
> >  ifdef PTXCONF_KERNEL_MODULES_INSTALL
> >  	@$(call world/install, KERNEL)
> > +	@chmod -x
> > $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo endif
> >  	@$(call world/dtb, KERNEL)
> >  	@$(call world/dtbo, KERNEL)  
> 




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2026-01-12 15:30   ` ruggero rossi via ptxdist
@ 2026-01-13  9:05     ` Michael Olbrich
  2026-01-13  9:48       ` ruggero rossi via ptxdist
  2026-01-13 14:57     ` [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable Uwe Kleine-König
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Olbrich @ 2026-01-13  9:05 UTC (permalink / raw)
  To: ruggero rossi via ptxdist; +Cc: Fabian Pfitzner, ruggero rossi

Hi,

On Mon, Jan 12, 2026 at 04:30:53PM +0100, ruggero rossi via ptxdist wrote:
> migrating to PTXDIST 2026.01.0, I found a problem compiling the kernel.
> In my (quite old) kernel, there are no modules.builtin.modinfo files,
> and ptxdist install fails.

Older than 5.2, right? That's the version the file was introduced from what
I can tell from the git history.

> It seems that the reason is this patch.
> 
> The following patch solved my problem:
> 
> --- /usr/local/lib/ptxdist-2026.01.0/rules/kernel.make	2025-12-12
> 09:44:06.000000000 +0100 +++ kernel.make	2026-01-12
> 16:14:44.223920509 +0100 @@ -285,7 +285,11 @@
>  	@$(call targetinfo)
>  ifdef PTXCONF_KERNEL_MODULES_INSTALL
>  	@$(call world/install, KERNEL)
> -	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
> +	@for fileName in
> $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo; do \
> +        if "$fileName" ; then \
> +            chmod -x "$filename" ; \
> +        fi ;\
> +    done

I don't like patterns like this, because it silently fails if there is a
typo. And we know, that this is only needed for 6.18 or later. And all 6.x
versions install this file. So maybe wrap it with:

ifeq ($(KERNEL_VERSION_MAJOR),6)
	...
endif

Michael

>  endif
>  	@$(call world/dtb, KERNEL)
>  	@$(call world/dtbo, KERNEL)
> 
> Best regards,
> 
> Ruggero Rossi
> 
> 
> On Fri, 12 Dec 2025 15:52:10 +0100
> Michael Olbrich <m.olbrich@pengutronix.de> wrote:
> 
> > Thanks, applied as 844408110d046a967ec1d588dd038d95a6065514.
> > 
> > Michael
> > 
> > [sent from post-receive hook]
> > 
> > On Fri, 12 Dec 2025 15:52:10 +0100, Fabian Pfitzner
> > <f.pfitzner@pengutronix.de> wrote:
> > > Since kernel commit a26a6c93edfe ("kbuild: Strip trailing padding
> > > bytes from modules.builtin.modinfo") [1], the resulting
> > > modules.builtin.modinfo file gets copied by objcopy resulting in an
> > > executable file.
> > > 
> > > It seems, that objcopy detects this file as executable even though
> > > the file is not executable at all.
> > > 
> > > Fix this problem by removing the execution bit afterwards.
> > > 
> > > I also send a patch upstream to the kernel [2].
> > > 
> > > [1]
> > > https://lore.kernel.org/all/20251105-kbuild-fix-builtin-modinfo-for-kmod-v1-1-b419d8ad4606@kernel.org
> > > [2]
> > > https://lore.kernel.org/all/20251209-modinfo-executable-v1-1-ed0c553a4390@pengutronix.de/#t
> > > 
> > > Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
> > > Message-Id:
> > > <20251210-modinfo-executable-v1-1-23c6f3fc999e@pengutronix.de>
> > > Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> > > 
> > > diff --git a/rules/kernel.make b/rules/kernel.make
> > > index 9cdc95a91b8b..e974304043f6 100644
> > > --- a/rules/kernel.make
> > > +++ b/rules/kernel.make
> > > @@ -274,6 +274,7 @@ $(STATEDIR)/kernel.install:
> > >  	@$(call targetinfo)
> > >  ifdef PTXCONF_KERNEL_MODULES_INSTALL
> > >  	@$(call world/install, KERNEL)
> > > +	@chmod -x
> > > $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo endif
> > >  	@$(call world/dtb, KERNEL)
> > >  	@$(call world/dtbo, KERNEL)  
> > 
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2026-01-13  9:05     ` Michael Olbrich
@ 2026-01-13  9:48       ` ruggero rossi via ptxdist
  2026-03-27  9:56         ` [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only Alexander Dahl via ptxdist
  0 siblings, 1 reply; 10+ messages in thread
From: ruggero rossi via ptxdist @ 2026-01-13  9:48 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: ruggero rossi, Fabian Pfitzner, ruggero rossi via ptxdist

Hi,
> 
> I don't like patterns like this, because it silently fails if there is a
> typo. And we know, that this is only needed for 6.18 or later. And all
> 6.x versions install this file. So maybe wrap it with:
> 
> ifeq ($(KERNEL_VERSION_MAJOR),6)
> 	...
> endif
> 
> Michael
> 
In this case the patch is much simpler:

-- /usr/local/lib/ptxdist-2026.01.0/rules/kernel.make	2025-12-12
09:44:06.000000000 +0100 
+++ kernel.make	2026-01-13 10:36:36.840222985 +0100 
@@ -285,8 +285,10 @@
 	@$(call targetinfo)
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
+ifeq ($(KERNEL_VERSION_MAJOR),6)
 	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
 endif
+endif
 	@$(call world/dtb, KERNEL)
 	@$(call world/dtbo, KERNEL)
 	@$(call touch)

Ín my case I tested it successfully, and I think it would be nice to have
it included in the future.

Best regards,

Ruggero



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2026-01-12 15:30   ` ruggero rossi via ptxdist
  2026-01-13  9:05     ` Michael Olbrich
@ 2026-01-13 14:57     ` Uwe Kleine-König
  2026-01-16  8:31       ` ruggero rossi via ptxdist
  1 sibling, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2026-01-13 14:57 UTC (permalink / raw)
  To: ruggero rossi via ptxdist; +Cc: Michael Olbrich, Fabian Pfitzner, ruggero rossi

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Hello,

On Mon, Jan 12, 2026 at 04:30:53PM +0100, ruggero rossi via ptxdist wrote:
> migrating to PTXDIST 2026.01.0, I found a problem compiling the kernel.
> In my (quite old) kernel, there are no modules.builtin.modinfo files,
> and ptxdist install fails.
> 
> It seems that the reason is this patch.
> 
> The following patch solved my problem:
> 
> --- /usr/local/lib/ptxdist-2026.01.0/rules/kernel.make	2025-12-12
> 09:44:06.000000000 +0100 +++ kernel.make	2026-01-12
> 16:14:44.223920509 +0100 @@ -285,7 +285,11 @@
>  	@$(call targetinfo)
>  ifdef PTXCONF_KERNEL_MODULES_INSTALL
>  	@$(call world/install, KERNEL)
> -	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
> +	@for fileName in
> $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo; do \
> +        if "$fileName" ; then \

	if "$fileName"

looks wrong to me. Either this gives you a "Permission denied" error, or
the file already has the x bit set :-)

The side effect is however that $? is 0 because the if swallows the
error code, so it indeed fixes the build (but probably with an error
message in the log).

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable
  2026-01-13 14:57     ` [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable Uwe Kleine-König
@ 2026-01-16  8:31       ` ruggero rossi via ptxdist
  0 siblings, 0 replies; 10+ messages in thread
From: ruggero rossi via ptxdist @ 2026-01-16  8:31 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: ruggero rossi, Michael Olbrich, Fabian Pfitzner,
	ruggero rossi via ptxdist

On Tue, 13 Jan 2026 15:57:29 +0100
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Hello,
> 
> 	if "$fileName"
> 
> looks wrong to me. Either this gives you a "Permission denied" error, or
> the file already has the x bit set :-)
you are right. For some reason the [ -f ... ] disappeared.

However the observation of Michael Olbrich
> I don't like patterns like this, because it silently fails if there is a
> typo. And we know, that this is only needed for 6.18 or later. And all
> 6.x versions install this file. So maybe wrap it with:
> 
> ifeq ($(KERNEL_VERSION_MAJOR),6)
> 	...
> endif
> 

made this workaround unnecessary. The patch now should be:

-- /usr/local/lib/ptxdist-2026.01.0/rules/kernel.make	2025-12-12
09:44:06.000000000 +0100 
+++ kernel.make	2026-01-13 10:36:36.840222985 +0100 
@@ -285,8 +285,10 @@
 	@$(call targetinfo)
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
+ifeq ($(KERNEL_VERSION_MAJOR),6)
 	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
 endif
+endif
 	@$(call world/dtb, KERNEL)
 	@$(call world/dtbo, KERNEL)
 	@$(call touch)

reducing the changes against the original to a very minimum.

Best regards

Ruggero




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only
  2026-01-13  9:48       ` ruggero rossi via ptxdist
@ 2026-03-27  9:56         ` Alexander Dahl via ptxdist
  2026-03-27 12:43           ` Bruno Thomsen
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Dahl via ptxdist @ 2026-03-27  9:56 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl, Michael Olbrich, Fabian Pfitzner, ruggero rossi

kernel.install stage fails for kernel versions before v5.2 (which
introduced modules.builtin.modinfo in the first place) like this:

      DEPMOD  4.9.327-rt197-tt
    depmod: WARNING: could not open modules.builtin.modinfo at [redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/4.9.327-rt197-tt: No such file or directory
    chmod: cannot access '[redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/*/modules.builtin.modinfo': No such file or directory
    make: *** [/usr/local/lib/ptxdist-2026.01.0/rules/kernel.make:287: [redacted]/platform-ncl/state/kernel.install] Error 1
    ptxdist install kernel  3,75s user 1,63s system 101% cpu 5,308 total

The chmod fix is only necessary for kernel v6.18 which introduced the
faulty executable permissions.  It was fixed for v6.19 with kernel commit
6d60354ea2f9 ("kbuild: Fix permissions of modules.builtin.modinfo").

Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
Tested-by: Ruggero Rossi <rugrossi@googlemail.com>
Fixes: 844408110d04 ("kernel: fix modules.builtin.modinfo being executable")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 rules/kernel.make | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rules/kernel.make b/rules/kernel.make
index c1f10f62e..d366be714 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -285,7 +285,9 @@ $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
 ifdef PTXCONF_KERNEL_MODULES_INSTALL
 	@$(call world/install, KERNEL)
+ifeq ($(KERNEL_VERSION_MAJOR),6)
 	@chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
+endif
 endif
 	@$(call world/dtb, KERNEL)
 	@$(call world/dtbo, KERNEL)

base-commit: eedd3da887e42dcc0e6ffb95a348107e2a5bcf4f
-- 
2.47.3




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only
  2026-03-27  9:56         ` [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only Alexander Dahl via ptxdist
@ 2026-03-27 12:43           ` Bruno Thomsen
  2026-03-27 13:01             ` Alexander Dahl via ptxdist
  0 siblings, 1 reply; 10+ messages in thread
From: Bruno Thomsen @ 2026-03-27 12:43 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl, Michael Olbrich, Fabian Pfitzner, ruggero rossi

Hi Alexander,

Den fre. 27. mar. 2026 kl. 10.56 skrev Alexander Dahl via ptxdist
<ptxdist@pengutronix.de>:
>
> kernel.install stage fails for kernel versions before v5.2 (which
> introduced modules.builtin.modinfo in the first place) like this:
>
>       DEPMOD  4.9.327-rt197-tt
>     depmod: WARNING: could not open modules.builtin.modinfo at [redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/4.9.327-rt197-tt: No such file or directory
>     chmod: cannot access '[redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/*/modules.builtin.modinfo': No such file or directory
>     make: *** [/usr/local/lib/ptxdist-2026.01.0/rules/kernel.make:287: [redacted]/platform-ncl/state/kernel.install] Error 1
>     ptxdist install kernel  3,75s user 1,63s system 101% cpu 5,308 total
>
> The chmod fix is only necessary for kernel v6.18 which introduced the
> faulty executable permissions.  It was fixed for v6.19 with kernel commit
> 6d60354ea2f9 ("kbuild: Fix permissions of modules.builtin.modinfo").
>
> Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
> Tested-by: Ruggero Rossi <rugrossi@googlemail.com>
> Fixes: 844408110d04 ("kernel: fix modules.builtin.modinfo being executable")
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> ---
>  rules/kernel.make | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/rules/kernel.make b/rules/kernel.make
> index c1f10f62e..d366be714 100644
> --- a/rules/kernel.make
> +++ b/rules/kernel.make
> @@ -285,7 +285,9 @@ $(STATEDIR)/kernel.install:
>         @$(call targetinfo)
>  ifdef PTXCONF_KERNEL_MODULES_INSTALL
>         @$(call world/install, KERNEL)
> +ifeq ($(KERNEL_VERSION_MAJOR),6)
>         @chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
> +endif

Good fix, but it will break when using kernel version 7.0 which is
expected to be
released next month. Maybe do something like this (untested):

ifeq ($(shell test $(KERNEL_VERSION_MAJOR) -ge 6; echo $$?),0)

/Bruno

>  endif
>         @$(call world/dtb, KERNEL)
>         @$(call world/dtbo, KERNEL)
>
> base-commit: eedd3da887e42dcc0e6ffb95a348107e2a5bcf4f
> --
> 2.47.3
>
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only
  2026-03-27 12:43           ` Bruno Thomsen
@ 2026-03-27 13:01             ` Alexander Dahl via ptxdist
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Dahl via ptxdist @ 2026-03-27 13:01 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl, Michael Olbrich, Fabian Pfitzner, ruggero rossi

Hello Bruno,

Am Fri, Mar 27, 2026 at 01:43:29PM +0100 schrieb Bruno Thomsen:
> Hi Alexander,
> 
> Den fre. 27. mar. 2026 kl. 10.56 skrev Alexander Dahl via ptxdist
> <ptxdist@pengutronix.de>:
> >
> > kernel.install stage fails for kernel versions before v5.2 (which
> > introduced modules.builtin.modinfo in the first place) like this:
> >
> >       DEPMOD  4.9.327-rt197-tt
> >     depmod: WARNING: could not open modules.builtin.modinfo at [redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/4.9.327-rt197-tt: No such file or directory
> >     chmod: cannot access '[redacted]/platform-ncl/packages/linux-4.9.327/lib/modules/*/modules.builtin.modinfo': No such file or directory
> >     make: *** [/usr/local/lib/ptxdist-2026.01.0/rules/kernel.make:287: [redacted]/platform-ncl/state/kernel.install] Error 1
> >     ptxdist install kernel  3,75s user 1,63s system 101% cpu 5,308 total
> >
> > The chmod fix is only necessary for kernel v6.18 which introduced the
> > faulty executable permissions.  It was fixed for v6.19 with kernel commit
> > 6d60354ea2f9 ("kbuild: Fix permissions of modules.builtin.modinfo").
> >
> > Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
> > Tested-by: Ruggero Rossi <rugrossi@googlemail.com>
> > Fixes: 844408110d04 ("kernel: fix modules.builtin.modinfo being executable")
> > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > ---
> >  rules/kernel.make | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/rules/kernel.make b/rules/kernel.make
> > index c1f10f62e..d366be714 100644
> > --- a/rules/kernel.make
> > +++ b/rules/kernel.make
> > @@ -285,7 +285,9 @@ $(STATEDIR)/kernel.install:
> >         @$(call targetinfo)
> >  ifdef PTXCONF_KERNEL_MODULES_INSTALL
> >         @$(call world/install, KERNEL)
> > +ifeq ($(KERNEL_VERSION_MAJOR),6)
> >         @chmod -x $(KERNEL_PKGDIR)/lib/modules/*/modules.builtin.modinfo
> > +endif
> 
> Good fix, but it will break when using kernel version 7.0 which is
> expected to be
> released next month. Maybe do something like this (untested):
> 
> ifeq ($(shell test $(KERNEL_VERSION_MAJOR) -ge 6; echo $$?),0)

I actually noticed the same thing: fix is for kernel v6 only,
and asked myself what's with v7 or later?

Turns out that's sufficient, because as written in the commit message:
only kernel v6.18 is affected.  There is no chmod necessary for
releases before _and_ after v6.18.  In other words: the chmod call
should be avoided for kernels up to v5.1 (intention of the patch), and
is neither necessary for v5.2 or later v5 kernels, nor is it necessary
for v7 and later (given there won't be regressions), because the flaw
was introduced with v6.18 and fixed with v6.19.  That's why I added a
note in the commit message.  I does not break things when calling on
all v6 kernels though.

I think Michael suggested to test on major version only, because it is
easier to implement and less likely to break?  Should we add a comment
in the makefile for clarifying or is git history enough?

Nevertheless, thanks for pointing it out.

Greets
Alex

> 
> /Bruno
> 
> >  endif
> >         @$(call world/dtb, KERNEL)
> >         @$(call world/dtbo, KERNEL)
> >
> > base-commit: eedd3da887e42dcc0e6ffb95a348107e2a5bcf4f
> > --
> > 2.47.3
> >
> >
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-03-27 13:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-10 16:22 [ptxdist] [PATCH] kernel: fix modules.builtin.modinfo being executable Fabian Pfitzner
2025-12-12 14:52 ` [ptxdist] [APPLIED] " Michael Olbrich
2026-01-12 15:30   ` ruggero rossi via ptxdist
2026-01-13  9:05     ` Michael Olbrich
2026-01-13  9:48       ` ruggero rossi via ptxdist
2026-03-27  9:56         ` [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only Alexander Dahl via ptxdist
2026-03-27 12:43           ` Bruno Thomsen
2026-03-27 13:01             ` Alexander Dahl via ptxdist
2026-01-13 14:57     ` [ptxdist] [APPLIED] kernel: fix modules.builtin.modinfo being executable Uwe Kleine-König
2026-01-16  8:31       ` ruggero rossi via ptxdist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox