rootfs.py: find .ko.zst kernel modules

Message ID 20220531151052.3667079-1-sean.anderson@seco.com
State Accepted, archived
Commit 425efac7110f0f42d70643e0a448e834d0f01a7a
Headers show
Series rootfs.py: find .ko.zst kernel modules | expand

Commit Message

Sean Anderson May 31, 2022, 3:10 p.m. UTC
With CONFIG_MODULE_COMPRESS_ZSTD enabled, kernel modules will have a
.ko.zst extension. This fixes depmod not being run.

Fixes: 1b696a45ddb ("rootfs.py: Add check for kernel modules before running depmod")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

 meta/lib/oe/rootfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Ceresoli June 1, 2022, 6:39 a.m. UTC | #1
Hi Sean,

Il giorno Tue, 31 May 2022 11:10:52 -0400
"Sean Anderson via lists.openembedded.org"
<sean.anderson=seco.com@lists.openembedded.org> ha scritto:

> With CONFIG_MODULE_COMPRESS_ZSTD enabled, kernel modules will have a
> .ko.zst extension. This fixes depmod not being run.
> 
> Fixes: 1b696a45ddb ("rootfs.py: Add check for kernel modules before running depmod")

We can't blame this commit done in 2015 for not having implemented
MODULE_COMPRESS_ZSTD, added in the kernel in 2021.

And actually I don't think there is anything to fix here, but rather we
have a feature that was non-existing in the past, now it exists and we
want to support it.

So I'm taking this patch in my testing branch with the 'Fixes:' line
removed.

> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> 
>  meta/lib/oe/rootfs.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index 98cf3f244d4..61ccf369f12 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -311,7 +311,7 @@ class Rootfs(object, metaclass=ABCMeta):
>      def _check_for_kernel_modules(self, modules_dir):
>          for root, dirs, files in os.walk(modules_dir, topdown=True):
>              for name in files:
> -                found_ko = name.endswith((".ko", ".ko.gz", ".ko.xz"))
> +                found_ko = name.endswith((".ko", ".ko.gz", ".ko.xz", ".ko.zst"))
>                  if found_ko:
>                      return found_ko
>          return False
Luca Ceresoli June 1, 2022, 7:13 a.m. UTC | #2
Hi Sean,

Il giorno Tue, 31 May 2022 11:10:52 -0400
"Sean Anderson via lists.openembedded.org"
<sean.anderson=seco.com@lists.openembedded.org> ha scritto:

As you can see from the above line, your e-mails appear as coming from
an inappropriate address. This is not your fault, it's a mangling done
by mail servers, but it makes applying patches more complex.

It should be easy to fix, at least enough to allow patches to apply
properly, by setting the sendemail.from parameter in your git config.
This should force outgoing patches to start with a 'From:' line in the
body, and that one is used by git am to take the correct commit author
e-mail.

Can you please try that before sending another patch?

Thank you!
Sean Anderson June 2, 2022, 2:52 p.m. UTC | #3
Hi Luca,

On 6/1/22 3:13 AM, Luca Ceresoli wrote:
> [You don't often get email from luca.ceresoli@bootlin.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification.]
> 
> Hi Sean,
> 
> Il giorno Tue, 31 May 2022 11:10:52 -0400
> "Sean Anderson via lists.openembedded.org"
> <sean.anderson=seco.com@lists.openembedded.org> ha scritto:
> 
> As you can see from the above line, your e-mails appear as coming from
> an inappropriate address. This is not your fault, it's a mangling done
> by mail servers, but it makes applying patches more complex.
> 
> It should be easy to fix, at least enough to allow patches to apply
> properly, by setting the sendemail.from parameter in your git config.
> This should force outgoing patches to start with a 'From:' line in the
> body, and that one is used by git am to take the correct commit author
> e-mail.
> 
> Can you please try that before sending another patch?
> 
> Thank you!

I believe the From header is being modified by the openembedded mailing
list. On my local email client I see the correct From. Further, git
send-email reports the correct From as well:

> Server: smtp.office365.com
> MAIL FROM:<sean.anderson@seco.com>
> RCPT TO:<openembedded-core@lists.openembedded.org>
> RCPT TO:<chris.chapuis@gmail.com>
> RCPT TO:<richard.purdie@linuxfoundation.org>
> RCPT TO:<Martin.Jansa@gmail.com>
> RCPT TO:<sean.anderson@seco.com>
> From: Sean Anderson <sean.anderson@seco.com>
> To: openembedded-core@lists.openembedded.org
> Cc: Christophe Chapuis <chris.chapuis@gmail.com>,
> 	Richard Purdie <richard.purdie@linuxfoundation.org>,
> 	Martin Jansa <Martin.Jansa@gmail.com>,
> 	Sean Anderson <sean.anderson@seco.com>
> Subject: [PATCH] rootfs.py: find .ko.zst kernel modules
> Date: Tue, 31 May 2022 11:10:52 -0400
> Message-Id: <20220531151052.3667079-1-sean.anderson@seco.com>
> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty
> MIME-Version: 1.0
> Content-Transfer-Encoding: 8bit
> 
> Result: 250

I suggest contacting the mailing list admin if you aren't happy with
this behavior.

--Sean
Luca Ceresoli June 3, 2022, 9:22 a.m. UTC | #4
Hi Sean,

On Thu, 2 Jun 2022 10:52:59 -0400
"Sean Anderson via lists.openembedded.org"
<sean.anderson=seco.com@lists.openembedded.org> wrote:

> Hi Luca,
> 
> On 6/1/22 3:13 AM, Luca Ceresoli wrote:
> > [You don't often get email from luca.ceresoli@bootlin.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification.]
> > 
> > Hi Sean,
> > 
> > Il giorno Tue, 31 May 2022 11:10:52 -0400
> > "Sean Anderson via lists.openembedded.org"
> > <sean.anderson=seco.com@lists.openembedded.org> ha scritto:
> > 
> > As you can see from the above line, your e-mails appear as coming from
> > an inappropriate address. This is not your fault, it's a mangling done
> > by mail servers, but it makes applying patches more complex.
> > 
> > It should be easy to fix, at least enough to allow patches to apply
> > properly, by setting the sendemail.from parameter in your git config.
> > This should force outgoing patches to start with a 'From:' line in the
> > body, and that one is used by git am to take the correct commit author
> > e-mail.
> > 
> > Can you please try that before sending another patch?
> > 
> > Thank you!  
> 
> I believe the From header is being modified by the openembedded mailing
> list. On my local email client I see the correct From. Further, git
> send-email reports the correct From as well:

Sure, this is absolutely *not* your fault!

This is done by DMARC (https://en.wikipedia.org/wiki/DMARC) as part of
anti-phishing and the like and it happend on some domains, including
the one I am using as you can see. The issue has already been discussed
but as far as I know if you are hit by it there is currently no better
alternative than using the git sendemail.from field to put an
*additional* From line at the beginning of the body.

When people receive an e-mail from the mailing list, it will look like:

------------------------8<------------------------
From: "Sean Anderson via lists.openembedded.org" <sean.anderson=seco.com@lists.openembedded.org>
To: openembedded-core@lists.openembedded.org
Cc: Christophe Chapuis <chris.chapuis@gmail.com>,
	Richard Purdie <richard.purdie@linuxfoundation.org>,
	Martin Jansa <Martin.Jansa@gmail.com>,
	Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH] rootfs.py: find .ko.zst kernel modules
Date: Tue, 31 May 2022 11:10:52 -0400
Message-Id: <20220531151052.3667079-1-sean.anderson@seco.com>
X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Sean Anderson <sean.anderson@seco.com>     <---- THIS ONE

...your original commit message + diff...
------------------------8<------------------------

See the additional 'From:' line in the body. Since it is in the body and
not in the header, DMARC won't mangle it. 'git am' will use it for the
Author: field and remove it from the commit message.

I suggest you (and anybody affected by the issue) to try and see: it's
simpler to do it than to explain it! :-)

Patch

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 98cf3f244d4..61ccf369f12 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -311,7 +311,7 @@  class Rootfs(object, metaclass=ABCMeta):
     def _check_for_kernel_modules(self, modules_dir):
         for root, dirs, files in os.walk(modules_dir, topdown=True):
             for name in files:
-                found_ko = name.endswith((".ko", ".ko.gz", ".ko.xz"))
+                found_ko = name.endswith((".ko", ".ko.gz", ".ko.xz", ".ko.zst"))
                 if found_ko:
                     return found_ko
         return False