diff mbox series

[isar-cip-core,v2] initramfs-crypt-hook: clarify resize error

Message ID 20250110160051.91196-1-Quirin.Gylstorff@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core,v2] initramfs-crypt-hook: clarify resize error | expand

Commit Message

Quirin Gylstorff Jan. 10, 2025, 4 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Add context to the resizing error as it is was unclear why the
encryption can not continue.

Also fix typo.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
Changes v2:
 - do not skip the check in case of optional encryption
 - add indication what failed to panic message
 - fix typo

 .../initramfs-crypt-hook/files/local-top-complete             | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Kiszka Jan. 10, 2025, 4:12 p.m. UTC | #1
On 10.01.25 17:00, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> Add context to the resizing error as it is was unclear why the
> encryption can not continue.
> 
> Also fix typo.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> Changes v2:
>  - do not skip the check in case of optional encryption
>  - add indication what failed to panic message
>  - fix typo
> 
>  .../initramfs-crypt-hook/files/local-top-complete             | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
> index 95d0a5d..b8a2f18 100644
> --- a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
> +++ b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
> @@ -82,14 +82,14 @@ reencrypt_existing_partition() {
>  EOF
>  		e2fsck -p -f "$1"
>  		if ! resize2fs "$1" "${reduced_size_in_kb}"; then
> -			panic "reencryption of filesystem $1 cannot continue!"
> +			panic "encryption of partition $1 cannot continue - resizing of the partition failed!"

reencrypt, encrypt - naming is a bit inconsistent, I suppose.
Technically, we are reencrypting, aren't we? Also, the partition flag is
called "reencrypt" as well.

Jan

>  		fi
>  		;;
>  	squashfs|swap|erofs|"")
>  		[ "$debug" = "y" ] && echo "skip disk resize as it is not supported or unnecessary for fstype: '$partition_fstype'"
>  		;;
>  	*)
> -		panic "cannot resize parition. unsupport fstype: $partition_fstype"
> +		panic "cannot resize partition. unsupport fstype: $partition_fstype"
>  		;;
>  	esac
>  	if [ -x /usr/sbin/cryptsetup-reencrypt ]; then
Quirin Gylstorff Jan. 10, 2025, 4:43 p.m. UTC | #2
On 1/10/25 17:12, Jan Kiszka wrote:
> On 10.01.25 17:00, Quirin Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> Add context to the resizing error as it is was unclear why the
>> encryption can not continue.
>>
>> Also fix typo.
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>> Changes v2:
>>   - do not skip the check in case of optional encryption
>>   - add indication what failed to panic message
>>   - fix typo
>>
>>   .../initramfs-crypt-hook/files/local-top-complete             | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> index 95d0a5d..b8a2f18 100644
>> --- a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> +++ b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
>> @@ -82,14 +82,14 @@ reencrypt_existing_partition() {
>>   EOF
>>   		e2fsck -p -f "$1"
>>   		if ! resize2fs "$1" "${reduced_size_in_kb}"; then
>> -			panic "reencryption of filesystem $1 cannot continue!"
>> +			panic "encryption of partition $1 cannot continue - resizing of the partition failed!"
> 
> reencrypt, encrypt - naming is a bit inconsistent, I suppose.
> Technically, we are reencrypting, aren't we? Also, the partition flag is
> called "reencrypt" as well.
> 

I will sent a v3 to use re-encrypt again.
Quirin

> Jan
> 
>>   		fi
>>   		;;
>>   	squashfs|swap|erofs|"")
>>   		[ "$debug" = "y" ] && echo "skip disk resize as it is not supported or unnecessary for fstype: '$partition_fstype'"
>>   		;;
>>   	*)
>> -		panic "cannot resize parition. unsupport fstype: $partition_fstype"
>> +		panic "cannot resize partition. unsupport fstype: $partition_fstype"
>>   		;;
>>   	esac
>>   	if [ -x /usr/sbin/cryptsetup-reencrypt ]; then
> 
>
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
index 95d0a5d..b8a2f18 100644
--- a/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
+++ b/recipes-initramfs/initramfs-crypt-hook/files/local-top-complete
@@ -82,14 +82,14 @@  reencrypt_existing_partition() {
 EOF
 		e2fsck -p -f "$1"
 		if ! resize2fs "$1" "${reduced_size_in_kb}"; then
-			panic "reencryption of filesystem $1 cannot continue!"
+			panic "encryption of partition $1 cannot continue - resizing of the partition failed!"
 		fi
 		;;
 	squashfs|swap|erofs|"")
 		[ "$debug" = "y" ] && echo "skip disk resize as it is not supported or unnecessary for fstype: '$partition_fstype'"
 		;;
 	*)
-		panic "cannot resize parition. unsupport fstype: $partition_fstype"
+		panic "cannot resize partition. unsupport fstype: $partition_fstype"
 		;;
 	esac
 	if [ -x /usr/sbin/cryptsetup-reencrypt ]; then