From 62c8366d2029cd1f9fe7dbf069b7e9dfb2773949 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Fri, 6 Sep 2024 08:44:11 -0400 Subject: [PATCH] key-init: If time resets, tell user to set it, but allow skipping The 'warn' message was not very effective, because change-time.sh clears the screen right after. Prompt with whiptail instead, which also lets the user know what's happening before we drop them into a series of prompts. Let the user skip changing time if they really want to. While they usually should set the time, it's rather frustrating if Heads forces them to go through these prompts when they don't want to. Signed-off-by: Jonathon Hall Signed-off-by: Thierry Laurion --- initrd/bin/key-init | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/initrd/bin/key-init b/initrd/bin/key-init index 19e3d6f6..dcfaf529 100755 --- a/initrd/bin/key-init +++ b/initrd/bin/key-init @@ -1,6 +1,7 @@ #!/bin/bash set -e -o pipefail . /etc/functions +. /etc/gui_functions TRACE_FUNC @@ -9,8 +10,11 @@ TRACE_FUNC # Good system clock is required for GPG to work properly. # if system year is less then 2024, prompt user to set correct time if [ "$(date +%Y)" -lt 2024 ]; then - warn "System time is incorrect. Please set the correct time." - change-time.sh + if whiptail_warning --title "System Time Incorrect" \ + --yesno "The system time is incorrect. Please set the correct time." \ + 0 80 --yes-button Continue --no-button Skip --clear; then + change-time.sh + fi fi # Import user's keys if they exist