Add installer support for u-boot imx6 boards.

DoneSubmitted by Vagrant Cascadian.
Details
4 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Mathieu Othacehe
  • Vagrant Cascadian
Owner
unassigned
Severity
normal
V
V
Vagrant Cascadian wrote on 10 May 2018 19:47
(address . guix-patches@gnu.org)
87h8nfwgfp.fsf@aikidev.net
Add support to install u-boot for wandboard and mx6cuboxi, and add
u-boot target and installer support for novena.

Tested using GuixSD on wandboard solo and novena. The mx6cuboxi target
uses the same device offsets, and worked with manual installation.

It should be noted that the offsets for installing u-boot.img on imx6
targets conflict with a typical GPT partition table header; works fine
with dos partition table headers. I'm not sure what safeguards could be
added to detect that. This also may not be unique to imx6 targets
(e.g. pine64 u-boot/atf also has a similar issue).

Also, the novena patch has a known flaw, in that it requires copying the
u-boot.img file to the first partition rather than writing it to a raw
offset on the mmc device.

Not sure how to handle that exactly, as partitioning is typically a
manual process in guixsd?

If nothing else, merging only the wandboard and mx6cuboxi patches and
only including the u-boot target for novena might make sense. Another
option would be to patch novena to load u-boot.img from an offset rather
than a filesystem, though I doubt that will be accepted in u-boot
upstream.


live well,
vagrant

Vagrant Cascadian (3):
system: Add mx6cuboxi installer.
system: Add wandboard installer.
gnu: Add u-boot-novena installer.

gnu/bootloader/u-boot.scm | 34 +++++++++++++++++++++++++++++++++-
gnu/packages/bootloaders.scm | 3 +++
gnu/system/install.scm | 20 +++++++++++++++++++-
3 files changed, 55 insertions(+), 2 deletions(-)

--
2.17.0
From 39b8f64e964c2a88d6f0bcbb5dcfa2ccb194793f Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Mon, 7 May 2018 14:32:02 +0000
Subject: [PATCH 1/3] system: Add mx6cuboxi installer.

* gnu/bootloader/u-boot.scm (u-boot-mx6cuboxi-bootloader):
New exported variable.
* gnu/system/install.scm (mx6cuboxi-installation-os):
New exported variable.
---
gnu/bootloader/u-boot.scm | 20 ++++++++++++++++++++
gnu/system/install.scm | 6 ++++++
2 files changed, 26 insertions(+)

Toggle diff (75 lines)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 21d0aecce..58ee528a2 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -33,6 +33,7 @@
             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))
 
 (define install-u-boot
@@ -62,6 +63,15 @@
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               device (* 8 1024)))))
 
+(define install-imx-u-boot
+  #~(lambda (bootloader device mount-point)
+      (let ((spl (string-append bootloader "/libexec/SPL"))
+            (u-boot (string-append bootloader "/libexec/u-boot.img")))
+        (write-file-on-device spl (stat:size (stat spl))
+                              device (* 1 1024))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              device (* 69 1024)))))
+
 
 
 ;;;
@@ -86,6 +96,11 @@
    (inherit u-boot-bootloader)
    (installer install-allwinner-u-boot)))
 
+(define u-boot-imx-bootloader
+  (bootloader
+   (inherit u-boot-bootloader)
+   (installer install-imx-u-boot)))
+
 (define u-boot-nintendo-nes-classic-edition-bootloader
   (bootloader
     (inherit u-boot-allwinner-bootloader)
@@ -110,3 +125,8 @@
   (bootloader
    (inherit u-boot-allwinner-bootloader)
    (package u-boot-banana-pi-m2-ultra)))
+
+(define u-boot-mx6cuboxi-bootloader
+  (bootloader
+   (inherit u-boot-imx-bootloader)
+   (package u-boot-mx6cuboxi)))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 920d21527..7580d981b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -49,6 +49,7 @@
             a20-olinuxino-micro-installation-os
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
+            mx6cuboxi-installation-os
             nintendo-nes-classic-edition-installation-os))
 
 ;;; Commentary:
@@ -429,6 +430,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
                             "/dev/mmcblk1" ; eMMC storage
                             "ttyS0"))
 
+(define mx6cuboxi-installation-os
+  (embedded-installation-os u-boot-mx6cuboxi-bootloader
+                            "/dev/mmcblk0" ; SD card storage
+                            "ttymxc0"))
+
 (define nintendo-nes-classic-edition-installation-os
   (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
                             "/dev/mmcblk0" ; SD card (solder it yourself)
-- 
2.17.0
From 4b552cb1c4cd1df18278a2b5b63aac4ca7337140 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Mon, 7 May 2018 14:34:43 +0000
Subject: [PATCH 2/3] system: Add wandboard installer.

* gnu/bootloader/u-boot.scm (u-boot-wandboard-bootloader):
New exported variable.
* gnu/system/install.scm (wandboard-installation-os):
New exported variable.
---
gnu/bootloader/u-boot.scm | 8 +++++++-
gnu/system/install.scm | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 58ee528a2..9a62a166f 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -34,7 +34,8 @@
             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-nintendo-nes-classic-edition-bootloader
+            u-boot-wandboard-bootloader))
 
 (define install-u-boot
   #~(lambda (bootloader device mount-point)
@@ -130,3 +131,8 @@
   (bootloader
    (inherit u-boot-imx-bootloader)
    (package u-boot-mx6cuboxi)))
+
+(define u-boot-wandboard-bootloader
+  (bootloader
+   (inherit u-boot-imx-bootloader)
+   (package u-boot-wandboard)))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 7580d981b..9bb1d8145 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -50,7 +50,8 @@
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
             mx6cuboxi-installation-os
-            nintendo-nes-classic-edition-installation-os))
+            nintendo-nes-classic-edition-installation-os
+            wandboard-installation-os))
 
 ;;; Commentary:
 ;;;
@@ -440,6 +441,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
                             "/dev/mmcblk0" ; SD card (solder it yourself)
                             "ttyS0"))
 
+(define wandboard-installation-os
+  (embedded-installation-os u-boot-wandboard-bootloader
+                            "/dev/mmcblk0" ; SD card storage
+                            "ttymxc0"))
+
 ;; Return the default os here so 'guix system' can consume it directly.
 installation-os
 
-- 
2.17.0
From 71cb0f715cf48bf703a8607f72088783b685d418 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Wed, 9 May 2018 06:59:10 +0000
Subject: [PATCH 3/3] gnu: Add u-boot-novena installer.

* gnu/packages/bootloaders.scm (u-boot-novena):
New variable.
* gnu/bootloader/u-boot.scm (u-boot-novena-bootloader):
New exported variable.
* gnu/system/install.scm (novena-installation-os):
New exported variable.
---
gnu/bootloader/u-boot.scm | 6 ++++++
gnu/packages/bootloaders.scm | 3 +++
gnu/system/install.scm | 6 ++++++
3 files changed, 15 insertions(+)

Toggle diff (61 lines)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 9a62a166f..bc8f98f32 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -35,6 +35,7 @@
             u-boot-beaglebone-black-bootloader
             u-boot-mx6cuboxi-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
+            u-boot-novena-bootloader
             u-boot-wandboard-bootloader))
 
 (define install-u-boot
@@ -136,3 +137,8 @@
   (bootloader
    (inherit u-boot-imx-bootloader)
    (package u-boot-wandboard)))
+
+(define u-boot-novena-bootloader
+  (bootloader
+   (inherit u-boot-imx-bootloader)
+   (package u-boot-novena)))
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 0db6ad3f6..c0a0101c5 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -469,6 +469,9 @@ also initializes the boards (RAM etc).")
 (define-public u-boot-mx6cuboxi
   (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf"))
 
+(define-public u-boot-novena
+  (make-u-boot-package "novena" "arm-linux-gnueabihf"))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 9bb1d8145..a2917e485 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -51,6 +51,7 @@
             beaglebone-black-installation-os
             mx6cuboxi-installation-os
             nintendo-nes-classic-edition-installation-os
+            novena-installation-os
             wandboard-installation-os))
 
 ;;; Commentary:
@@ -436,6 +437,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
                             "/dev/mmcblk0" ; SD card storage
                             "ttymxc0"))
 
+(define novena-installation-os
+  (embedded-installation-os u-boot-novena-bootloader
+                            "/dev/mmcblk1" ; SD card storage
+                            "ttymxc1"))
+
 (define nintendo-nes-classic-edition-installation-os
   (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
                             "/dev/mmcblk0" ; SD card (solder it yourself)
-- 
2.17.0
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlr0hcoACgkQt4uC1IFL
kbZWLQ//eSD5dcF+26FQvIlhUbUXo/BhyPW+ieRo6zZf7N3TQ7mxYnUUVCnTZvO5
h5n1gi6QtkvDps3tIzm/T1sdqNd3d6IlEbuBPL1lhA/tPYXWldj9Cq4IJD/aKgnw
VvdprteRWRNNY09kQfiHA8QXdVbDsJWkHSrZ4gvEwu9EYUAhLAafj2K9qCON9JOw
43mK2aechvgauFBbvNvt5XKMMai5RwHsF15njn1zuD0vNr8yPZggFsrRaSxEAoC2
8BizCUaMqI/Rxhy7igoAT7gwz8W5syjmCwqJ3jMD9+xfXVnQJYM48oKVlnudXdOo
mJxKdrLU/wxsdpNo39PgB/6KDejoMu0A1YscvdMzexvWMmd6Yp7FYFxNT9566IXH
Q0bcTdYgSwGTEcnq/IzbdQXOfUNHWlDAjo26nJhs9wPzu5UcOxjrGM+K2TQ2oOnz
IdhtJ4EX4wb7G16Ts8UpasWydUUvgfKmegGCiGDEmQTAWqjbhfarMs99wYNSbUif
LX9P/gIhynGbRHTWRTu5vCaynBZWG2LZzi4d7wROcIM+w55g/HWjDbEpFiALQRF1
cQlqfmN0sZKv+eZ7mg8mgNYli4SlbCgMLlV1IvYxbv8H5hRT69tmfJwYpwBOsBH1
hJHiv4jcn/e7vhiIHWYZJO6Vs+QT9VEnYp2gEzyHPdC2Avh978Q=
=j/Vx
-----END PGP SIGNATURE-----

M
M
Mathieu Othacehe wrote on 11 May 2018 09:53
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 31404@debbugs.gnu.org)
87zi16d3w6.fsf@gmail.com
Hi Vagrant,

Great to see GuixSD ported to new ARM boards, good job!

Toggle quote (6 lines)
> It should be noted that the offsets for installing u-boot.img on imx6
> targets conflict with a typical GPT partition table header; works fine
> with dos partition table headers. I'm not sure what safeguards could be
> added to detect that. This also may not be unique to imx6 targets
> (e.g. pine64 u-boot/atf also has a similar issue).

We could maybe check in install procedures if the partition table is
DOS/GPT before installing and abort if the wrong type is detected?

Toggle quote (7 lines)
> Also, the novena patch has a known flaw, in that it requires copying the
> u-boot.img file to the first partition rather than writing it to a raw
> offset on the mmc device.
>
> Not sure how to handle that exactly, as partitioning is typically a
> manual process in guixsd?

In the case the GuixSD installation is done directly on the target we
could try to locate the first partition, it's mount point and copy
u-boot.img at the correct location. As it sounds quite complicated, the
best option in my opinion is not to try to install u-boot on novena.

You could also add a comment explaining why the bootloader is not
installed and what does it take to make it work.

Otherwise this seems fine to me.

Thanks,

Mathieu

Toggle quote (245 lines)
> Vagrant Cascadian (3):
> system: Add mx6cuboxi installer.
> system: Add wandboard installer.
> gnu: Add u-boot-novena installer.
>
> gnu/bootloader/u-boot.scm | 34 +++++++++++++++++++++++++++++++++-
> gnu/packages/bootloaders.scm | 3 +++
> gnu/system/install.scm | 20 +++++++++++++++++++-
> 3 files changed, 55 insertions(+), 2 deletions(-)
>
> --
> 2.17.0
>
> From 39b8f64e964c2a88d6f0bcbb5dcfa2ccb194793f Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@debian.org>
> Date: Mon, 7 May 2018 14:32:02 +0000
> Subject: [PATCH 1/3] system: Add mx6cuboxi installer.
>
> * gnu/bootloader/u-boot.scm (u-boot-mx6cuboxi-bootloader):
> New exported variable.
> * gnu/system/install.scm (mx6cuboxi-installation-os):
> New exported variable.
> ---
> gnu/bootloader/u-boot.scm | 20 ++++++++++++++++++++
> gnu/system/install.scm | 6 ++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
> index 21d0aecce..58ee528a2 100644
> --- a/gnu/bootloader/u-boot.scm
> +++ b/gnu/bootloader/u-boot.scm
> @@ -33,6 +33,7 @@
> 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))
>
> (define install-u-boot
> @@ -62,6 +63,15 @@
> (write-file-on-device u-boot (stat:size (stat u-boot))
> device (* 8 1024)))))
>
> +(define install-imx-u-boot
> + #~(lambda (bootloader device mount-point)
> + (let ((spl (string-append bootloader "/libexec/SPL"))
> + (u-boot (string-append bootloader "/libexec/u-boot.img")))
> + (write-file-on-device spl (stat:size (stat spl))
> + device (* 1 1024))
> + (write-file-on-device u-boot (stat:size (stat u-boot))
> + device (* 69 1024)))))
> +
>
>
> ;;;
> @@ -86,6 +96,11 @@
> (inherit u-boot-bootloader)
> (installer install-allwinner-u-boot)))
>
> +(define u-boot-imx-bootloader
> + (bootloader
> + (inherit u-boot-bootloader)
> + (installer install-imx-u-boot)))
> +
> (define u-boot-nintendo-nes-classic-edition-bootloader
> (bootloader
> (inherit u-boot-allwinner-bootloader)
> @@ -110,3 +125,8 @@
> (bootloader
> (inherit u-boot-allwinner-bootloader)
> (package u-boot-banana-pi-m2-ultra)))
> +
> +(define u-boot-mx6cuboxi-bootloader
> + (bootloader
> + (inherit u-boot-imx-bootloader)
> + (package u-boot-mx6cuboxi)))
> diff --git a/gnu/system/install.scm b/gnu/system/install.scm
> index 920d21527..7580d981b 100644
> --- a/gnu/system/install.scm
> +++ b/gnu/system/install.scm
> @@ -49,6 +49,7 @@
> a20-olinuxino-micro-installation-os
> banana-pi-m2-ultra-installation-os
> beaglebone-black-installation-os
> + mx6cuboxi-installation-os
> nintendo-nes-classic-edition-installation-os))
>
> ;;; Commentary:
> @@ -429,6 +430,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
> "/dev/mmcblk1" ; eMMC storage
> "ttyS0"))
>
> +(define mx6cuboxi-installation-os
> + (embedded-installation-os u-boot-mx6cuboxi-bootloader
> + "/dev/mmcblk0" ; SD card storage
> + "ttymxc0"))
> +
> (define nintendo-nes-classic-edition-installation-os
> (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
> "/dev/mmcblk0" ; SD card (solder it yourself)
> --
> 2.17.0
>
> From 4b552cb1c4cd1df18278a2b5b63aac4ca7337140 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@debian.org>
> Date: Mon, 7 May 2018 14:34:43 +0000
> Subject: [PATCH 2/3] system: Add wandboard installer.
>
> * gnu/bootloader/u-boot.scm (u-boot-wandboard-bootloader):
> New exported variable.
> * gnu/system/install.scm (wandboard-installation-os):
> New exported variable.
> ---
> gnu/bootloader/u-boot.scm | 8 +++++++-
> gnu/system/install.scm | 8 +++++++-
> 2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
> index 58ee528a2..9a62a166f 100644
> --- a/gnu/bootloader/u-boot.scm
> +++ b/gnu/bootloader/u-boot.scm
> @@ -34,7 +34,8 @@
> 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-nintendo-nes-classic-edition-bootloader
> + u-boot-wandboard-bootloader))
>
> (define install-u-boot
> #~(lambda (bootloader device mount-point)
> @@ -130,3 +131,8 @@
> (bootloader
> (inherit u-boot-imx-bootloader)
> (package u-boot-mx6cuboxi)))
> +
> +(define u-boot-wandboard-bootloader
> + (bootloader
> + (inherit u-boot-imx-bootloader)
> + (package u-boot-wandboard)))
> diff --git a/gnu/system/install.scm b/gnu/system/install.scm
> index 7580d981b..9bb1d8145 100644
> --- a/gnu/system/install.scm
> +++ b/gnu/system/install.scm
> @@ -50,7 +50,8 @@
> banana-pi-m2-ultra-installation-os
> beaglebone-black-installation-os
> mx6cuboxi-installation-os
> - nintendo-nes-classic-edition-installation-os))
> + nintendo-nes-classic-edition-installation-os
> + wandboard-installation-os))
>
> ;;; Commentary:
> ;;;
> @@ -440,6 +441,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
> "/dev/mmcblk0" ; SD card (solder it yourself)
> "ttyS0"))
>
> +(define wandboard-installation-os
> + (embedded-installation-os u-boot-wandboard-bootloader
> + "/dev/mmcblk0" ; SD card storage
> + "ttymxc0"))
> +
> ;; Return the default os here so 'guix system' can consume it directly.
> installation-os
>
> --
> 2.17.0
>
> From 71cb0f715cf48bf703a8607f72088783b685d418 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@debian.org>
> Date: Wed, 9 May 2018 06:59:10 +0000
> Subject: [PATCH 3/3] gnu: Add u-boot-novena installer.
>
> * gnu/packages/bootloaders.scm (u-boot-novena):
> New variable.
> * gnu/bootloader/u-boot.scm (u-boot-novena-bootloader):
> New exported variable.
> * gnu/system/install.scm (novena-installation-os):
> New exported variable.
> ---
> gnu/bootloader/u-boot.scm | 6 ++++++
> gnu/packages/bootloaders.scm | 3 +++
> gnu/system/install.scm | 6 ++++++
> 3 files changed, 15 insertions(+)
>
> diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
> index 9a62a166f..bc8f98f32 100644
> --- a/gnu/bootloader/u-boot.scm
> +++ b/gnu/bootloader/u-boot.scm
> @@ -35,6 +35,7 @@
> u-boot-beaglebone-black-bootloader
> u-boot-mx6cuboxi-bootloader
> u-boot-nintendo-nes-classic-edition-bootloader
> + u-boot-novena-bootloader
> u-boot-wandboard-bootloader))
>
> (define install-u-boot
> @@ -136,3 +137,8 @@
> (bootloader
> (inherit u-boot-imx-bootloader)
> (package u-boot-wandboard)))
> +
> +(define u-boot-novena-bootloader
> + (bootloader
> + (inherit u-boot-imx-bootloader)
> + (package u-boot-novena)))
> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
> index 0db6ad3f6..c0a0101c5 100644
> --- a/gnu/packages/bootloaders.scm
> +++ b/gnu/packages/bootloaders.scm
> @@ -469,6 +469,9 @@ also initializes the boards (RAM etc).")
> (define-public u-boot-mx6cuboxi
> (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf"))
>
> +(define-public u-boot-novena
> + (make-u-boot-package "novena" "arm-linux-gnueabihf"))
> +
> (define-public vboot-utils
> (package
> (name "vboot-utils")
> diff --git a/gnu/system/install.scm b/gnu/system/install.scm
> index 9bb1d8145..a2917e485 100644
> --- a/gnu/system/install.scm
> +++ b/gnu/system/install.scm
> @@ -51,6 +51,7 @@
> beaglebone-black-installation-os
> mx6cuboxi-installation-os
> nintendo-nes-classic-edition-installation-os
> + novena-installation-os
> wandboard-installation-os))
>
> ;;; Commentary:
> @@ -436,6 +437,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
> "/dev/mmcblk0" ; SD card storage
> "ttymxc0"))
>
> +(define novena-installation-os
> + (embedded-installation-os u-boot-novena-bootloader
> + "/dev/mmcblk1" ; SD card storage
> + "ttymxc1"))
> +
> (define nintendo-nes-classic-edition-installation-os
> (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
> "/dev/mmcblk0" ; SD card (solder it yourself)
D
D
Danny Milosavljevic wrote on 11 May 2018 12:29
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 31404@debbugs.gnu.org)
20180511122926.15ed71b7@scratchpost.org
Hi Vagrant,

On Thu, 10 May 2018 10:47:54 -0700
Vagrant Cascadian <vagrant@debian.org> wrote:

Toggle quote (6 lines)
> Add support to install u-boot for wandboard and mx6cuboxi, and add
> u-boot target and installer support for novena.
>
> Tested using GuixSD on wandboard solo and novena. The mx6cuboxi target
> uses the same device offsets, and worked with manual installation.

Cool!

Toggle quote (6 lines)
> It should be noted that the offsets for installing u-boot.img on imx6
> targets conflict with a typical GPT partition table header; works fine
> with dos partition table headers. I'm not sure what safeguards could be
> added to detect that. This also may not be unique to imx6 targets
> (e.g. pine64 u-boot/atf also has a similar issue).

Yeah, and Allwinner A10, A20, R40 etc have the same problem. I've talked
to parted upstream about it so that at least the new partition tables are
not created in a stupid way - but movement is slow.

Toggle quote (4 lines)
> Also, the novena patch has a known flaw, in that it requires copying the
> u-boot.img file to the first partition rather than writing it to a raw
> offset on the mmc device.

Yeah, I guess it's fine to use mtools in the installer.

Toggle quote (3 lines)
> Not sure how to handle that exactly, as partitioning is typically a
> manual process in guixsd?

Yeah, for a first step we could just check sanity (in this case check
whether mcat failed or not).

Toggle quote (6 lines)
> If nothing else, merging only the wandboard and mx6cuboxi patches and
> only including the u-boot target for novena might make sense. Another
> option would be to patch novena to load u-boot.img from an offset rather
> than a filesystem, though I doubt that will be accepted in u-boot
> upstream.

There are lots of boards which need that setup anyway - most notably
x86_64 UEFI systems - so we have to handle the case anyway.

I vote for using mtools.

I applied your patches to guix master.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlr1cIYACgkQ5xo1VCww
uqXVbAf/Wdz4ftscE6rBXPbppIz3ZAeBG+J7IcA8eJFHm2AAbE+PCARucRngewCW
eYHc6i2opG++12uIevm6L4NG73EoNPPleM8sFS4g/1IrtF4ZHMI5Kpie48JIYGpv
MjNSm88ODRCPJU9eGltYbS23lBo+yGSaGCYmzNtFujsFyx26n9Yz4YT1eynYwzuL
oZHfS0gaYThUsGVXY38SBk4yg0gS8SETS8E08hfech2j/74NlevRnNg0RhiYfJCx
Rgh5G1ujfU4yemwvW5LR5AKqemdXBVQU90Kn6J0+K1CFB3NgAwLbzarueXjCyNS6
EAHCGVbK2kN4thh7sqSlMlR7sXRYnw==
=cxsL
-----END PGP SIGNATURE-----


V
V
Vagrant Cascadian wrote on 11 May 2018 20:55
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 31404@debbugs.gnu.org)
877eoavx7p.fsf@aikidev.net
On 2018-05-11, Danny Milosavljevic wrote:
Toggle quote (18 lines)
> On Thu, 10 May 2018 10:47:54 -0700
> Vagrant Cascadian <vagrant@debian.org> wrote:
>> It should be noted that the offsets for installing u-boot.img on imx6
>> targets conflict with a typical GPT partition table header; works fine
>> with dos partition table headers. I'm not sure what safeguards could be
>> added to detect that. This also may not be unique to imx6 targets
>> (e.g. pine64 u-boot/atf also has a similar issue).
>
> Yeah, and Allwinner A10, A20, R40 etc have the same problem. I've talked
> to parted upstream about it so that at least the new partition tables are
> not created in a stupid way - but movement is slow.
>
>> Also, the novena patch has a known flaw, in that it requires copying the
>> u-boot.img file to the first partition rather than writing it to a raw
>> offset on the mmc device.
>
> Yeah, I guess it's fine to use mtools in the installer.

The novena also supports loading u-boot.img off of ext2/3/4, so simply
symlinking it to /u-boot.img would work... if / was mounted from the
first microSD partition and /gnu/store was on the same partition. Also,
novena supports SATA, so you'd still need to support putting u-boot.img
on the microSD. Though SPL could be fixed to support loading u-boot.img
off of SATA as well...

Of course, creating a separate fat partition on the microSD would also
work.

Toggle quote (17 lines)
>> Not sure how to handle that exactly, as partitioning is typically a
>> manual process in guixsd?
>
> Yeah, for a first step we could just check sanity (in this case check
> whether mcat failed or not).
>
>> If nothing else, merging only the wandboard and mx6cuboxi patches and
>> only including the u-boot target for novena might make sense. Another
>> option would be to patch novena to load u-boot.img from an offset rather
>> than a filesystem, though I doubt that will be accepted in u-boot
>> upstream.
>
> There are lots of boards which need that setup anyway - most notably
> x86_64 UEFI systems - so we have to handle the case anyway.
>
> I vote for using mtools.

Ok, the next immediate change that occurs to me is to make
gnu/bootloaders/u-boot.scm install-u-boot-imx take arguments of weather
to install spl and u-boot.img, defaulting to true in both cases, and
setting the u-boot.img portion to false for novena...

There are also some imx targets which don't have SPL but do install
u-boot.img to the same offset. That can probably be auto-detected by the
presence of the SPL file... maybe that's simpler than a true/false flag.

I'll work on some follow-up patches for those.


Toggle quote (2 lines)
> I applied your patches to guix master.

Thanks!


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlr15xoACgkQt4uC1IFL
kbbB8xAAshOeYKxQX9NjMWDL/gbjBnx41ppj+Rgy/MysMF0AkrVQUbqx3N8tCnBZ
g+WmtLRo4S2pyiXPBEKKK5Jfen8Zhj6CFgWzHTdwPH97lvwOcX3TCHqobCXm21r8
2Qep9TyC8aK10kSTHARxMgRki9ou+p33iUypIBQN+cQJIthX6AdmCwWsUThxQP/j
YYWy/rUBhZ0XdAhZ/BQQLisxIp9Mpef1tE4NmI+6AGztRciWD3YQJo/yKol3ajCk
TtI08B4ZlsxitX2D/gbdvD8ln7YvBOM11EexbeweYVKoOxZVZchydSAI609J0x1q
9AwAa0RgdGvWy0opEi2Mh0dvj8+rIfmtUfQkoCCVFWycgglg1ueGdBUm0++uGQO4
Ugv3uqcbxZBkm8IX3J6i7hw/mgYIj3wIBgFEf3Jdo96Mr/m3vuzSNGR/WPFlwzi8
O7j3/Y1NvThSTAcqfAiJF8XmOQ9uKtlAMz9rhzvTtbo5FYdp/LiTM4K2NDc897WJ
Hw6/bYwOhDmDPMfTcTySnxjTKPWqELt3XOKe2BEG++6iqVndV8Tg+7Xj32WVzFfj
5UjBBM2NwMLDA4qrlFfQw0g1CXu9k+RLoPyzhDU9VRUQMguKfuS36wbFlfAgGcaq
kAeaJ+1NGA/vDcGNAXYa/tXDr5ckVa5H5085xdUayRrhSn7/FKw=
=oX97
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 13 May 2018 11:36
control message for bug #31404
(address . control@debbugs.gnu.org)
874ljbnbhf.fsf@gnu.org
tags 31404 fixed
close 31404
?
Your comment

This issue is archived.

To comment on this conversation send email to 31404@debbugs.gnu.org