From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7OUb-0004FH-Ph for guix-patches@gnu.org; Sun, 07 May 2017 11:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7OUY-0004Yq-GM for guix-patches@gnu.org; Sun, 07 May 2017 11:53:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7OUY-0004Yg-CD for guix-patches@gnu.org; Sun, 07 May 2017 11:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7OUY-0000d8-0Q for guix-patches@gnu.org; Sun, 07 May 2017 11:53:02 -0400 Subject: bug#26815: [PATCH 2/3] vm: Support creating FAT partitions. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20170507172656.55edb3e9@scratchpost.org> References: <20170507143647.21036-1-mbakke@fastmail.com> <20170507143647.21036-2-mbakke@fastmail.com> <20170507172656.55edb3e9@scratchpost.org> Date: Sun, 07 May 2017 17:52:43 +0200 Message-ID: <871ss0zmt0.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 26815@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Danny Milosavljevic writes: > Hi Marius, > > On Sun, 7 May 2017 16:36:46 +0200 > Marius Bakke wrote: >> +(define* (create-ext-file-system partition type >> + #:key label) >> + "Create an ext-family filesystem of TYPE on PARTITION. If LABEL is t= rue, >> +use that as the volume name." >> + (format #t "creating ~a partition...\n" type) >> + (apply system* (string-append "mkfs." type) >> + "-F" partition >> + (if label >> + `("-L" ,label) >> + '()))) > > Could you document that the result of the procedure is the system* status= ? Also, is that wise? I think it should instead do the error handling and= (error ...) out on error. It's longer but less surprising. I had that first, but the error handling was exactly identical, so opted to just handle it in the caller. It does sound safer to handle errors there instead of passing system* around though, will do that in lieu of other comments.=20 >> +(define* (create-fat32-file-system partition >> + #:key label) >> + "Create a FAT32 filesystem on PARTITION, which must be at least 32 Mi= B long. >> +If LABEL is true, use that as volume name." > > Same as above. > >> (define* (format-partition partition type > [...] >> + (define format-procedure >> + (cond >> + ((string-prefix? "ext" type) >> + (create-ext-file-system partition type #:label label)) >> + ((string-suffix? "fat" type) >> + (create-fat32-file-system partition #:label label)) >> + (else #f))) > > "format-procedure" is not actually the procedure, right? It's already the= formatting-status ... Oops, an artifact of rebasing a lot of revisions... >> + (if format-procedure >> + (match (status:exit-val format-procedure) >> + (0 #t) >> + (_ (error "Formatting partition failed."))) >> + (error "Unsupported file system."))) > > status:exit-val will fail when given #f, which it will get in the error c= ase of format-procedure. Thanks for pointing that out. Will re-submit this patch shortly. > scheme@(guile-user)> (status:exit-val #f) > ERROR: In procedure status:exit-val: > ERROR: Wrong type (expecting exact integer): #f > >> + "nls_iso8859-1" ;for `mkfs.fat`, et.al > > This adds nls_iso8859-1 unconditionally. OK. It's required by "dosfstools" which is also added unconditionally. Not sure how to improve it. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlkPQssACgkQoqBt8qM6 VPp31Qf+P+nViW5Jexef3/cJOHAwLPvIH58Co1XlfXxiiH++YwlDT/YEBdn8y0A+ E+Z5rIGmYdeMS7VOqiLeWpxluS+RZEZW/eJDjPq22S7kU60L17DgqzfdDZOBlnsh 4wVSIJS9bchT8vDhGm/AceQYQU5Mxw35M6aKYCLC6v6QSmf12s8h2apxDh5vghCK fiCCAZEXmU1MhnmU1emORFl4mIq1EELjsku5M5KHaNusrTam7w5T80GM37jnGcSl ueaZEFzFBRbCLeqJ8otE/KJQmOeGBcZnJv3pIX6DVsTkCLOKBVZUoiIbdLfe60CL g5jsEILJ6uC2P4SELNoKxk9fIPkDYQ== =OySS -----END PGP SIGNATURE----- --=-=-=--