Subject: [bug#62024] [PATCH] Adjustments..

From: Jacob Hrbek <[email-masked]>
Date: Tue, 07 Mar 2023 15:48:55 +0000

Now builds

Signed-off-by: Jacob Hrbek <[email-masked]>
---
 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