all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 31416@debbugs.gnu.org
Subject: [bug#31416] [PATCH 2/4] bootloader: install-u-boot: Automatically select the correct installer.
Date: Fri, 11 May 2018 16:36:50 +0200	[thread overview]
Message-ID: <20180511143652.26935-2-dannym@scratchpost.org> (raw)
In-Reply-To: <20180511143652.26935-1-dannym@scratchpost.org>

* gnu/bootloader/u-boot.scm (install-u-boot): Automatically select the correct
installer.
---
 gnu/bootloader/u-boot.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index bc8f98f32..e0941c961 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -41,7 +41,24 @@
 (define install-u-boot
   #~(lambda (bootloader device mount-point)
       (if bootloader
-        (error "Failed to install U-Boot"))))
+        (let* ((config-file-name (string-append bootloader "/libexec/.config"))
+               (soc (call-with-input-file config-file-name
+                                          (let loop ((line (read-line port)))
+                                            (if (not (eof-object? line))
+                                                (let ((match
+                                                       (string-match
+                                                        "^CONFIG_SYS_SOC=\"([^\"]*)\""
+                                                        line)))
+                                                  (if match
+                                                      (match:substring match 1)
+                                                      (loop (read-line port))))
+                                                #f)))))
+          (match soc
+           ("am33xx" (install-beaglebone-black-u-boot bootloader device mount-point))
+           ("mx6" (install-imx-u-boot bootloader device mount-point))
+           ("sunxi" (install-allwinner-u-boot bootloader device mount-point))
+           (_ (error "Failed to install U-Boot (no installation method found)"
+                     soc)))))))
 
 (define install-beaglebone-black-u-boot
   ;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot

  reply	other threads:[~2018-05-11 14:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 14:35 [bug#31416] [PATCH 0/4] Generalize bootloader installer selection Danny Milosavljevic
2018-05-11 14:36 ` [bug#31416] [PATCH 1/4] system: Add os-with-u-boot Danny Milosavljevic
2018-05-11 14:36   ` Danny Milosavljevic [this message]
2018-05-13  9:31     ` [bug#31416] [PATCH 2/4] bootloader: install-u-boot: Automatically select the correct installer Ludovic Courtès
2018-05-13 10:43       ` Danny Milosavljevic
2018-05-11 14:36   ` [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader Danny Milosavljevic
2018-05-13  9:36     ` Ludovic Courtès
2018-05-13 11:03       ` Danny Milosavljevic
2018-05-13 11:15         ` Danny Milosavljevic
2018-05-14  8:31           ` Ludovic Courtès
2018-05-13 13:46         ` Danny Milosavljevic
2018-05-14  8:34         ` Ludovic Courtès
2018-05-14 16:29           ` Danny Milosavljevic
2018-06-15  7:12             ` Ludovic Courtès
2018-06-17  0:28               ` Danny Milosavljevic
2018-06-17 12:35                 ` Danny Milosavljevic
2018-06-17 20:33                 ` Ludovic Courtès
2018-06-17 21:41                   ` Danny Milosavljevic
2018-06-18  8:25                     ` Ludovic Courtès
2018-05-11 14:36   ` [bug#31416] [PATCH 4/4] bootloader: Simplify bootloader installer selection Danny Milosavljevic
2018-05-13  9:24   ` [bug#31416] [PATCH 1/4] system: Add os-with-u-boot Ludovic Courtès
2018-05-13 12:09   ` Jelle Licht
2023-07-21 16:53 ` [bug#31416] [PATCH 0/4] Generalize bootloader installer selection Maxim Cournoyer
2023-09-01 18:47   ` bug#31416: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180511143652.26935-2-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=31416@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.