#!/bin/sh set -e # Source debconf library. . /usr/share/debconf/confmodule CONFIGDIR=/etc/console-setup CONFIGFILE=/etc/default/console-setup if [ "$1" = "configure" ]; then # Remove non-update-alternatives-maintained config file [ -f /etc/vtrgb ] && [ ! -h /etc/vtrgb ] && (md5sum /etc/vtrgb | grep -qs e7c707883505a6e15e6e42aedcab64a1) && rm -f /etc/vtrgb update-alternatives --remove vtrgb /usr/share/console-setup/vtrgb 2>/dev/null || true update-alternatives --install /etc/vtrgb vtrgb "$CONFIGDIR/vtrgb" 50 update-alternatives --install /etc/vtrgb vtrgb "$CONFIGDIR/vtrgb.vga" 20 db_get console-setup/codesetcode codeset="$RET" db_get console-setup/fontface47 fontface="$RET" db_metaget console-setup/use_system_font description if [ "$fontface" = "$RET" ]; then fontface='' fi db_get console-setup/fontsize fontsize="$RET" if [ -z "$fontface" ]; then fontsize='' fi db_get console-setup/charmap47 charmap="${RET:-UTF-8}" if [ ! -e $CONFIGFILE ]; then cat /usr/share/console-setup/console-setup >$CONFIGFILE || true fi . $CONFIGFILE || true CONSOLE_MAP=${CONSOLE_MAP:-$ACM} # If $CONFFILE is produced by an old version of console-setup or by a # new version of console-setup-mini if \ grep "^ *XKBLAYOUT=" $CONFIGFILE >/dev/null || \ ! grep "^ *CHARMAP=" $CONFIGFILE >/dev/null then cp -a $CONFIGFILE $CONFIGFILE.tmp cat /usr/share/console-setup/console-setup >$CONFIGFILE.tmp cat >>$CONFIGFILE.tmp <>$CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE fi # For compatibility with programs that expect console-setup-mini # to define XKB... variables in /etc/default/console-setup. if \ ! grep '^ *[.] */etc/default/keyboard' $CONFIGFILE >/dev/null then cat >>$CONFIGFILE <$CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE db_set console-setup/store_defaults_in_debconf_db true fi if type plymouth >/dev/null && plymouth --ping; then # setting the keymap breaks with plymouth in raw mode, and setting the # font will currently also break if on vgacon setupcon --save-only elif [ -d /lib/debian-installer ] || \ expr "$(fgconsole 2>/dev/null || true)" : '[1-6]$' >/dev/null; then setupcon --force --save else # setting the font corrupts X setupcon --save-only setupcon --force -k cat >&2 </dev/null; then # upstart transition to a single job, not entirely handled by debhelper # autoscripts update-rc.d -f keyboard-setup remove >/dev/null fi #DEBHELPER# if type update-initramfs >/dev/null 2>&1; then update-initramfs -u fi exit 0