GNU bug report logs - #62024
[PATCH] OLIMEX-Teres-A64: Official Support

Previous Next

Package: guix-patches;

Reported by: Jacob Hrbek <kreyren <at> rixotstudio.cz>

Date: Tue, 7 Mar 2023 04:20:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 62024 AT debbugs.gnu.org.

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#62024; Package guix-patches. (Tue, 07 Mar 2023 04:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jacob Hrbek <kreyren <at> rixotstudio.cz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 07 Mar 2023 04:20:02 GMT) Full text and rfc822 format available.

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

From: Jacob Hrbek <kreyren <at> rixotstudio.cz>
To: guix-patches <at> gnu.org
Cc: Jacob Hrbek <kreyren <at> rixotstudio.cz>
Subject: [PATCH] OLIMEX-Teres-A64: Official Support
Date: Tue, 07 Mar 2023 04:18:36 +0000
This contribution uses experience gained from
https://github.com/armbian/build/pull/4807 to implement an official
GNU Guix support for the OLIMEX Teres-A64 system.

Signed-off-by: Jacob Hrbek <kreyren <at> rixotstudio.cz>
---
 gnu/system/images/olimex-teres-a64.scm | 79 ++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 gnu/system/images/olimex-teres-a64.scm

diff --git a/gnu/system/images/olimex-teres-a64.scm b/gnu/system/images/olimex-teres-a64.scm
new file mode 100644
index 0000000000..7398ee9314
--- /dev/null
+++ b/gnu/system/images/olimex-teres-a64.scm
@@ -0,0 +1,79 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Mathieu Othacehe <m.othacehe <at> gmail.com>
+;;; Copyright © 2023 Jacob Hrbek <kreyren <at> fsfe.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; This file provides an official GNU Guix support for the OLIMEX Teres-A64
+
+(define-module (gnu system images olimex-teres-a64)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu bootloader u-boot)
+  #:use-module (gnu image)
+  #:use-module (gnu packages linux)
+  #:use-module (guix platforms arm)
+  #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu system)
+  #:use-module (gnu system file-systems)
+  #:use-module (gnu system image)
+  #:use-module (srfi srfi-26)
+  #:export (olimex-teres-a64-barebones-os
+            olimex-teres-a64-image-type
+            olimex-teres-a64-barebones-raw-image))
+
+(define olimex-teres-a64-barebones-os
+  (operating-system
+    (host-name "olimex")
+    (timezone "UTC")
+    (locale "en_US.utf8")
+    (bootloader (bootloader-configuration
+                 (bootloader u-boot-teres_i-bootloader)
+                 (targets '("/dev/mmcblk0"))))
+    (initrd-modules '())
+    (kernel linux-libre-arm64-generic)
+    (file-systems (cons (file-system
+                          (device (file-system-label "my-root"))
+                          (mount-point "/")
+                          (type "ext4"))
+                        %base-file-systems))
+    (services (cons (service agetty-service-type
+                             (agetty-configuration
+                              (baud-rate "115200")
+                              (term "vt100")
+                              (tty "ttyS0")))
+                    %base-services))))
+
+(define olimex-teres-a64-image-type
+  (image-type
+   (name 'pinebook-pro-raw)
+   (constructor (lambda (os)
+                  (image
+                   (inherit
+		    ;; All AllWinner SoCs will try to find a boot image at sector 16 (8KB) of an SD card [https://u-boot.readthedocs.io/en/latest/board/allwinner/sunxi.html#installing-u-boot]
+                    (raw-with-offset-disk-image (* 1024 8))) ; 1024 (sector size for 1 kilobyte) * 8 = 8196 sectors which is 8 KB)
+                   (operating-system os)
+                   (platform aarch64-linux))))))
+
+(define olimex-teres-a64-barebones-raw-image
+  (image
+   (inherit
+    (os+platform->image olimex-teres-a64-barebones-os aarch64-linux
+                        #:type olimex-teres-a64-image-type))
+   (name 'olimex-teres-a64-barebones-raw-image)))
+
+;; Return the default image.
+olimex-teres-a64-raw-image
--
2.37.3






Information forwarded to guix-patches <at> gnu.org:
bug#62024; Package guix-patches. (Tue, 07 Mar 2023 12:55:02 GMT) Full text and rfc822 format available.

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

From: Jacob Hrbek <kreyren <at> rixotstudio.cz>
To: 62024 <at> debbugs.gnu.org
Cc: Jacob Hrbek <kreyren <at> rixotstudio.cz>
Subject: [PATCH] Add missing bootloader config
Date: Tue, 07 Mar 2023 12:54:01 +0000
Signed-off-by: Jacob Hrbek <kreyren <at> rixotstudio.cz>
---
 gnu/bootloader/u-boot.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 65d7923465..d68f019b82 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -43,6 +43,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-puma-rk3399-bootloader
             u-boot-rock64-rk3328-bootloader
             u-boot-rockpro64-rk3399-bootloader
+	    u-boot-teres_i-bootloader
             u-boot-ts7970-q-2g-1000mhz-c-bootloader
             u-boot-wandboard-bootloader))

@@ -129,6 +130,15 @@ (define install-rockpro64-rk3399-u-boot

 (define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot)

+(define install-teres_i-u-boot
+  #~(lambda (bootloader root-index image)
+      (let ((idb (string-append bootloader "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+        (write-file-on-device idb (stat:size (stat idb))
+                              image (* 64 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 16384 512)))))
+
 (define install-u-boot-ts7970-q-2g-1000mhz-c-u-boot
   #~(lambda (bootloader device mount-point)
       (let ((u-boot.imx (string-append bootloader "/libexec/u-boot.imx"))
@@ -264,6 +274,12 @@ (define u-boot-pinebook-pro-rk3399-bootloader
    (package u-boot-pinebook-pro-rk3399)
    (disk-image-installer install-pinebook-pro-rk3399-u-boot)))

+(define u-boot-teres_i-bootloader
+  (bootloader
+   (inherit u-boot-allwinner64-bootloader)
+   (package u-boot-teres_i)
+   (disk-image-installer install-teres_i-u-boot)))
+
 (define u-boot-ts7970-q-2g-1000mhz-c-bootloader
   ;; This bootloader doesn't really need to be installed, as it is read from
   ;; an SPI memory chip, not the SD card.  It is copied to /boot/u-boot.imx
--
2.37.3






Information forwarded to guix-patches <at> gnu.org:
bug#62024; Package guix-patches. (Tue, 07 Mar 2023 15:50:01 GMT) Full text and rfc822 format available.

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

From: Jacob Hrbek <kreyren <at> rixotstudio.cz>
To: 62024 <at> debbugs.gnu.org
Cc: Jacob Hrbek <kreyren <at> rixotstudio.cz>
Subject: [PATCH] Adjustments..
Date: Tue, 07 Mar 2023 15:48:55 +0000
Now builds

Signed-off-by: Jacob Hrbek <kreyren <at> rixotstudio.cz>
---
 gnu/bootloader/u-boot.scm                     | 12 +----
 gnu/packages/bootloaders.scm                  |  4 ++
 .../{olimex-teres-a64.scm => teres_i.scm}     | 44 +++++++++++--------
 3 files changed, 30 insertions(+), 30 deletions(-)
 rename gnu/system/images/{olimex-teres-a64.scm => teres_i.scm} (70%)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index d68f019b82..50bbd2975a 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -130,15 +130,6 @@ (define install-rockpro64-rk3399-u-boot

 (define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot)

-(define install-teres_i-u-boot
-  #~(lambda (bootloader root-index image)
-      (let ((idb (string-append bootloader "/libexec/idbloader.img"))
-            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
-        (write-file-on-device idb (stat:size (stat idb))
-                              image (* 64 512))
-        (write-file-on-device u-boot (stat:size (stat u-boot))
-                              image (* 16384 512)))))
-
 (define install-u-boot-ts7970-q-2g-1000mhz-c-u-boot
   #~(lambda (bootloader device mount-point)
       (let ((u-boot.imx (string-append bootloader "/libexec/u-boot.imx"))
@@ -277,8 +268,7 @@ (define u-boot-pinebook-pro-rk3399-bootloader
 (define u-boot-teres_i-bootloader
   (bootloader
    (inherit u-boot-allwinner64-bootloader)
-   (package u-boot-teres_i)
-   (disk-image-installer install-teres_i-u-boot)))
+   (package u-boot-teres_i)))

 (define u-boot-ts7970-q-2g-1000mhz-c-bootloader
   ;; This bootloader doesn't really need to be installed, as it is read from
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index ee47a9fad7..17e752b10a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1315,6 +1315,10 @@ (define*-public (make-u-boot-bin-package u-boot-package
                           u-boot-bin)))
     (license (package-license u-boot-package))))

+(define-public u-boot-teres_i
+  (make-u-boot-sunxi64-package
+   "teres_i" "aarch64-linux-gnu"))
+
 (define-public %u-boot-rpi-efi-configs
   '("CONFIG_OF_EMBED"
     "CONFIG_OF_BOARD=y"))
diff --git a/gnu/system/images/olimex-teres-a64.scm b/gnu/system/images/teres_i.scm
similarity index 70%
rename from gnu/system/images/olimex-teres-a64.scm
rename to gnu/system/images/teres_i.scm
index 7398ee9314..a9b16b677f 100644
--- a/gnu/system/images/olimex-teres-a64.scm
+++ b/gnu/system/images/teres_i.scm
@@ -19,23 +19,25 @@

 ;;; This file provides an official GNU Guix support for the OLIMEX Teres-A64

-(define-module (gnu system images olimex-teres-a64)
+(define-module (gnu system images teres_i)
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader u-boot)
   #:use-module (gnu image)
+  #:use-module (gnu packages certs)
   #:use-module (gnu packages linux)
   #:use-module (guix platforms arm)
   #:use-module (gnu services)
   #:use-module (gnu services base)
+  #:use-module (gnu services networking)
   #:use-module (gnu system)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system image)
   #:use-module (srfi srfi-26)
-  #:export (olimex-teres-a64-barebones-os
-            olimex-teres-a64-image-type
-            olimex-teres-a64-barebones-raw-image))
+  #:export (teres_i-barebones-os
+            teres_i-image-type
+            teres_i-barebones-raw-image))

-(define olimex-teres-a64-barebones-os
+(define teres_i-barebones-os
   (operating-system
     (host-name "olimex")
     (timezone "UTC")
@@ -50,30 +52,34 @@ (define olimex-teres-a64-barebones-os
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems))
-    (services (cons (service agetty-service-type
-                             (agetty-configuration
-                              (baud-rate "115200")
-                              (term "vt100")
-                              (tty "ttyS0")))
-                    %base-services))))
+    (services (cons*
+	       (service agetty-service-type
+                         (agetty-configuration
+                          (baud-rate "115200")
+                          (term "vt100")
+                          (tty "ttyS0")))
+	       (service dhcp-client-service-type)
+	       (service ntp-service-type)
+               %base-services))
+    (packages (cons nss-certs %base-packages))))

-(define olimex-teres-a64-image-type
+(define teres_i-image-type
   (image-type
-   (name 'pinebook-pro-raw)
+   (name 'teres_i-raw)
    (constructor (lambda (os)
                   (image
                    (inherit
 		    ;; All AllWinner SoCs will try to find a boot image at sector 16 (8KB) of an SD card [https://u-boot.readthedocs.io/en/latest/board/allwinner/sunxi.html#installing-u-boot]
-                    (raw-with-offset-disk-image (* 1024 8))) ; 1024 (sector size for 1 kilobyte) * 8 = 8196 sectors which is 8 KB)
+                    (raw-with-offset-disk-image (* 1024 8))) ; 1024 (sector size for 1 kilobyte) * 8 = 8192 sectors which is 8 KB)
                    (operating-system os)
                    (platform aarch64-linux))))))

-(define olimex-teres-a64-barebones-raw-image
+(define teres_i-barebones-raw-image
   (image
    (inherit
-    (os+platform->image olimex-teres-a64-barebones-os aarch64-linux
-                        #:type olimex-teres-a64-image-type))
-   (name 'olimex-teres-a64-barebones-raw-image)))
+    (os+platform->image teres_i-barebones-os aarch64-linux
+                        #:type teres_i-image-type))
+   (name 'teres_i-barebones-raw-image)))

 ;; Return the default image.
-olimex-teres-a64-raw-image
+teres_i-barebones-raw-image
--
2.37.3






Information forwarded to guix-patches <at> gnu.org:
bug#62024; Package guix-patches. (Wed, 08 Mar 2023 03:17:02 GMT) Full text and rfc822 format available.

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

From: Jacob Hrbek <kreyren <at> rixotstudio.cz>
To: 62024 <at> debbugs.gnu.org
Cc: Jacob Hrbek <kreyren <at> rixotstudio.cz>
Subject: [PATCH] Align offset with pine64
Date: Wed, 08 Mar 2023 03:16:33 +0000
It doesn't boot which where the likely culprit is the offset as it
expects the bootloader on 8192 sector start

Signed-off-by: Jacob Hrbek <kreyren <at> rixotstudio.cz>
---
 gnu/system/images/teres_i.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/system/images/teres_i.scm b/gnu/system/images/teres_i.scm
index a9b16b677f..607d003a11 100644
--- a/gnu/system/images/teres_i.scm
+++ b/gnu/system/images/teres_i.scm
@@ -69,8 +69,7 @@ (define teres_i-image-type
    (constructor (lambda (os)
                   (image
                    (inherit
-		    ;; All AllWinner SoCs will try to find a boot image at sector 16 (8KB) of an SD card [https://u-boot.readthedocs.io/en/latest/board/allwinner/sunxi.html#installing-u-boot]
-                    (raw-with-offset-disk-image (* 1024 8))) ; 1024 (sector size for 1 kilobyte) * 8 = 8192 sectors which is 8 KB)
+                    (raw-with-offset-disk-image))
                    (operating-system os)
                    (platform aarch64-linux))))))

--
2.37.3






Information forwarded to guix-patches <at> gnu.org:
bug#62024; Package guix-patches. (Wed, 08 Mar 2023 04:44:02 GMT) Full text and rfc822 format available.

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

From: Jacob Hrbek <kreyren <at> rixotstudio.cz>
To: 62024 <at> debbugs.gnu.org
Cc: "GNUtoo <at> cyberdimension.org" <GNUtoo <at> cyberdimension.org>
Subject: Re: [PATCH] Align offset with pine64
Date: Wed, 08 Mar 2023 04:42:51 +0000
It now builds and boots, but without an internet connection due to the proprietary firmware on the WiFI and lack of any other method to connect beyond a USB modem.

h-node says that there is a way to make it work fully libre with some kernel hacks that i have no idea what they mean[https://h-node.org/wifi/view/en/1725/Realtek-Semiconductor-Co---Ltd--RTL8723BE-PCIe-Wireless-Network-Adapter/1/1/undef/undef/undef/undef/wifi-works/RTL8723]

CC GNUToo your turn 

-- Jacob "Kreyren" Hrbek


------- Original Message -------
On Wednesday, March 8th, 2023 at 4:16 AM, Jacob Hrbek <kreyren <at> rixotstudio.cz> wrote:


> It doesn't boot which where the likely culprit is the offset as it
> expects the bootloader on 8192 sector start
> 
> Signed-off-by: Jacob Hrbek kreyren <at> rixotstudio.cz
> 
> ---
> gnu/system/images/teres_i.scm | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gnu/system/images/teres_i.scm b/gnu/system/images/teres_i.scm
> index a9b16b677f..607d003a11 100644
> --- a/gnu/system/images/teres_i.scm
> +++ b/gnu/system/images/teres_i.scm
> @@ -69,8 +69,7 @@ (define teres_i-image-type
> (constructor (lambda (os)
> (image
> (inherit
> - ;; All AllWinner SoCs will try to find a boot image at sector 16 (8KB) of an SD card [https://u-boot.readthedocs.io/en/latest/board/allwinner/sunxi.html#installing-u-boot]
> - (raw-with-offset-disk-image (* 1024 8))) ; 1024 (sector size for 1 kilobyte) * 8 = 8192 sectors which is 8 KB)
> + (raw-with-offset-disk-image))
> (operating-system os)
> (platform aarch64-linux))))))
> 
> --
> 2.37.3




This bug report was last modified 1 year and 256 days ago.

Previous Next


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