summaryrefslogtreecommitdiff
path: root/sh.Linux
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-26 08:02:21 +0000
committerRoy Marples <roy@marples.name>2007-04-26 08:02:21 +0000
commit431e8cc84fe960ec91c3463493ce94df65ef41f2 (patch)
treea80360e058a6fc33d5040c3fc19541cf7023d87b /sh.Linux
parentc1d6bfc721eff57798317036004b0d87ce85a068 (diff)
downloadopenrc-431e8cc84fe960ec91c3463493ce94df65ef41f2.tar.gz
openrc-431e8cc84fe960ec91c3463493ce94df65ef41f2.tar.bz2
openrc-431e8cc84fe960ec91c3463493ce94df65ef41f2.tar.xz
Fix early setting of font
Diffstat (limited to 'sh.Linux')
-rwxr-xr-xsh.Linux/init.sh21
1 files changed, 6 insertions, 15 deletions
diff --git a/sh.Linux/init.sh b/sh.Linux/init.sh
index 616c98d..b8be723 100755
--- a/sh.Linux/init.sh
+++ b/sh.Linux/init.sh
@@ -87,22 +87,13 @@ get_KV() {
}
# Try and set a font as early as we can
-ttydev=${CONSOLE:-/dev/tty1}
-if [ ! -c "${ttydev}" ] ; then
- [ -c /dev/vc/1 ] && ttydev="/dev/vc/1" || ttydev=
+termencoding="(K"
+[ -e "${RC_LIBDIR}"/console/unicode ] && termencoding="%G"
+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
-[ -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
. "${RC_LIBDIR}"/sh/init-functions.sh