- Package:
- console-setup
- Source:
- console-setup
- Submitter:
- Pavel Samsonov
- Date:
- 2024-07-12 08:42:02 UTC
- Severity:
- normal
- Tags:
Dear Maintainer, The /etc/init.d/console-setup.sh startup script does not change the system console font if the plymouth graphic splash screen is enabled at startup.
Still reproducible on testing. Here is the deal: Console setup is supposed to rely on cached scripts in /etc/console-setup (copied to initramfs). But plymouth starts in initramfs, occupies tty1, which causes setupcon to detect graphical mode and skip tty1. When scripts exist in /etc/console-setup, conditions in /lib/console-setup/console-setup.sh basically skip running setupcon if console-setup.service is launched first time during boot. To fix this: 1. add plymouth-exit.service to After= in console-setup.service 2. add plymouth exit detection to console-setup.sh--- /lib/console-setup/console-setup.sh 2023-02-09 01:33:51.198998809 +0300 +++ /lib/console-setup/console-setup.sh 2023-02-09 01:34:10.826464995 +0300 @@ -16,6 +16,10 @@ -nt /etc/default/keyboard ] || do_configure=yes [ /etc/console-setup/cached_setup_terminal.sh \ -nt /etc/default/console-setup ] || do_configure=yes + + # if plymouth-exit.service was launched and registered as active, + # plymouth has released tty1 for us to fix + systemctl is-active -q plymouth-quit.service && do_configure=yes ;; esac
Check if systemd is present to avoid errors if it is not.--- /lib/console-setup/console-setup.sh 2023-02-09 01:33:51.198998809 +0300 +++ /lib/console-setup/console-setup.sh 2023-02-09 01:59:48.786418782 +0300 @@ -16,6 +16,13 @@ -nt /etc/default/keyboard ] || do_configure=yes [ /etc/console-setup/cached_setup_terminal.sh \ -nt /etc/default/console-setup ] || do_configure=yes + + # if plymouth-exit.service was launched, this means + # plymouth released tty1 for us to fix + command -v systemctl >/dev/null && \ + [ $(ps -p 1 -o comm=) == "systemd" ] && \ + systemctl is-active -q plymouth-quit.service && \ + do_configure=yes ;; esac Other than that I do not know how to quickly detect exited plymouth and properly order console-setup launch in a SysV boot. Maybe modify /etc/init.d/console-setup.sh to hold while plymouthd is running (with a timeout).
A bit more refined variant without ps:--- a/lib/console-setup/console-setup.sh 2024-02-09 17:45:38.000000000 +0300 +++ b/lib/console-setup/console-setup.sh 2024-02-14 01:15:24.413177808 +0300 @@ -16,6 +16,16 @@ -nt /etc/default/keyboard ] || do_configure=yes [ /etc/console-setup/cached_setup_terminal.sh \ -nt /etc/default/console-setup ] || do_configure=yes + + # if plymouth-exit.service was launched, this means + # plymouth released tty1 for us to fix + if [ -r /proc/1/comm ] && + [ "$(read -r INIT < /proc/1/comm ; echo "$INIT")" = "systemd" ] && + command -v systemctl >/dev/null && + systemctl is-active -q plymouth-quit.service + then + do_configure=yes + fi ;; esac
If plymouth password prompt is used during boot (i.e. root volume decryption from initramfs), just the patch above will not work, also need to add plymouth-quit.service to 'After' property in console-setup.service