From patchwork Thu Oct 3 12:13:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Scherer X-Patchwork-Id: 31610 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CD4FD27BBEA; Thu, 3 Oct 2024 13:15:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4CBA827BBE2 for ; Thu, 3 Oct 2024 13:15:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swKjX-00042t-U3; Thu, 03 Oct 2024 08:15:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swKjV-00041a-M1 for guix-patches@gnu.org; Thu, 03 Oct 2024 08:15:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swKjV-0000ef-Cd; Thu, 03 Oct 2024 08:15:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=SPt+lkEbDzFZm1X8U/ekYOGL+C2KD+dAiLcDJNwN6o0=; b=nxlhZ+pcYbx3aZJLuipvZZTT+91PcVWW+mjvEwC8Hn/Jp8IcjDbUS0Rul4hlryeLUMimA+KNJq8nmwSuQuyCghf1OwXHKsI6vEstklDEQ37L4V7BesE1RinA8ZjaqhBahEsF3aXnewGwMFiT5YwyduRCDUqAeG7tWOD3b6ESLW3SbaxJkGrp2jVfDQ6AG71ABm0BOvxhNqzVt/YBYv2iXo/ZWcwJMXaTNrLmHKebXM59MbDvk+EagIK4SeOD8sEdzFYCvv4yRg4JYIVLCXpz+WqSxpjr/IIow0yO8+bQW1I4FD9CJstYvD6Af5veiULRkLttkqsSvm6AI7dttsuCcw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swKjX-0008Jc-2c; Thu, 03 Oct 2024 08:15:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73612] [PATCH 1/2] image: Use file system options in make-vfat-image. Resent-From: Roman Scherer Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Thu, 03 Oct 2024 12:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73612@debbugs.gnu.org Cc: Roman Scherer , Florian Pelz , Ludovic Court?s , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Ludovic Court?s , Maxim Cournoyer Received: via spool by 73612-submit@debbugs.gnu.org id=B73612.172795768931922 (code B ref 73612); Thu, 03 Oct 2024 12:15:03 +0000 Received: (at 73612) by debbugs.gnu.org; 3 Oct 2024 12:14:49 +0000 Received: from localhost ([127.0.0.1]:60236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swKjI-0008In-MO for submit@debbugs.gnu.org; Thu, 03 Oct 2024 08:14:48 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:51542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swKjF-0008IN-Iy for 73612@debbugs.gnu.org; Thu, 03 Oct 2024 08:14:45 -0400 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso150888766b.3 for <73612@debbugs.gnu.org>; Thu, 03 Oct 2024 05:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1727957618; x=1728562418; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SPt+lkEbDzFZm1X8U/ekYOGL+C2KD+dAiLcDJNwN6o0=; b=KG79CU1SerIm/RzFUV8Vi5pS98mVXygmNtJKAX+6FE5HxjUiAaVG2o4gv34zywMIY0 1IS9YJZpBy6YgiJDqPJnocRkHI3WbkiDN2TQh/2v0PibcCn1696ECTMryGxBYhLsIxey s30Eo5dA1Hl+wT2OcHLBbzxkf9RA3ZLsoGvYzZWqJfVnPP7IhFvggtoQMnpM4BKqSUwv CCLKTFMaRWG8leK8ZXC2xsui6kae5F2pEQECwEVaFmAUbfefJh1nWfwCcQ/LRg03Z6Za YvrDekgQAXdZc0aktNzsOjwwJH9AQZmEYqLOh+PYrNKsWQFhY5c3p4o2Hf1W0fjU/yw2 On1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727957618; x=1728562418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SPt+lkEbDzFZm1X8U/ekYOGL+C2KD+dAiLcDJNwN6o0=; b=VjZNTSriLcSXLvlJFdsvUha6fAiXkniYltlIdgZlPn8Re8pGk6H4shCn/Q+Si/eXmO HRpxkY9HRo9gR8GNne+c8nrd3KadJa20M+yOVuLVPjIBE++d98AvzMfrA96Xx1+P8+Cj DG14ly2mqsQTaTMFBoHA05NO5I6qv4wa96+SQnQsqPmEyKJ40vR5rNx6pR9tmRAHOehB Ue1WaaMpzioGWzP2LMAM7i1JK/ddvfR6zal/a1ii1uX0hSQ4oZ+IQ28CF5iM6o2U/Ccb sPqpYozgxWG+EUF8JD2pkH4I1f99dmVtL6Z4hexMIBol+Qke/KMYlv56QwQ7BGMR7MVi k5Yw== X-Gm-Message-State: AOJu0YxfDIib0aCnk+XKwFnI4+HTFdiN2sLHupCtdn0ocpCeOl/UOM2m 3ZtmlAMkfQtnCneKmqDxEl6IvC0eAkkfMTbt4siwyoGn7DNs4+XLlTNhvY5PaAIh0/dr8maoUzf y X-Google-Smtp-Source: AGHT+IGDiYyAH4Q4eZLe01sacikD6/KU39xysWsSYRWxYWia5kBkehReqBtZgY/mZyeeOXDzf6T23Q== X-Received: by 2002:a17:907:2689:b0:a90:348f:fad7 with SMTP id a640c23a62f3a-a98f829695dmr629781366b.38.1727957617812; Thu, 03 Oct 2024 05:13:37 -0700 (PDT) Received: from localhost.localdomain ([2a01:599:11c:96e4:28c8:f563:d9da:c488]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99104c6d1esm78088066b.189.2024.10.03.05.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 05:13:37 -0700 (PDT) From: Roman Scherer Date: Thu, 3 Oct 2024 14:13:31 +0200 Message-ID: <2afad4c3208e6bb3d2a4e65f151fdcc58dae8b61.1727957293.git.roman@burningswell.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/build/image.scm (make-vfat-image): Use file system options. Change-Id: I791aadd2803d1ef96fc79cf8910a74a0083d2b6e --- doc/guix.texi | 3 ++- gnu/build/image.scm | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 52e36e4354..87904761f0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47918,7 +47918,8 @@ partition Reference @item @code{file-system-options} (default: @code{'()}) The partition file system creation options that should be passed to the partition creation tool, as a list of strings. This is only supported -when creating @code{"ext4"} partitions. +when creating @code{"vfat"}, @code{"fat16"}, @code{"fat32"} or +@code{"ext4"} partitions. See the @code{"extended-options"} man page section of the @code{"mke2fs"} tool for a more complete reference. diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 6ca0a428e0..50518585f8 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -105,17 +105,21 @@ (define* (make-vfat-image partition target root fs-bits) "Handle the creation of VFAT partition images. See 'make-partition-image'." (let ((size (partition-size partition)) (label (partition-label partition)) - (flags (partition-flags partition))) + (flags (partition-flags partition)) + (fs-options (partition-file-system-options partition))) (apply invoke "fakeroot" "mkdosfs" "-n" label "-C" target - "-F" (number->string fs-bits) - (size-in-kib - (if (eq? size 'guess) - (estimate-partition-size root) - size)) - ;; u-boot in particular needs the formatted block - ;; size and the physical block size to be equal. - ;; TODO: What about 4k blocks? - (if (member 'esp flags) (list "-S" "512") '())) + "-F" (number->string fs-bits) + (size-in-kib + (if (eq? size 'guess) + (estimate-partition-size root) + size)) + ;; u-boot in particular needs the formatted block + ;; size and the physical block size to be equal. + ;; TODO: What about 4k blocks? + (if (and (member 'esp flags) + (not (member "-S" fs-options))) + (append (list "-S" "512") fs-options) + fs-options)) (for-each (lambda (file) (unless (member file '("." "..")) (invoke "mcopy" "-bsp" "-i" target