doc: cookbook: Update custom kernel guide.

* doc/guix-cookbook.texi (Customizing the Kernel): Adjust to new interface.
This commit is contained in:
Leo Famulari 2021-12-23 00:48:40 -05:00
parent d6b519c718
commit c7d74a9bcc
No known key found for this signature in database
GPG key ID: 2646FA30BACA7F08

View file

@ -1430,37 +1430,34 @@ The @code{linux-libre} kernel package definition is actually a procedure which
creates a package. creates a package.
@lisp @lisp
(define* (make-linux-libre version hash supported-systems (define* (make-linux-libre* version gnu-revision source supported-systems
#:key #:key
;; A function that takes an arch and a variant. (extra-version #f)
;; See kernel-config for an example. ;; A function that takes an arch and a variant.
(extra-version #false) ;; See kernel-config for an example.
(configuration-file #false) (configuration-file #f)
(defconfig "defconfig") (defconfig "defconfig")
(extra-options %default-extra-linux-options) (extra-options %default-extra-linux-options))
(patches (list %boot-logo-patch)))
...) ...)
@end lisp @end lisp
The current @code{linux-libre} package is for the 5.1.x series, and is The current @code{linux-libre} package is for the 5.15.x series, and is
declared like this: declared like this:
@lisp @lisp
(define-public linux-libre (define-public linux-libre-5.15
(make-linux-libre %linux-libre-version (make-linux-libre* linux-libre-5.15-version
%linux-libre-hash linux-libre-5.15-gnu-revision
'("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux") linux-libre-5.15-source
#:patches %linux-libre-5.1-patches '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
#:configuration-file kernel-config)) #:configuration-file kernel-config))
@end lisp @end lisp
Any keys which are not assigned values inherit their default value from the Any keys which are not assigned values inherit their default value from the
@code{make-linux-libre} definition. When comparing the two snippets above, @code{make-linux-libre} definition. When comparing the two snippets above,
you may notice that the code comment in the first doesn't actually refer to notice the code comment that refers to @code{#:configuration-file}. Because of
the @code{#:extra-version} keyword; it is actually for this, it is not actually easy to include a custom kernel configuration from the
@code{#:configuration-file}. Because of this, it is not actually easy to definition, but don't worry, there are other ways to work with what we do have.
include a custom kernel configuration from the definition, but don't worry,
there are other ways to work with what we do have.
There are two ways to create a kernel with a custom kernel configuration. The There are two ways to create a kernel with a custom kernel configuration. The
first is to provide a standard @file{.config} file during the build process by first is to provide a standard @file{.config} file during the build process by
@ -1560,14 +1557,15 @@ custom kernel:
(@@@@ (gnu packages linux) %default-extra-linux-options))) (@@@@ (gnu packages linux) %default-extra-linux-options)))
(define-public linux-libre-macbook41 (define-public linux-libre-macbook41
;; XXX: Access the internal 'make-linux-libre' procedure, which is ;; XXX: Access the internal 'make-linux-libre*' procedure, which is
;; private and unexported, and is liable to change in the future. ;; private and unexported, and is liable to change in the future.
((@@@@ (gnu packages linux) make-linux-libre) (@@@@ (gnu packages linux) %linux-libre-version) ((@@@@ (gnu packages linux) make-linux-libre*)
(@@@@ (gnu packages linux) %linux-libre-hash) (@@@@ (gnu packages linux) linux-libre-version)
'("x86_64-linux") (@@@@ (gnu packages linux) linux-libre-gnu-revision)
#:extra-version "macbook41" (@@@@ (gnu packages linux) linux-libre-source)
#:patches (@@@@ (gnu packages linux) %linux-libre-5.1-patches) '("x86_64-linux")
#:extra-options %macbook41-config-options)) #:extra-version "macbook41"
#:extra-options %macbook41-config-options))
@end lisp @end lisp
In the above example @code{%file-systems} is a collection of flags enabling In the above example @code{%file-systems} is a collection of flags enabling