Subject: [bug#62024] [PATCH] Add missing bootloader config

From: Jacob Hrbek <[email-masked]>
Date: Tue, 07 Mar 2023 12:54:01 +0000

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