You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uniformize vocabulary: LUKS TPM Disk Unlock Key & LUKS Disk Recovery Key
When playing with long fbwhiptail/whiptail messages, this commit played around the long string using fold.
'''
echo -e "This will replace the encrypted container content and its LUKS Disk Recovery Key.\n\nThe passphrase associated with this key will be asked from the user under the following conditions:\n 1-Every boot if no Disk Unlock Key was added to the TPM\n 2-If the TPM fails (hardware failure)\n 3-If the firmware has been tampered with/modified by the user\n\nThis process requires you to type the current LUKS Disk Recovery Key passphrase and will delete the LUKS TPM Disk Unlock Key slot, if set up, by setting a default boot LUKS key slot (1) if present.\n\nAt the next prompt, you may be asked to select which file corresponds to\nthe LUKS device container.\n\nHit Enter to continue." | fold -w 70 -s
'''
Which gave the exact output of what will be inside of the fbwhiptail prompt, fixed to 70 chars width:
'''
This will replace the encrypted container content and its LUKS Disk
Recovery Key.
The passphrase associated with this key will be asked from the user
under the following conditions:
1-Every boot if no Disk Unlock Key was added to the TPM
2-If the TPM fails (hardware failure)
3-If the firmware has been tampered with/modified by the user
This process requires you to type the current LUKS Disk Recovery Key
passphrase and will delete the LUKS TPM Disk Unlock Key slot, if set
up, by setting a default boot LUKS key slot (1) if present.
At the next prompt, you may be asked to select which file corresponds
to
the LUKS device container.
Hit Enter to continue.
'''
Therefore, for long prompts in the future, one can just deal with "\n 1-" alignments to be respected in prompts and have fold deal with cutting the length of strings properly.
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Copy file name to clipboardExpand all lines: initrd/bin/oem-factory-reset
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -626,7 +626,7 @@ generate_checksums() {
626
626
mount -o remount,rw /boot || whiptail_error_die "Unable to mount /boot"
627
627
fi
628
628
629
-
#Check if previous TPM Disk unlock Key was set
629
+
#Check if previous LUKS TPM Disk Unlock Key was set
630
630
if [ -e /boot/kexec_key_devices.txt ];then
631
631
TPM_DISK_ENCRYPTION_KEY_SET=1
632
632
fi
@@ -657,7 +657,7 @@ generate_checksums() {
657
657
fi
658
658
fi
659
659
660
-
# set default boot option only if no TPM Disk Unlock Key previously set
660
+
# set default boot option only if no LUKS TPM Disk Unlock Key previously set
661
661
if [ -z"$TPM_DISK_ENCRYPTION_KEY_SET" ];then
662
662
set_default_boot_option
663
663
fi
@@ -903,7 +903,7 @@ if [ "$use_defaults" == "n" -o "$use_defaults" == "N" ]; then
903
903
echo -e "\n"
904
904
fi
905
905
906
-
echo -e -n "Would you like to re-encrypt LUKS encrypted container and generate new Disk Recovery key?\n (Highly recommended if you didn't install the operating system yourself: this would prevent any LUKS backed up header to be restored to access encrypted data) [y/N]: "
906
+
echo -e -n "Would you like to re-encrypt LUKS encrypted container and generate new LUKS Disk Recovery Key?\n (Highly recommended if you didn't install the operating system yourself: this would prevent any LUKS backed up header to be restored to access encrypted data) [y/N]: "
907
907
read -n 1 prompt_output
908
908
echo
909
909
if [ "$prompt_output"=="y" \
@@ -1022,13 +1022,13 @@ if [ "$use_defaults" == "n" -o "$use_defaults" == "N" ]; then
1022
1022
if [ -n"$luks_new_Disk_Recovery_Key_passphrase_desired"-a-z"$luks_new_Disk_Recovery_Key_passphrase" ];then
1023
1023
# We catch here if changing LUKS Disk Recovery Key passphrase was desired
1024
1024
# but yet undone. This is if not being covered by the single password
1025
-
echo -e "\nEnter desired replacement for current Disk Recovery Key passphrase (At least 8 characters long):"
1025
+
echo -e "\nEnter desired replacement for current LUKS Disk Recovery Key passphrase (At least 8 characters long):"
1026
1026
while [[ ${#luks_new_Disk_Recovery_Key_passphrase}-lt 8 ]];do
1027
1027
{
1028
1028
read -r luks_new_Disk_Recovery_Key_passphrase
1029
1029
}
1030
1030
done
1031
-
#We test that current Disk Recovery Key passphrase is known prior of going further
1031
+
#We test that current LUKS Disk Recovery Key passphrase is known prior of going further
1032
1032
test_luks_current_disk_recovery_key_passphrase
1033
1033
echo -e "\n"
1034
1034
fi
@@ -1147,7 +1147,7 @@ if [[ "$SKIP_BOOT" == "n" ]]; then
1147
1147
fi
1148
1148
1149
1149
if [ -n"$luks_new_Disk_Recovery_Key_desired"-a-n"$luks_new_Disk_Recovery_Key_passphrase_desired" ];then
1150
-
#Reencryption of disk, disk recovery key and Disk Recovery Key passphrase change is requested
1150
+
#Reencryption of disk, LUKS Disk Recovery Key and LUKS Disk Recovery Key passphrase change is requested
0 commit comments