unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
diff for duplicates of <ZR0P278MB0268FD293FEB52837F22105FC18EA@ZR0P278MB0268.CHEP278.PROD.OUTLOOK.COM>

diff --git a/N1/2.bin b/N1/2.bin
new file mode 100644
index 0000000..7cd30b1
--- /dev/null
+++ b/N1/2.bin
@@ -0,0 +1,198 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
+</head>
+<body dir="ltr">
+<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Would you mind giving my previously attached service a try and tell me whether this works?</span></div>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
+</span></div>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">If there is no other input I will just prepare a patch where the service renders a bash
+ script which (somewhat stupidly) attempts to resize the file-system at (every!) boot - mostly because I'm not sure whether we have the facilities to (or I wouldn't know how)</span></div>
+<ol start="1" style="margin-block: 0px;" data-editing-info="{&quot;orderedStyleType&quot;:6,&quot;unorderedStyleType&quot;:1}" data-listchain="__List_Chain_113">
+<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; list-style-type: &quot;a) &quot;; color: rgb(0, 0, 0);">
+<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">run a service once per system generation (or some other measure) and<br>
+</span></li><li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; list-style-type: &quot;b) &quot;; color: rgb(0, 0, 0);">
+<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">to construct such a Shell-script in a more verifiable or maintainable fashion in Guile (though I'd be willing to
+ write relevant helper functions)<br>
+</span></li></ol>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
+</span></div>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Thanks for all your input!&nbsp; If there is no more input I'll just prepare some patch from
+ the existing service.</span></div>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
+</span></div>
+<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">P.S. Since this isn't a classic &quot;help&quot; problem anymore I'm moving the discussion over
+ to the devel-list.<br>
+</span></div>
+<div id="appendonsend"></div>
+<hr style="display:inline-block;width:98%" tabindex="-1">
+<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Csepp &lt;raingloom@riseup.net&gt;<br>
+<b>Sent:</b> Sunday, December 10, 2023 6:03 PM<br>
+<b>To:</b> Efraim Flashner &lt;efraim@flashner.co.il&gt;<br>
+<b>Cc:</b> Wicki Gabriel (wicg) &lt;wicg@zhaw.ch&gt;; help-guix@gnu.org &lt;help-guix@gnu.org&gt;<br>
+<b>Subject:</b> Re: Resize Filesystem Service</font>
+<div>&nbsp;</div>
+</div>
+<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
+<div class="PlainText">#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil tex:dvipng d:nil<br>
+#+STARTUP: hidestars indent inlineimages<br>
+:PROPERTIES:<br>
+:reply-to: nil<br>
+:attachment: nil<br>
+:alternatives: (utf-8)<br>
+:END:<br>
+<br>
+Efraim Flashner &lt;efraim@flashner.co.il&gt; writes:<br>
+<br>
+&gt; [[PGP Signed Part:Undecided]]<br>
+&gt; On Thu, Dec 07, 2023 at 09:25:43AM +0000, Wicki Gabriel (wicg) wrote:<br>
+&gt;&gt; Hi<br>
+&gt;&gt;<br>
+&gt;&gt; Thanks for the input, Felix. I finally managed to get it to work (with<br>
+&gt;&gt; additional input from ludo). I attach the service to this mail. If people<br>
+&gt;&gt; think this might be a nice-to-have in upstream guix i'll happily craft a<br>
+&gt;&gt; patch.<br>
+&gt;&gt;<br>
+&gt;&gt; g<br>
+&gt;&gt; ________________________________<br>
+&gt;&gt; From: Felix Lechner &lt;felix.lechner@lease-up.com&gt;<br>
+&gt;&gt; Sent: Monday, December 4, 2023 9:18 PM<br>
+&gt;&gt; To: Wicki Gabriel (wicg) &lt;wicg@zhaw.ch&gt;; help-guix@gnu.org &lt;help-guix@gnu.org&gt;<br>
+&gt;&gt; Subject: Re: Resize Filesystem Service<br>
+&gt;&gt;<br>
+&gt;&gt; Hi Gabriel,<br>
+&gt;&gt;<br>
+&gt;&gt; On Mon, Dec 04 2023, Wicki Gabriel wrote:<br>
+&gt;&gt;<br>
+&gt;&gt; &gt; I crafted the service in the file attached but this doesn't work and i<br>
+&gt;&gt; &gt; neither know where to look nor how to debug the issue.<br>
+&gt;&gt;<br>
+&gt;&gt; Writing services is probably more complex than it should be, but it can<br>
+&gt;&gt; be done.<br>
+&gt;&gt;<br>
+&gt;&gt; Please have a look at the cachefilesd-service [1] which I wrote together<br>
+&gt;&gt; with Bruno Victal (mirai) and which was accepted, or the Heimdal<br>
+&gt;&gt; Kerberos services that are still waiting for review. [2]<br>
+&gt;&gt;<br>
+&gt;&gt; My most immediate suggestion is that I would use define-configuration<br>
+&gt;&gt; even when no serialization (which helps write configuration files) is<br>
+&gt;&gt; needed. Also, you have to think carefully about where to place the<br>
+&gt;&gt; G-Expressions, which can be tough to wrap your mind arround. Finally, I<br>
+&gt;&gt; would use &quot;file-append&quot; instead of string-append for some of the<br>
+&gt;&gt; configurable executable paths.<br>
+&gt;&gt;<br>
+&gt;&gt; Kind regards<br>
+&gt;&gt; Felix<br>
+&gt;&gt;<br>
+&gt;&gt; [1] <a href="https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/linux.scm#n492">
+https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/linux.scm#n492</a><br>
+&gt;&gt; [2] <a href="https://issues.guix.gnu.org/67555">https://issues.guix.gnu.org/67555</a><br>
+&gt;<br>
+&gt;&gt; (define-module (services resize-fs)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (guix gexp)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (guix records)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages bash)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages disk) ; parted<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages linux); e2fsprogs<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (guix build utils)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (guix packages)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services configuration)<br>
+&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services shepherd)<br>
+&gt;&gt;&nbsp;&nbsp; #:export (resize-fs-configuration<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration?<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-parted<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-e2fsprogs<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-device<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-partition<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-end<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-service-type))<br>
+&gt;&gt;<br>
+&gt;&gt; (define-configuration/no-serialization resize-fs-configuration<br>
+&gt;&gt;&nbsp;&nbsp; (parted<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (file-like parted)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The parted package to use.&quot;)<br>
+&gt;&gt;&nbsp;&nbsp; (e2fsprogs<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (file-like e2fsprogs)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The e2fsprogs package providing the resize2fs utility.&quot;)<br>
+&gt;&gt;&nbsp;&nbsp; (device<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (string &quot;/dev/mmcblk0&quot;) ;; #f may be preferrable here to prevent accidental resizing of wrong file-system<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The device containing the partition to be resized.&quot;)<br>
+&gt;&gt;&nbsp;&nbsp; (partition<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (number 2)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The partition number that is to be resized.&quot;)<br>
+&gt;&gt;&nbsp;&nbsp; (end<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (string &quot;100%&quot;)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The end position of the resized partition as understood by the parted \<br>
+&gt;&gt;&nbsp;&nbsp; utility (e.g. \&quot;100%\&quot;, \&quot;500M\&quot; or \&quot;16GiB\&quot;).&quot;))<br>
+&gt;&gt;<br>
+&gt;&gt; (define (resize-fs-script config)<br>
+&gt;&gt;&nbsp;&nbsp; (match-record<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config &lt;resize-fs-configuration&gt; (parted e2fsprogs device partition end)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (let ((parted-bin (file-append parted &quot;/sbin/parted&quot;))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (resize2fs&nbsp; (file-append e2fsprogs &quot;/sbin/resize2fs&quot;))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (device+partition (string-append device &quot;p&quot; (number-&gt;string partition))))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (mixed-text-file &quot;resize-fs.sh&quot;<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;#!/bin/sh<br>
+&gt;&gt; echoerr() { printf \&quot;$*\\n\&quot; &gt;&amp;2 ; }<br>
+&gt;&gt;<br>
+&gt;&gt; cmd() {<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &quot; parted-bin &quot; &quot; device &quot; ---pretend-input-tty &lt;&lt;EOF &amp;&amp; &quot; resize2fs &quot; &quot; device+partition &quot;<br>
+&gt;&gt; resizepart<br>
+&gt;&gt; &quot; (number-&gt;string partition) &quot;<br>
+&gt;&gt; Yes<br>
+&gt;&gt; &quot; end &quot;<br>
+&gt;&gt; EOF<br>
+&gt;&gt; }<br>
+&gt;&gt;<br>
+&gt;&gt; set -o errexit<br>
+&gt;&gt; set -o pipefail<br>
+&gt;&gt;<br>
+&gt;&gt; echoerr hello from resize-fs script<br>
+&gt;&gt;<br>
+&gt;&gt; if cmd; then<br>
+&gt;&gt;&nbsp;&nbsp; echoerr \&quot;Resizing successful\&quot;<br>
+&gt;&gt; else<br>
+&gt;&gt;&nbsp;&nbsp; echoerr \&quot;resize-script returned $?\&quot;<br>
+&gt;&gt; fi<br>
+&gt;&gt; &quot;))))<br>
+&gt;&gt;<br>
+&gt;&gt; (define (resize-fs-shepherd-service config)<br>
+&gt;&gt;&nbsp;&nbsp; &quot;Return a list of &lt;shepherd-service&gt; for resize-fs-service for CONFIG&quot;<br>
+&gt;&gt;&nbsp;&nbsp; (let ((resize-script (resize-fs-script config)))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (shepherd-service<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (documentation &quot;Resize a file-system.&nbsp; Intended for Guix Systems that are booted from an image&quot;)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (provision '(resize-fs))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (requirement '(user-processes))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (one-shot? #t)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (respawn? #f)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (start #~(make-forkexec-constructor<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list #$(file-append bash &quot;/bin/sh&quot;) #$resize-script))))))<br>
+&gt;&gt;<br>
+&gt;&gt; (define resize-fs-service-type<br>
+&gt;&gt;&nbsp;&nbsp; (service-type<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (name 'resize-fs)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (description &quot;Resize a partition.&quot;)<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (extensions<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (list<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (service-extension shepherd-root-service-type<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (compose list resize-fs-shepherd-service))))<br>
+&gt;&gt;&nbsp;&nbsp;&nbsp; (default-value (resize-fs-configuration))))<br>
+&gt;<br>
+&gt; I think it would be helpful to have upstream. I'm guessing it would be<br>
+&gt; useful not just on single board computers but also on VPSs and probably<br>
+&gt; other use cases.<br>
+&gt;<br>
+&gt; Not directly related to upstreaming this service, this seems like a<br>
+&gt; useful service to offer for an 'on first boot' service, or as some sort<br>
+&gt; of special service to be loaded with 'sudo herd load root'.<br>
+<br>
+I tried to write something similar for my VPS but it wasn't working at boot,<br>
+although it did if I restarted the service.<br>
+So I for one would be very grateful if a working resizer service were<br>
+upstreamed.<br>
+</div>
+</span></font></div>
+</body>
+</html>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..c12b5e0
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,2 @@
+Content-Type: text/html; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
diff --git a/a/content_digest b/N1/content_digest
index 0a04eec..0a274c5 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -30,7 +30,7 @@
   " Csepp <raingloom\@riseup.net>\0"
 ]
 [
-  "\0000:1\0"
+  "\0001:1\0"
 ]
 [
   "b\0"
@@ -210,5 +210,211 @@
   "So I for one would be very grateful if a working resizer service were\n",
   "upstreamed."
 ]
+[
+  "\0001:2\0"
+]
+[
+  "b\0"
+]
+[
+  "<html>\r\n",
+  "<head>\r\n",
+  "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">\r\n",
+  "<style type=\"text/css\" style=\"display:none;\"> P {margin-top:0;margin-bottom:0;} </style>\r\n",
+  "</head>\r\n",
+  "<body dir=\"ltr\">\r\n",
+  "<div><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">Would you mind giving my previously attached service a try and tell me whether this works?</span></div>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\"><br>\r\n",
+  "</span></div>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">If there is no other input I will just prepare a patch where the service renders a bash\r\n",
+  " script which (somewhat stupidly) attempts to resize the file-system at (every!) boot - mostly because I'm not sure whether we have the facilities to (or I wouldn't know how)</span></div>\r\n",
+  "<ol start=\"1\" style=\"margin-block: 0px;\" data-editing-info=\"{&quot;orderedStyleType&quot;:6,&quot;unorderedStyleType&quot;:1}\" data-listchain=\"__List_Chain_113\">\r\n",
+  "<li style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; list-style-type: &quot;a) &quot;; color: rgb(0, 0, 0);\">\r\n",
+  "<span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">run a service once per system generation (or some other measure) and<br>\r\n",
+  "</span></li><li style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; list-style-type: &quot;b) &quot;; color: rgb(0, 0, 0);\">\r\n",
+  "<span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">to construct such a Shell-script in a more verifiable or maintainable fashion in Guile (though I'd be willing to\r\n",
+  " write relevant helper functions)<br>\r\n",
+  "</span></li></ol>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\"><br>\r\n",
+  "</span></div>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">Thanks for all your input!&nbsp; If there is no more input I'll just prepare some patch from\r\n",
+  " the existing service.</span></div>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\"><br>\r\n",
+  "</span></div>\r\n",
+  "<div class=\"elementToProof\"><span style=\"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);\">P.S. Since this isn't a classic &quot;help&quot; problem anymore I'm moving the discussion over\r\n",
+  " to the devel-list.<br>\r\n",
+  "</span></div>\r\n",
+  "<div id=\"appendonsend\"></div>\r\n",
+  "<hr style=\"display:inline-block;width:98%\" tabindex=\"-1\">\r\n",
+  "<div id=\"divRplyFwdMsg\" dir=\"ltr\"><font face=\"Calibri, sans-serif\" style=\"font-size:11pt\" color=\"#000000\"><b>From:</b> Csepp &lt;raingloom\@riseup.net&gt;<br>\r\n",
+  "<b>Sent:</b> Sunday, December 10, 2023 6:03 PM<br>\r\n",
+  "<b>To:</b> Efraim Flashner &lt;efraim\@flashner.co.il&gt;<br>\r\n",
+  "<b>Cc:</b> Wicki Gabriel (wicg) &lt;wicg\@zhaw.ch&gt;; help-guix\@gnu.org &lt;help-guix\@gnu.org&gt;<br>\r\n",
+  "<b>Subject:</b> Re: Resize Filesystem Service</font>\r\n",
+  "<div>&nbsp;</div>\r\n",
+  "</div>\r\n",
+  "<div class=\"BodyFragment\"><font size=\"2\"><span style=\"font-size:11pt;\">\r\n",
+  "<div class=\"PlainText\">#+OPTIONS: html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil tex:dvipng d:nil<br>\r\n",
+  "#+STARTUP: hidestars indent inlineimages<br>\r\n",
+  ":PROPERTIES:<br>\r\n",
+  ":reply-to: nil<br>\r\n",
+  ":attachment: nil<br>\r\n",
+  ":alternatives: (utf-8)<br>\r\n",
+  ":END:<br>\r\n",
+  "<br>\r\n",
+  "Efraim Flashner &lt;efraim\@flashner.co.il&gt; writes:<br>\r\n",
+  "<br>\r\n",
+  "&gt; [[PGP Signed Part:Undecided]]<br>\r\n",
+  "&gt; On Thu, Dec 07, 2023 at 09:25:43AM +0000, Wicki Gabriel (wicg) wrote:<br>\r\n",
+  "&gt;&gt; Hi<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; Thanks for the input, Felix. I finally managed to get it to work (with<br>\r\n",
+  "&gt;&gt; additional input from ludo). I attach the service to this mail. If people<br>\r\n",
+  "&gt;&gt; think this might be a nice-to-have in upstream guix i'll happily craft a<br>\r\n",
+  "&gt;&gt; patch.<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; g<br>\r\n",
+  "&gt;&gt; ________________________________<br>\r\n",
+  "&gt;&gt; From: Felix Lechner &lt;felix.lechner\@lease-up.com&gt;<br>\r\n",
+  "&gt;&gt; Sent: Monday, December 4, 2023 9:18 PM<br>\r\n",
+  "&gt;&gt; To: Wicki Gabriel (wicg) &lt;wicg\@zhaw.ch&gt;; help-guix\@gnu.org &lt;help-guix\@gnu.org&gt;<br>\r\n",
+  "&gt;&gt; Subject: Re: Resize Filesystem Service<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; Hi Gabriel,<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; On Mon, Dec 04 2023, Wicki Gabriel wrote:<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; &gt; I crafted the service in the file attached but this doesn't work and i<br>\r\n",
+  "&gt;&gt; &gt; neither know where to look nor how to debug the issue.<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; Writing services is probably more complex than it should be, but it can<br>\r\n",
+  "&gt;&gt; be done.<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; Please have a look at the cachefilesd-service [1] which I wrote together<br>\r\n",
+  "&gt;&gt; with Bruno Victal (mirai) and which was accepted, or the Heimdal<br>\r\n",
+  "&gt;&gt; Kerberos services that are still waiting for review. [2]<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; My most immediate suggestion is that I would use define-configuration<br>\r\n",
+  "&gt;&gt; even when no serialization (which helps write configuration files) is<br>\r\n",
+  "&gt;&gt; needed. Also, you have to think carefully about where to place the<br>\r\n",
+  "&gt;&gt; G-Expressions, which can be tough to wrap your mind arround. Finally, I<br>\r\n",
+  "&gt;&gt; would use &quot;file-append&quot; instead of string-append for some of the<br>\r\n",
+  "&gt;&gt; configurable executable paths.<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; Kind regards<br>\r\n",
+  "&gt;&gt; Felix<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; [1] <a href=\"https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/linux.scm#n492\">\r\n",
+  "https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/linux.scm#n492</a><br>\r\n",
+  "&gt;&gt; [2] <a href=\"https://issues.guix.gnu.org/67555\">https://issues.guix.gnu.org/67555</a><br>\r\n",
+  "&gt;<br>\r\n",
+  "&gt;&gt; (define-module (services resize-fs)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (guix gexp)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (guix records)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages bash)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages disk) ; parted<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu packages linux); e2fsprogs<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (guix build utils)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (guix packages)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services configuration)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:use-module (gnu services shepherd)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; #:export (resize-fs-configuration<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration?<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-parted<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-e2fsprogs<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-device<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-partition<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-configuration-end<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize-fs-service-type))<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; (define-configuration/no-serialization resize-fs-configuration<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (parted<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (file-like parted)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The parted package to use.&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (e2fsprogs<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (file-like e2fsprogs)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The e2fsprogs package providing the resize2fs utility.&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (device<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (string &quot;/dev/mmcblk0&quot;) ;; #f may be preferrable here to prevent accidental resizing of wrong file-system<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The device containing the partition to be resized.&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (partition<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (number 2)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The partition number that is to be resized.&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (end<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (string &quot;100%&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; &quot;The end position of the resized partition as understood by the parted \\<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; utility (e.g. \\&quot;100%\\&quot;, \\&quot;500M\\&quot; or \\&quot;16GiB\\&quot;).&quot;))<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; (define (resize-fs-script config)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (match-record<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config &lt;resize-fs-configuration&gt; (parted e2fsprogs device partition end)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (let ((parted-bin (file-append parted &quot;/sbin/parted&quot;))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (resize2fs&nbsp; (file-append e2fsprogs &quot;/sbin/resize2fs&quot;))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (device+partition (string-append device &quot;p&quot; (number-&gt;string partition))))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (mixed-text-file &quot;resize-fs.sh&quot;<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;#!/bin/sh<br>\r\n",
+  "&gt;&gt; echoerr() { printf \\&quot;\$*\\\\n\\&quot; &gt;&amp;2 ; }<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; cmd() {<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &quot; parted-bin &quot; &quot; device &quot; ---pretend-input-tty &lt;&lt;EOF &amp;&amp; &quot; resize2fs &quot; &quot; device+partition &quot;<br>\r\n",
+  "&gt;&gt; resizepart<br>\r\n",
+  "&gt;&gt; &quot; (number-&gt;string partition) &quot;<br>\r\n",
+  "&gt;&gt; Yes<br>\r\n",
+  "&gt;&gt; &quot; end &quot;<br>\r\n",
+  "&gt;&gt; EOF<br>\r\n",
+  "&gt;&gt; }<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; set -o errexit<br>\r\n",
+  "&gt;&gt; set -o pipefail<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; echoerr hello from resize-fs script<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; if cmd; then<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; echoerr \\&quot;Resizing successful\\&quot;<br>\r\n",
+  "&gt;&gt; else<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; echoerr \\&quot;resize-script returned \$?\\&quot;<br>\r\n",
+  "&gt;&gt; fi<br>\r\n",
+  "&gt;&gt; &quot;))))<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; (define (resize-fs-shepherd-service config)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; &quot;Return a list of &lt;shepherd-service&gt; for resize-fs-service for CONFIG&quot;<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (let ((resize-script (resize-fs-script config)))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (shepherd-service<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (documentation &quot;Resize a file-system.&nbsp; Intended for Guix Systems that are booted from an image&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (provision '(resize-fs))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (requirement '(user-processes))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (one-shot? #t)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (respawn? #f)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (start #~(make-forkexec-constructor<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list #\$(file-append bash &quot;/bin/sh&quot;) #\$resize-script))))))<br>\r\n",
+  "&gt;&gt;<br>\r\n",
+  "&gt;&gt; (define resize-fs-service-type<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp; (service-type<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (name 'resize-fs)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (description &quot;Resize a partition.&quot;)<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (extensions<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; (list<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (service-extension shepherd-root-service-type<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (compose list resize-fs-shepherd-service))))<br>\r\n",
+  "&gt;&gt;&nbsp;&nbsp;&nbsp; (default-value (resize-fs-configuration))))<br>\r\n",
+  "&gt;<br>\r\n",
+  "&gt; I think it would be helpful to have upstream. I'm guessing it would be<br>\r\n",
+  "&gt; useful not just on single board computers but also on VPSs and probably<br>\r\n",
+  "&gt; other use cases.<br>\r\n",
+  "&gt;<br>\r\n",
+  "&gt; Not directly related to upstreaming this service, this seems like a<br>\r\n",
+  "&gt; useful service to offer for an 'on first boot' service, or as some sort<br>\r\n",
+  "&gt; of special service to be loaded with 'sudo herd load root'.<br>\r\n",
+  "<br>\r\n",
+  "I tried to write something similar for my VPS but it wasn't working at boot,<br>\r\n",
+  "although it did if I restarted the service.<br>\r\n",
+  "So I for one would be very grateful if a working resizer service were<br>\r\n",
+  "upstreamed.<br>\r\n",
+  "</div>\r\n",
+  "</span></font></div>\r\n",
+  "</body>\r\n",
+  "</html>\r\n"
+]
 
-45b437435651edd964bc27748e6ba4ea8a74d742d31638c2534dc2cf7203a2af
+8fc83bebb6027465fcb2f8a4c4f741656e749eaef6d3e8e4d701fc7caf93c2a3

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).