summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorReza Alizadeh Majd <r.majd@pantherx.org>2022-08-28 12:34:46 +0430
committerMathieu Othacehe <othacehe@gnu.org>2022-08-30 08:50:44 +0200
commitf126f23b132148192b2c9a89032a5831af0b3c52 (patch)
tree0d2095dcc46fe7d6b436d9137125007c4b2eb7c8 /gnu
parente214e87cc5e0bd0d3325aab1c9086354f6570e9c (diff)
bootloader: Add device-tree-support? option.
In some specific cases where the device tree file is already loaded in RAM, it can be preferable that the bootloader does not try to use a device tree from the Linux kernel tree. * gnu/bootloader.scm (<bootloader-configuration>)[device-tree-support?]: New field. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Add FDTDIR line based on <device-tree-support?> field of <bootloader-configuration>. * doc/guix.texi (Bootloader Configuration)[device-tree-support?]: Add documentation for the new field.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/bootloader.scm6
-rw-r--r--gnu/bootloader/extlinux.scm12
2 files changed, 15 insertions, 3 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 2eec48693c3..7d076ec51cc 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -5,6 +5,7 @@
5;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org> 5;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org>
6;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> 6;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
7;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> 7;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
8;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@pantherx.org>
8;;; 9;;;
9;;; This file is part of GNU Guix. 10;;; This file is part of GNU Guix.
10;;; 11;;;
@@ -72,6 +73,7 @@
72 bootloader-configuration-terminal-inputs 73 bootloader-configuration-terminal-inputs
73 bootloader-configuration-serial-unit 74 bootloader-configuration-serial-unit
74 bootloader-configuration-serial-speed 75 bootloader-configuration-serial-speed
76 bootloader-configuration-device-tree-support?
75 77
76 %bootloaders 78 %bootloaders
77 lookup-bootloader-by-name 79 lookup-bootloader-by-name
@@ -232,7 +234,9 @@ instead~%")))
232 (serial-unit bootloader-configuration-serial-unit ;integer | #f 234 (serial-unit bootloader-configuration-serial-unit ;integer | #f
233 (default #f)) 235 (default #f))
234 (serial-speed bootloader-configuration-serial-speed ;integer | #f 236 (serial-speed bootloader-configuration-serial-speed ;integer | #f
235 (default #f))) 237 (default #f))
238 (device-tree-support? bootloader-configuration-device-tree-support?
239 (default #t))) ;boolean
236 240
237(define-deprecated (bootloader-configuration-target config) 241(define-deprecated (bootloader-configuration-target config)
238 bootloader-configuration-targets 242 bootloader-configuration-targets
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 6b5ff298e74..d9b6d8bf8a2 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -1,6 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 David Craven <david@craven.ch> 2;;; Copyright © 2017 David Craven <david@craven.ch>
3;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> 3;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
4;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@pantherx.org>
4;;; 5;;;
5;;; This file is part of GNU Guix. 6;;; This file is part of GNU Guix.
6;;; 7;;;
@@ -38,6 +39,9 @@ corresponding to old generations of the system."
38 (define all-entries 39 (define all-entries
39 (append entries (bootloader-configuration-menu-entries config))) 40 (append entries (bootloader-configuration-menu-entries config)))
40 41
42 (define with-fdtdir?
43 (bootloader-configuration-device-tree-support? config))
44
41 (define (menu-entry->gexp entry) 45 (define (menu-entry->gexp entry)
42 (let ((label (menu-entry-label entry)) 46 (let ((label (menu-entry-label entry))
43 (kernel (menu-entry-linux entry)) 47 (kernel (menu-entry-linux entry))
@@ -46,12 +50,16 @@ corresponding to old generations of the system."
46 #~(format port "LABEL ~a 50 #~(format port "LABEL ~a
47 MENU LABEL ~a 51 MENU LABEL ~a
48 KERNEL ~a 52 KERNEL ~a
49 FDTDIR ~a/lib/dtbs 53 ~a
50 INITRD ~a 54 INITRD ~a
51 APPEND ~a 55 APPEND ~a
52~%" 56~%"
53 #$label #$label 57 #$label #$label
54 #$kernel (dirname #$kernel) #$initrd 58 #$kernel
59 (if #$with-fdtdir?
60 (string-append "FDTDIR " (dirname #$kernel) "/lib/dtbs")
61 "")
62 #$initrd
55 (string-join (list #$@kernel-arguments))))) 63 (string-join (list #$@kernel-arguments)))))
56 64
57 (define builder 65 (define builder