From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 17 14:44:52 2020 Received: (at submit) by debbugs.gnu.org; 17 Jun 2020 18:44:52 +0000 Received: from localhost ([127.0.0.1]:52189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jld3L-0003Ul-SV for submit@debbugs.gnu.org; Wed, 17 Jun 2020 14:44:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:44392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jld3H-0003Ua-4V for submit@debbugs.gnu.org; Wed, 17 Jun 2020 14:44:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jld3G-00067v-DV for guix-patches@gnu.org; Wed, 17 Jun 2020 14:44:46 -0400 Received: from forward105o.mail.yandex.net ([2a02:6b8:0:1a2d::608]:37554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jld3D-0000rH-DZ for guix-patches@gnu.org; Wed, 17 Jun 2020 14:44:46 -0400 Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 9BCD74201FA5 for ; Wed, 17 Jun 2020 21:44:36 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback7o.mail.yandex.net (mxback/Yandex) with ESMTP id A25J3XgW8z-iaD86kf0; Wed, 17 Jun 2020 21:44:36 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592419476; bh=cuBP9eYbsCczWZxxR3m68zNUr3hnM4KD9j+NGCWzzuU=; h=Message-Id:Date:Subject:To:From; b=hLduEs3ba0DXGiKEg+tym6c7DkWX4EGWFg5+1GwIgrOsDJiyBlZbW3uECc79Iyw/A PqnA7+uQk46tx4J4fgxvPCYoBM6xGVJDLjUfafDRLTaGbMIw7zFs/6Qb3LqHsONl8l rxUuySeUA3ot6SE9HP+NwDiDDT8gIixM2dk0b8pQ= Authentication-Results: mxback7o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt6-6c65baa90efa.qloud-c.yandex.net with HTTP; Wed, 17 Jun 2020 21:44:35 +0300 From: Ivan Kozlov To: guix-patches Subject: [PATCH] profiles: Make linux-module-database skip inappropriate inputs MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 17 Jun 2020 21:44:35 +0300 Message-Id: <169811592419302@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Received-SPF: pass client-ip=2a02:6b8:0:1a2d::608; envelope-from=kanichos@yandex.ru; helo=forward105o.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This allows a Linux package with CONFIG_MODULES=n, that doesn’t contain the ‘lib/modules’ directory, to be used. * guix/profiles.scm (linux-module-database): Add if clause to ignore unrelated inputs. Allow empty result. --- guix/profiles.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 25ff146bdf..a3868e8343 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1220,9 +1220,11 @@ This is meant to be used as a profile hook." inputs)) (directory-entries (lambda (directory) - (scandir directory (lambda (basename) - (not - (string-prefix? "." basename)))))) + (if (file-exists? directory) + (scandir directory (lambda (basename) + (not + (string-prefix? "." basename)))) + '()))) ;; Note: Should usually result in one entry. (versions (delete-duplicates (append-map directory-entries @@ -1233,6 +1235,8 @@ This is meant to be used as a profile hook." (setenv "PATH" #+(file-append kmod "/bin")) (make-linux-module-directory inputs version #$output) (setenv "PATH" old-path))) + ;; Do nothing when there is nothing to do + (() (mkdir #$output)) (_ (error "Specified Linux kernel and Linux kernel modules are not all of the same version"))))))) (gexp->derivation "linux-module-database" build -- 2.26.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 17 17:19:09 2020 Received: (at 41924) by debbugs.gnu.org; 17 Jun 2020 21:19:09 +0000 Received: from localhost ([127.0.0.1]:52283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlfSe-00077f-Qq for submit@debbugs.gnu.org; Wed, 17 Jun 2020 17:19:09 -0400 Received: from forward501j.mail.yandex.net ([5.45.198.251]:51738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlfSa-000777-3D for 41924@debbugs.gnu.org; Wed, 17 Jun 2020 17:19:06 -0400 Received: from mxback28o.mail.yandex.net (mxback28o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::79]) by forward501j.mail.yandex.net (Yandex) with ESMTP id E841F338002E for <41924@debbugs.gnu.org>; Thu, 18 Jun 2020 00:18:56 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback28o.mail.yandex.net (mxback/Yandex) with ESMTP id eiJfClVMNX-Iuq40si8; Thu, 18 Jun 2020 00:18:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592428736; bh=xDHzHkNjncpew0U2dWjAdje58NYc1/bnXO7phOA78Lw=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=HtZByRSyx273/tz0paBOUv7Dk/Oyl9Nmt2EZ3Vt/TnmhUpUBJ3YJQm9rXQD1MujQ1 dU8NAj5s9Q3efm1UG+qvzpgfmns+/RukM22dD2hUq/tRl6rseV1AeQPkcLKYP7Aql+ e79uonCW5T7e/VzL208iXeP/lLwn6hz0aelXvbWg= Authentication-Results: mxback28o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas8-f59b61ed75ea.qloud-c.yandex.net with HTTP; Thu, 18 Jun 2020 00:18:55 +0300 From: Ivan Kozlov To: "41924@debbugs.gnu.org" <41924@debbugs.gnu.org> In-Reply-To: <169811592419302@mail.yandex.ru> References: <169811592419302@mail.yandex.ru> Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 18 Jun 2020 00:18:55 +0300 Message-Id: <182531592428678@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41924 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) mkdir should of course be changed to mkdir-p. 17.06.2020, 21:45, "Ivan Kozlov" : > This allows a Linux package with CONFIG_MODULES=n, that doesn’t contain the ‘lib/modules’ directory, to be used. > > * guix/profiles.scm (linux-module-database): Add if clause to ignore unrelated inputs. Allow empty result. > --- >  guix/profiles.scm | 10 +++++++--- >  1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/guix/profiles.scm b/guix/profiles.scm > index 25ff146bdf..a3868e8343 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -1220,9 +1220,11 @@ This is meant to be used as a profile hook." >                         inputs)) >                   (directory-entries >                    (lambda (directory) > - (scandir directory (lambda (basename) > - (not > - (string-prefix? "." basename)))))) > + (if (file-exists? directory) > + (scandir directory (lambda (basename) > + (not > + (string-prefix? "." basename)))) > + '()))) >                   ;; Note: Should usually result in one entry. >                   (versions (delete-duplicates >                              (append-map directory-entries > @@ -1233,6 +1235,8 @@ This is meant to be used as a profile hook." >                    (setenv "PATH" #+(file-append kmod "/bin")) >                    (make-linux-module-directory inputs version #$output) >                    (setenv "PATH" old-path))) > + ;; Do nothing when there is nothing to do > + (() (mkdir #$output)) >                 (_ (error "Specified Linux kernel and Linux kernel modules >  are not all of the same version"))))))) >    (gexp->derivation "linux-module-database" build > -- > 2.26.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 18 14:16:54 2020 Received: (at 41924) by debbugs.gnu.org; 18 Jun 2020 18:16:54 +0000 Received: from localhost ([127.0.0.1]:54377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlz5p-00072W-QT for submit@debbugs.gnu.org; Thu, 18 Jun 2020 14:16:54 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:35526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlz5n-00072N-75 for 41924@debbugs.gnu.org; Thu, 18 Jun 2020 14:16:52 -0400 Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at [80.110.127.207]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 6AAC93367CA9; Thu, 18 Jun 2020 20:16:49 +0200 (CEST) Date: Thu, 18 Jun 2020 20:16:47 +0200 From: Danny Milosavljevic To: Ivan Kozlov Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs Message-ID: <20200618201647.73f8b0d5@scratchpost.org> In-Reply-To: <169811592419302@mail.yandex.ru> References: <169811592419302@mail.yandex.ru> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/dGUmEEssDGSBA/+P7J_vIU."; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41924 Cc: 41924@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/dGUmEEssDGSBA/+P7J_vIU. Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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=3Dn. > (directory-entries > (lambda (directory) > - (scandir directory (lambda (basename) > - (not > - (string-prefix? "." basename)= ))))) > + (if (file-exists? directory) > + (scandir directory (lambda (basename) > + (not > + (string-prefix? "." basena= me)))) > + '()))) 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 mo= dules (for the wrong kernel, one with CONFIG_MODULES=3Dy) 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 h= ere :-> 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 wi= th module support but no modules compiled), and then try to ascertain whether CONFIG_MODULES=3Dy 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. --Sig_/dGUmEEssDGSBA/+P7J_vIU. Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl7rr48ACgkQ5xo1VCww uqVcIAgAhexE7zXohEsHW3z/NM29tk04kEv8fTtdPRwapwt+6uYqay5G9igZ6W24 sYLzvZL82CJRRPmNKCpsNAWIDqc3fdBcYphukY/Q9ShuxsQZO7l946msrosrrxbg 5gRTR/JAVmebPmRIXo84Y+AfPPDQBPmPx70cDs0lwmCkOOS7TbgjgpnqJTlKj5KX cDBVIzkjXKxjrISGQ8tnsVqQUw4RHvhL/H5B+/QgGTBGbY57Zp3bj1fyAwKaEF9z kEprwXHeL2K9L4nG1mpC0qpod0hyLP81XQ6iT9P7YnrqwF1DChOHD8PPphmbhuac fdZ37w3nigcH97DPx0AVYFQpjOKgig== =0PiM -----END PGP SIGNATURE----- --Sig_/dGUmEEssDGSBA/+P7J_vIU.-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 19 03:47:41 2020 Received: (at 41924) by debbugs.gnu.org; 19 Jun 2020 07:47:41 +0000 Received: from localhost ([127.0.0.1]:55033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmBkE-0004FS-2R for submit@debbugs.gnu.org; Fri, 19 Jun 2020 03:47:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmBkC-0004FG-Hf for 41924@debbugs.gnu.org; Fri, 19 Jun 2020 03:47:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57598) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmBk6-0005g0-Qw; Fri, 19 Jun 2020 03:47:18 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37226 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jmBk6-0002Du-CI; Fri, 19 Jun 2020 03:47:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Danny Milosavljevic Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs References: <169811592419302@mail.yandex.ru> <20200618201647.73f8b0d5@scratchpost.org> Date: Fri, 19 Jun 2020 09:47:15 +0200 In-Reply-To: <20200618201647.73f8b0d5@scratchpost.org> (Danny Milosavljevic's message of "Thu, 18 Jun 2020 20:16:47 +0200") Message-ID: <877dw3ijjw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41924 Cc: 41924@debbugs.gnu.org, Ivan Kozlov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ivan & Danny, I forgot to email you back (sorry about that!): I pushed a variant of this patch here: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D05f79da93fb4fd521= 6feb41510bf0a41f8eedf5b WDYT? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 19 04:20:49 2020 Received: (at 41924) by debbugs.gnu.org; 19 Jun 2020 08:20:49 +0000 Received: from localhost ([127.0.0.1]:55070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmCGW-00054G-R4 for submit@debbugs.gnu.org; Fri, 19 Jun 2020 04:20:49 -0400 Received: from forward501p.mail.yandex.net ([77.88.28.111]:34747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmCGS-00053w-Dv for 41924@debbugs.gnu.org; Fri, 19 Jun 2020 04:20:47 -0400 Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward501p.mail.yandex.net (Yandex) with ESMTP id C22A23500733; Fri, 19 Jun 2020 11:20:37 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback19j.mail.yandex.net (mxback/Yandex) with ESMTP id S5naOWrrpz-Kan8GrG5; Fri, 19 Jun 2020 11:20:37 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592554837; bh=RpEfpHvKVZHO4fOPMbVth3tpzJ0FTMHTMyFT3WgMEMo=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=Qgka/uK6bv4xQDo2Ui64nMMJTfdL46A3HjGgwJjriu92gkjuquHW+iVmqXe8SelAk Epw80YBBdNufuV6SRmk4g1vRHfnbwlKKUHTforV9twKsnrPrWSZ85H1K078CNcuZ2n V9qm7K2wD9hd+usxLQyZU/Sn1NT9YDmteMHXoMXc= Authentication-Results: mxback19j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva6-22e79380f52c.qloud-c.yandex.net with HTTP; Fri, 19 Jun 2020 11:20:36 +0300 From: Ivan Kozlov To: Danny Milosavljevic In-Reply-To: <20200618201647.73f8b0d5@scratchpost.org> References: <169811592419302@mail.yandex.ru> <20200618201647.73f8b0d5@scratchpost.org> Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 19 Jun 2020 11:20:36 +0300 Message-Id: <3181592520939@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41924 Cc: "41924@debbugs.gnu.org" <41924@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi, > 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. The only way to do this sort of thing is to have the config. Otherwise the kernel will always sort of exist in a separate world. You can always compile it in a way that breaks the rest of the Guix system’s assumptions, e.g. by disabling the necessary system calls or cgroups controllers, and get no warnings/build failures. This applies to any extra kernel modules, too. I don’t think LKM support stands out. I actually don’t think it is a big problem that using an unofficial Linux package puts some burden on the maintainer, I merely want such setups to be possible. The problem in question really applies to all cases when there aren’t any modules to deal with, as you correctly point out, not necessary having to do with CONFIG_MODULES; e.g. building a system with CONFIG_MODULES=y and no loadable modules, and no extra modules, is perfectly legitimate. > 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) It is possible to rely on the way operating-system-directory-base-entries builds the manifest to avoid this specific issue: (car #$(manifest-inputs manifest)) should be the kernel. I haven’t really looked into the test suite, here is my guess: diff --git a/gnu/tests/linux-modules.scm b/gnu/tests/linux-modules.scm index 953b132ef7..2fc8f52b90 100644 --- a/gnu/tests/linux-modules.scm +++ b/gnu/tests/linux-modules.scm @@ -25,6 +25,7 @@ #:use-module (gnu system) #:use-module (gnu system vm) #:use-module (gnu tests) + #:use-module (gnu tests base) #:use-module (guix derivations) #:use-module (guix gexp) #:use-module (guix modules) @@ -129,3 +130,37 @@ with two extra modules.") (package-arguments ddcci-driver-linux)))))) '("acpi_call" "ddcci"))))) + +(define %test-no-loadable-kernel-modules + (let* ((kernel (package + (inherit linux-libre) + (arguments + (substitute-keyword-arguments (package-arguments linux-libre) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'build 'no-lkm-config + (lambda _ + (substitute* ".config" + (("=m") "=y")) + (let ((port (open-file ".config" "a"))) + (display "CONFIG_MODULES=n" port) + (close-port port)))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (for-each + (let ((out (assoc-ref outputs "out"))) + (lambda (file) (install-file file out))) + (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$")))))))))) + (os (marionette-operating-system + (operating-system + (inherit (simple-operating-system)) + (kernel kernel) + (initrd-modules '())) + #:imported-modules '((gnu services herd) + (guix combinators)))) + (vm (virtual-machine os))) + (system-test + (name "no-loadable-kernel-modules") + (description "Build and run a basic system without loadable kernel module support") + (value (run-basic-test (virtualized-operating-system os '()) + #~(list #$vm)))))) diff --git a/guix/profiles.scm b/guix/profiles.scm index 25ff146bdf..abf0cf7f27 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1201,6 +1201,8 @@ for both major versions of GTK+." "Return a derivation that unites all the kernel modules of the manifest and creates the dependency graph of all these kernel modules. +The first entry in the manifest must be a Linux kernel package. + This is meant to be used as a profile hook." (define kmod ; lazy reference (module-ref (resolve-interface '(gnu packages linux)) 'kmod)) @@ -1226,14 +1228,22 @@ This is meant to be used as a profile hook." ;; Note: Should usually result in one entry. (versions (delete-duplicates (append-map directory-entries - module-directories)))) - (match versions - ((version) - (let ((old-path (getenv "PATH"))) - (setenv "PATH" #+(file-append kmod "/bin")) - (make-linux-module-directory inputs version #$output) - (setenv "PATH" old-path))) - (_ (error "Specified Linux kernel and Linux kernel modules + (if (file-exists? (car module-directories)) + module-directories + (cdr module-directories)))))) + (match versions + ((version) + (let ((old-path (getenv "PATH"))) + (setenv "PATH" #+(file-append kmod "/bin")) + (make-linux-module-directory inputs version #$output) + (setenv "PATH" old-path))) + ;; Do nothing when there is nothing to do + (() (mkdir #$output)) + ;; This might not catch a version incompatibility + ;; if all kernel modules reside in extra packages + ;; Would checking the kernel package version have + ;; undesirable effects? + (_ (error "Specified Linux kernel and Linux kernel modules are not all of the same version"))))))) (gexp->derivation "linux-module-database" build #:local-build? #t From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 19 10:24:01 2020 Received: (at 41924) by debbugs.gnu.org; 19 Jun 2020 14:24:01 +0000 Received: from localhost ([127.0.0.1]:56623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmHw0-0001fM-Fe for submit@debbugs.gnu.org; Fri, 19 Jun 2020 10:24:01 -0400 Received: from forward500p.mail.yandex.net ([77.88.28.110]:42684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmHvy-0001f7-2s for 41924@debbugs.gnu.org; Fri, 19 Jun 2020 10:23:59 -0400 Received: from mxback19g.mail.yandex.net (mxback19g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:319]) by forward500p.mail.yandex.net (Yandex) with ESMTP id 4A0669405E8; Fri, 19 Jun 2020 17:23:51 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback19g.mail.yandex.net (mxback/Yandex) with ESMTP id dmWOIZIWOt-No0CjlNQ; Fri, 19 Jun 2020 17:23:50 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1592576630; bh=THW5jwnaZ7v/N0WUe2Ti5LulCIZzAO/gBz5LSuIN0q8=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=Dr/wqWoitAFpq6b0zzRLUom/2A/xrji/et2Yf7IlEX1wEJfF19DZ0iyAVInambIOv D5FB8n71O4ZMB7sI37OBo43+M6fCKhOVd106c8ScXFL8DWvGncZ7eVlhoE9aeSSAU6 3L43eLCHrn2StVqoth9YOHoiSY/X4eIwT92gAVOI= Authentication-Results: mxback19g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva8-5dcdbacf01c7.qloud-c.yandex.net with HTTP; Fri, 19 Jun 2020 17:23:49 +0300 From: Ivan Kozlov To: =?utf-8?B?THVkb3ZpYyBDb3VydMOocw==?= In-Reply-To: <877dw3ijjw.fsf@gnu.org> References: <169811592419302@mail.yandex.ru> <20200618201647.73f8b0d5@scratchpost.org> <877dw3ijjw.fsf@gnu.org> Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 19 Jun 2020 17:23:49 +0300 Message-Id: <122651592575910@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41924 Cc: Danny Milosavljevic , "41924@debbugs.gnu.org" <41924@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi, Thanks, I’m happy enough with this. 19.06.2020, 10:47, "Ludovic Courtès" : > Hi Ivan & Danny, > > I forgot to email you back (sorry about that!): I pushed a variant of > this patch here: > >   https://git.savannah.gnu.org/cgit/guix.git/commit/?id=05f79da93fb4fd5216feb41510bf0a41f8eedf5b > > WDYT? > > Ludo’. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 19 16:27:20 2020 Received: (at 41924-done) by debbugs.gnu.org; 19 Jun 2020 20:27:20 +0000 Received: from localhost ([127.0.0.1]:56897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmNbc-0001wx-IL for submit@debbugs.gnu.org; Fri, 19 Jun 2020 16:27:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmNbb-0001wl-AK for 41924-done@debbugs.gnu.org; Fri, 19 Jun 2020 16:27:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55274) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmNbV-0004IQ-IT; Fri, 19 Jun 2020 16:27:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39232 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jmNbR-0006Z1-P3; Fri, 19 Jun 2020 16:27:10 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ivan Kozlov Subject: Re: [bug#41924] [PATCH] profiles: Make linux-module-database skip inappropriate inputs References: <169811592419302@mail.yandex.ru> <20200618201647.73f8b0d5@scratchpost.org> <877dw3ijjw.fsf@gnu.org> <122651592575910@mail.yandex.ru> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 Messidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 19 Jun 2020 22:27:08 +0200 In-Reply-To: <122651592575910@mail.yandex.ru> (Ivan Kozlov's message of "Fri, 19 Jun 2020 17:23:49 +0300") Message-ID: <87o8peg5sz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41924-done Cc: Danny Milosavljevic , "41924@debbugs.gnu.org" <41924-done@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ivan Kozlov skribis: > Thanks, I=E2=80=99m happy enough with this. Cool, closing. Thank you. Ludo=E2=80=99. From unknown Sat Aug 16 14:31:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 18 Jul 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator