From 54baa37d4a808adc156393e9df5a9389ff6d94e0 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Fri, 6 Dec 2024 16:26:41 -0500 Subject: [PATCH] oem-factory-reset: Stop adding leading blank lines in 'passphrases' msg We're adding leading blank lines, which makes the prompt look odd and now have to be removed later. Just stop adding the leading blank lines. Signed-off-by: Jonathon Hall Signed-off-by: Thierry Laurion --- initrd/bin/oem-factory-reset | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/initrd/bin/oem-factory-reset b/initrd/bin/oem-factory-reset index 61356953..66340e65 100755 --- a/initrd/bin/oem-factory-reset +++ b/initrd/bin/oem-factory-reset @@ -1376,7 +1376,7 @@ if [[ "$SKIP_BOOT" == "n" ]]; then fi # passphrases set to be empty first -passphrases="\n" +passphrases="" # Prepare whiptail output of configured secrets if [ -n "$luks_new_Disk_Recovery_Key_passphrase" -o -n "$luks_new_Disk_Recovery_Key_passphrase_desired" ]; then @@ -1406,14 +1406,11 @@ fi # Show configured secrets in whiptail and loop until user confirms qr code was scanned while true; do - whiptail --msgbox " - $(echo -e "$passphrases" | fold -w $((WIDTH - 5)))" \ + whiptail --msgbox "$(echo -e "$passphrases" | fold -w $((WIDTH - 5)))" \ $HEIGHT $WIDTH --title "Configured secrets" - # strip the initial newline of passphrases - qr_code=$(echo -e "$passphrases" | sed '1s/^\n//') #Tell user to scan the QR code containing all configured secrets echo -e "\nScan the QR code below to save the secrets to a secure location" - qrenc "$qr_code" + qrenc "$(echo -e "$passphrases")" # Prompt user to confirm scanning of qrcode on console prompt not whiptail: y/n echo -e -n "Please confirm you have scanned the QR code above and/or written down the secrets? [y/N]: " read -n 1 prompt_output