Index: etc/rc.conf =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/etc/rc.conf,v --- etc/rc.conf 3 Oct 2004 09:13:02 -0000 1.27 +++ etc/rc.conf 15 Oct 2004 17:47:09 -0000 @@ -17,6 +17,12 @@ EXTENDED_KEYMAPS= #EXTENDED_KEYMAPS="backspace keypad euro" +# UNICODE specifies whether you want to have UNICODE support in the console. +# If you set it to yes, please make sure to set a UNICODE aware CONSOLEFONT +# and KEYMAP + +UNICODE="no" + # CONSOLEFONT specifies the default font that you'd like Linux to use on the # console. You can find a good selection of fonts in /usr/share/consolefonts; # you shouldn't specify the trailing ".psf.gz", just the font name below. Index: init.d/consolefont =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/init.d/consolefont,v --- init.d/consolefont 23 Aug 2004 06:39:41 -0000 1.24 +++ init.d/consolefont 15 Oct 2004 17:47:09 -0000 @@ -5,6 +5,7 @@ depend() { need localmount + need keymaps # sets up terminal encoding scheme after hotplug } @@ -13,6 +14,10 @@ local param= local sf_param= local retval=1 + local ttydev= + [ -d /dev/vc ] \ + && ttydev=/dev/vc/ \ + || ttydev=/dev/tty if [ -n "${CONSOLEFONT}" ] then @@ -23,10 +28,10 @@ fi # Actually setting font + local errmsg="" + ebegin "Setting user font" if [ -x /bin/setfont ] then - ebegin "Setting user font" - # We patched setfont to have --tty support ... if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" -o \ -n "`setfont --help 2>&1 | grep -e '-C'`" ] @@ -40,45 +45,21 @@ for x in $(seq 1 "${RC_TTY_NUMBER}") do - # Using DEVFS ? - if [ -e /dev/.devfsd ] || \ - [ -e /dev/.udev -a -d /dev/vc ] - then - /bin/setfont ${CONSOLEFONT} ${param} \ - ${sf_param}/dev/vc/${x} >/dev/null - retval=$? - else - /bin/setfont ${CONSOLEFONT} ${param} \ - ${sf_param}/dev/tty${x} >/dev/null - retval=$? - fi + /bin/setfont ${CONSOLEFONT} ${param} \ + ${sf_param}/${ttydev}${x} >/dev/null + retval=$? done else /bin/setfont ${CONSOLEFONT} ${param} >/dev/null retval=$? fi + errmsg="Failed to set user font" else # No console program installed! - eend 1 "The setfont executable was not found" - return 1 - fi - - if [ "${retval}" -eq 0 ] - then - for x in $(seq 1 "${RC_TTY_NUMBER}") - do - # Using DEVFS ? - if [ -e /dev/.devfsd ] || \ - [ -e /dev/.udev -a -d /dev/vc ] - then - echo -ne "\033(K" >/dev/vc/${x} - else - echo -ne "\033(K" >/dev/tty${x} - fi - done + retval=1 + errmsg="The setfont executable was not found" fi - - eend ${retval} "Failed to set user font" + eend ${retval} "${errmsg}" else ebegin "Using the default console font" eend 0 Index: init.d/keymaps =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/init.d/keymaps,v --- init.d/keymaps 16 Sep 2004 12:30:13 -0000 1.22 +++ init.d/keymaps 15 Oct 2004 17:47:09 -0000 @@ -26,21 +26,11 @@ echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes fi - ebegin "Loading key mappings" - - # Enable unicode ... - set -- ${KEYMAP} - if [ "$1" = "-u" ] - then - /usr/bin/kbd_mode -u - KEYMAP="${KEYMAP/-u}" - fi - # New kbd support ... + ebegin "Loading key mappings" if [ -x /bin/loadkeys ] then [ "${SET_WINDOWKEYS}" = "yes" ] && WINDOWKEYS_KEYMAP="windowkeys" - /bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} \ ${EXTENDED_KEYMAPS} >/dev/null else @@ -48,6 +38,29 @@ return 1 fi eend $? "Error loading key mappings" + + # Enable unicode if requested ... see utf-8(7) for info + local termencoding="" termmsg="" + if [ "${UNICODE}" == "yes" ] + then + /usr/bin/kbd_mode -u + dumpkeys | loadkeys --unicode + termencoding='\033%G' + termmsg="UTF-8" + else + termencoding='\033%@' + termmsg="ASCII" + fi + local n ttydev="" + [ -d /dev/vc ] \ + && ttydev=/dev/vc/ \ + || ttydev=/dev/tty + ebegin "Setting terminal encoding to ${termmsg}" + for n in $(seq 1 "${RC_TTY_NUMBER}") + do + echo -n -e ${termencoding} > ${ttydev}${n} + done + eend 0 }