Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / lib / dpkg / info / | server ip : 172.67.156.115 your ip : 172.70.100.208 H O M E |
Filename | /var/lib/dpkg/info/console-setup.postinst |
Size | 5.26 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 09:50 |
Last modified | 29-Jan-2014 21:39 |
Last accessed | 06-Jul-2025 22:03 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/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 <<EOF
if [ -f /etc/default/keyboard ]; then
. /etc/default/keyboard
fi
######################################################################
# You can remove the lines that follow. They contain the contents of
# this file before version 1.47 of console-setup.
######################################################################
EOF
sed 's/^/# /' <$CONFIGFILE >>$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 <<EOF
if [ -f /etc/default/keyboard ]; then
. /etc/default/keyboard
fi
EOF
fi
# Ensure we do not mess up the config file's ownership and permissions.
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
for var in \
VERBOSE_OUTPUT ACTIVE_CONSOLES CHARMAP CODESET FONTFACE FONTSIZE
do
if ! grep "^ *${var}=" $CONFIGFILE >/dev/null; then
echo "${var}=" >>$CONFIGFILE
fi
done
if [ "$FONT" ] && ! grep "^ *FONT=" $CONFIGFILE >/dev/null; then
echo "FONT=" >>$CONFIGFILE
fi
if [ "$FONT_MAP" ] && ! grep "^ *FONT_MAP=" $CONFIGFILE >/dev/null; then
echo "FONT_MAP=" >>$CONFIGFILE
fi
if \
[ "$CONSOLE_MAP" ] \
&& ! grep "^ *CONSOLE_MAP=" $CONFIGFILE >/dev/null \
&& ! grep "^ *ACM=" $CONFIGFILE >/dev/null
then
echo "CONSOLE_MAP=" >>$CONFIGFILE
fi
sed \
-e "s|^ *VERBOSE_OUTPUT=.*|VERBOSE_OUTPUT=\"${VERBOSE_OUTPUT:-no}\"|" \
-e "s|^ *ACTIVE_CONSOLES=.*|ACTIVE_CONSOLES=\"${ACTIVE_CONSOLES:-/dev/tty[1-6]}\"|" \
-e "s|^ *FONT=.*|FONT=\"$FONT\"|" \
-e "s|^ *FONT_MAP=.*|FONT_MAP=\"$FONT_MAP\"|" \
-e "s|^ *CONSOLE_MAP=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
-e "s|^ *ACM=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
-e "s|^ *CHARMAP=.*|CHARMAP=\"$charmap\"|" \
-e "s|^ *CODESET=.*|CODESET=\"$codeset\"|" \
-e "s|^ *FONTFACE=.*|FONTFACE=\"$fontface\"|" \
-e "s|^ *FONTSIZE=.*|FONTSIZE=\"$fontsize\"|" \
<$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 <<EOF
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
EOF
fi
if type update-rc.d >/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
# Automatically added by dh_installinit
if [ -x "/etc/init.d/console-font" ]; then
if [ ! -e "/etc/init/console-font.conf" ]; then
update-rc.d console-font defaults >/dev/null
fi
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f console-font remove >/dev/null || exit $?
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/setvtrgb" ]; then
if [ ! -e "/etc/init/setvtrgb.conf" ]; then
update-rc.d setvtrgb defaults >/dev/null
fi
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f setvtrgb remove >/dev/null || exit $?
# End automatically added section
if type update-initramfs >/dev/null 2>&1; then
update-initramfs -u
fi
exit 0
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 <<EOF
if [ -f /etc/default/keyboard ]; then
. /etc/default/keyboard
fi
######################################################################
# You can remove the lines that follow. They contain the contents of
# this file before version 1.47 of console-setup.
######################################################################
EOF
sed 's/^/# /' <$CONFIGFILE >>$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 <<EOF
if [ -f /etc/default/keyboard ]; then
. /etc/default/keyboard
fi
EOF
fi
# Ensure we do not mess up the config file's ownership and permissions.
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
for var in \
VERBOSE_OUTPUT ACTIVE_CONSOLES CHARMAP CODESET FONTFACE FONTSIZE
do
if ! grep "^ *${var}=" $CONFIGFILE >/dev/null; then
echo "${var}=" >>$CONFIGFILE
fi
done
if [ "$FONT" ] && ! grep "^ *FONT=" $CONFIGFILE >/dev/null; then
echo "FONT=" >>$CONFIGFILE
fi
if [ "$FONT_MAP" ] && ! grep "^ *FONT_MAP=" $CONFIGFILE >/dev/null; then
echo "FONT_MAP=" >>$CONFIGFILE
fi
if \
[ "$CONSOLE_MAP" ] \
&& ! grep "^ *CONSOLE_MAP=" $CONFIGFILE >/dev/null \
&& ! grep "^ *ACM=" $CONFIGFILE >/dev/null
then
echo "CONSOLE_MAP=" >>$CONFIGFILE
fi
sed \
-e "s|^ *VERBOSE_OUTPUT=.*|VERBOSE_OUTPUT=\"${VERBOSE_OUTPUT:-no}\"|" \
-e "s|^ *ACTIVE_CONSOLES=.*|ACTIVE_CONSOLES=\"${ACTIVE_CONSOLES:-/dev/tty[1-6]}\"|" \
-e "s|^ *FONT=.*|FONT=\"$FONT\"|" \
-e "s|^ *FONT_MAP=.*|FONT_MAP=\"$FONT_MAP\"|" \
-e "s|^ *CONSOLE_MAP=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
-e "s|^ *ACM=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
-e "s|^ *CHARMAP=.*|CHARMAP=\"$charmap\"|" \
-e "s|^ *CODESET=.*|CODESET=\"$codeset\"|" \
-e "s|^ *FONTFACE=.*|FONTFACE=\"$fontface\"|" \
-e "s|^ *FONTSIZE=.*|FONTSIZE=\"$fontsize\"|" \
<$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 <<EOF
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
EOF
fi
if type update-rc.d >/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
# Automatically added by dh_installinit
if [ -x "/etc/init.d/console-font" ]; then
if [ ! -e "/etc/init/console-font.conf" ]; then
update-rc.d console-font defaults >/dev/null
fi
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f console-font remove >/dev/null || exit $?
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/setvtrgb" ]; then
if [ ! -e "/etc/init/setvtrgb.conf" ]; then
update-rc.d setvtrgb defaults >/dev/null
fi
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f setvtrgb remove >/dev/null || exit $?
# End automatically added section
if type update-initramfs >/dev/null 2>&1; then
update-initramfs -u
fi
exit 0