unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Marius Bakke <mbakke@fastmail.com>
Cc: 26815@debbugs.gnu.org
Subject: bug#26815: [PATCH 2/3] vm: Support creating FAT partitions.
Date: Sun, 7 May 2017 17:26:56 +0200	[thread overview]
Message-ID: <20170507172656.55edb3e9@scratchpost.org> (raw)
In-Reply-To: <20170507143647.21036-2-mbakke@fastmail.com>

Hi Marius,

On Sun,  7 May 2017 16:36:46 +0200
Marius Bakke <mbakke@fastmail.com> wrote:
> +(define* (create-ext-file-system partition type
> +                                 #:key label)
> +  "Create an ext-family filesystem of TYPE on PARTITION.  If LABEL is true,
> +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.

> +(define* (create-fat32-file-system partition
> +                                   #:key label)
> +  "Create a FAT32 filesystem on PARTITION, which must be at least 32 MiB 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 ...

> +  (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 case of format-procedure.

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.

Otherwise LGTM.

  reply	other threads:[~2017-05-07 15:28 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 14:35 bug#26815: [PATCH 0/3] Hybrid UEFI disk image Marius Bakke
2017-05-07 14:36 ` bug#26815: [PATCH 1/3] vm: Add support for arbitrary partition flags Marius Bakke
2017-05-07 14:36   ` bug#26815: [PATCH 2/3] vm: Support creating FAT partitions Marius Bakke
2017-05-07 15:26     ` Danny Milosavljevic [this message]
2017-05-07 15:52       ` Marius Bakke
2017-05-07 16:32         ` bug#26815: [PATCH v2 " Marius Bakke
2017-05-07 17:06         ` bug#26815: [PATCH " Danny Milosavljevic
2017-05-07 19:15           ` Marius Bakke
2017-05-07 20:07             ` Danny Milosavljevic
2017-05-08 14:45               ` Ludovic Courtès
2017-05-08 15:59     ` Maxim Cournoyer
2017-05-07 14:36   ` bug#26815: [PATCH 3/3] vm: Support EFI boot in base image Marius Bakke
2017-05-07 15:18     ` Danny Milosavljevic
2017-05-07 15:41       ` Marius Bakke
2017-05-07 19:17       ` Marius Bakke
2017-05-08  9:06         ` Marius Bakke
2017-05-08 14:50           ` Ludovic Courtès
2017-05-10 19:52             ` bug#26815: [PATCH 1/3] vm: Support arbitrary partition flags Marius Bakke
2017-05-10 19:52               ` bug#26815: [PATCH 2/3] vm: Support creating FAT partitions Marius Bakke
2017-05-10 19:52               ` bug#26815: [PATCH 3/3] vm: Add UEFI loader to disk images Marius Bakke
2017-05-10 21:05                 ` Ludovic Courtès
2017-05-10 21:21                   ` Marius Bakke
2017-05-10 19:58             ` bug#26815: [PATCH 3/3] vm: Support EFI boot in base image Marius Bakke
2017-05-12 22:06               ` Ludovic Courtès
2017-05-12 23:12                 ` Marius Bakke
2017-05-13  9:17                   ` Mathieu Othacehe
2017-05-13 13:11                     ` Ludovic Courtès
2017-05-13 14:13                       ` Marius Bakke
2017-05-13 19:23                         ` Ludovic Courtès
2017-05-16 15:17                         ` Ludovic Courtès
2017-05-17 11:05                           ` Marius Bakke
2017-05-17 12:36                             ` Marius Bakke
2017-05-17 13:42                               ` Ricardo Wurmus
2017-05-17 19:47                               ` Ludovic Courtès
2017-05-17 11:05                           ` bug#26815: [PATCH v4 1/3] vm: Support arbitrary partition flags Marius Bakke
2017-05-17 11:05                             ` bug#26815: [PATCH v4 2/3] vm: Support creating FAT partitions Marius Bakke
2017-05-17 11:05                             ` bug#26815: [PATCH v4 3/3] vm: Add UEFI loader to disk images Marius Bakke
2017-05-17 21:28                               ` Ludovic Courtès
2017-05-18 16:21                                 ` Marius Bakke
2017-05-18 17:34                                   ` Marius Bakke
2017-05-18 20:59                                     ` Ludovic Courtès
2017-05-19 16:15                                       ` Marius Bakke
2017-05-19 17:37                                         ` Mathieu Othacehe
2017-05-19 18:06                                           ` Marius Bakke
2017-05-20  8:25                                             ` Ludovic Courtès
2017-05-20  8:55                                               ` Mathieu Othacehe
2017-05-20  9:23                                               ` Marius Bakke
2017-05-20  9:36                                                 ` Ludovic Courtès
2017-05-20  9:36                                             ` Mathieu Othacehe
2017-05-20 10:05                                               ` Marius Bakke
2017-05-19 21:21                                         ` Ludovic Courtès
2017-05-18 20:50                                   ` Ludovic Courtès
2017-05-18 22:52                                     ` Marius Bakke
2017-05-19  7:00                                       ` Ludovic Courtès
2017-05-17 21:21                             ` bug#26815: [PATCH v4 1/3] vm: Support arbitrary partition flags Ludovic Courtès
2017-05-07 15:28   ` bug#26815: [PATCH 1/3] vm: Add support for " Danny Milosavljevic
2017-05-08 14:43   ` Ludovic Courtès
2017-05-08 15:55   ` Maxim Cournoyer
2017-05-08 21:41   ` Danny Milosavljevic
2017-05-07 15:02 ` bug#26815: [PATCH 0/3] Hybrid UEFI disk image Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170507172656.55edb3e9@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=26815@debbugs.gnu.org \
    --cc=mbakke@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).