From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cF+TJA91k2SgXwEASxT56A (envelope-from ) for ; Thu, 22 Jun 2023 00:09:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SHXOIw91k2Q4ZQEAG6o9tA (envelope-from ) for ; Thu, 22 Jun 2023 00:09:19 +0200 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 3035C3C1BE for ; Thu, 22 Jun 2023 00:09:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qC60k-0006yb-0r; Wed, 21 Jun 2023 18:09:10 -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 1qC60c-0006yK-Sj for guix-patches@gnu.org; Wed, 21 Jun 2023 18:09:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qC60c-0004mW-K4 for guix-patches@gnu.org; Wed, 21 Jun 2023 18:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qC60c-00057r-BY for guix-patches@gnu.org; Wed, 21 Jun 2023 18:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jun 2023 22:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: Tobias Geerinckx-Rice , Simon Tournier , paren@disroot.org, Christopher Baines , 63766@debbugs.gnu.org, Ricardo Wurmus , Raghav Gururajan , jgart , Mathieu Othacehe Received: via spool by 63766-submit@debbugs.gnu.org id=B63766.168738531119664 (code B ref 63766); Wed, 21 Jun 2023 22:09:02 +0000 Received: (at 63766) by debbugs.gnu.org; 21 Jun 2023 22:08:31 +0000 Received: from localhost ([127.0.0.1]:34336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC606-000574-Ks for submit@debbugs.gnu.org; Wed, 21 Jun 2023 18:08:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC604-00056s-EC for 63766@debbugs.gnu.org; Wed, 21 Jun 2023 18:08:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC5zv-0004Ml-UJ; Wed, 21 Jun 2023 18:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=WBua78ExBYQ/AN9IbDyehl2qfxqKK3u72xuValvOyxQ=; b=nG2R4sd+a7o4kbudlKwP voYfbTnrE2vkmMqQ6p2cB++59R8n8qXR0CTZoZrdattxnl3gddMHnJ0L/rUkA37polc7xY5bwfbfX c5sZo4rg2LBAuKkGtAgXX/TeZHbpfPOk8LC2EilxrVCbYOjf/eF7IIKyzorwhsjaGGg89xvloSc8w qK8xhIAsaeVqHfYLSKesuOIMZtJBuE4Psv1UNJtjvtVDGFbr3zkL1GPmdf3jaiWEJG2M5rAJUaisP CHbxv6MYs+jWxiOnRDJN+VukK0S13E7TEoMLtItch8PspCy6iU9y26RlSc+Vo4BhbX6tsy/84VLFh 2jJEwaY9cbsWBg==; Received: from lsm-cpl.in2p3.fr ([134.158.178.2] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC5zv-0007Vz-Ev; Wed, 21 Jun 2023 18:08:19 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87jzwcv03m.fsf_-_@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quartidi 4 Messidor an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de la =?UTF-8?Q?V=C3=A9ronique?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 22 Jun 2023 00:08:16 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 13 Jun 2023 12:53:47 +0300") Message-ID: <878rcc5uzz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687385359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WBua78ExBYQ/AN9IbDyehl2qfxqKK3u72xuValvOyxQ=; b=kOwa9iPKXjQsJLXUylid6piekH+GTrf3E4oyYmOJONfd11BKjPdL6czIVMD9hUXeLWUJJ8 CgkSTouf/OIWwVYaPwpBfo838EeaiMkIndgRnEPnIcopO0TsLV/pR9uloSlXn3yHPFaNJl 6rYaz8PaEEB9WRmlPyQkArmQfeohF9KOLmAd6v5zGgpXMLYdJowBww79mKkqhlYbaAkKeR ErtBI1gb/YZjB+K1HZ27sA7RYTEiE2Ey15+YsFqThNXRWDRzuoP9O2joBeZP3+uW3xBCi6 cAmT1Mo5sre6K4/uNjh3pG1e7N1rJowAuVoZ/TgQrL8XYIVCNp1vjzS94kFRZw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nG2R4sd+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687385359; a=rsa-sha256; cv=none; b=hPoZGcj/GXyjChs+uo2MtdLt1OZhDhZhv5ARNS1a/8R0B1q+7fz6gQ/egtMtY2Aw8ylLdS UovP6G9zJu88Hv3V2oFkA6sl4RvCTP+MPknw6vzBUNeEZ1rMDBTDM0INE/RRsNtjXCBmsa x6mBmURkNwe2lFGBq9vgfdkhoy4bZnhoMsF15LAk6Dzuu3IfCK5uXjPuGmDjfS+jwv5bsZ iOELwYbZy2YADF0bLLl2cTXSlgMjFaBNrxSdqXiok+I8j0q9cSxC7XvTjujMIOU7Fskn2R Nud3VRXpjBh48aEeIdO0QNQ0XcL1nXyqj7/wK3p/6VXR07u7ABKnBhRxSjiwng== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.15 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nG2R4sd+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3035C3C1BE X-Spam-Score: -1.15 X-TUID: WnLfAC7dao9x Hi, Efraim Flashner skribis: > I changed it to: > > (let ((size (partition-size partition))) > ;; Create the file and then truncate it to the desired size. > (with-output-to-file target > (lambda _ (display ""))) > (truncate-file target size))) > > And that got me the empty partition/block device as needed. A slight improvement would be: (catch 'system-error (lambda () (truncate-file target size)) (lambda args (if (=3D ENOENT (system-error-errno args)) (call-with-output-file target (const #t)) (apply throw args)))) It=E2=80=99s more verbose but makes the intent clearer. Ludo=E2=80=99.