Hi,

I've a patch to add a new ARM computer to Guix (attached), but when I
add this to the system definition (to generate an image):
>   (bootloader (bootloader-configuration
>                (bootloader u-boot-rock-4c-plus-rk3399-bootloader)
>                (targets '("/dev/mmcblk0"))))

I then get an image that boots on GRUB and then GRUB doesn't find its
grub.cfg.

Is this behavior intended or is that a consequence of u-boot
having introduced the new bootflow way of booting?

If it's intended, how do I fix my configuration?

Also what would be the ideal way of dealing with that? Do we intend to
support both syslinux and GRUB? 

On another computer (rockpro64) I also had an issue with GRUB not
loading due to block size mismatch (I didn't investigate it yet in
depth), so it might be worth to also keep syslinux for strange cases
like that.

Note that on the rock-4c-plus, I can boot Guix but it requires messing
with u-boot by doing the following:
(1) I need to interrupt the boot in u-boot.
(2) I then need to run 'bootflow scan' and wait enough to populate the
    list of ways it can boot. During the scan it also tries to see if it
    can boot from the network and that is super long but it can also be
    interrupted manually as this is the last option. At the end, the
    'bootflow list' can then list the available boot options.
(3) I then need to run 'bootflow select 2' to use syslinux and then
   'bootflow boot'.

I've not investigated yet how to always select 2 beside adding some
bootcmd in the environment, but that would also require to run
'bootflow scan' and u-boot should be managed by the guix
system configuration anyway.

Denis.
From d11c723f7e19788e15464f11012c7cc366217504 Mon Sep 17 00:00:00 2001
Message-ID: <d11c723f7e19788e15464f11012c7cc366217504.1744494887.git.gnu...@cyberdimension.org>
From: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org>
Date: Fri, 21 Mar 2025 00:48:58 +0100
Subject: [PATCH] system: Add u-boot-rock-4c-plus-rk3399.

* gnu/packages/bootloaders.scm (u-boot-rock-4c-plus-rk3399): New variable.
* gnu/bootloader/u-boot.scm (u-boot-rock-4c-plus-rk3399-bootloader):
  New exported variable.
* gnu/system/install.scm (rock-4c-plus-installation-os):
  New exported variable.

Change-Id: I37025b248178311ccf8246cb0e02ed9399f9c6ac
Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org>
---
 gnu/bootloader/u-boot.scm    |  6 ++++++
 gnu/packages/bootloaders.scm | 10 ++++++++++
 gnu/system/install.scm       |  5 +++++
 3 files changed, 21 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 64fb319f50..0e7eb95ba4 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -47,6 +47,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-pinebook-bootloader
             u-boot-pinebook-pro-rk3399-bootloader
             u-boot-puma-rk3399-bootloader
+            u-boot-rock-4c-plus-rk3399-bootloader
             u-boot-rock64-rk3328-bootloader
             u-boot-rockpro64-rk3399-bootloader
             u-boot-sifive-unmatched-bootloader
@@ -252,6 +253,11 @@ (define u-boot-puma-rk3399-bootloader
    (package u-boot-puma-rk3399)
    (disk-image-installer install-puma-rk3399-u-boot)))
 
+(define u-boot-rock-4c-plus-rk3399-bootloader
+  (bootloader
+   (inherit u-boot-rockchip-bootloader)
+   (package u-boot-rock-4c-plus-rk3399)))
+
 (define u-boot-rock64-rk3328-bootloader
   (bootloader
    (inherit u-boot-rockchip-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 8ece61f11c..a9f70f8bf1 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1430,6 +1430,16 @@ (define-public u-boot-rock64-rk3328
 (define-public u-boot-firefly-rk3399
   (make-u-boot-rockchip-package "firefly" 'rk3399))
 
+(define-public u-boot-rock-4c-plus-rk3399
+  (let ((base (make-u-boot-rockchip-package
+               "rock-4c-plus" 'rk3399
+               '("CONFIG_USB=y"
+                 ;; Disable SPL FIT signatures, due to GPLv2 and
+                 ;; OpenSSL license incompatibilities.
+                 "# CONFIG_SPL_FIT_SIGNATURE is not set"))))
+    (package
+      (inherit base))))
+
 (define-public u-boot-rockpro64-rk3399
   (let ((base (make-u-boot-rockchip-package
                "rockpro64" 'rk3399
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 15ea401f1c..60e0825ce3 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -662,6 +662,11 @@ (define rock64-installation-os
                             "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
                             "ttyS2")) ; UART2 connected on the Pi2 bus
 
+(define rock-4c-plus-installation-os
+  (embedded-installation-os u-boot-rock-4c-plus-rk3399-bootloader
+                            "/dev/mmcblk0" ; SD card storage
+                            "ttyS2")) ;; Default UART as per the Linux DTS.
+
 (define rockpro64-installation-os
   (embedded-installation-os u-boot-rockpro64-rk3399-bootloader
                             "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage

base-commit: f7c41ab31f5023023385500f6eb9083d23dd1ccb
-- 
2.48.1

Attachment: pgpfDaH4qhrgf.pgp
Description: OpenPGP digital signature

Reply via email to