All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josselin Poiret <dev@jpoiret.xyz>
To: grub-devel@gnu.org
Cc: Josselin Poiret <dev@jpoiret.xyz>
Subject: [PATCH 1/2] devmapper/getroot: Have devmapper recognize LUKS2
Date: Thu,  9 Dec 2021 18:38:52 +0100	[thread overview]
Message-ID: <20211209173853.30489-2-dev@jpoiret.xyz> (raw)
In-Reply-To: <20211209173853.30489-1-dev@jpoiret.xyz>

Changes UUID comparisons so that LUKS1 and LUKS2 are both recognized
as being LUKS cryptodisks.
---
 grub-core/osdep/devmapper/getroot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c
index 9ba5c9865..ad1daf9c8 100644
--- a/grub-core/osdep/devmapper/getroot.c
+++ b/grub-core/osdep/devmapper/getroot.c
@@ -138,7 +138,7 @@ grub_util_get_dm_abstraction (const char *os_dev)
       grub_free (uuid);
       return GRUB_DEV_ABSTRACTION_LVM;
     }
-  if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0)
+  if (strncmp (uuid, "CRYPT-LUKS", sizeof ("CRYPT-LUKS") - 1) == 0)
     {
       grub_free (uuid);
       return GRUB_DEV_ABSTRACTION_LUKS;
@@ -179,7 +179,7 @@ grub_util_pull_devmapper (const char *os_dev)
 	  grub_util_pull_device (subdev);
 	}
     }
-  if (uuid && strncmp (uuid, "CRYPT-LUKS1-", sizeof ("CRYPT-LUKS1-") - 1) == 0
+  if (uuid && strncmp (uuid, "CRYPT-LUKS", sizeof ("CRYPT-LUKS") - 1) == 0
       && lastsubdev)
     {
       char *grdev = grub_util_get_grub_dev (lastsubdev);
@@ -253,11 +253,11 @@ grub_util_get_devmapper_grub_dev (const char *os_dev)
       {
 	char *dash;
 
-	dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-');
+	dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS*-") - 1, '-');
 	if (dash)
 	  *dash = 0;
 	grub_dev = grub_xasprintf ("cryptouuid/%s",
-				   uuid + sizeof ("CRYPT-LUKS1-") - 1);
+				   uuid + sizeof ("CRYPT-LUKS*-") - 1);
 	grub_free (uuid);
 	return grub_dev;
       }
-- 
2.34.0



  reply	other threads:[~2021-12-09 17:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 17:38 [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2021-12-09 17:38 ` Josselin Poiret [this message]
2021-12-09 17:38 ` [PATCH 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2021-12-09 20:15 ` [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe Glenn Washburn
2021-12-11 12:29   ` [PATCH v2 " Josselin Poiret
2021-12-11 12:29     ` [PATCH v2 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-05-12 22:25       ` Glenn Washburn
2021-12-11 12:29     ` [PATCH v2 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-05-12 22:38       ` Glenn Washburn
2022-05-20 18:20         ` [PATCH v3 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-05-20 18:20           ` [PATCH v3 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-05-20 18:20           ` [PATCH v3 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-05-21  0:20             ` Glenn Washburn
2022-05-21  9:27               ` Josselin Poiret
2022-06-14 13:47               ` [PATCH v4 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-06-14 13:47                 ` [PATCH v4 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-06-14 13:47                 ` [PATCH v4 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-06-14 18:28                   ` Glenn Washburn
2022-06-15  3:52                   ` Michael Chang
2022-06-14 18:31                 ` [PATCH v4 0/2] Have LUKS2 cryptomounts be useable with grub-probe Glenn Washburn
2022-06-15 10:01                   ` [PATCH v5 " Josselin Poiret
2022-06-15 10:02                     ` [PATCH v5 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-06-15 10:02                     ` [PATCH v5 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-07-05 11:09                       ` Daniel Kiper
2022-07-08 10:06                         ` [PATCH v6 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-07-08 10:06                           ` [PATCH v6 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-07-08 10:06                           ` [PATCH v6 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-11-08 15:07                             ` Fabian Vogt
2022-08-11 18:18                           ` [PATCH v6 0/2] Have LUKS2 cryptomounts be useable with grub-probe Glenn Washburn
2022-05-12 22:20     ` [PATCH v2 " Glenn Washburn
2022-05-13 11:58       ` Fabian Vogt

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

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

  git send-email \
    --in-reply-to=20211209173853.30489-2-dev@jpoiret.xyz \
    --to=dev@jpoiret.xyz \
    --cc=grub-devel@gnu.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.