unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: Mathieu Othacehe <othacehe@gnu.org>, guix-devel <guix-devel@gnu.org>
Subject: Re: Distributing Guix System Pinebook Pro images
Date: Sun, 29 Aug 2021 13:41:06 -0700	[thread overview]
Message-ID: <87sfysrnkt.fsf@yucca> (raw)
In-Reply-To: <87v93oror7.fsf@yucca>

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

On 2021-08-29, Vagrant Cascadian wrote:
> On 2021-08-29, Mathieu Othacehe wrote:
>> The Guix website now offers Pinebook Pro Guix System images[1]. Those
>> images can be directly copied on a micro-SD card and booted from. More
>> details here[2].
>
> It seems like I need to write up a hybrid pinebook/pinebook-pro
> bootloader definition, then that image could support *two* whole
> platforms. :)

Something like this, but that is valid guile and actually works :)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 6cad33b741..325618c5c5 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -127,6 +127,28 @@
 
 (define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot)
 
+(define install-pinebook-and-pinebook-pro-u-boot
+  ;; Install bootloaders for both pinebook pro and pinebook at compatible
+  ;; offsets.
+  ;;
+  ;; pinebook pro
+  #~(lambda (bootloader-pinebook-pro root-index image)
+      (let ((idb (string-append bootloader-pinebook-pro "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader-pinebook-pro "/libexec/u-boot.itb")))
+        ;; Use alternate offset of 2112 to avoid conflicts with pinebook
+        (write-file-on-device idb (stat:size (stat idb))
+                              image (* 2112 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 16384 512))))
+  ;; pinebook
+  #~(lambda (bootloader-pinebook root-index image)
+      (let ((spl (string-append bootloader-pinebook "/libexec/u-boot-sunxi-with-spl.bin"))
+            (u-boot (string-append bootloader-pinebook "/libexec/u-boot-sunxi-with-spl.fit.itb")))
+        (write-file-on-device spl (stat:size (stat spl))
+                              image (* 8 1024))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 40 1024)))))
+
 \f
 
 ;;;
@@ -255,3 +277,9 @@
    (inherit u-boot-bootloader)
    (package u-boot-pinebook-pro-rk3399)
    (disk-image-installer install-pinebook-pro-rk3399-u-boot)))
+
+(define u-boot-pinebook-and-pinebook-pro-bootloader
+  (bootloader
+   (inherit u-boot-bootloader)
+   (packages '(u-boot-pinebook-pro-rk3399 u-boot-pinebook))
+   (disk-image-installer install-pinebook-and-pinebook-pro-uboot)))


live well,
  vagrant

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

  reply	other threads:[~2021-08-29 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-29  9:09 Distributing Guix System Pinebook Pro images Mathieu Othacehe
2021-08-29 15:16 ` Maxim Cournoyer
2021-08-29 20:15 ` Vagrant Cascadian
2021-08-29 20:41   ` Vagrant Cascadian [this message]
2021-08-30 11:07     ` Efraim Flashner
2021-08-30 11:00   ` Efraim Flashner
2021-08-30  9:52 ` Mathieu Othacehe
2021-08-30 14:01   ` Vagrant Cascadian
2021-08-30 14:52     ` Mathieu Othacehe
2021-08-30 19:13       ` André A. Gomes
2021-08-30 14:37 ` Katherine Cox-Buday

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfysrnkt.fsf@yucca \
    --to=vagrant@debian.org \
    --cc=guix-devel@gnu.org \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).