diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-07-23 20:49:41 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-07-24 11:43:04 +0000 |
commit | 5a9b44f15e450768f46e6601653ecda927e35c00 (patch) | |
tree | 9dc43d8cc79d18192ad2806178b857569fa40286 /main/openrc/consolefont.initd | |
parent | 5cd04102085f46700dfb0aa146d7876c939ee575 (diff) | |
download | aports-5a9b44f15e450768f46e6601653ecda927e35c00.tar.bz2 aports-5a9b44f15e450768f46e6601653ecda927e35c00.tar.xz |
main/openrc: ship saner consolefont service
Patch from Bernd Lauert
fixes #4457
Diffstat (limited to 'main/openrc/consolefont.initd')
-rw-r--r-- | main/openrc/consolefont.initd | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/main/openrc/consolefont.initd b/main/openrc/consolefont.initd new file mode 100644 index 0000000000..6f666373a3 --- /dev/null +++ b/main/openrc/consolefont.initd @@ -0,0 +1,36 @@ +#!/sbin/openrc-run + +description="Applies a font for the consoles." + +depend() { + need localmount + keyword -openvz -prefix -uml -vserver -xenu -lxc +} + +start() { + ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} + if [ -z "$consolefont" ] || [ "$ttyn" -le 0 ]; then + return + fi + + local params= + [ -n "$consoletranslation" ] && params="-m $consoletranslation" + + # The -m flag is only supported by kbds setfont implementation + [ -n "$unicodemap" ] && params="$params -u $unicodemap" + + local ttydev=/dev/tty + [ -d /dev/vc ] && ttydev=/dev/vc/ + + ebegin "Setting console font" + local i=1 ret=0 + while [ $i -le $ttyn ]; do + setfont "$consolefont" $params -C $ttydev$i || ret=1 + i=$(( i + 1 )) + done + eend $ret +} + +stop() { + return +} |