GNU bug report logs - #55407
[PATCH] system: Improve warning when using LUKS mapped devices without UUIDs.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sat, 14 May 2022 06:06:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 55407 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 55407 <at> debbugs.gnu.org
Subject: Re: bug#55407: [PATCH] system: Improve warning when using LUKS
 mapped devices without UUIDs.
Date: Wed, 18 May 2022 22:44:57 +0200
Hi!

Maxim Cournoyer <maxim.cournoyer <at> 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’.




This bug report was last modified 3 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.