GNU bug report logs - #45722
[PATCH] gnu: kernel-module-loader does not require file-systems

Previous Next

Package: guix-patches;

Reported by: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>

Date: Fri, 8 Jan 2021 02:14:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45722 in the body.
You can then email your comments to 45722 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45722; Package guix-patches. (Fri, 08 Jan 2021 02:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to raid5atemyhomework <raid5atemyhomework <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Jan 2021 02:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: kernel-module-loader does not require file-systems
Date: Fri, 08 Jan 2021 02:12:49 +0000
In https://issues.guix.gnu.org/45692#5 Danny brings up that the `kernel-module-loader-shepherd-service` might not need to depend on `file-systems`.

So:

* `kernel-module-loader-shepherd-service` uses the `/proc` filesystem.
  * However, this filesystem is mounted in `initrd` before handing over to the real root (in `gnu/build/linux-boot.scm`'s  `mount-essential-file-systems`, which is called in `boot-system` very early.
  * Before handing over to the real root, the mounts are moved in `move-essential-file-systems`, which is called by the `switch-root` procedure that is called by `boot-system` after mounting the root filesystem.
* The `/proc/sys/kernel/modprobe` file contains a reference to a `/gnu/store` path to a `modprobe` binary.
  * Shepherd starts with the root file system already mounted (by the `initrd` `boot-system` procedure), so the full `/gnu/store` should be accessible as soon as Shepherd starts.

I've tested this as follows:

* Created a QEMU VM image that pointlessly loads "btrfs" (which is not loaded by default) by `(simple-service 'load-btrfs kernel-module-loader-service-type '("btrfs"))` and confirmed it boots to desktop and `lsmod` lists `btrfs`.
* Ran tests "loadable-kernel-modules-0", "loadable-kernel-modules-1", and "loadable-kernel-module-2" and confirmed they pass.

In theory this could break a system, if an existing kernel module reads from some file (which Linux kernel modules are discouraged from doing) at loadtime *and* the system administrator put that file in a non-root filesystem (which if it's a "proper" module it should be in either `/etc` or `/var`, the former of which is, on Guix System, created by Guix on the root filesystem, and the latter of which should generally be on the root filesystem as well).  So I think the risk of this breaking *some* system is fairly low.

Please review.


From d028dac0efaf6ab3d8edafc2e68c0d2ef692bab7 Mon Sep 17 00:00:00 2001
From: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
Date: Fri, 8 Jan 2021 09:41:25 +0800
Subject: [PATCH] gnu: kernel-module-loader does not require file-systems

* gnu/services/linux.scm (kernel-module-loader-shepherd-service):
Remove requirement of file-systems.
---
 gnu/services/linux.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 1046a7e0c2..340b330030 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -150,7 +151,7 @@ representation."
      (shepherd-service
       (documentation "Load kernel modules.")
       (provision '(kernel-module-loader))
-      (requirement '(file-systems))
+      (requirement '())
       (one-shot? #t)
       (modules `((srfi srfi-1)
                  (srfi srfi-34)
--
2.30.0





Information forwarded to guix-patches <at> gnu.org:
bug#45722; Package guix-patches. (Mon, 08 Feb 2021 02:56:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: raid5atemyhomework via Guix-patches via <guix-patches <at> gnu.org>
Cc: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>,
 45722-done <at> debbugs.gnu.org
Subject: Re: [bug#45722] [PATCH] gnu: kernel-module-loader does not require
 file-systems
Date: Mon, 8 Feb 2021 03:55:22 +0100
[Message part 1 (text/plain, inline)]
Pushed to guix master as commit fe7529d71b8d7b09b48679c86e1155895afd92a4.

Thanks!
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
You have taken responsibility. (Mon, 08 Feb 2021 02:56:02 GMT) Full text and rfc822 format available.

Notification sent to raid5atemyhomework <raid5atemyhomework <at> protonmail.com>:
bug acknowledged by developer. (Mon, 08 Feb 2021 02:56:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Mar 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.