public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, Claudius Heine <ch@denx.de>,
	cip-dev@lists.cip-project.org
Subject: Re: [PATCH 3/5] initramfs-crypt-hook: use real device path in luksFormat case
Date: Thu, 27 Feb 2025 13:47:57 +0100	[thread overview]
Message-ID: <6a9c322c-cd7e-4cad-84b8-ecc91f2910d2@siemens.com> (raw)
In-Reply-To: <bbedfad1-fb7e-4664-a42d-c37f4f6b35be@siemens.com>



On 2/27/25 10:16, Jan Kiszka wrote:
> On 26.02.25 10:59, Claudius Heine wrote:
>> In the 'format' case the `$partition` variable is used instead of
>> `$part_device`, which is likely an error, because all other cases use
>> `$part_device`.
>>
>> `$part_device` is the real path to the block device, while `$partition`
>> is the 'name' of the partition in the `$PARITIONS` variable, as defined
>> in the recipe.
>>
>> This fixes an inconsistency, it shouldn't be a bug here, but could
>> result in bugs when this script is adapted in product layers, etc.
>>
>> Signed-off-by: Claudius Heine <ch@denx.de>
>> ---
>>   recipes-initramfs/initramfs-crypt-hook/files/local-top-complete | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> index f1aa0d7..b907ea7 100644
>> --- a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> +++ b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> @@ -254,7 +254,7 @@ for partition_set in $partition_sets; do
>>   		"format")
>>   			log_begin_msg "Encryption of ${part_device}"
>>   			/usr/sbin/cryptsetup luksFormat --batch-mode \
>> -				 --type luks2 "$partition" < "$tmp_key"
>> +				 --type luks2 "$part_device" < "$tmp_key"
>>   			enroll_tpm2_token "$part_device" "$tmp_key" "$tpm_device" "$tpm_key_algorithm" "$pcr_bank_hash_type"
>>   			open_tpm2_partition "$part_device" "$crypt_mount_name" "$tpm_device"
>>   			eval "${create_file_system_cmd} ${decrypted_part}"
> 
> This goes back to commit 98974a68ab9b, and there it is stated:
> 
> +       # clevis does not work with links in /dev/disk*
> +       part_device=$(readlink -f "$partition")
> 
> So this really looks like a pure consistency cleanup (but a valid one).
> Right, Quirin?
Yes.

Quirin
> 
> Jan
> 



  reply	other threads:[~2025-02-27 12:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26  9:59 [PATCH 0/5] Initramfs-crypt-hook patches, encryption on update Claudius Heine
2025-02-26  9:59 ` [PATCH 1/5] initramfs-crypt-hook: make sure that mount path exists Claudius Heine
2025-02-27  9:13   ` Jan Kiszka
2025-02-26  9:59 ` [PATCH 2/5] initramfs-crypt-hook: fix inconsistent whitespace Claudius Heine
2025-02-27  9:14   ` Jan Kiszka
2025-02-26  9:59 ` [PATCH 3/5] initramfs-crypt-hook: use real device path in luksFormat case Claudius Heine
2025-02-27  9:16   ` Jan Kiszka
2025-02-27 12:47     ` Quirin Gylstorff [this message]
2025-02-27 12:49   ` Jan Kiszka
2025-02-26  9:59 ` [PATCH 4/5] initramfs-crypt-hook: implement 'noencrypt' option Claudius Heine
2025-02-27  9:17   ` Jan Kiszka
2025-02-27  9:55     ` Claudius Heine
2025-02-27 12:48       ` Jan Kiszka
2025-02-27 13:16   ` [cip-dev] " Quirin Gylstorff
2025-02-27 14:04     ` Claudius Heine
2025-02-26  9:59 ` [PATCH 5/5] initramfs-crypt-hook: add 'format-if-empty' feature Claudius Heine

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=6a9c322c-cd7e-4cad-84b8-ecc91f2910d2@siemens.com \
    --to=quirin.gylstorff@siemens.com \
    --cc=ch@denx.de \
    --cc=cip-dev@lists.cip-project.org \
    --cc=jan.kiszka@siemens.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox