diff --git a/live/root/etc/systemd/system/agama-certificate-issue.service b/live/root/etc/systemd/system/agama-certificate-issue.service index 5623d363de..245aba998f 100644 --- a/live/root/etc/systemd/system/agama-certificate-issue.service +++ b/live/root/etc/systemd/system/agama-certificate-issue.service @@ -1,6 +1,5 @@ [Unit] Description=Generate issue file for Agama SSL certificate -Before=systemd-user-sessions.service [Service] Type=oneshot diff --git a/live/root/etc/systemd/system/live-password-dialog.service b/live/root/etc/systemd/system/live-password-dialog.service index 2e120642ca..f463684ce1 100644 --- a/live/root/etc/systemd/system/live-password-dialog.service +++ b/live/root/etc/systemd/system/live-password-dialog.service @@ -22,21 +22,28 @@ Before=serial-getty@ttyS1.service Before=serial-getty@ttyS2.service Before=serial-getty@ttysclp0.service -# start at the end to avoid overwriting the screen with systemd messages -After=agama.service -After=modprobe@drm.service - # kernel command line option ConditionKernelCommandLine=live.password_dialog [Service] Type=oneshot Environment=TERM=linux + +# disable the kernel output on the console ExecStartPre=dmesg --console-off +# disable the systemd status messages on the console +ExecStartPre=kill -SIGRTMIN+21 1 + ExecStart=live-password --dialog + +# reset the console state after closing the dialog otherwise the dialog +# content would stay on the screen +ExecStartPost=reset +# enable back the kernel output on the console ExecStartPost=dmesg --console-on -TTYReset=yes -TTYVHangup=yes +# enable back the systemd status messages on the console +ExecStartPost=kill -SIGRTMIN+20 1 + StandardInput=tty RemainAfterExit=true TimeoutSec=0 diff --git a/live/root/etc/systemd/system/live-password-systemd.service b/live/root/etc/systemd/system/live-password-systemd.service index 444d1ce9c1..eb81bae6c3 100644 --- a/live/root/etc/systemd/system/live-password-systemd.service +++ b/live/root/etc/systemd/system/live-password-systemd.service @@ -22,18 +22,24 @@ Before=serial-getty@ttyS1.service Before=serial-getty@ttyS2.service Before=serial-getty@ttysclp0.service -# start at the end to avoid overwriting the screen with systemd messages -After=agama.service -After=modprobe@drm.service - # kernel command line option ConditionKernelCommandLine=live.password_systemd [Service] Type=oneshot + +# disable the kernel output on the console ExecStartPre=dmesg --console-off +# disable the systemd status messages on the console +ExecStartPre=kill -SIGRTMIN+21 1 + ExecStart=live-password --systemd + +# enable back the kernel output on the console ExecStartPost=dmesg --console-on +# enable back the systemd status messages on the console +ExecStartPost=kill -SIGRTMIN+20 1 + StandardOutput=tty RemainAfterExit=true TimeoutSec=0 diff --git a/live/root/usr/bin/live-password b/live/root/usr/bin/live-password index 1d3f0b4ae6..76ebf390d9 100755 --- a/live/root/usr/bin/live-password +++ b/live/root/usr/bin/live-password @@ -16,22 +16,23 @@ TITLE="Set Login Password" # functions for entering the password in an interactive dialog confirm_exit() { - if dialog --backtitle "$BTITLE" --defaultno --yesno "Are you sure you want to cancel?" 5 40; then + # --keep-tite is not a misspelling of "title" + if dialog --keep-tite --backtitle "$BTITLE" --defaultno --yesno "Are you sure you want to cancel?" 5 40; then exit 1 fi } msg_box() { - dialog --backtitle "$BTITLE" --msgbox "$1" 6 30 + dialog --keep-tite --backtitle "$BTITLE" --msgbox "$1" 6 30 } ask_password() { - if ! PWD1=$(dialog --title "$TITLE" --backtitle "$BTITLE" --stdout --insecure --passwordbox "Password:" 8 40); then + if ! PWD1=$(dialog --keep-tite --title "$TITLE" --backtitle "$BTITLE" --stdout --insecure --passwordbox "Password:" 8 40); then confirm_exit ask_password fi - if ! PWD2=$(dialog --title "$TITLE" --backtitle "$BTITLE" --stdout --insecure --passwordbox "Verify Password:" 8 40); then + if ! PWD2=$(dialog --keep-tite --title "$TITLE" --backtitle "$BTITLE" --stdout --insecure --passwordbox "Verify Password:" 8 40); then confirm_exit ask_password fi