summary refs log tree commit diff
path: root/gnu/bootloader/extlinux.scm
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/bootloader/extlinux.scm
parente214e87cc5e0bd0d3325aab1c9086354f6570e9c (diff)
downloadguix-f126f23b132148192b2c9a89032a5831af0b3c52.tar.gz
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/bootloader/extlinux.scm')
-rw-r--r--gnu/bootloader/extlinux.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 6b5ff298e7..d9b6d8bf8a 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 David Craven <david@craven.ch>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@pantherx.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,9 @@ corresponding to old generations of the system."
   (define all-entries
     (append entries (bootloader-configuration-menu-entries config)))
 
+  (define with-fdtdir?
+    (bootloader-configuration-device-tree-support? config))
+
   (define (menu-entry->gexp entry)
     (let ((label (menu-entry-label entry))
           (kernel (menu-entry-linux entry))
@@ -46,12 +50,16 @@ corresponding to old generations of the system."
       #~(format port "LABEL ~a
   MENU LABEL ~a
   KERNEL ~a
-  FDTDIR ~a/lib/dtbs
+  ~a
   INITRD ~a
   APPEND ~a
 ~%"
                 #$label #$label
-                #$kernel (dirname #$kernel) #$initrd
+                #$kernel
+                (if #$with-fdtdir?
+                    (string-append "FDTDIR " (dirname #$kernel) "/lib/dtbs")
+                    "")
+                #$initrd
                 (string-join (list #$@kernel-arguments)))))
 
   (define builder