From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qBXPLJan8F+0PQAA0tVLHw (envelope-from ) for ; Sat, 02 Jan 2021 17:04:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QI6zKJan8F9UNgAA1q6Kng (envelope-from ) for ; Sat, 02 Jan 2021 17:04:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 17C9A9404D0 for ; Sat, 2 Jan 2021 17:04:22 +0000 (UTC) Received: from localhost ([::1]:49954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvkKD-0008ES-1F for larch@yhetil.org; Sat, 02 Jan 2021 12:04:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvkJu-0008Dn-Mx for guix-patches@gnu.org; Sat, 02 Jan 2021 12:04:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvkJt-0007qw-UB for guix-patches@gnu.org; Sat, 02 Jan 2021 12:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvkJt-0004Cz-Pj for guix-patches@gnu.org; Sat, 02 Jan 2021 12:04:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45584] [PATCH 0/2] system: image: Fix root fs corruption from certain u-boot. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Jan 2021 17:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45584 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Caliph Nomble Received: via spool by 45584-submit@debbugs.gnu.org id=B45584.160960702116150 (code B ref 45584); Sat, 02 Jan 2021 17:04:01 +0000 Received: (at 45584) by debbugs.gnu.org; 2 Jan 2021 17:03:41 +0000 Received: from localhost ([127.0.0.1]:60596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvkJY-0004CQ-JT for submit@debbugs.gnu.org; Sat, 02 Jan 2021 12:03:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvkJW-0004CA-3e for 45584@debbugs.gnu.org; Sat, 02 Jan 2021 12:03:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56631) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvkJQ-0007mO-Ty; Sat, 02 Jan 2021 12:03:32 -0500 Received: from pop.92-184-107-157.mobile.abo.orange.fr ([92.184.107.157]:33830 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kvkJG-0004GB-3b; Sat, 02 Jan 2021 12:03:28 -0500 From: Mathieu Othacehe References: <87zh1swsch.fsf@gnu.org> Date: Sat, 02 Jan 2021 18:03:18 +0100 In-Reply-To: (Caliph Nomble's message of "Fri, 01 Jan 2021 23:32:41 +0000") Message-ID: <87zh1rp8yx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "45584@debbugs.gnu.org" <45584@debbugs.gnu.org> Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.33 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 17C9A9404D0 X-Spam-Score: -1.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: V5Q2ZCivGtcB --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-offset.patch >From 2c0806c28ae5ca07cba136ce2e32a7de0702693d Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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"))) @@ -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) <>)))) ;; 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 --=-=-=--