guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#30604] [PATCH v3 4/6] linux-boot: Load kernel modules only when the


From: Ludovic Courtès
Subject: [bug#30604] [PATCH v3 4/6] linux-boot: Load kernel modules only when the hardware is present.
Date: Tue, 27 Feb 2018 15:26:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Nice patch series!

Danny Milosavljevic <address@hidden> skribis:

> * gnu/build/linux-boot.scm (boot-system): Load kernel modules only when
> the hardware is present.
> * gnu/system/linux-initrd.scm (raw-initrd): Add imports.

[...]

> +  (define (load-kernel-modules)
> +    "Examine /sys/devices to find out which modules to load and load them."
> +    (define enter?
> +      (const #t))
> +    (define (down! path stat result)
> +     ;; Note: modprobe mutates the tree starting with path.
> +     (let ((modalias-name (string-append path "/modalias")))
> +       (if (file-exists? modalias-name)
> +           (let ((modalias
> +                 (string-trim-right (call-with-input-file modalias-name
> +                                                          read-string)
> +                                    #\newline)))
> +             (system* "/sbin/modprobe" "-q" "--" modalias))))

Can we build upon (gnu build linux-modules) to achieve this?

Hopefully the tools at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30629#14> can help a bit.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]