Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 32111 | Differences between
and this patch

Collapse All | Expand All

(-)etc/rc.conf (+6 lines)
Lines 17-22 Link Here
17
EXTENDED_KEYMAPS=
17
EXTENDED_KEYMAPS=
18
#EXTENDED_KEYMAPS="backspace keypad euro"
18
#EXTENDED_KEYMAPS="backspace keypad euro"
19
19
20
# UNICODE specifies whether you want to have UNICODE support in the console.
21
# If you set it to yes, please make sure to set a UNICODE aware CONSOLEFONT 
22
# and KEYMAP
23
24
UNICODE="no"
25
20
# CONSOLEFONT specifies the default font that you'd like Linux to use on the
26
# CONSOLEFONT specifies the default font that you'd like Linux to use on the
21
# console.  You can find a good selection of fonts in /usr/share/consolefonts;
27
# console.  You can find a good selection of fonts in /usr/share/consolefonts;
22
# you shouldn't specify the trailing ".psf.gz", just the font name below.
28
# you shouldn't specify the trailing ".psf.gz", just the font name below.
(-)init.d/consolefont (-33 / +14 lines)
Lines 5-10 Link Here
5
5
6
depend() {
6
depend() {
7
	need localmount
7
	need localmount
8
	need keymaps    # sets up terminal encoding scheme
8
	after hotplug
9
	after hotplug
9
}
10
}
10
11
Lines 13-18 Link Here
13
	local param=
14
	local param=
14
	local sf_param=
15
	local sf_param=
15
	local retval=1
16
	local retval=1
17
	local ttydev=
18
	[ -d /dev/vc ] \
19
		&& ttydev=/dev/vc/ \
20
		|| ttydev=/dev/tty
16
	
21
	
17
	if [ -n "${CONSOLEFONT}" ]
22
	if [ -n "${CONSOLEFONT}" ]
18
	then
23
	then
Lines 23-32 Link Here
23
		fi
28
		fi
24
		
29
		
25
		# Actually setting font
30
		# Actually setting font
31
		local errmsg=""
32
		ebegin "Setting user font"
26
		if [ -x /bin/setfont ]
33
		if [ -x /bin/setfont ]
27
		then
34
		then
28
			ebegin "Setting user font"
29
30
			# We patched setfont to have --tty support ...
35
			# We patched setfont to have --tty support ...
31
			if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" -o \
36
			if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" -o \
32
			     -n "`setfont --help 2>&1 | grep -e '-C'`" ]
37
			     -n "`setfont --help 2>&1 | grep -e '-C'`" ]
Lines 40-84 Link Here
40
				
45
				
41
				for x in $(seq 1 "${RC_TTY_NUMBER}")
46
				for x in $(seq 1 "${RC_TTY_NUMBER}")
42
				do
47
				do
43
					# Using DEVFS ?
48
					/bin/setfont ${CONSOLEFONT} ${param} \
44
					if [ -e /dev/.devfsd ] || \
49
						${sf_param}/${ttydev}${x} >/dev/null
45
					   [ -e /dev/.udev -a -d /dev/vc ]
50
					retval=$?
46
					then
47
						/bin/setfont ${CONSOLEFONT} ${param} \
48
							${sf_param}/dev/vc/${x} >/dev/null
49
						retval=$?
50
					else
51
						/bin/setfont ${CONSOLEFONT} ${param} \
52
							${sf_param}/dev/tty${x} >/dev/null
53
						retval=$?
54
					fi
55
				done
51
				done
56
			else
52
			else
57
				/bin/setfont ${CONSOLEFONT} ${param} >/dev/null
53
				/bin/setfont ${CONSOLEFONT} ${param} >/dev/null
58
				retval=$?
54
				retval=$?
59
			fi
55
			fi
56
			errmsg="Failed to set user font"
60
		else
57
		else
61
			# No console program installed!
58
			# No console program installed!
62
			eend 1 "The setfont executable was not found"
59
			retval=1
63
			return 1
60
			errmsg="The setfont executable was not found"
64
		fi
65
66
		if [ "${retval}" -eq 0 ]
67
		then
68
			for x in $(seq 1 "${RC_TTY_NUMBER}")
69
			do
70
				# Using DEVFS ?
71
				if [ -e /dev/.devfsd ] || \
72
				   [ -e /dev/.udev -a -d /dev/vc ]
73
				then
74
					echo -ne "\033(K" >/dev/vc/${x}
75
				else
76
					echo -ne "\033(K" >/dev/tty${x}
77
				fi
78
			done
79
		fi
61
		fi
80
		
62
		eend ${retval} "${errmsg}"
81
		eend ${retval} "Failed to set user font"
82
	else
63
	else
83
		ebegin "Using the default console font"
64
		ebegin "Using the default console font"
84
		eend 0
65
		eend 0
(-)init.d/keymaps (-11 / +24 lines)
Lines 26-46 Link Here
26
		echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
26
		echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
27
	fi
27
	fi
28
28
29
	ebegin "Loading key mappings"
30
31
	# Enable unicode ...
32
	set -- ${KEYMAP}
33
	if [ "$1" = "-u" ]
34
	then
35
		/usr/bin/kbd_mode -u
36
		KEYMAP="${KEYMAP/-u}"
37
	fi
38
39
	# New kbd support ...
29
	# New kbd support ...
30
	ebegin "Loading key mappings"
40
	if [ -x /bin/loadkeys ]
31
	if [ -x /bin/loadkeys ]
41
	then
32
	then
42
		[ "${SET_WINDOWKEYS}" = "yes" ] && WINDOWKEYS_KEYMAP="windowkeys"
33
		[ "${SET_WINDOWKEYS}" = "yes" ] && WINDOWKEYS_KEYMAP="windowkeys"
43
		
44
		/bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} \
34
		/bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} \
45
		                 ${EXTENDED_KEYMAPS} >/dev/null
35
		                 ${EXTENDED_KEYMAPS} >/dev/null
46
	else
36
	else
Lines 48-53 Link Here
48
		return 1
38
		return 1
49
	fi
39
	fi
50
	eend $? "Error loading key mappings"
40
	eend $? "Error loading key mappings"
41
42
	# Enable unicode if requested ... see utf-8(7) for info
43
	local termencoding="" termmsg=""
44
	if [ "${UNICODE}" == "yes" ]
45
	then
46
		/usr/bin/kbd_mode -u
47
		dumpkeys | loadkeys --unicode
48
		termencoding='\033%G'
49
		termmsg="UTF-8"
50
	else
51
		termencoding='\033%@'
52
		termmsg="ASCII"
53
	fi
54
	local n ttydev=""
55
	[ -d /dev/vc ] \
56
		&& ttydev=/dev/vc/ \
57
		|| ttydev=/dev/tty
58
	ebegin "Setting terminal encoding to ${termmsg}"
59
	for n in $(seq 1 "${RC_TTY_NUMBER}")
60
	do
61
		echo -n -e ${termencoding} > ${ttydev}${n}
62
	done
63
	eend 0
51
}
64
}
52
65
53
66

Return to bug 32111