all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#31404] Add installer support for u-boot imx6 boards.
@ 2018-05-10 17:47 Vagrant Cascadian
  2018-05-11  7:53 ` Mathieu Othacehe
  2018-05-11 10:29 ` Danny Milosavljevic
  0 siblings, 2 replies; 4+ messages in thread
From: Vagrant Cascadian @ 2018-05-10 17:47 UTC (permalink / raw)
  To: 31404


[-- Attachment #1.1: Type: text/plain, Size: 1566 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-system-Add-mx6cuboxi-installer.patch --]
[-- Type: text/x-diff, Size: 3234 bytes --]

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)))))
+
 \f
 
 ;;;
@@ -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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-system-Add-wandboard-installer.patch --]
[-- Type: text/x-diff, Size: 2345 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: 0003-gnu-Add-u-boot-novena-installer.patch --]
[-- Type: text/x-diff, Size: 2823 bytes --]

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#31404] Add installer support for u-boot imx6 boards.
  2018-05-10 17:47 [bug#31404] Add installer support for u-boot imx6 boards Vagrant Cascadian
@ 2018-05-11  7:53 ` Mathieu Othacehe
  2018-05-11 10:29 ` Danny Milosavljevic
  1 sibling, 0 replies; 4+ messages in thread
From: Mathieu Othacehe @ 2018-05-11  7:53 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 31404


Hi Vagrant,

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

> 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?

> 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

> 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)))))
> +
>  \f
>  
>  ;;;
> @@ -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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#31404] Add installer support for u-boot imx6 boards.
  2018-05-10 17:47 [bug#31404] Add installer support for u-boot imx6 boards Vagrant Cascadian
  2018-05-11  7:53 ` Mathieu Othacehe
@ 2018-05-11 10:29 ` Danny Milosavljevic
  2018-05-11 18:55   ` Vagrant Cascadian
  1 sibling, 1 reply; 4+ messages in thread
From: Danny Milosavljevic @ 2018-05-11 10:29 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 31404

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

Hi Vagrant,

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

> 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!

> 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.

> 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.

I applied your patches to guix master.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#31404] Add installer support for u-boot imx6 boards.
  2018-05-11 10:29 ` Danny Milosavljevic
@ 2018-05-11 18:55   ` Vagrant Cascadian
  0 siblings, 0 replies; 4+ messages in thread
From: Vagrant Cascadian @ 2018-05-11 18:55 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 31404

[-- Attachment #1: Type: text/plain, Size: 2648 bytes --]

On 2018-05-11, Danny Milosavljevic wrote:
> 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.

>> 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.


> I applied your patches to guix master.

Thanks!


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-11 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 17:47 [bug#31404] Add installer support for u-boot imx6 boards Vagrant Cascadian
2018-05-11  7:53 ` Mathieu Othacehe
2018-05-11 10:29 ` Danny Milosavljevic
2018-05-11 18:55   ` Vagrant Cascadian

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.