mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl via ptxdist <ptxdist@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <ada@thorsis.com>,
	Michael Olbrich <m.olbrich@pengutronix.de>,
	Fabian Pfitzner <f.pfitzner@pengutronix.de>,
	ruggero rossi <rugrossi@googlemail.com>
Subject: Re: [ptxdist] [PATCH] kernel: Call chmod modules.builtin.modinfo for v6.x only
Date: Fri, 27 Mar 2026 14:01:17 +0100	[thread overview]
Message-ID: <20260327-engraving-dipped-b51998608d5b@thorsis.com> (raw)
In-Reply-To: <CAH+2xPDB5ib9dtYwcOQCfORWKQ=3V5-nfg4UBTwDRpsKZOOWng@mail.gmail.com>

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



  reply	other threads:[~2026-03-27 13:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260327-engraving-dipped-b51998608d5b@thorsis.com \
    --to=ptxdist@pengutronix.de \
    --cc=ada@thorsis.com \
    --cc=f.pfitzner@pengutronix.de \
    --cc=m.olbrich@pengutronix.de \
    --cc=rugrossi@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox