unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Caliph Nomble via Guix-patches via <guix-patches@gnu.org>
To: 45584@debbugs.gnu.org
Cc: Caliph Nomble <calnomble@protonmail.com>
Subject: [bug#45584] [PATCH 1/2] system: image: Add support for rockchip bootloader offsets.
Date: Fri, 01 Jan 2021 01:11:49 +0000	[thread overview]
Message-ID: <CPrSnKXmKTMtnTOqOCUH3Mu8UdaGrGnlYu7QEGzYqw@cp3-web-020.plabs.ch> (raw)
In-Reply-To: <AJu4ls8-KuZO9eCkkVO_MApWUbxUt-RLNY1iy-xT-w-5FZV5_9QXIdGfPDReJhPqLExElN6z9rb5vD1pDJ22QZW_sn2HwKlAGAAohucNMuw=@protonmail.com>

* gnu/system/image.scm (root-largeboot-offset, arm32-largeboot-disk-image,
arm32-largeboot-image-type): New variables, used primarily to define...
(arm64-largeboot-disk-image,
arm64-largeboot-image-type): ...these new variables.
---
 gnu/system/image.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 67930750d5..58d92cf4b6 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -59,6 +59,7 @@
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:export (root-offset
+            root-largeboot-offset
             root-label
 
             esp-partition
@@ -67,7 +68,9 @@
             efi-disk-image
             iso9660-image
             arm32-disk-image
+            arm32-largeboot-disk-image
             arm64-disk-image
+            arm64-largeboot-disk-image
 
             image-with-os
             raw-image-type
@@ -75,7 +78,9 @@
             iso-image-type
             uncompressed-iso-image-type
             arm32-image-type
+            arm32-largeboot-image-type
             arm64-image-type
+            arm64-largeboot-image-type
 
             image-with-label
             system-image
@@ -92,6 +97,10 @@
 ;; this post-MBR gap.
 (define root-offset (* 512 2048))
 
+;; Same as above, except 9MB big. Necessary for eg. rk3399 and rk3328
+;; systems, which install the bootloader at an 8MB offset.
+(define root-largeboot-offset (+ root-offset (* 8 (expt 2 20))))
+
 ;; Generic root partition label.
 (define root-label "Guix_image")
 
@@ -140,11 +149,24 @@
    ;; fails.
    (volatile-root? #f)))
 
+(define arm32-largeboot-disk-image
+  (image
+   (inherit arm32-disk-image)
+   (partitions
+    (list (partition
+           (inherit root-partition)
+           (offset root-largeboot-offset))))))
+
 (define arm64-disk-image
   (image
    (inherit arm32-disk-image)
    (target "aarch64-linux-gnu")))
 
+(define arm64-largeboot-disk-image
+  (image
+   (inherit arm32-largeboot-disk-image)
+   (target "aarch64-linux-gnu")))
+
 \f
 ;;;
 ;;; Images types.
@@ -191,11 +213,21 @@ set to the given OS."
    (name 'arm32-raw)
    (constructor (cut image-with-os arm32-disk-image <>))))
 
+(define arm32-largeboot-image-type
+  (image-type
+   (name 'arm32-largeboot-raw)
+   (constructor (cut image-with-os arm32-largeboot-disk-image <>))))
+
 (define arm64-image-type
   (image-type
    (name 'arm64-raw)
    (constructor (cut image-with-os arm64-disk-image <>))))
 
+(define arm64-largeboot-image-type
+  (image-type
+   (name 'arm64-largeboot-raw)
+   (constructor (cut image-with-os arm64-largeboot-disk-image <>))))
+
 \f
 ;;
 ;; Helpers.
-- 
2.26.2






  reply	other threads:[~2021-01-01  1:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 23:34 [bug#45584] [PATCH 0/2] system: image: Fix root fs corruption from certain u-boot Caliph Nomble via Guix-patches via
2021-01-01  1:11 ` Caliph Nomble via Guix-patches via [this message]
2021-01-01  1:12 ` [bug#45584] [PATCH 2/2] image: pinebook-pro: Fix pinebook-pro root filesystem Caliph Nomble via Guix-patches via
2021-01-01 16:10 ` [bug#45584] [PATCH 0/2] system: image: Fix root fs corruption from certain u-boot Mathieu Othacehe
2021-01-01 23:32   ` Caliph Nomble via Guix-patches via
2021-01-02 17:03     ` Mathieu Othacehe
2021-01-10  0:48       ` Caliph Nomble via Guix-patches via
2021-01-10  0:53         ` Caliph Nomble via Guix-patches via
2021-01-10 15:16         ` bug#45584: " Mathieu Othacehe

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=CPrSnKXmKTMtnTOqOCUH3Mu8UdaGrGnlYu7QEGzYqw@cp3-web-020.plabs.ch \
    --to=guix-patches@gnu.org \
    --cc=45584@debbugs.gnu.org \
    --cc=calnomble@protonmail.com \
    /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).