Fix early setting of font
This commit is contained in:
parent
c1d6bfc721
commit
431e8cc84f
@ -72,14 +72,9 @@ start() {
|
|||||||
if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ] ; then
|
if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ] ; then
|
||||||
mkdir -p "${RC_LIBDIR}"/console
|
mkdir -p "${RC_LIBDIR}"/console
|
||||||
|
|
||||||
# Pipe errors to null as maps may not be in use
|
for font in /usr/share/consolefonts/"${CONSOLEFONT}".* ; do : ; done
|
||||||
/bin/setfont -o "${RC_LIBDIR}"/console/font 2>/dev/null \
|
cp "${font}" "${RC_LIBDIR}"/console
|
||||||
|| rm -f "${RC_LIBDIR}"/console/font
|
echo "$(basename "${font}")" > "${RC_LIBDIR}"/console/font
|
||||||
/bin/setfont -om "${RC_LIBDIR}"/console/map 2>/dev/null \
|
|
||||||
|| rm -f "${RC_LIBDIR}"/console/map
|
|
||||||
/bin/setfont -ou "${RC_LIBDIR}"/console/unimap 2>/dev/null \
|
|
||||||
|| rm -f "${RC_LIBDIR}"/console/unimap
|
|
||||||
|
|
||||||
if [ "${UNICODE}" = "yes" ] ; then
|
if [ "${UNICODE}" = "yes" ] ; then
|
||||||
touch "${RC_LIBDIR}"/console/unicode
|
touch "${RC_LIBDIR}"/console/unicode
|
||||||
else
|
else
|
||||||
|
@ -58,10 +58,10 @@ start() {
|
|||||||
[ -n "${DUMPKEYS_CHARSET}" ] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}"
|
[ -n "${DUMPKEYS_CHARSET}" ] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}"
|
||||||
|
|
||||||
dumpkeys ${dumpkey_opts} | loadkeys --unicode
|
dumpkeys ${dumpkey_opts} | loadkeys --unicode
|
||||||
termencoding='\033%%G'
|
termencoding="%G"
|
||||||
termmsg="UTF-8"
|
termmsg="UTF-8"
|
||||||
else
|
else
|
||||||
termencoding='\033(K'
|
termencoding="(K"
|
||||||
termmsg="ASCII"
|
termmsg="ASCII"
|
||||||
fi
|
fi
|
||||||
local n=1 ttydev=
|
local n=1 ttydev=
|
||||||
@ -70,7 +70,7 @@ start() {
|
|||||||
|| ttydev=/dev/tty
|
|| ttydev=/dev/tty
|
||||||
ebegin "Setting terminal encoding to" ${termmsg}
|
ebegin "Setting terminal encoding to" ${termmsg}
|
||||||
while [ ${n} -le "${RC_TTY_NUMBER}" ] ; do
|
while [ ${n} -le "${RC_TTY_NUMBER}" ] ; do
|
||||||
printf "${termencoding}" >"${ttydev}${n}"
|
printf "\033%s" "${termencoding}" >"${ttydev}${n}"
|
||||||
n=$((${n} + 1))
|
n=$((${n} + 1))
|
||||||
done
|
done
|
||||||
eend 0
|
eend 0
|
||||||
|
@ -87,22 +87,13 @@ get_KV() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Try and set a font as early as we can
|
# Try and set a font as early as we can
|
||||||
ttydev=${CONSOLE:-/dev/tty1}
|
termencoding="(K"
|
||||||
if [ ! -c "${ttydev}" ] ; then
|
[ -e "${RC_LIBDIR}"/console/unicode ] && termencoding="%G"
|
||||||
[ -c /dev/vc/1 ] && ttydev="/dev/vc/1" || ttydev=
|
printf "\033%s" "${termencoding}" >/dev/console
|
||||||
|
if [ -r "${RC_LIBDIR}"/console/font ] ; then
|
||||||
|
font="$(cat "${RC_LIBDIR}"/console/font)"
|
||||||
|
setfont -C /dev/console "${RC_LIBDIR}"/console/"${font}"
|
||||||
fi
|
fi
|
||||||
[ -r "${RC_LIBDIR}"/console/font ] \
|
|
||||||
&& /bin/setfont ${ttydev:+-C} ${ttydev} "${RC_LIBDIR}"/console/font
|
|
||||||
[ -r "${RC_LIBDIR}"/console/map ] \
|
|
||||||
&& /bin/setfont ${ttydev:+-C} ${ttydev} -m "${RC_LIBDIR}"/console/map
|
|
||||||
[ -r "${RC_LIBDIR}"/console/unimap ] \
|
|
||||||
&& /bin/setfont ${ttydev:+-C} ${ttydev} -u "${RC_LIBDIR}"/console/unimap
|
|
||||||
if [ -e "${RC_LIBDIR}"/console/unicode ] ; then
|
|
||||||
eval printf '"\033%%G"' ${ttydev:+>} ${ttydev}
|
|
||||||
else
|
|
||||||
eval printf '"\033(K"' ${ttydev:+>} ${ttydev}
|
|
||||||
fi
|
|
||||||
unset ttydev
|
|
||||||
|
|
||||||
. /etc/init.d/functions.sh
|
. /etc/init.d/functions.sh
|
||||||
. "${RC_LIBDIR}"/sh/init-functions.sh
|
. "${RC_LIBDIR}"/sh/init-functions.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user