Skip to content

Commit 86a6158

Browse files
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 <jonathon.hall@puri.sm>
1 parent c00c036 commit 86a6158

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

initrd/bin/oem-factory-reset

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ if [[ "$SKIP_BOOT" == "n" ]]; then
13761376
fi
13771377

13781378
# passphrases set to be empty first
1379-
passphrases="\n"
1379+
passphrases=""
13801380

13811381
# Prepare whiptail output of configured secrets
13821382
if [ -n "$luks_new_Disk_Recovery_Key_passphrase" -o -n "$luks_new_Disk_Recovery_Key_passphrase_desired" ]; then
@@ -1406,14 +1406,11 @@ fi
14061406

14071407
# Show configured secrets in whiptail and loop until user confirms qr code was scanned
14081408
while true; do
1409-
whiptail --msgbox "
1410-
$(echo -e "$passphrases" | fold -w $((WIDTH - 5)))" \
1409+
whiptail --msgbox "$(echo -e "$passphrases" | fold -w $((WIDTH - 5)))" \
14111410
$HEIGHT $WIDTH --title "Configured secrets"
1412-
# strip the initial newline of passphrases
1413-
qr_code=$(echo -e "$passphrases" | sed '1s/^\n//')
14141411
#Tell user to scan the QR code containing all configured secrets
14151412
echo -e "\nScan the QR code below to save the secrets to a secure location"
1416-
qrenc "$qr_code"
1413+
qrenc "$(echo -e "$passphrases")"
14171414
# Prompt user to confirm scanning of qrcode on console prompt not whiptail: y/n
14181415
echo -e -n "Please confirm you have scanned the QR code above and/or written down the secrets? [y/N]: "
14191416
read -n 1 prompt_output

0 commit comments

Comments
 (0)