From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EGEfFRRbhWK+VAAAbAwnHQ (envelope-from ) for ; Wed, 18 May 2022 22:46:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SJMpFBRbhWLgVgEAG6o9tA (envelope-from ) for ; Wed, 18 May 2022 22:46:12 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CE4371EFB9 for ; Wed, 18 May 2022 22:46:11 +0200 (CEST) Received: from localhost ([::1]:34110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrQYc-000896-Bw for larch@yhetil.org; Wed, 18 May 2022 16:46:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrQYU-00088r-RT for guix-patches@gnu.org; Wed, 18 May 2022 16:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrQYU-0002Hu-Ix for guix-patches@gnu.org; Wed, 18 May 2022 16:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrQYU-00045p-Fo for guix-patches@gnu.org; Wed, 18 May 2022 16:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55407] [PATCH] system: Improve warning when using LUKS mapped devices without UUIDs. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 May 2022 20:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55407 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 55407@debbugs.gnu.org Received: via spool by 55407-submit@debbugs.gnu.org id=B55407.165290670815650 (code B ref 55407); Wed, 18 May 2022 20:46:02 +0000 Received: (at 55407) by debbugs.gnu.org; 18 May 2022 20:45:08 +0000 Received: from localhost ([127.0.0.1]:33736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrQXb-00044M-HK for submit@debbugs.gnu.org; Wed, 18 May 2022 16:45:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrQXZ-00043X-I1 for 55407@debbugs.gnu.org; Wed, 18 May 2022 16:45:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrQXU-0001yg-58; Wed, 18 May 2022 16:45:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ah6cdjFy/+jLac22KR5mtbK1Q70H+Hj1XR/yo7a8k54=; b=M60Edqn5/s2OBBk02p5T GciQfjOm3Dsc4RPAncG+BM45xHFpbaBeY6XvaxD+9uLTitzcRcZ4n6X/1eSUJwDbVFspFx1HI/YN5 TvnyFc3ELuGdxh2RfJUMzbrshJA7ymEL6UQKerNYLmB4/FWSQ7MD/oMAQgR8IMxE2RttZbGC0UPLX 82LTOSyFrTuloj7JAaqfCwHghakuslfUZEtTtz8ZByqY9pVO66cPvkdD6Wo6VyE68DZHmeSVA7aRE RKXxyuSbL14hWjDCFfKVtob58nM+G8kYgHGdwDOnjUj4SI4FTQda6kIpF4KsZLJe05KORe7v8V7WC dV2+UYNnz62C6A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49376 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrQXT-0002Sy-PK; Wed, 18 May 2022 16:44:59 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220514060532.1011-1-maxim.cournoyer@gmail.com> Date: Wed, 18 May 2022 22:44:57 +0200 In-Reply-To: <20220514060532.1011-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 14 May 2022 02:05:32 -0400") Message-ID: <87ee0q1sfq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652906771; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ah6cdjFy/+jLac22KR5mtbK1Q70H+Hj1XR/yo7a8k54=; b=tZTw+fpGB+C65fLapcaA0oHgMbEFCyRtRnapMyqtliU/Ibd7w4kZoPFu9Tkll/oJ1Oqpop j2AK7LFM7SU++v0vG2z2QpNr/UYMBPgwDdIuKrUE6DdPsC8C1gDRKbIrfbzd24OfHGYiNZ 0GKuQjMxt3ceiwjZFdjbO35HpqX9W49+M53OxxV2+3VtcN4aZNhSN1P06tlKhd1D/PbZB8 mZGAVOMRYlNkDHsAmtNzG3tx11iiiXye4QaV2D+1Uz51DypjBROzRRX3KGm6wHdxWlLRL8 M8S5qNUA8aPsdLV0b1YAbRcFM3nJOGoPZQyVANDbgvI+bYSB8c4J90D29u5B4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652906771; a=rsa-sha256; cv=none; b=XeW19gcwIdkCV4/TbxB+9Y1JyX0xkCrZWVe8KoO/JRkjRhc74lIkMfAKbgNMaCs5JexCOh 5eypznNZawNBfFQjM+n2hD3Q3TNoijD0WxKzFQcxs2z14u/3fecVNYWf0D38dBWNa+tAa7 Oym35j/S6KQI7jk2W47F7/IeAsDuNAvbl4IX9aMqrPFvJ/dc3RlXdPceGhWkmIAtkiE5r+ EDCv+r8mC40knWdrGzhKTaOqmyKx73UK5uqogpuLmbl5Oj41OAxa0gQ0JAyLUL+NZqWpzX AkDpNKQPl3MdXPXNXWql6Vw5AZ63MRcqEaydzFuFumSrbJjfvMemC5BKGBaG6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=M60Edqn5; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=M60Edqn5; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CE4371EFB9 X-Spam-Score: -4.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: g4DNCcStnaQv Hi! Maxim Cournoyer 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 =E2=80=98mlambdaq=E2=80=99 so that OS is compared with =E2=80=98e= q?=E2=80=99, 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 =E2=80=98let=E2=80=99 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 =E2=80=A6")) Given that we have location info, it might be better to report one warning per device? Last, hints should be reported either with =E2=80=98display-hint=E2=80=99 o= r with a =E2=80=98&fix-hint=E2=80=99 exception. The hint itself can be one or two p= aragraphs using Texinfo markup. All this should ensure consistent diagnostic reporting. I hope this makes sense! Thanks, Ludo=E2=80=99.