locales=ru_RU.UTF-8
keyboard-layouts=us,ru
keyboard-options=grp:ctrl_shift_toggle,lctrl_shift_toggle
echo FRAMEBUFFER=y | sudo tee -a /etc/initramfs-tools/initramfs.conf sudo update-initramfs -u sudo reboot
cat /etc/default/console-setup
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE="Fixed"
FONTSIZE="8x16"
mkdir console-setup && cd console-setup apt-get download console-setup dpkg-deb -R *.deb ./
# console-font - set console font # # Set the console font, in case the similar udev rule races with Plymouth # and thus fails to do it. description "set console font" start on starting plymouth-splash task exec /lib/udev/console-setup-tty fbcon
... # Based on setupcon, but stripped down for use in a udev rule. ... . /etc/default/console-setup ... if [ "$1" = fbcon ]; then # Technically we have to wait for /dev/tty[1-6] to appear; but these are # created in vty_init, so I think it will always be early enough. If # I'm wrong, then the -w test will fail and we end up with the wrong # fonts on some virtual consoles; the user can run setupcon to fix it. for console in $ACTIVE_CONSOLES; do if [ -w "$console" ]; then setup_font "$console" fi done else if [ -w "$1" ]; then setup_unicode "$1" setup_font "$1" setup_keyboard_mode "$1" fi fi
setup_font () { # Set the font and ACM. setfont will silently do nothing for a console # in graphics mode. SETFONT_ARGS= if [ "$FONT" ]; then FONT="/etc/console-setup/${FONT##*/}" FONT="${FONT%.gz}" else FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf" fi if [ -f "$FONT" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }$FONT" fi if [ "$ACM" ]; then ACM="/etc/console-setup/${ACM##*/}" ACM="${ACM%.gz}" else ACM="/etc/console-setup/$CHARMAP.acm" fi if [ -f "$ACM" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }-m $ACM" fi if [ "$SETFONT_ARGS" ]; then setfont -C "$1" $SETFONT_ARGS fi }
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE="Fixed"
FONTSIZE="8x16"
ls /etc/console-setup/*.psf* /etc/console-setup/Uni2-Fixed16.psf.gz
if [ -f "$FONT" ];
if [ "$SETFONT_ARGS" ]; then setfont -C "$1" $SETFONT_ARGS fi
cd /etc/console-setup sudo gunzip -k Uni2-Fixed16.psf.gz
# setupcon -- setup the font and keyboard on the Linux console … ########################################################################### ### INITIALIZATION AND DEFAULT VALUES ########################################################################### … # CODESET [ "$CODESET" != guess ] || CODESET='' if [ -z "$CODESET" ]; then case "$CHARMAP" in UTF-8) CODESET=Uni2;; ARMSCII-8) CODESET=Armenian ;; CP1251) CODESET=CyrSlav ;; CP1255) CODESET=Hebrew ;; CP1256) CODESET=Arabic ;; GEORGIAN-ACADEMY) CODESET=Georgian ;; GEORGIAN-PS) CODESET=Georgian ;; IBM1133) CODESET=Lao ;; ISIRI-3342) CODESET=Arabic ;; ISO-8859-1) CODESET=Lat15 ;; ISO-8859-2) CODESET=Lat2 ;; ISO-8859-3) CODESET=Lat38 ;; ISO-8859-4) CODESET=Lat7 ;; # sometimes Lat15 ISO-8859-5) CODESET=CyrSlav ;; ISO-8859-6) CODESET=Arabic ;; ISO-8859-7) CODESET=Greek ;; ISO-8859-8) CODESET=Hebrew ;; ISO-8859-9) CODESET=Lat15 ;; ISO-8859-10) CODESET=Lat15 ;; ISO-8859-11) CODESET=Thai ;; ISO-8859-13) CODESET=Lat7 ;; ISO-8859-14) CODESET=Lat38 ;; ISO-8859-15) CODESET=Lat15 ;; ISO-8859-16) CODESET=Lat2 ;; KOI8-R) CODESET=CyrKoi ;; KOI8-U) CODESET=CyrKoi ;; TIS-620) CODESET=Thai ;; VISCII) CODESET=Vietnamese ;; *) if [ "$do_font" ]; then echo Unsupported charmap $CHARMAP >&2 exit 1 fi ;; esac if [ "$kernel" = freebsd ]; then # 512 character fonts are not supported on FreeBSD case "$CODESET" in Uni*|Vietnamese|Arabic|Ethiopian) CODESET=Lat15 ;; esac fi fi … # FONTSIZE if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then FONTSIZE=16 fi case "$FONTSIZE" in 8x*) FONTSIZE=${FONTSIZE#*x} ;; *x8) FONTSIZE=${FONTSIZE%x*} ;; *x*) a=${FONTSIZE%x*} b=${FONTSIZE#*x} if [ "$a" -lt "$b" ]; then FONTSIZE=${b}x${a} fi ;; esac
*x*) a=${FONTSIZE%x*} b=${FONTSIZE#*x}
(a is the first digit, b is the second), then the larger digit is rearranged forward: if [ "$a" -lt "$b" ]; then FONTSIZE=${b}x${a} fi
ls /usr/share/consolefonts/ … /usr/share/consolefonts/Uni2-Fixed13.psf.gz /usr/share/consolefonts/Uni2-Fixed14.psf.gz … /usr/share/consolefonts/Uni2-Terminus22x11.psf.gz /usr/share/consolefonts/Uni2-Terminus24x12.psf.gz … /usr/share/consolefonts/Uni2-TerminusBold28x14.psf.gz /usr/share/consolefonts/Uni2-TerminusBold32x16.psf.gz …
if [ -f "$FONT" ] || [ -f "$FONT.gz" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }$FONT" fi … if [ -f "$ACM" ] || [ -f "$ACM.gz" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }-m $ACM" fi
sudo apt-get install apt-file apt-file update apt-file search /lib/udev/console-setup-tty keyboard-configuration: /lib/udev/console-setup-tty
apt-get download keyboard-configuration dpkg-deb -R keyboard-configuration_1.108ubuntu9_all.deb ./
grep -rm 1 etc/default/console-setup ./ ./lib/udev/console-setup-tty:. /etc/default/console-setup ./usr/share/doc/keyboard-configuration/README.Debian:(/etc/default/keyboard and /etc/default/console-setup) perhaps it will ./usr/share/apport/package-hooks/source_console-setup.py: report, '/etc/default/console-setup', 'ConsoleSetup') ./usr/share/initramfs-tools/scripts/panic/console_setup:[ -r /etc/default/console-setup ] || exit 0 ./usr/share/initramfs-tools/scripts/init-top/console_setup:[ -r /etc/default/console-setup ] || exit 0 ./usr/share/initramfs-tools/hooks/console_setup:[ -r /etc/default/console-setup ] || exit 0 ./DEBIAN/config:OLDCONFIGFILE=/etc/default/console-setup
./lib/udev/console-setup-tty ./usr/share/initramfs-tools/scripts/panic/console_setup ./usr/share/initramfs-tools/scripts/init-top/console_setup ./usr/share/initramfs-tools/hooks/console_setup
./usr/share/initramfs-tools/scripts/panic/console_setup ./usr/share/initramfs-tools/scripts/init-top/console_setup
OPTION=FRAMEBUFFER
… CONFDIR="/etc/initramfs-tools" ... . "${CONFDIR}/initramfs.conf" … # add existant boot scripts for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \ -regextype posix-extended -regex '.*/[[:alnum:]\._-]+$' -type f); do option=$(sed '/^OPTION=/!d;$d;s/^OPTION=//;s/[[:space:]]*$//' "/usr/share/initramfs-tools/scripts/${b}") [ -z "${option}" ] || eval test -n \"\${$option}\" -a \"\${$option}\" != \"n\" || continue [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")" cp -p "/usr/share/initramfs-tools/scripts/${b}" \ "${DESTDIR}/scripts/$(dirname "${b}")/" done
OPTION=FRAMEBUFFER
cd /usr/share/initramfs-tools/scripts grep -rl FRAMEBUFFER ./ ./init-premount/brltty ./panic/plymouth ./init-bottom/plymouth ./init-top/keymap ./init-top/framebuffer ./init-top/console_setup ./init-top/brltty ./init-top/plymouth
./lib/udev/console-setup-tty ./usr/share/initramfs-tools/scripts/panic/console_setup ./usr/share/initramfs-tools/scripts/init-top/console_setup ./usr/share/initramfs-tools/hooks/console_setup
... CONFDIR="/etc/initramfs-tools" ... run_scripts_optional /usr/share/initramfs-tools/hooks run_scripts_optional "${CONFDIR}"/hooks
apt-get source keyboard-configuration sudo apt-get build-dep keyboard-configuration
grep -rl \$FONT ./ ./debian/font-switch ./debian/console-setup.config ./debian/console-setup.postinst ./debian/console-setup.initramfs-hook ./debian/console-setup.initramfs-top ./console-setup-tty ./setupcon
./debian/console-setup.initramfs-hook ./debian/console-setup.initramfs-top ./console-setup-tty ./setupcon
# CODESET [ "$CODESET" != guess ] || CODESET='' if [ -z "$CODESET" ]; then case "$CHARMAP" in UTF-8) CODESET=Uni2;; ARMSCII-8) CODESET=Armenian ;; CP1251) CODESET=CyrSlav ;; CP1255) CODESET=Hebrew ;; CP1256) CODESET=Arabic ;; GEORGIAN-ACADEMY) CODESET=Georgian ;; GEORGIAN-PS) CODESET=Georgian ;; IBM1133) CODESET=Lao ;; ISIRI-3342) CODESET=Arabic ;; ISO-8859-1) CODESET=Lat15 ;; ISO-8859-2) CODESET=Lat2 ;; ISO-8859-3) CODESET=Lat38 ;; ISO-8859-4) CODESET=Lat7 ;; # sometimes Lat15 ISO-8859-5) CODESET=CyrSlav ;; ISO-8859-6) CODESET=Arabic ;; ISO-8859-7) CODESET=Greek ;; ISO-8859-8) CODESET=Hebrew ;; ISO-8859-9) CODESET=Lat15 ;; ISO-8859-10) CODESET=Lat15 ;; ISO-8859-11) CODESET=Thai ;; ISO-8859-13) CODESET=Lat7 ;; ISO-8859-14) CODESET=Lat38 ;; ISO-8859-15) CODESET=Lat15 ;; ISO-8859-16) CODESET=Lat2 ;; KOI8-R) CODESET=CyrKoi ;; KOI8-U) CODESET=CyrKoi ;; TIS-620) CODESET=Thai ;; VISCII) CODESET=Vietnamese ;; *) ;; esac fi # FONTSIZE if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then FONTSIZE=16 fi case "$FONTSIZE" in 8x*) FONTSIZE=${FONTSIZE#*x} ;; *x8) FONTSIZE=${FONTSIZE%x*} ;; *x*) a=${FONTSIZE%x*} b=${FONTSIZE#*x} if [ "$a" -lt "$b" ]; then FONTSIZE=${b}x${a} fi ;; esac
... [ -r /etc/default/console-setup ] || exit 0 . /etc/default/console-setup [ "$ACTIVE_CONSOLES" ] || exit 0 # CODESET [ "$CODESET" != guess ] || CODESET='' if [ -z "$CODESET" ]; then ...
if [ -f "$FONT" ] || [ -f "$FONT.gz" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }$FONT" fi … if [ -f "$ACM" ] || [ -f "$ACM.gz" ]; then SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }-m $ACM" fi
dpkg-buildpackage -uc -b
sudo dpkg -i keyboard-configuration_*.deb sudo apt-mark hold keyboard-configuration
Source: https://habr.com/ru/post/281170/
All Articles