diff mbox series

[bug#57070] bootloader: extlinux: support for optional FDTDIR

Message ID 20220809103044.27964-1-r.majd@pantherx.org
State Accepted
Headers show
Series [bug#57070] bootloader: extlinux: support for optional FDTDIR | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Reza Alizadeh Majd Aug. 9, 2022, 10:30 a.m. UTC
* gnu/bootloader.scm (<bootloader>)[ignore-fdtdir?]: new field.
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): add FDTDIR line based on bootloader <ignore-fdtdir?> field of <bootloader>.
---
 gnu/bootloader.scm          |  5 ++++-
 gnu/bootloader/extlinux.scm | 12 ++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

Comments

Mathieu Othacehe Aug. 15, 2022, 9:27 a.m. UTC | #1
Hello,

> * gnu/bootloader.scm (<bootloader>)[ignore-fdtdir?]: new field.

The bootloader record is supposed to be bootloader agnostic. This fdtdir
naming thing seems to be extlinux specific.

Should we maybe rename this field "device-tree-support?"

Thanks,

Mathieu
diff mbox series

Patch

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 9cf5457873..acf51bff7a 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -54,6 +54,7 @@  (define-module (gnu bootloader)
             bootloader-disk-image-installer
             bootloader-configuration-file
             bootloader-configuration-file-generator
+            bootloader-ignore-fdtdir?
 
             bootloader-configuration
             bootloader-configuration?
@@ -173,7 +174,9 @@  (define-record-type* <bootloader>
   (disk-image-installer            bootloader-disk-image-installer
                                    (default #f))
   (configuration-file              bootloader-configuration-file)
-  (configuration-file-generator    bootloader-configuration-file-generator))
+  (configuration-file-generator    bootloader-configuration-file-generator)
+  (ignore-fdtdir?                  bootloader-ignore-fdtdir?
+                                   (default #f)))
 
 
 ;;;
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 6b5ff298e7..084ed1e7c9 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -38,6 +38,10 @@  (define* (extlinux-configuration-file config entries
   (define all-entries
     (append entries (bootloader-configuration-menu-entries config)))
 
+  (define ignore-fdtdir?
+    (let ((bootloader (bootloader-configuration-bootloader config)))
+      (bootloader-ignore-fdtdir? bootloader)))
+
   (define (menu-entry->gexp entry)
     (let ((label (menu-entry-label entry))
           (kernel (menu-entry-linux entry))
@@ -46,12 +50,16 @@  (define (menu-entry->gexp entry)
       #~(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 (not #$ignore-fdtdir?)
+                    (string-append "FDTDIR " (dirname #$kernel) "/lib/dtbs")
+                    "")
+                #$initrd
                 (string-join (list #$@kernel-arguments)))))
 
   (define builder