all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Caliph Nomble <calnomble@protonmail.com>
Cc: "45584@debbugs.gnu.org" <45584@debbugs.gnu.org>
Subject: [bug#45584] [PATCH 0/2] system: image: Fix root fs corruption from certain u-boot.
Date: Sat, 02 Jan 2021 18:03:18 +0100	[thread overview]
Message-ID: <87zh1rp8yx.fsf@gnu.org> (raw)
In-Reply-To: <LCsju6Xhd7Uqz2cPgtoYT3txjfm-JZIiNIkXMpzTtlQ0rXk7wfZFhT_UrWbEUDymoyVATd9KKG_IcT8QQG8tFnz-mA5NRYC8WBOXbkF5pCo=@protonmail.com> (Caliph Nomble's message of "Fri, 01 Jan 2021 23:32:41 +0000")

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


Hey,

> I was originally considering doing something like that, but I was unsure how
> that'd interact with --image-type (unless there's another way to specify an
> image that I don't know of)? Would there still just be multiple image-types but
> with procedural disk-images?

Here's an attached patch that should do that, but I'm not sure it brings
a real improvement, unless there are a lot of different offset out
there.

>> Were you able to actually use the generated image on a pinebook-pro? I
>> added support for this machine without being able to test it.
>
> I just tried to use it on one, but I was unable to get it to boot. I'm not sure
> why, exactly, as I didn't have a chance to open it up to enable serial. Could
> just be the kernel, seeing as wip-pinebook-pro has its own patched linux-libre
> (which I was unable to get working with an inferior on the main branch, but
> I don't really know how to use them anyway).

It looks like the wip-pinebook-pro is adding some kernel patches, maybe
you could try to apply them directly on master?

> I did, however, test these changes on a rockpro64 (both pinebook-pro and
> rockpro64 use the rk3399 SoC), and it did fix fs corruption preventing proper
> boot.

That's nice, thanks for your work!

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-offset.patch --]
[-- Type: text/x-diff, Size: 3123 bytes --]

From 2c0806c28ae5ca07cba136ce2e32a7de0702693d Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Sat, 2 Jan 2021 17:56:25 +0100
Subject: [PATCH] offset

---
 gnu/system/image.scm               | 12 ++++++------
 gnu/system/images/novena.scm       |  2 +-
 gnu/system/images/pine64.scm       |  2 +-
 gnu/system/images/pinebook-pro.scm |  4 +++-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 67930750d5..90b9209988 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -128,21 +128,21 @@
            (label "GUIX_IMAGE")
            (flags '(boot)))))))
 
-(define arm32-disk-image
+(define* (arm32-disk-image #:optional (offset root-offset))
   (image
    (format 'disk-image)
    (target "arm-linux-gnueabihf")
    (partitions
     (list (partition
            (inherit root-partition)
-           (offset root-offset))))
+           (offset offset))))
    ;; FIXME: Deleting and creating "/var/run" and "/tmp" on the overlayfs
    ;; fails.
    (volatile-root? #f)))
 
-(define arm64-disk-image
+(define* (arm64-disk-image #:optional (offset root-offset))
   (image
-   (inherit arm32-disk-image)
+   (inherit (arm32-disk-image offset))
    (target "aarch64-linux-gnu")))
 
 \f
@@ -189,12 +189,12 @@ set to the given OS."
 (define arm32-image-type
   (image-type
    (name 'arm32-raw)
-   (constructor (cut image-with-os arm32-disk-image <>))))
+   (constructor (cut image-with-os (arm32-disk-image) <>))))
 
 (define arm64-image-type
   (image-type
    (name 'arm64-raw)
-   (constructor (cut image-with-os arm64-disk-image <>))))
+   (constructor (cut image-with-os (arm64-disk-image) <>))))
 
 \f
 ;;
diff --git a/gnu/system/images/novena.scm b/gnu/system/images/novena.scm
index c4d25e850e..dfaf2c60ee 100644
--- a/gnu/system/images/novena.scm
+++ b/gnu/system/images/novena.scm
@@ -52,7 +52,7 @@
 (define novena-image-type
   (image-type
    (name 'novena-raw)
-   (constructor (cut image-with-os arm32-disk-image <>))))
+   (constructor (cut image-with-os (arm32-disk-image) <>))))
 
 (define novena-barebones-raw-image
   (image
diff --git a/gnu/system/images/pine64.scm b/gnu/system/images/pine64.scm
index f0b0c3f50d..63b31399a5 100644
--- a/gnu/system/images/pine64.scm
+++ b/gnu/system/images/pine64.scm
@@ -57,7 +57,7 @@
 (define pine64-image-type
   (image-type
    (name 'pine64-raw)
-   (constructor (cut image-with-os arm64-disk-image <>))))
+   (constructor (cut image-with-os (arm64-disk-image) <>))))
 
 (define pine64-barebones-raw-image
   (image
diff --git a/gnu/system/images/pinebook-pro.scm b/gnu/system/images/pinebook-pro.scm
index b038e262cb..02a0b8132d 100644
--- a/gnu/system/images/pinebook-pro.scm
+++ b/gnu/system/images/pinebook-pro.scm
@@ -57,7 +57,9 @@
 (define pinebook-pro-image-type
   (image-type
    (name 'pinebook-pro-raw)
-   (constructor (cut image-with-os arm64-disk-image <>))))
+   (constructor (cut image-with-os
+                     (arm64-disk-image (* 9 (expt 2 20))) ;9MiB
+                     <>))))
 
 (define pinebook-pro-barebones-raw-image
   (image
-- 
2.29.2


  reply	other threads:[~2021-01-02 17:04 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 ` [bug#45584] [PATCH 1/2] system: image: Add support for rockchip bootloader offsets Caliph Nomble via Guix-patches via
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 [this message]
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

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

  git send-email \
    --in-reply-to=87zh1rp8yx.fsf@gnu.org \
    --to=othacehe@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.