From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id SBaaFjijXWfcdAAAe85BDQ:P1 (envelope-from ) for ; Sat, 14 Dec 2024 15:24:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id SBaaFjijXWfcdAAAe85BDQ (envelope-from ) for ; Sat, 14 Dec 2024 16:24:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=pH15cYcs; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=cB8cJN97; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734189880; 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=Vcitba0pcFgHwuJUe+wEoXF6ux3Jt53ZKRCcPPleQhY=; b=Pw0fgeARXhGa11Go6OzzQCrrJ3M3vHBrlUqpD59SLMhpCMwrwJWnIGPECDa84ANq7QNHNo JJi3QkY2cdG0rM+e8ehI4/sv2U91LV4iYkRSFLteZsrruLvyXio5MQV+aD+mO0Vc0mnFjk 5KPHIjnY7UohnXBIN9kTbopbB+l8Bi2F471rqE4VqhFnzg+nUtFzoBXpw1sEkKpmvbZC02 Nr4RjLQDU+IxIKGz9fGK+m8ZPvnvObmwKTLn3IP+0Lrns6qoz+7R+zU3qfxZY2zs6XQa4G VMdI/GWlI5c9W0lzNvgJuq7HSffoTYra9qzIgpjZ8+gPwdKW1Q4g9LrXrAsnDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=pH15cYcs; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=cB8cJN97; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734189880; a=rsa-sha256; cv=none; b=W1ga/N9TKDPuZ9uQf9AFD2EvsiTI0MxTDMqppA2TkEaEIZSDvpa5cMu8wBbEh2W3DowS0W 281F0GMSxmUScdKI1PNoYzhb208nLJUsufXpA+visHaHUGq4xu1/4pl0+r731sdK4lGVoq VYW//ZQ8ahEMh+df/+QI+RM8gU2wt3uYntqMl1AMXaaiE5v5kgr8yS5FGBvHl8/4QIAK3/ P0qTRYTUwLe8I1Wfszh12oB7WKbPwLOKyxhCv5UhCiq94+fIZ8kbp9C9dQ8hPzqPfDqn8q 5PO4gDBCNQAm/2iHANleMsCapnD1eAnEqIQfcUD3lyighQIvWra8jUZAoNDkAQ== 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 A64755F42C for ; Sat, 14 Dec 2024 16:24:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMTzy-0003z0-6P; Sat, 14 Dec 2024 10:24:06 -0500 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 1tMTzv-0003yc-Kl for guix-patches@gnu.org; Sat, 14 Dec 2024 10:24:03 -0500 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 1tMTzv-0006ME-CC for guix-patches@gnu.org; Sat, 14 Dec 2024 10:24:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Vcitba0pcFgHwuJUe+wEoXF6ux3Jt53ZKRCcPPleQhY=; b=pH15cYcsM0USNmRO5shDpKFJbbFRSs+gijLqDDwRqbQQPKemUoFQpB7+BFuGgJljsY2jgNgNR88/vqmiWDPcRNSlmKEbfWaC8Uc4X1LrRb+VRojp0qRomYF0biJ0bB1BTDpumInyri72bTf5HWR85ldle7r5AF03OcJv05uYdPY7VVv3yh4y0Qptxv9EAxj07Q8w2bAQ7KQBTtgv3IyNqJluwCfb4TFpPZBRcj1Vp0gcWi5eqi5NGkt7CWm4vbHtY897PDYvRQRHOMMIuTyCOtJejq7BbeeOs/hEBYgq+kPySKV3wFmQhKCSefjozJpOz0KMyprekUNwWppSAj7YsA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMTzu-0007Sl-7j for guix-patches@gnu.org; Sat, 14 Dec 2024 10:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74837] [PATCH v2 1/2] gnu: services: Add resize-fs-service. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Dec 2024 15:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74837 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Richard Sent Cc: Maxim Cournoyer , 74837@debbugs.gnu.org Received: via spool by 74837-submit@debbugs.gnu.org id=B74837.173418983128669 (code B ref 74837); Sat, 14 Dec 2024 15:24:02 +0000 Received: (at 74837) by debbugs.gnu.org; 14 Dec 2024 15:23:51 +0000 Received: from localhost ([127.0.0.1]:48008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMTzc-0007SD-Ql for submit@debbugs.gnu.org; Sat, 14 Dec 2024 10:23:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMTzZ-0007Ru-Ja for 74837@debbugs.gnu.org; Sat, 14 Dec 2024 10:23:42 -0500 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 1tMTzU-0006JJ-6c; Sat, 14 Dec 2024 10:23:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Vcitba0pcFgHwuJUe+wEoXF6ux3Jt53ZKRCcPPleQhY=; b=cB8cJN973fc0uyeE2AM/ N99DYPXRxIEjQwRM8uzmkg9E9Ns/3wywIurITTzycqqNCt18fy4JKmr5pINL8Ga3UCX+T3pATukgm UEbJysIMktdZ2mSL/hXwZwNwiTlhH5C/yRluJqNQEjv798fi8F6pn30hHgtb/AJo3jIHchlaGZkFs mWCtsmyD/nTzEJsdZsP8uAD5MMKigVYv2j9nbXyVuzqfhV4QVeyL/c3jc20ij8ptPljR99YwfjkNG ms8f2xviS21eh0OQ4129EwGgEj1M96dlR0ZkRnvq3apfdLOB86x07LCyjzn8cel7gDnZ3ZBbWcyDn MPVaCE2NSWdZ1Q==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> (Richard Sent's message of "Thu, 12 Dec 2024 16:15:29 -0500") References: <472c97dc7cb15bc73e93576868d4da8517d2ddb5.1734038130.git.richard@freakingpenguin.com> Date: Sat, 14 Dec 2024 16:23:27 +0100 Message-ID: <874j36mgpc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: A64755F42C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.32 X-Spam-Score: -4.32 X-TUID: PnuBp26lF/TL Hello, Richard Sent skribis: > * gnu/services/admin.scm (resize-fs-configuration): New configuration > type. > (resize-fs-shepherd-service): New procedure. > (resize-fs-service-type): New variable. > * doc/guix.texi (Miscallaneous Services): Document it. > > Change-Id: Icae2fefc9a8d936d4c3add47520258b341f689a4 Nice! Overall LGTM. Minor comments below. > +@subsubheading Resize File System service > + > +This service type lets you resize a live file system during boot, which > +can be convenient if a Guix image is flashed on an SD Card (e.g. for an > +embedded device) or uploaded to a VPS. In both cases the medium the > +image will reside upon may be larger than the image you want to produce. > + > +For an embedded device booting from an SD card you may use something lik= e: > +@lisp > +(service resize-fs-service-type > + (resize-fs-configuration > + (file-system > + (device (file-system-label "root")) > + (type "ext4")))) > +@end lisp I would avoid abbreviations as usual and go for =E2=80=98file-system-resizing-service-type=E2=80=99. WDYT? > +Be extra cautious to use the correct device and type. The service has > +little error handling of its own and relies on the underlying tools. > +Wrong use could end in loss of data or the corruption of the operating > +system. Maybe wrap this paragraph in =E2=80=9C@quotation Warning=E2=80=9D. > +@item @code{file-system} (default: @code{#f}) (type: file-system) > +The file-system object to resize. This object must have the device and ^ Maybe add =E2=80=9C(@pxref{File Systems})=E2=80=9D. > +type fields set. The others are ignored. =E2=80=9Cthe @code{device} and @code{type} fields set. Other fields are ignored.=E2=80=9D > +@item @code{cloud-utils} (default: @code{cloud-utils}) (type: file-like) > +The cloud-utils package to use. Maybe add a sentence explaining that =E2=80=98cloud-utils=E2=80=99 is used = for its =E2=80=98growpart=E2=80=99 command. I wonder if Guile-Parted could be used instead of =E2=80=98growpart=E2=80= =99 (shouldn=E2=80=99t be a blocker though). > + (let/ec return > + (guard (c ((and (invoke-error? c) > + ;; growpart NOCHANGE exits with 1.= It is > + ;; unlikely the partition was resi= zed > + ;; while the file system was not. = Just > + ;; exit. > + (equal? (invoke-error-exit-status = c) 1)) > + (format (current-error-port) > + "The device ~a is already resiz= ed.~%" device) > + ;; Must return something or Shepherd co= nsiders > + ;; the service perpetually starting. > + (return 0))) > + (apply invoke grow-partition-command)) > + (apply invoke grow-filesystem-command))))))))) No need for =E2=80=98let/ec=E2=80=99 here, you can just return from the =E2= =80=98guard=E2=80=99 handler. The second patch LGTM, though perhaps it should come before this patch since it fixes something that the resize service needs. Could you send updated patches? Thanks! Ludo=E2=80=99.