3
# Provides: console-setup
4
# Required-Start: $remote_fs
6
# Should-Start: console-screen kbd
10
# Short-Description: Set console font and keymap
15
# This script is used jointly by console-setup and console-setup-mini.
16
# It belongs to keyboard-configuration because it is forbidden two
17
# different packages to share common configuration file.
19
test -f /bin/setupcon || exit 0
21
if [ -f /lib/lsb/init-functions ]; then
22
. /lib/lsb/init-functions
24
log_action_begin_msg () {
28
log_action_end_msg () {
29
if [ "$1" -eq 0 ]; then
37
# Are we running from init?
40
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
45
# console-setup isn't a daemon
47
start|force-reload|restart|reload)
48
if expr "$(fgconsole 2>/dev/null || true)" : '[1-6]$' >/dev/null && \
49
(! type plymouth >/dev/null || ! plymouth --ping); then
50
log_action_begin_msg "Setting up console font and keymap"
51
# Only use --save if we aren't in the boot sequence, to avoid
52
# slowing down the boot too much. Outside the boot sequence,
53
# this means that 'dpkg-reconfigure console-setup' automatically
54
# saves the font and keymap.
60
if setupcon --force $save; then
65
elif ! run_by_init; then
66
log_action_begin_msg "Saving console font and keymap for next boot"
67
if setupcon --save-only; then
75
echo 'Usage: /etc/init.d/console-setup {start|reload|restart|force-reload|stop}'