/usr/share/initramfs-tools/hooks/console_setup is in keyboard-configuration 1.178ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | #! /bin/sh -e
PREREQ="kbd|console_tools"
prereqs () {
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
[ -r /etc/default/keyboard ] || exit 0
[ -r /etc/default/console-setup ] || exit 0
. /etc/default/console-setup # also sources /etc/default/keyboard
# 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
# Copy console-setup configuration
mkdir -p "$DESTDIR/etc/default"
cp -p /etc/default/keyboard "$DESTDIR/etc/default"
cp -p /etc/default/console-setup "$DESTDIR/etc/default"
# Assume setupcon --save has been run
if [ -f "$FONT" ]; then
FONT="/etc/console-setup/${FONT##*/}"
FONT="${FONT%.gz}"
else
FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
fi
if [ -f "$FONT" ]; then
mkdir -p "$DESTDIR${FONT%/*}"
cp -p "$FONT" "$DESTDIR$FONT"
fi
if [ -f "$FONT.gz" ]; then
mkdir -p "$DESTDIR${FONT%/*}"
cp -p "$FONT.gz" "$DESTDIR$FONT.gz"
fi
if [ -f "$ACM" ]; then
ACM="/etc/console-setup/${ACM##*/}"
ACM="${ACM%.gz}"
else
ACM="/etc/console-setup/$CHARMAP.acm"
fi
if [ -f "$ACM" ]; then
mkdir -p "$DESTDIR${ACM%/*}"
cp -p "$ACM" "$DESTDIR$ACM"
fi
if [ -f "$ACM.gz" ]; then
mkdir -p "$DESTDIR${ACM%/*}"
cp -p "$ACM.gz" "$DESTDIR$ACM.gz"
fi
if [ -f "/etc/console-setup/cached_${CHARMAP}_del.kmap.gz" ]; then
mkdir -p "$DESTDIR/etc/console-setup"
cp -p "/etc/console-setup/cached_${CHARMAP}_del.kmap.gz" \
"$DESTDIR/etc/console-setup/cached_${CHARMAP}_del.kmap.gz"
fi
exit 0
a
|