GNU bug report logs - #31416
[PATCH 0/4] Generalize bootloader installer selection.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Fri, 11 May 2018 14:36:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31416 in the body.
You can then email your comments to 31416 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 11 May 2018 14:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 11 May 2018 14:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: guix-patches <at> gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH 0/4] Generalize bootloader installer selection.
Date: Fri, 11 May 2018 16:35:15 +0200
Danny Milosavljevic (4):
  system: Add os-with-u-boot.
  bootloader: install-u-boot: Automatically select the correct
    installer.
  bootloader: Add make-u-boot-bootloader.
  bootloader: Simplify bootloader installer selection.

 doc/guix.texi                             | 21 ++++++++
 gnu/bootloader/u-boot.scm                 | 88 ++++++++-----------------------
 gnu/packages/bootloaders.scm              |  4 +-
 gnu/system/examples/beaglebone-black.tmpl |  2 +-
 gnu/system/install.scm                    | 33 ++++++++----
 5 files changed, 70 insertions(+), 78 deletions(-)





Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 11 May 2018 14:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 31416 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH 1/4] system: Add os-with-u-boot.
Date: Fri, 11 May 2018 16:36:49 +0200
* gnu/system/install.scm (os-with-u-boot): New procedure.
* gnu/packages/bootloaders.scm (make-u-boot-package): Export.
* doc/guix.texi (Building the Installation Image for ARM boards): New
subsection.
---
 doc/guix.texi                | 21 +++++++++++++++++++++
 gnu/packages/bootloaders.scm |  2 +-
 gnu/system/install.scm       | 16 +++++++++++++++-
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 637c9c3f4..b2b173ded 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8733,6 +8733,27 @@ Have a look at @file{gnu/system/install.scm} in the source tree,
 and see also @ref{Invoking guix system} for more information
 about the installation image.
 
+@subsection Building the Installation Image for ARM boards
+
+Many ARM boards require a board-specific bootloader in order to boot.
+
+If you build an entire disk image and the is not still available otherwise
+(on another available drive etc), it's advisable to build an image that
+includes the bootloader, specifically:
+
+@example
+guix system disk-image --system=armhf-linux -e '((@ (gnu system install) os-with-u-boot) (@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")'
+@end example
+
+Or if you don't cross compile:
+
+@example
+guix system disk-image -e '((@ (gnu system install) os-with-u-boot) (@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")'
+@end example
+
+"A20-OLinuXino-Lime2" is the name of the board.  If you specify an invalid
+board, you get a list.
+
 @node System Configuration
 @section System Configuration
 
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index c0a0101c5..526e53384 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -359,7 +359,7 @@ tree binary files.  These are board description files used by Linux and BSD.")
 also initializes the boards (RAM etc).")
     (license license:gpl2+)))
 
-(define (make-u-boot-package board triplet)
+(define-public (make-u-boot-package board triplet)
   "Returns a u-boot package for BOARD cross-compiled for TRIPLET."
   (let ((same-arch? (if (string-prefix? (%current-system)
                                         (gnu-triplet->nix-system triplet))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index a2917e485..b563e8b5b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -52,7 +52,8 @@
             mx6cuboxi-installation-os
             nintendo-nes-classic-edition-installation-os
             novena-installation-os
-            wandboard-installation-os))
+            wandboard-installation-os
+            os-with-u-boot))
 
 ;;; Commentary:
 ;;;
@@ -386,6 +387,19 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
+(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
+                         (triplet "arm-linux-gnueabihf"))
+  "Given OS, amend it with the u-boot bootloader for BOARD,
+installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET.
+
+If you want a serial console, make sure to specify one in your
+operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
+  (operating-system (inherit os)
+    (bootloader (bootloader-configuration
+                 (bootloader (bootloader (inherit u-boot-bootloader)
+                              (package (make-u-boot-package board triplet))))
+                 (target bootloader-target)))))
+
 (define* (embedded-installation-os bootloader bootloader-target tty
                                    #:key (extra-modules '()))
   "Return an installation os for embedded systems.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 11 May 2018 14:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 31416 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH 2/4] bootloader: install-u-boot: Automatically select the
 correct installer.
Date: Fri, 11 May 2018 16:36:50 +0200
* 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




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 11 May 2018 14:38:02 GMT) Full text and rfc822 format available.

Message #14 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 31416 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Fri, 11 May 2018 16:36:51 +0200
* gnu/bootloader/u-boot.scm (make-u-boot-bootloader): New procedure.
(u-boot-allwinner-bootloader): Delete variable.
(u-boot-imx-bootloader): Delete variable.
(u-boot-beaglebone-black-bootloader): Modify.
(u-boot-nintendo-nes-classic-edition-bootloader): Modify.
(u-boot-a20-olinuxino-lime-bootloader): Modify.
(u-boot-a20-olinuxino-lime2-bootloader): Modify.
(u-boot-a20-olinuxino-micro-bootloader): Modify.
(u-boot-banana-pi-m2-ultra-bootloader): Modify.
(u-boot-mx6cuboxi-bootloader): Modify.
(u-boot-wandboard-bootloader): Modify.
(u-boot-novena-bootloader): Modify.
---
 gnu/bootloader/u-boot.scm | 54 ++++++++++++++---------------------------------
 1 file changed, 16 insertions(+), 38 deletions(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index e0941c961..feda17f99 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -36,7 +36,8 @@
             u-boot-mx6cuboxi-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
-            u-boot-wandboard-bootloader))
+            u-boot-wandboard-bootloader
+            make-u-boot-bootloader))
 
 (define install-u-boot
   #~(lambda (bootloader device mount-point)
@@ -104,58 +105,35 @@
    (package #f)
    (installer install-u-boot)))
 
-(define u-boot-beaglebone-black-bootloader
-  (bootloader
-   (inherit u-boot-bootloader)
-   (package u-boot-beagle-bone-black)
-   (installer install-beaglebone-black-u-boot)))
-
-(define u-boot-allwinner-bootloader
+(define (make-u-boot-bootloader bootloader-package)
+  "Given BOOTLOADER-PACKAGE, make a bootloader that can install."
   (bootloader
-   (inherit u-boot-bootloader)
-   (installer install-allwinner-u-boot)))
+    (inherit u-boot-bootloader)
+    (package bootloader-package)))
 
-(define u-boot-imx-bootloader
-  (bootloader
-   (inherit u-boot-bootloader)
-   (installer install-imx-u-boot)))
+(define u-boot-beaglebone-black-bootloader
+  (make-u-boot-bootloader u-boot-beagle-bone-black))
 
 (define u-boot-nintendo-nes-classic-edition-bootloader
-  (bootloader
-    (inherit u-boot-allwinner-bootloader)
-    (package u-boot-nintendo-nes-classic-edition)))
+  (make-u-boot-bootloader u-boot-nintendo-nes-classic-edition))
 
 (define u-boot-a20-olinuxino-lime-bootloader
-  (bootloader
-   (inherit u-boot-allwinner-bootloader)
-   (package u-boot-a20-olinuxino-lime)))
+  (make-u-boot-bootloader u-boot-a20-olinuxino-lime))
 
 (define u-boot-a20-olinuxino-lime2-bootloader
-  (bootloader
-   (inherit u-boot-allwinner-bootloader)
-   (package u-boot-a20-olinuxino-lime2)))
+  (make-u-boot-bootloader u-boot-a20-olinuxino-lime2))
 
 (define u-boot-a20-olinuxino-micro-bootloader
-  (bootloader
-   (inherit u-boot-allwinner-bootloader)
-   (package u-boot-a20-olinuxino-micro)))
+  (make-u-boot-bootloader u-boot-a20-olinuxino-micro))
 
 (define u-boot-banana-pi-m2-ultra-bootloader
-  (bootloader
-   (inherit u-boot-allwinner-bootloader)
-   (package u-boot-banana-pi-m2-ultra)))
+  (make-u-boot-bootloader u-boot-banana-pi-m2-ultra))
 
 (define u-boot-mx6cuboxi-bootloader
-  (bootloader
-   (inherit u-boot-imx-bootloader)
-   (package u-boot-mx6cuboxi)))
+  (make-u-boot-bootloader u-boot-mx6cuboxi))
 
 (define u-boot-wandboard-bootloader
-  (bootloader
-   (inherit u-boot-imx-bootloader)
-   (package u-boot-wandboard)))
+  (make-u-boot-bootloader u-boot-wandboard))
 
 (define u-boot-novena-bootloader
-  (bootloader
-   (inherit u-boot-imx-bootloader)
-   (package u-boot-novena)))
+  (make-u-boot-bootloader u-boot-novena))




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 11 May 2018 14:38:03 GMT) Full text and rfc822 format available.

Message #17 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 31416 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH 4/4] bootloader: Simplify bootloader installer selection.
Date: Fri, 11 May 2018 16:36:52 +0200
* gnu/bootloader/u-boot.scm (u-boot-bootloader): Delete variable.
(u-boot-a20-olinuxino-lime-bootloader): Delete variable.
(u-boot-a20-olinuxino-lime2-bootloader): Delete variable.
(u-boot-a20-olinuxino-micro-bootloader): Delete variable.
(u-boot-banana-pi-m2-ultra-bootloader): Delete variable.
(u-boot-beaglebone-black-bootloader): Delete variable.
(u-boot-mx6cuboxi-bootloader): Delete variable.
(u-boot-nintendo-nes-classic-edition-bootloader): Delete variable.
(u-boot-novena-bootloader): Delete variable.
(u-boot-wandboard-bootloader): Delete variable.
* gnu/packages/bootloader.scm (u-boot-beagle-bone-black): Rename to...
(u-boot-beaglebone-black): ...this.
* gnu/system/examples/beaglebone-black.tmpl: Use make-u-boot-bootloader.
* gnu/system/install.scm (os-with-u-boot): Use make-u-boot-bootloader.
(beaglebone-black-installation-os): Use make-u-boot-bootloader.
(a20-olinuxino-lime-installation-os): Use make-u-boot-bootloader.
(a20-olinuxino-lime2-emmc-installation-os): Use make-u-boot-bootloader.
(a20-olinuxino-micro-installation-os): Use make-u-boot-bootloader.
(banana-pi-m2-ultra-installation-os): Use make-u-boot-bootloader.
(mx6cuboxi-installation-os): Use make-u-boot-bootloader.
(novena-installation-os): Use make-u-boot-bootloader.
(nintendo-nes-classic-edition-installation-os): Use make-u-boot-bootloader.
(wandboard-installation-os): Use make-u-boot-bootloader.
---
 gnu/bootloader/u-boot.scm                 | 39 +------------------------------
 gnu/packages/bootloaders.scm              |  2 +-
 gnu/system/examples/beaglebone-black.tmpl |  2 +-
 gnu/system/install.scm                    | 21 ++++++++---------
 4 files changed, 13 insertions(+), 51 deletions(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index feda17f99..f804997a4 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -27,17 +27,7 @@
   #:use-module (guix monads)
   #:use-module (guix records)
   #:use-module (guix utils)
-  #:export (u-boot-bootloader
-            u-boot-a20-olinuxino-lime-bootloader
-            u-boot-a20-olinuxino-lime2-bootloader
-            u-boot-a20-olinuxino-micro-bootloader
-            u-boot-banana-pi-m2-ultra-bootloader
-            u-boot-beaglebone-black-bootloader
-            u-boot-mx6cuboxi-bootloader
-            u-boot-nintendo-nes-classic-edition-bootloader
-            u-boot-novena-bootloader
-            u-boot-wandboard-bootloader
-            make-u-boot-bootloader))
+  #:export (make-u-boot-bootloader))
 
 (define install-u-boot
   #~(lambda (bootloader device mount-point)
@@ -110,30 +100,3 @@
   (bootloader
     (inherit u-boot-bootloader)
     (package bootloader-package)))
-
-(define u-boot-beaglebone-black-bootloader
-  (make-u-boot-bootloader u-boot-beagle-bone-black))
-
-(define u-boot-nintendo-nes-classic-edition-bootloader
-  (make-u-boot-bootloader u-boot-nintendo-nes-classic-edition))
-
-(define u-boot-a20-olinuxino-lime-bootloader
-  (make-u-boot-bootloader u-boot-a20-olinuxino-lime))
-
-(define u-boot-a20-olinuxino-lime2-bootloader
-  (make-u-boot-bootloader u-boot-a20-olinuxino-lime2))
-
-(define u-boot-a20-olinuxino-micro-bootloader
-  (make-u-boot-bootloader u-boot-a20-olinuxino-micro))
-
-(define u-boot-banana-pi-m2-ultra-bootloader
-  (make-u-boot-bootloader u-boot-banana-pi-m2-ultra))
-
-(define u-boot-mx6cuboxi-bootloader
-  (make-u-boot-bootloader u-boot-mx6cuboxi))
-
-(define u-boot-wandboard-bootloader
-  (make-u-boot-bootloader u-boot-wandboard))
-
-(define u-boot-novena-bootloader
-  (make-u-boot-bootloader u-boot-novena))
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 526e53384..759abdc92 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -424,7 +424,7 @@ also initializes the boards (RAM etc).")
 (define-public u-boot-malta
   (make-u-boot-package "malta" "mips64el-linux-gnuabi64"))
 
-(define-public u-boot-beagle-bone-black
+(define-public u-boot-beaglebone-black
   (make-u-boot-package "am335x_boneblack" "arm-linux-gnueabihf"))
 
 (define-public u-boot-pine64-plus
diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl
index 97201330c..1fd03dab9 100644
--- a/gnu/system/examples/beaglebone-black.tmpl
+++ b/gnu/system/examples/beaglebone-black.tmpl
@@ -13,7 +13,7 @@
   ;; Assuming /dev/mmcblk1 is the eMMC, and "my-root" is
   ;; the label of the target root file system.
   (bootloader (bootloader-configuration
-               (bootloader u-boot-beaglebone-black-bootloader)
+               (bootloader (make-u-boot-bootloader u-boot-beaglebone-black))
                (target "/dev/mmcblk1")))
 
   ;; This module is required to mount the SD card.
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index b563e8b5b..7508f95a8 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -396,8 +396,7 @@ If you want a serial console, make sure to specify one in your
 operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
   (operating-system (inherit os)
     (bootloader (bootloader-configuration
-                 (bootloader (bootloader (inherit u-boot-bootloader)
-                              (package (make-u-boot-package board triplet))))
+                 (bootloader (make-u-boot-bootloader (make-u-boot-package board triplet)))
                  (target bootloader-target)))))
 
 (define* (embedded-installation-os bootloader bootloader-target tty
@@ -418,7 +417,7 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (initrd-modules (append extra-modules %base-initrd-modules))))
 
 (define beaglebone-black-installation-os
-  (embedded-installation-os u-boot-beaglebone-black-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-beaglebone-black)
                             "/dev/sda"
                             "ttyO0"
                             #:extra-modules
@@ -427,42 +426,42 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
 
 
 (define a20-olinuxino-lime-installation-os
-  (embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-a20-olinuxino-lime)
                             "/dev/mmcblk0" ; SD card storage
                             "ttyS0"))
 
 (define a20-olinuxino-lime2-emmc-installation-os
-  (embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-a20-olinuxino-lime2)
                             "/dev/mmcblk1" ; eMMC storage
                             "ttyS0"))
 
 (define a20-olinuxino-micro-installation-os
-  (embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-a20-olinuxino-micro)
                             "/dev/mmcblk0" ; SD card storage
                             "ttyS0"))
 
 (define banana-pi-m2-ultra-installation-os
-  (embedded-installation-os u-boot-banana-pi-m2-ultra-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-banana-pi-m2-ultra)
                             "/dev/mmcblk1" ; eMMC storage
                             "ttyS0"))
 
 (define mx6cuboxi-installation-os
-  (embedded-installation-os u-boot-mx6cuboxi-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-mx6cuboxi)
                             "/dev/mmcblk0" ; SD card storage
                             "ttymxc0"))
 
 (define novena-installation-os
-  (embedded-installation-os u-boot-novena-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-novena)
                             "/dev/mmcblk1" ; SD card storage
                             "ttymxc1"))
 
 (define nintendo-nes-classic-edition-installation-os
-  (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-nintendo-nes-classic-edition)
                             "/dev/mmcblk0" ; SD card (solder it yourself)
                             "ttyS0"))
 
 (define wandboard-installation-os
-  (embedded-installation-os u-boot-wandboard-bootloader
+  (embedded-installation-os (make-u-boot-bootloader u-boot-wandboard)
                             "/dev/mmcblk0" ; SD card storage
                             "ttymxc0"))
 




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 09:25:02 GMT) Full text and rfc822 format available.

Message #20 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 1/4] system: Add os-with-u-boot.
Date: Sun, 13 May 2018 11:24:30 +0200
Hello!

Great that you’re streamlining GuixSD on ARM!

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> * gnu/system/install.scm (os-with-u-boot): New procedure.
> * gnu/packages/bootloaders.scm (make-u-boot-package): Export.
> * doc/guix.texi (Building the Installation Image for ARM boards): New
> subsection.

[...]

> +@subsection Building the Installation Image for ARM boards

“Boards”

> +Many ARM boards require a board-specific bootloader in order to boot.

Maybe: “require a specific variant of the
@uref{http://www.denx.de/wiki/U-Boot/, U-Boot} bootloader.”

> +If you build an entire disk image and the is not still available otherwise
> +(on another available drive etc), it's advisable to build an image that
> +includes the bootloader, specifically:
> +
> +@example
> +guix system disk-image --system=armhf-linux -e '((@ (gnu system install) os-with-u-boot) (@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")'
> +@end example

Note: In Texinfo you need to double all the at signs.

> +Or if you don't cross compile:

It’s not cross-compilation.  :-)

But I don’t think you need to repeat the command line.

> +"A20-OLinuXino-Lime2" is the name of the board.  If you specify an invalid
   ^
@code

> +board, you get a list.

I think the patch is otherwise OK.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 09:32:02 GMT) Full text and rfc822 format available.

Message #23 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 2/4] bootloader: install-u-boot: Automatically
 select the correct installer.
Date: Sun, 13 May 2018 11:31:23 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> * 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)))))))

Hmm ‘install-beaglebone-black-u-boot’ & co are not in the same stage
AFAICS; are you missing #$ escapes here?

Also we’re probably missing (ice-9 rdelim) and (ice-9 regex) as in the
build stage.

Last, isn’t it a bit hacky?  :-)  Previously every <bootloader> would
contain its installation method, so this was unambiguous, but now we’re
back to guessing what installation method to use.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 09:37:02 GMT) Full text and rfc822 format available.

Message #26 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 13 May 2018 11:36:02 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> +(define (make-u-boot-bootloader bootloader-package)
> +  "Given BOOTLOADER-PACKAGE, make a bootloader that can install."
>    (bootloader
> -   (inherit u-boot-bootloader)
> -   (installer install-allwinner-u-boot)))
> +    (inherit u-boot-bootloader)
> +    (package bootloader-package)))

What about making it entirely dynamic similar to the ‘cross-gcc’
procedure?

Like:

  (define (u-boot-bootloader board)
    (bootloader
      (installer (board-installer board))
      (package (make-u-boot-package (board-name board)
                                    (board-triplet board)))))

where:

  (define-record-type <board>
    (board name triplet installer)
    …)

Thoughts?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 10:44:01 GMT) Full text and rfc822 format available.

Message #29 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 2/4] bootloader: install-u-boot:
 Automatically select the correct installer.
Date: Sun, 13 May 2018 12:43:50 +0200
[Message part 1 (text/plain, inline)]
Hi Ludo,

On Sun, 13 May 2018 11:31:23 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Last, isn’t it a bit hacky?  :-)  Previously every <bootloader> would
> contain its installation method, so this was unambiguous, but now we’re
> back to guessing what installation method to use.

Yeah, it's a bit hacky.

But I don't like the weird spreading-out of bootloader installers as
opposed to bootloader packages either.  It would be nicest if upstream
just included installation scripts :P

How the board will boot depends *only* on the Sytem-On-a-Chip in use -
for example all the Allwinner sunxi chips boot the same way.

Usually it's just what the vendor decided to use years (decades) ago
and it stays the same over many many chip generations.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 11:04:02 GMT) Full text and rfc822 format available.

Message #32 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 13 May 2018 13:03:43 +0200
[Message part 1 (text/plain, inline)]
Hi Ludo,

>   (define-record-type <board>
>     (board name triplet installer)
>     …)
> 
> Thoughts?

The idea of make-u-boot-bootloader (and os-with-u-boot) was that it would free
us from having to play whack-a-mole regarding u-boot (except for the
installation methods of which there are much fewer than boards or chip models)
and also free the user from having to know anything but the board name.

With your idea it would mean that we'd have to carry a huge list of <board>s,
defining the board and architecture and installer, right? (or I guess the
user would have to create it on-the-fly)

That's exactly what I was trying to avoid :)

I know my method isn't perfect either - I should have said "WIP" - but the idea
is that the user would just use os-with-u-boot and specify his board name - and the
rest is magically being worked out (for all boards in u-boot).

I'm trying to keep to information that is available within u-boot (like .config)
so we don't have to maintain the stuff ourselves.  The installer was supposed
to read out the u-boot parts and infer the correct incantations to use by itself.

To infer the triplet, we can search for "CONFIG_ARM64=y".

The SOC should be fine to infer as in this patch.

No chance inferring the actual installation commands, though.  Too bad...

They've got all kinds of funny config entries like

  CONFIG_SPL_FIT_GENERATOR="board/sunxi/mksunxi_fit_atf.sh"

but I don't see the installation commands / info... hrmmmm...
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 11:16:02 GMT) Full text and rfc822 format available.

Message #35 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 13 May 2018 13:15:10 +0200
[Message part 1 (text/plain, inline)]
> To infer the triplet, we can search for "CONFIG_ARM64=y".

Not really, it's not in the u-boot tarball before it started building it.  Hmm...

But you're right, it shouldn't be cross-compiling it in the first place if "-s"
works (or if the user builds it on the target anyway), so we could just punt on
this entirely.

P.S. how do I make make-u-boot-package default triplet to the host triplet?
(%current-system) is not a gnu triplet, right?
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 12:10:01 GMT) Full text and rfc822 format available.

Message #38 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 1/4] system: Add os-with-u-boot.
Date: Sun, 13 May 2018 14:09:06 +0200
[Message part 1 (text/plain, inline)]
2018-05-11 16:36 GMT+02:00 Danny Milosavljevic <dannym <at> scratchpost.org>:
[...]

> +@subsection Building the Installation Image for ARM boards
> +
> +Many ARM boards require a board-specific bootloader in order to boot.
> +
> +If you build an entire disk image and the is not still available otherwise
> +(on another available drive etc), it's advisable to build an image that
> +includes the bootloader, specifically:
>
`and the' seems to miss something after it.

> +
> +@example
> +guix system disk-image --system=armhf-linux -e '((@ (gnu system install)
> os-with-u-boot) (@ (gnu system install) installation-os)
> "A20-OLinuXino-Lime2")'
> +@end example
> +
> +Or if you don't cross compile:
>

nitpick: I do not like contractions in writing, but if we already use them
elsewhere, disregard this ;-).

> +
> +@example
> +guix system disk-image -e '((@ (gnu system install) os-with-u-boot) (@
> (gnu system install) installation-os) "A20-OLinuXino-Lime2")'
> +@end example
> +
> +"A20-OLinuXino-Lime2" is the name of the board.  If you specify an invalid
> +board, you get a list.
>

Could you clarify what you mean when you say you get a list?

> [...]
>
>
Thanks for working on this! I really want to see GuixSD on ARM succeed as
well.
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 13 May 2018 13:47:02 GMT) Full text and rfc822 format available.

Message #41 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 13 May 2018 15:46:15 +0200
[Message part 1 (text/plain, inline)]
The number of boards vs. the number of SOCs:

u-boot-2018.05$ tools/genboardscfg.py
u-boot-2018.05$ wc -l boards.cfg
1249 boards.cfg
u-boot-2018.05$ cat boards.cfg |tail +7 |awk '{print $4}' |sort |uniq  |grep -v '^$' |wc -l # 4 is the "SOC" column
86
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Mon, 14 May 2018 08:32:02 GMT) Full text and rfc822 format available.

Message #44 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Mon, 14 May 2018 10:31:13 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> P.S. how do I make make-u-boot-package default triplet to the host triplet?
> (%current-system) is not a gnu triplet, right?

You could do:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix utils)
scheme@(guile-user)> (nix-system->gnu-triplet (%current-system))
$2 = "x86_64-unknown-linux-gnu"
--8<---------------cut here---------------end--------------->8---

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Mon, 14 May 2018 08:35:02 GMT) Full text and rfc822 format available.

Message #47 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Mon, 14 May 2018 10:34:20 +0200
Hello Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

>>   (define-record-type <board>
>>     (board name triplet installer)
>>     …)
>> 
>> Thoughts?
>
> The idea of make-u-boot-bootloader (and os-with-u-boot) was that it would free
> us from having to play whack-a-mole regarding u-boot (except for the
> installation methods of which there are much fewer than boards or chip models)
> and also free the user from having to know anything but the board name.
>
> With your idea it would mean that we'd have to carry a huge list of <board>s,
> defining the board and architecture and installer, right? (or I guess the
> user would have to create it on-the-fly)
>
> That's exactly what I was trying to avoid :)

Oh I see, especially the 1.2K boards vs. 86 SoCs!

Then perhaps “board” is not the right abstraction; maybe <soc> would
make more sense?

Either way, my point was that it would be nice to have some abstraction
to clearly specify things, and then use that as an input to construct
both the U-Boot package and its configuration.

Or do you think enumerating the SoCs would still be too painful?  In
that case, some auto-guessing might be the right choice, but in general,
I think it should be a last resort.  :-)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Mon, 14 May 2018 16:30:02 GMT) Full text and rfc822 format available.

Message #50 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Mon, 14 May 2018 18:29:53 +0200
Ji Ludo,

> Or do you think enumerating the SoCs would still be too painful?  

No, I think that would be a good idea.

I'm not 100% sure that the SOC's ROM loads the bootloader always in the same
way - but all SOCs I have ever seen so far do that (it also makes sense -
the factory probably has chip test rigs and they don't want to
update those every time a new chip revision comes out).

(sometimes this can even be generalized to the vendor instead of the soc,
though not always)

If it does happen that there's a config resistor or something, we can cross
that bridge when we come to it.

So yeah, let's have a table of installers, using the soc as a key (for now?).

Still to do: bikeshedding the name :)

What about

(define-record <installer>
   soc installation-procedure
...)

(I think <soc> as record name would be weird, no?)

Or just a hash table soc -> installation-procedure ?

How does the instantiation of the table data look?  Just toplevel statements?  I've caused problems with those before :)

Where do we put it? gnu/bootloader/u-boot.scm ?




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 15 Jun 2018 07:13:02 GMT) Full text and rfc822 format available.

Message #53 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Fri, 15 Jun 2018 09:12:31 +0200
Hi Danny,

Apologies for dropping the ball!

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> Still to do: bikeshedding the name :)
>
> What about
>
> (define-record <installer>
>    soc installation-procedure
> ...)
>
> (I think <soc> as record name would be weird, no?)

I think <installer> is too vague and it sounds like it’s basically a
procedure, which it’s not.  <soc> would be fine IMO, or <system-on-chip>
if we want.

> Or just a hash table soc -> installation-procedure ?
>
> How does the instantiation of the table data look?  Just toplevel statements?  I've caused problems with those before :)

I think we need a table to look things up by name anyway, but we may
also need a record type: I suppose we’d want to describe things in that
record.

For the lookup table itself, see for example ‘file-system-type-modules’
in (gnu system linux-initrd).

> Where do we put it? gnu/bootloader/u-boot.scm ?

Sounds like the right place, yes.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 17 Jun 2018 00:30:02 GMT) Full text and rfc822 format available.

Message #56 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 17 Jun 2018 02:28:55 +0200
[Message part 1 (text/plain, inline)]
Hi Ludo,

On Fri, 15 Jun 2018 09:12:31 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Apologies for dropping the ball!

No problem, no need to hurry!

I've researched a little in the mean time and found out that other projects
DO have automated u-boot installation, for example:

https://github.com/buildroot/buildroot/blob/master/board/olimex/a20_olinuxino/genimage.cfg

So we could leave this stuff mostly to them - although it would mean
we'd only support boards they support.

It would make us lose support for these for now:

* qemu_arm_vexpress
* qemu_mips64el_malta
* banana-pi-m2-ultra
* nintendo-nes-classic-edition
* novena
* cubieboard
* puma-rk3399

So we'd have to upstream support for those[1] - and also have a fallback in the
mean time maybe.

A very minimal WIP patch for that is attached.

What it does is install a "genimage.cfg" which describes how to install u-boot for
the current board into the derivation of u-boot.

Do we want to proceed like that?

Should I move load-u-boot-config into a new guix/build/u-boot.scm ? Or how
do I get it into the build side without rebuilding the world?

[1] I added banana-pi-m2-ultra in my local buildroot checkout by creating 3 short
text files, so it's not that bad.
[QQ.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 17 Jun 2018 12:36:02 GMT) Full text and rfc822 format available.

Message #59 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 17 Jun 2018 14:35:17 +0200
[Message part 1 (text/plain, inline)]
v2, with u-boot-without-buildroot fallback, attached.
[QQ2.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 17 Jun 2018 20:34:01 GMT) Full text and rfc822 format available.

Message #62 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 17 Jun 2018 22:33:05 +0200
Hello Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> I've researched a little in the mean time and found out that other projects
> DO have automated u-boot installation, for example:
>
> https://github.com/buildroot/buildroot/blob/master/board/olimex/a20_olinuxino/genimage.cfg
>
> So we could leave this stuff mostly to them - although it would mean
> we'd only support boards they support.

Instead of using these .cfg files as-is, how about “importing” them?
That <soc> structure (or whatever) we discussed could contain
essentially the relevant part of those .cfg files (the partitioning info
founds in those files seems less relevant to me, or at least it seems
like a separate issue.)

WDYT?

IOW, we could definitely take Buildroot as an inspiration (it’s probably
one of the best tools in this area), but maybe not reuse the actual
files.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Sun, 17 Jun 2018 21:42:02 GMT) Full text and rfc822 format available.

Message #65 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Sun, 17 Jun 2018 23:41:38 +0200
[Message part 1 (text/plain, inline)]
Hi,

On Sun, 17 Jun 2018 22:33:05 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Instead of using these .cfg files as-is, how about “importing” them?
> That <soc> structure (or whatever) we discussed could contain
> essentially the relevant part of those .cfg files

Yeah

> (the partitioning info
> founds in those files seems less relevant to me

Yes.  Buildroot is a huge superset of what we actually need :).

> IOW, we could definitely take Buildroot as an inspiration (it’s probably
> one of the best tools in this area), but maybe not reuse the actual
> files.

The advantage if we reused the actual files is that we'd not have to maintain
it so much ourselves.

But if we use the <soc> solution, it's not actually that much work to maintain it.

I've extracted the list of socs using

  u-boot-2018.05$ grep -C 1 -r SYS_SOC . |grep default |awk '{print $3}' |sort |uniq |grep '"' >Q

and I got this list:

"ae250"
"ae3xx"
"ag101"
"am33xx"
"apq8016"
"apq8096"
"armada100"
"aspeed"
"at91"
"ath79"
"au1x00"
"baytrail"
"bcm235xx"
"bcm281xx"
"bcm283x"
"bcm3380"
"bcmcygnus"
"bcmnsp"
"braswell"
"broadwell"
"coreboot"
"davinci"
"efi"
"ep93xx"
"exynos"
"fsl-layerscape"
"hi3798cv200"
"hi6220"
"highbank"
"ivybridge"
"keystone"
"kirkwood"
"lpc32xx"
"ls102xa"
"meson"
"mvebu"
"mx25"
"mx27"
"mx31"
"mx35"
"mx5"
"mx6"
"mx7"
"mx7ulp"
"mx8m"
"mxs"
"ns2"
"omap3"
"omap4"
"omap5"
"orion5x"
"pic32mzda"
"qemu"
"quark"
"queensbay"
"rmobile"
"rockchip"
"s5pc1xx"
"snapdragon"
"socfpga"
"socfpga_arria10"
"spear"
"stih410"
"stm32mp"
"stv0991"
"sunxi"
"tangier"
"tegra114"
"tegra124"
"tegra186"
"tegra20"
"tegra210"
"tegra30"
"uniphier-v7"
"vf610"
"zynq"
"zynqmp"

Not that bad, eh?

Next would be to find those in buildroot, extract the relevant information from their genimage.cfg and unify them.
But that's a little involved.  A path would be:

(1) Extract possible SYS_SOC and SYS_VENDOR from all u-boot Kconfigs
(2) Find out which u-boot defconfigs would lead to those u-boot Kconfigs
(3) Find out which buildroot defconfigs would lead to those u-boot defconfigs
(4) Find out which buildroot board directory is used by each buildroot defconfig
(5) Extract the genimage.cfg from each such buildroot board directory
(6) Extract the u-boot installation specific parts from the genimage.cfg
(7) Unify the set of "genimage.cfg" parts for this SOC and make sure they are always the same
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Mon, 18 Jun 2018 08:26:01 GMT) Full text and rfc822 format available.

Message #68 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: [bug#31416] [PATCH 3/4] bootloader: Add make-u-boot-bootloader.
Date: Mon, 18 Jun 2018 10:25:00 +0200
Hi Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> On Sun, 17 Jun 2018 22:33:05 +0200
> ludo <at> gnu.org (Ludovic Courtès) wrote:

[...]

>> IOW, we could definitely take Buildroot as an inspiration (it’s probably
>> one of the best tools in this area), but maybe not reuse the actual
>> files.
>
> The advantage if we reused the actual files is that we'd not have to maintain
> it so much ourselves.

[...]

> Next would be to find those in buildroot, extract the relevant information from their genimage.cfg and unify them.
> But that's a little involved.  A path would be:
>
> (1) Extract possible SYS_SOC and SYS_VENDOR from all u-boot Kconfigs
> (2) Find out which u-boot defconfigs would lead to those u-boot Kconfigs
> (3) Find out which buildroot defconfigs would lead to those u-boot defconfigs
> (4) Find out which buildroot board directory is used by each buildroot defconfig
> (5) Extract the genimage.cfg from each such buildroot board directory
> (6) Extract the u-boot installation specific parts from the genimage.cfg
> (7) Unify the set of "genimage.cfg" parts for this SOC and make sure they are always the same

Sounds like a plan.

Though honestly, I think it’s fine if we have fewer configs available as
long as they’re known good.  It’s not a goal IMO to have as many
supported boards as Buildroot.

So I’d suggest defining the <soc> API and using it, taking inspiration
from those genimage.cfg files as needed.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31416; Package guix-patches. (Fri, 21 Jul 2023 16:55:02 GMT) Full text and rfc822 format available.

Message #71 received at 31416 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416 <at> debbugs.gnu.org
Subject: Re: bug#31416: [PATCH 0/4] Generalize bootloader installer selection.
Date: Fri, 21 Jul 2023 12:53:50 -0400
Hi Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> Danny Milosavljevic (4):
>   system: Add os-with-u-boot.
>   bootloader: install-u-boot: Automatically select the correct
>     installer.
>   bootloader: Add make-u-boot-bootloader.
>   bootloader: Simplify bootloader installer selection.

Is there something to salvage here, 5 years later, or should we close
this?

-- 
Thanks,
Maxim




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 01 Sep 2023 18:48:02 GMT) Full text and rfc822 format available.

Notification sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
bug acknowledged by developer. (Fri, 01 Sep 2023 18:48:02 GMT) Full text and rfc822 format available.

Message #76 received at 31416-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 31416-done <at> debbugs.gnu.org
Subject: Re: bug#31416: [PATCH 0/4] Generalize bootloader installer selection.
Date: Fri, 01 Sep 2023 14:47:06 -0400
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Hi Danny,
>
> Danny Milosavljevic <dannym <at> scratchpost.org> writes:
>
>> Danny Milosavljevic (4):
>>   system: Add os-with-u-boot.
>>   bootloader: install-u-boot: Automatically select the correct
>>     installer.
>>   bootloader: Add make-u-boot-bootloader.
>>   bootloader: Simplify bootloader installer selection.
>
> Is there something to salvage here, 5 years later, or should we close
> this?

Closing.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 Sep 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.