guix-patches
[Top][All Lists]
Advanced

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

[bug#70962] [PATCH 11/14] gnu: linux: Turn %default-extra-linux-options


From: Maxim Cournoyer
Subject: [bug#70962] [PATCH 11/14] gnu: linux: Turn %default-extra-linux-options into a procedure.
Date: Wed, 15 May 2024 12:57:21 -0400

This is to allow version-specific options to the list of defaults.

* gnu/packages/linux.scm (%default-extra-linux-options): Transform to...
(default-extra-linux-options): ... this procedure, which accepts a 'version'
argument.
(make-linux-libre, linux-libre-arm-generic, linux-libre-arm-generic-5.10)
(linux-libre-arm-generic-5.4, linux-libre-arm64-generic)
(linux-libre-arm64-generic-5.10, linux-libre-arm64-generic-5.4)
(linux-libre-riscv64-generic, linux-libre-mips64el-fuloong2e)
(linux-libre-with-bpf): Adjust accordingly.
* doc/guix-cookbook.texi (Customizing the Kernel): Adjust accordingly.

Change-Id: Ifd3be8b7ed8699bada224a938dbc84205366ff3d
---

 doc/guix-cookbook.texi | 17 +++++++++--------
 gnu/packages/linux.scm | 24 ++++++++++++------------
 2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 3bc63cba7a..6f23fe53ec 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -1681,7 +1681,7 @@ Customizing the Kernel
                             ;; See kernel-config for an example.
                             (configuration-file #f)
                             (defconfig "defconfig")
-                            (extra-options %default-extra-linux-options))
+                            (extra-options (default-extra-linux-options 
version)))
   ...)
 @end lisp
 
@@ -1748,7 +1748,7 @@ Customizing the Kernel
 it:
 
 @lisp
-(define %default-extra-linux-options
+(define (default-extra-linux-options version)
   `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
    ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #true)
    ;; Modules required for initrd:
@@ -1798,7 +1798,7 @@ Customizing the Kernel
           %file-systems
           %efi-support
           %emulation
-          (@@@@ (gnu packages linux) %default-extra-linux-options)))
+          ((@@@@ (gnu packages linux) default-extra-linux-options) version)))
 
 (define-public linux-libre-macbook41
   ;; XXX: Access the internal 'make-linux-libre*' procedure, which is
@@ -1812,11 +1812,12 @@ Customizing the Kernel
    #:extra-options %macbook41-config-options))
 @end lisp
 
-In the above example @code{%file-systems} is a collection of flags enabling
-different file system support, @code{%efi-support} enables EFI support and
-@code{%emulation} enables a x86_64-linux machine to act in 32-bit mode also.
-@code{%default-extra-linux-options} are the ones quoted above, which had to be
-added in since they were replaced in the @code{extra-options} keyword.
+In the above example @code{%file-systems} is a collection of flags
+enabling different file system support, @code{%efi-support} enables EFI
+support and @code{%emulation} enables a x86_64-linux machine to act in
+32-bit mode also.  The @code{default-extra-linux-options} procedure is
+the one defined above, which had to be used to avoid loosing the default
+configuration options of the @code{extra-options} keyword.
 
 This all sounds like it should be doable, but how does one even know which
 modules are required for a particular system?  Two places that can be helpful
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 4547ab525f..eaa9f66d74 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -825,7 +825,7 @@ (define* (kernel-config arch #:key variant)
          (config (search-auxiliary-file file)))
     (and config (local-file config))))
 
-(define %default-extra-linux-options
+(define (default-extra-linux-options version)
   `(;; Make the kernel config available at /proc/config.gz
     ("CONFIG_IKCONFIG" . #t)
     ("CONFIG_IKCONFIG_PROC" . #t)
@@ -938,7 +938,7 @@ (define* (make-linux-libre version gnu-revision hash-string 
supported-systems
                            ;; for an example.
                            (configuration-file #f)
                            (defconfig "defconfig")
-                           (extra-options %default-extra-linux-options)
+                           (extra-options (default-extra-linux-options 
version))
                            (patches
                             `(,%boot-logo-patch
                               ,@(if (apply-infodoc-patch? version)
@@ -964,7 +964,7 @@ (define* (make-linux-libre* version gnu-revision source 
supported-systems
                             ;; See kernel-config for an example.
                             (configuration-file #f)
                             (defconfig "defconfig")
-                            (extra-options %default-extra-linux-options))
+                            (extra-options (default-extra-linux-options 
version)))
   (package
     (name (if extra-version
               (string-append "linux-libre-" extra-version)
@@ -1208,7 +1208,7 @@ (define-public linux-libre-arm-generic
                      (append
                       `(;; needed to fix the RTC on rockchip platforms
                         ("CONFIG_RTC_DRV_RK808" . #t))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-version))))
 
 (define-public linux-libre-arm-generic-5.10
   (make-linux-libre* linux-libre-5.10-version
@@ -1221,7 +1221,7 @@ (define-public linux-libre-arm-generic-5.10
                      (append
                       `(;; needed to fix the RTC on rockchip platforms
                         ("CONFIG_RTC_DRV_RK808" . #t))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-5.10-version))))
 
 (define-public linux-libre-arm-generic-5.4
   (make-linux-libre* linux-libre-5.4-version
@@ -1234,7 +1234,7 @@ (define-public linux-libre-arm-generic-5.4
                      (append
                       `(;; needed to fix the RTC on rockchip platforms
                         ("CONFIG_RTC_DRV_RK808" . #t))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-5.4-version))))
 
 (define-public linux-libre-arm-generic-4.19
   (make-linux-libre* linux-libre-4.19-version
@@ -1286,7 +1286,7 @@ (define-public linux-libre-arm64-generic
                         ("CONFIG_BATTERY_CW2015" . m)
                         ("CONFIG_CHARGER_GPIO" . m)
                         ("CONFIG_SND_SOC_ES8316" . m))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-version))))
 
 (define-public linux-libre-arm64-generic-5.10
   (make-linux-libre* linux-libre-5.10-version
@@ -1312,7 +1312,7 @@ (define-public linux-libre-arm64-generic-5.10
                         ("CONFIG_BATTERY_CW2015" . m)
                         ("CONFIG_CHARGER_GPIO" . m)
                         ("CONFIG_SND_SOC_ES8316" . m))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-5.10-version))))
 
 (define-public linux-libre-arm64-generic-5.4
   (make-linux-libre* linux-libre-5.4-version
@@ -1325,7 +1325,7 @@ (define-public linux-libre-arm64-generic-5.4
                      (append
                       `(;; needed to fix the RTC on rockchip platforms
                         ("CONFIG_RTC_DRV_RK808" . #t))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-5.4-version))))
 
 (define-public linux-libre-riscv64-generic
   (make-linux-libre* linux-libre-version
@@ -1349,7 +1349,7 @@ (define-public linux-libre-riscv64-generic
                         ("CONFIG_HW_RANDOM_VIRTIO" . m)
                         ("CONFIG_VIRTIO_CONSOLE" . m)
                         ("CONFIG_CRYPTO_XTS" . m))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-version))))
 
 (define-public linux-libre-mips64el-fuloong2e
   (make-linux-libre* linux-libre-version
@@ -1361,7 +1361,7 @@ (define-public linux-libre-mips64el-fuloong2e
                      #:extra-options
                      (append
                       `(("CONFIG_OVERLAY_FS" . m))
-                      %default-extra-linux-options)))
+                      (default-extra-linux-options linux-libre-version))))
 
 (define-public linux-libre-with-bpf
   (let ((base-linux-libre
@@ -1375,7 +1375,7 @@ (define-public linux-libre-with-bpf
           #:configuration-file kernel-config
           #:extra-options
           (append %bpf-extra-linux-options
-                  %default-extra-linux-options))))
+                  (default-extra-linux-options linux-libre-6.8-version)))))
     (package
       (inherit base-linux-libre)
       (inputs (modify-inputs (package-inputs base-linux-libre)
-- 
2.41.0






reply via email to

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