unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Ivan Kozlov <kanichos@yandex.ru>
Cc: 41924@debbugs.gnu.org
Subject: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs
Date: Thu, 18 Jun 2020 20:16:47 +0200	[thread overview]
Message-ID: <20200618201647.73f8b0d5@scratchpost.org> (raw)
In-Reply-To: <169811592419302@mail.yandex.ru>

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

Hi Ivan,

thanks for the patch, and for persevering on this.

Could you also add a system test to gnu/tests/linux-modules.scm ?

That would also mean that you'd create a variant of linux-libre that has
CONFIG_MODULES=n.

>                   (directory-entries
>                    (lambda (directory)
> -                    (scandir directory (lambda (basename)
> -                                         (not
> -                                           (string-prefix? "." basename))))))
> +                    (if (file-exists? directory)
> +                        (scandir directory (lambda (basename)
> +                                             (not
> +                                              (string-prefix? "." basename))))
> +                        '())))

That would silently skip packages that don't contain kernel modules (but for
example supertux or something), too, right?
(so misconfigured guix wouldn't be detected)

Also, if you tried to use a kernel without module support and then added modules
(for the wrong kernel, one with CONFIG_MODULES=y) via extra guix packages,
this would erroneously succeed, right?
(I guess depmod would have something against it, though.  Still, I'd like a test
for that)

Usually I'd be fine with these unsupported constellations, but misconfigured
kernel vs module ABI makes me reconsider my life choices, so probably not here :->

What I would do is try to find a file that's only in the kernel when there's
module support (/lib/modules doesn't count since there could be a kernel with
module support but no modules compiled), and then try to ascertain whether
CONFIG_MODULES=y that way, so
(define config-modules? (any (append-map directory-entries with marker-file)))
or something.

Then succeed either with config-modules? and at least one file per entry, or
with (not config-modules?) and no files anywhere.

Alternatively, we could at least make it only possible for the FIRST entry
in the list of module packages (which is the Linux kernel) to have no
/lib/modules, and not care about any of the other entries in that way.

> +               ;; Do nothing when there is nothing to do
> +               (() (mkdir #$output))

Good idea.

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

  parent reply	other threads:[~2020-06-18 18:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 18:44 [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs Ivan Kozlov
2020-06-17 21:18 ` Ivan Kozlov
2020-06-18 18:16 ` Danny Milosavljevic [this message]
2020-06-19  7:47   ` Ludovic Courtès
2020-06-19 14:23     ` Ivan Kozlov
2020-06-19 20:27       ` bug#41924: " Ludovic Courtès
2020-06-19  8:20   ` [bug#41924] " Ivan Kozlov

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20200618201647.73f8b0d5@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=41924@debbugs.gnu.org \
    --cc=kanichos@yandex.ru \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).