#!/bin/sh ### BEGIN INIT INFO # Provides: keyboard-setup # Required-Start: mountkernfs # Required-Stop: # Should-Start: keymap udev # X-Start-Before: checkroot # Default-Start: S # Default-Stop: # X-Interactive: true # Short-Description: Set preliminary keymap # Description: Set the console keyboard as early as possible # so during the file systems checks the administrator # can interact. At this stage of the boot process # only the ASCII symbols are supported. ### END INIT INFO set -e # This script is not used by keyboard-configuration. It is used # jointly by console-setup and console-setup-mini test -f /bin/setupcon || exit 0 if test -f /etc/default/locale { # In order to permit auto-detection of the charmap when # console-setup-mini operates without configuration file. source /etc/default/locale export LANG } if test -f /lib/lsb/init-functions { source /lib/lsb/init-functions } else { proc log_action_begin_msg { echo -n "$ifsjoin(Argv)... " } proc log_action_end_msg { if test $1 -eq 0 { echo done. } else { echo failed. } } } matchstr $1 { stop|status { # keyboard-setup isn't a daemon } start|force-reload|restart|reload { # If plymouth is running, then the console may be in raw mode and # loadkeys will do confusing things to the keymap, so don't try. if ! type plymouth >/dev/null || ! plymouth --ping { log_action_begin_msg "Setting preliminary keymap" if setupcon -k --force !2 >/dev/null { log_action_end_msg 0 } else { log_action_end_msg $Status } } } * { echo 'Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop|status}' exit 1 } } exit 0 (CommandList children: [ (C {(set)} {(-e)}) (AndOr children:[(C {(test)} {(-f)} {(/bin/setupcon)})(C {(exit)} {(0)})] op_id:Op_DPipe) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(/etc/default/locale)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(.)} {(/etc/default/locale)}) (C {(export)} {(LANG)})] spids: [-1 85] ) ] spids: [-1 105] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(/lib/lsb/init-functions)} {(Lit_Other "]")}) terminator: ) ] action: [(C {(.)} {(/lib/lsb/init-functions)})] spids: [-1 119] ) ] else_action: [ (FuncDef name: log_action_begin_msg body: (BraceGroup children: [(C {(echo)} {(-n)} {(DQ ($ VSub_At "$@") ("... "))})] spids: [134] ) spids: [129 133] ) (FuncDef name: log_action_end_msg body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Number "$1"))} {(-eq)} {(0)} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(echo)} {(done.)})] spids: [-1 174] ) ] else_action: [(C {(echo)} {(failed.)})] spids: [183 191] ) ] spids: [156] ) spids: [151 155] ) ] spids: [126 196] ) (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list:[{(stop)}{(status)}] spids:[208211218-1]) (case_arm pat_list: [{(start)} {(force-reload)} {(restart)} {(reload)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (Pipeline children: [ (SimpleCommand words: [{(type)} {(plymouth)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [247] ) ] ) ] negated: True ) (Pipeline children: [(C {(plymouth)} {(--ping)})] negated: True ) ] op_id: Op_DPipe ) terminator: ) ] action: [ (C {(log_action_begin_msg)} {(DQ ("Setting preliminary keymap"))}) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(setupcon)} {(-k)} {(--force)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [277] ) ] ) terminator: ) ] action: [(C {(log_action_end_msg)} {(0)})] spids: [-1 281] ) ] else_action: [(C {(log_action_end_msg)} {($ VSub_QMark "$?")})] spids: [289 297] ) ] spids: [-1 259] ) ] spids: [-1 300] ) ] spids: [221 228 303 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(echo)} { (SQ < "Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop|status}" > ) } ) (C {(exit)} {(1)}) ] spids: [306 307 322 -1] ) ] spids: [199 205 324] ) (C {(exit)} {(0)}) ] )