From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 55407@debbugs.gnu.org
Subject: [bug#55407] [PATCH] system: Improve warning when using LUKS mapped devices without UUIDs.
Date: Wed, 18 May 2022 22:44:57 +0200 [thread overview]
Message-ID: <87ee0q1sfq.fsf@gnu.org> (raw)
In-Reply-To: <20220514060532.1011-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 14 May 2022 02:05:32 -0400")
Hi!
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
> This corrects two problems with the previous mapped devices warning:
>
> 1. It wasn't clear how to correct the situation.
> 2. The output would be repeated twice, as the procedure is called
> twice during a system reconfigure.
>
> * gnu/system.scm (operating-system-bootloader-crypto-devices): Memoize
> procedure. Produce a single message for the combined problematic devices.
> Add a hint to help users fix the warning.
[...]
> +(define operating-system-bootloader-crypto-devices
> + (mlambda (os) ;to avoid duplicated output
Should be ‘mlambdaq’ so that OS is compared with ‘eq?’, which is cheaper
and better corresponds to what we want to achieve here.
> + (receive (uuid-crypto-devices non-uuid-crypto-devices)
> + (partition (compose uuid? mapped-device-source) luks-devices)
I suggest using ‘let’ from (srfi srfi-71) for consistency.
> + (when (not (null? non-uuid-crypto-devices))
> + (warning (N_ "\
> +the following mapped device may not be mounted by the bootloader: ~s
> +hint: specify the mapped device source via its LUKS UUID.~%"
> + "\
> +the following mapped devices may not be mounted by the bootloader: ~s
> +hint: specify the mapped device sources via their LUKS UUID.~%"
> + (length non-uuid-crypto-devices))
> + (map mapped-device-source non-uuid-crypto-devices)))
By convention, warnings should fit on a single line and not be full
sentences.
If we emit one warning per mapped device, we can report the source
location using:
(warning (mapped-device-location dev) (G_ "mapped device …"))
Given that we have location info, it might be better to report one
warning per device?
Last, hints should be reported either with ‘display-hint’ or with a
‘&fix-hint’ exception. The hint itself can be one or two paragraphs
using Texinfo markup.
All this should ensure consistent diagnostic reporting.
I hope this makes sense!
Thanks,
Ludo’.
next prev parent reply other threads:[~2022-05-18 20:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-14 6:05 [bug#55407] [PATCH] system: Improve warning when using LUKS mapped devices without UUIDs Maxim Cournoyer
2022-05-18 20:44 ` Ludovic Courtès [this message]
2022-05-21 4:17 ` bug#55407: " Maxim Cournoyer
2022-05-21 16:46 ` [bug#55407] " Ludovic Courtès
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=87ee0q1sfq.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=55407@debbugs.gnu.org \
--cc=maxim.cournoyer@gmail.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).