guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration pa


From: Ludovic Courtès
Subject: Re: [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter.
Date: Sun, 11 Sep 2016 23:13:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

David Craven <address@hidden> skribis:

> * gnu/packages/linux.scm (linux-libre): Use
>   %default-additional-kernel-configuration.
>   (%default-additional-kernel-configuration): New variable.
> ---
>  gnu/packages/linux.scm | 32 ++++++++++++++++++--------------
>  1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index ab20f6e..f629045 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -257,10 +257,26 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
> such configuration."
>               (file (string-append "gnu/packages/" name)))
>      (search-path %load-path file)))
>  
> +(define %default-additional-kernel-configuration
> +  (string-append "CONFIG_NET_9P=m\n"
> +                 "CONFIG_NET_9P_VIRTIO=m\n"
> +                 "CONFIG_VIRTIO_BLK=m\n"
> +                 "CONFIG_VIRTIO_NET=m\n"
> +                 ;; 
> https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
> +                 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
> +                 "CONFIG_VIRTIO_PCI=m\n"
> +                 "CONFIG_VIRTIO_BALLOON=m\n"
> +                 "CONFIG_VIRTIO_MMIO=m\n"
> +                 "CONFIG_FUSE_FS=m\n"
> +                 "CONFIG_CIFS=m\n"
> +                 "CONFIG_9P_FS=m\n"))
> +
>  (define* (make-linux-libre version hash
>                             #:key
>                             (configuration-file #f)
> -                           (defconfig "defconfig"))
> +                           (defconfig "defconfig")
> +                           (additional-configuration
> +                            %default-additional-kernel-configuration))

Why not, but from the rest of the patch it’s not clear if it’s actually
used, is it?

If we take that route, I would suggest a more idiomatic approach, like:

  (define %default-extra-linux-options
    `(("CONFIG_NET_9P" . m)
      ("CONFIG_SOMETHING" . #f)
      ("CONFIG_SOMETHING_ELSE" . #t)))

This alist could be turned into a string that can be appended to the
config:

  (string-join (string-map (match-lambda
                             ((option . 'm)
                              (string-append option "=m"))
                             ((option . #t)
                              (string-append option "=y"))
                             ((option . #f)
                              (string-append option "=n")))
                            options)
               "\n")

WDYT?

Ludo’.



reply via email to

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