Fix var names
This commit is contained in:
		| @@ -1,19 +1,19 @@ | ||||
| # /etc/conf.d/consolefont | ||||
|  | ||||
| # CONSOLEFONT specifies the default font that you'd like Linux to use on the | ||||
| # 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. | ||||
| # To use the default console font, comment out the CONSOLEFONT setting below. | ||||
| # This setting is used by the /etc/init.d/consolefont script (NOTE: if you do | ||||
| # not want to use it, run "rc-update del consolefont" as root). | ||||
| CONSOLEFONT="default8x16" | ||||
| consolefont="default8x16" | ||||
|  | ||||
| # CONSOLETRANSLATION is the charset map file to use.  Leave commented to use | ||||
| # consoletranslation is the charset map file to use.  Leave commented to use | ||||
| # the default one.  Have a look in /usr/share/consoletrans for a selection of | ||||
| # map files you can use. | ||||
| #CONSOLETRANSLATION="8859-1_to_uni" | ||||
| #consoletranslation="8859-1_to_uni" | ||||
|  | ||||
| # UNICODEMAP is the unicode map file to use. Leave commented to use the | ||||
| # unicodemap is the unicode map file to use. Leave commented to use the | ||||
| # default one. Have a look in /usr/share/unimaps for a selection of map files | ||||
| # you can use. | ||||
| #UNICODEMAP="iso01" | ||||
| #unicodemap="iso01" | ||||
|   | ||||
| @@ -2,31 +2,22 @@ | ||||
|  | ||||
| # Use KEYMAP to specify the default console keymap.  There is a complete tree | ||||
| # of keymaps in /usr/share/keymaps to choose from. | ||||
|  | ||||
| KEYMAP="us" | ||||
|  | ||||
| keymap="us" | ||||
|  | ||||
| # Should we first load the 'windowkeys' console keymap?  Most x86 users will | ||||
| # say "yes" here.  Note that non-x86 users should leave it as "no". | ||||
|  | ||||
| SET_WINDOWKEYS="no" | ||||
|  | ||||
| windowkeys="no" | ||||
|  | ||||
| # The maps to load for extended keyboards.  Most users will leave this as is. | ||||
|  | ||||
| EXTENDED_KEYMAPS="" | ||||
| #EXTENDED_KEYMAPS="backspace keypad euro2" | ||||
|  | ||||
| extended_keymaps="" | ||||
| #extended_keymaps="backspace keypad euro2" | ||||
|  | ||||
| # Tell dumpkeys(1) to interpret character action codes to be  | ||||
| # from the specified character set. | ||||
| # This only matters if you set UNICODE="yes" in /etc/rc.conf. | ||||
| # This only matters if you set unicode="yes" in /etc/rc.conf. | ||||
| # For a list of valid sets, run `dumpkeys --help` | ||||
|  | ||||
| DUMPKEYS_CHARSET="" | ||||
|  | ||||
| dumpkeys_charset="" | ||||
|  | ||||
| # Some fonts map AltGr-E to the currency symbol ¤ instead of the Euro € | ||||
| # To fix this, set to "yes" | ||||
|  | ||||
| FIX_EURO="no" | ||||
| fix_euro="no" | ||||
|   | ||||
| @@ -37,17 +37,22 @@ start() { | ||||
| 	rm -rf "${RC_LIBDIR}"/console | ||||
|  | ||||
| 	case "${RC_SYS}" in | ||||
| 		UML|VPS|XEN) return 0 ;; | ||||
| 		UML|VPS|XEN) return 0;; | ||||
| 	esac | ||||
|  | ||||
| 	if [ -z "${CONSOLEFONT}" ] ; then | ||||
| 		ebegin $"Using the default console font" | ||||
| 	ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} | ||||
| 	consolefont=${consolefont:-${CONSOLEFONT}} | ||||
| 	unicodemap=${unicodemap:-${UNICODEMAP}} | ||||
| 	consoletranslation=${consoletranslation:-${CONSOLETRANSLATION}} | ||||
|  | ||||
| 	if [ -z "${consolefont}" ]; then | ||||
| 		ebegin "Using the default console font" | ||||
| 		eend 0 | ||||
| 		return 0 | ||||
| 	fi | ||||
|  | ||||
| 	if [ ${RC_TTY_NUMBER} -eq 0 ] ; then | ||||
| 		ebegin "Skipping font setup (RC_TTY_NUMBER == 0); you should disable this init.d" | ||||
| 	if [ "${ttyn}" = 0 ]; then | ||||
| 		ebegin "Skipping font setup (rc_tty_number == 0); you should disable this init.d" | ||||
| 		eend 0 | ||||
| 		return 0 | ||||
| 	fi | ||||
| @@ -55,11 +60,11 @@ start() { | ||||
| 	local x= param= sf_param= retval=1 | ||||
|  | ||||
| 	# Get additional parameters | ||||
| 	if [ -n "${CONSOLETRANSLATION}" ] ; then | ||||
| 		param="${param} -m ${CONSOLETRANSLATION}" | ||||
| 	if [ -n "${consoletranslation}" ]; then | ||||
| 		param="${param} -m ${consoletranslation}" | ||||
| 	fi | ||||
| 	if [ -n "${UNICODEMAP}" ] ; then | ||||
| 		param="${param} -u ${UNICODEMAP}" | ||||
| 	if [ -n "${unicodemap}" ]; then | ||||
| 		param="${param} -u ${unicodemap}" | ||||
| 	fi | ||||
|  | ||||
| 	# Set the console font | ||||
| @@ -70,7 +75,7 @@ start() { | ||||
| 		if [ -n "$(setfont --help 2>&1 | grep -e '--tty')" ] || \ | ||||
| 			[ -n "$(setfont --help 2>&1 | grep -e '-C')" ] | ||||
| 		then | ||||
| 			if [ -n "$(setfont --help 2>&1 | grep -e '--tty')" ] ; then | ||||
| 			if [ -n "$(setfont --help 2>&1 | grep -e '--tty')" ]; then | ||||
| 				sf_param="--tty=" | ||||
| 			else | ||||
| 				sf_param="-C " | ||||
| @@ -81,14 +86,14 @@ start() { | ||||
| 				|| ttydev=/dev/tty | ||||
|  | ||||
| 			x=1 | ||||
| 			while [ ${x} -le "${RC_TTY_NUMBER}" ] ; do | ||||
| 				/bin/setfont ${CONSOLEFONT} ${param} \ | ||||
| 			while [ ${x} -le ${ttyn} ]; do | ||||
| 				/bin/setfont ${consolefont} ${param} \ | ||||
| 					${sf_param}/${ttydev}${x} > /dev/null | ||||
| 				retval=$? | ||||
| 				x=$((${x} + 1)) | ||||
| 			done | ||||
| 		else | ||||
| 			/bin/setfont ${CONSOLEFONT} ${param} > /dev/null | ||||
| 			/bin/setfont ${consolefont} ${param} > /dev/null | ||||
| 			retval=$? | ||||
| 		fi | ||||
| 		errmsg="Failed to set user font" | ||||
| @@ -99,14 +104,14 @@ start() { | ||||
| 	eend ${retval} "${errmsg}" | ||||
|  | ||||
| 	# Store the last font so we can use it ASAP on boot | ||||
| 	if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ] ; then | ||||
| 	if [ ${retval} -eq 0 -a -w "${RC_LIBDIR}" ]; then | ||||
| 		mkdir -p "${RC_LIBDIR}"/console | ||||
|  | ||||
| 		for font in /usr/share/consolefonts/"${CONSOLEFONT}".* ; do : ; done | ||||
| 		for font in /usr/share/consolefonts/"${consolefont}".*; do :; done | ||||
| 		cp "${font}" "${RC_LIBDIR}"/console | ||||
| 		echo "$(basename "${font}")" > "${RC_LIBDIR}"/console/font | ||||
| 		if [ "${UNICODE}" = "yes" ] ; then | ||||
| 			echo > "${RC_LIBDIR}"/console/unicode | ||||
| 		if yesno ${unicode:-${UNICODE}} ; then | ||||
| 			printf "" > "${RC_LIBDIR}"/console/unicode | ||||
| 		else | ||||
| 			rm -f "${RC_LIBDIR}"/console/unicode | ||||
| 		fi | ||||
|   | ||||
| @@ -26,22 +26,18 @@ | ||||
|  | ||||
| description="Applies a keymap for the consoles." | ||||
|  | ||||
| ttyn=${rc_tty_number:-${RC_TTY_NUMBER}:-12} | ||||
| unicode=${unicode:-${UNICODE}} | ||||
| keymap=${keymap:-${KEYMAP}} | ||||
| extended_keymaps=${extended_keymaps:-${EXTENDED_KEYMAPS}} | ||||
| windowskeys=${windowskeys:-${SET_WINDOWSKEYS}}  | ||||
| fix_euro=${fix_euro:-${FIX_EURO}} | ||||
| dumpkeys_charset=${dumpkeys_charset:-${DUMPKEYS_CHARSET}} | ||||
|  | ||||
| depend() { | ||||
| 	need localmount | ||||
| } | ||||
|  | ||||
| checkconfig() { | ||||
| 	if [ -z "${KEYMAP}" ] ; then | ||||
| 		eerror "You need to setup KEYMAP in /etc/conf.d/keymaps first" | ||||
| 		return 1 | ||||
| 	fi | ||||
|  | ||||
| 	# Make sure user isn't using rc.conf anymore | ||||
| 	if grep -q "^KEYMAP=" /etc/rc.conf ; then | ||||
| 		ewarn "KEYMAP should not be set in /etc/rc.conf but in /etc/conf.d/keymaps" | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| start() { | ||||
| 	case "${RC_SYS}" in | ||||
| 		UML|VPS|XEN) | ||||
| @@ -51,37 +47,39 @@ start() { | ||||
| 			;; | ||||
| 	esac | ||||
|  | ||||
| 	local WINDOWKEYS_KEYMAP= LOADKEYS_UNI= | ||||
| 	if [ -z "${keymap}" ] ; then | ||||
| 		eerror "You need to setup keymap in /etc/conf.d/keymaps first" | ||||
| 		return 1 | ||||
| 	fi | ||||
|  | ||||
| 	local loadkeys_uni= wkeys=  | ||||
| 	local ttydev= n= | ||||
| 	[ -d /dev/vc ] \ | ||||
| 		&& ttydev=/dev/vc/ \ | ||||
| 		|| ttydev=/dev/tty | ||||
|  | ||||
| 	checkconfig || return 1 | ||||
|  | ||||
| 	# Force linux keycodes for PPC. | ||||
| 	if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ] ; then | ||||
| 		echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes | ||||
| 	fi | ||||
|  | ||||
| 	# Turn on unicode if user wants it | ||||
| 	if [ "${UNICODE}" = "yes" ]; then | ||||
| 	if yesno ${unicode}; then | ||||
| 		n=1 | ||||
| 		while [ ${n} -le "${RC_TTY_NUMBER}" ]; do | ||||
| 		while [ ${n} -le "${ttyn}" ]; do | ||||
| 			kbd_mode -u -C "${ttydev}${n}" | ||||
| 			n=$((${n} + 1)) | ||||
| 		done | ||||
| 		LOADKEYS_UNI="--unicode" | ||||
| 		loadkeys_uni="--unicode" | ||||
| 	fi | ||||
|  | ||||
| 	ebegin "Loading key mappings" | ||||
| 	if [ -x /bin/loadkeys ] ; then | ||||
| 		[ "${SET_WINDOWKEYS}" = "yes" ] && WINDOWKEYS_KEYMAP="windowkeys" | ||||
| 		loadkeys -q ${LOADKEYS_UNI} ${WINDOWKEYS_KEYMAP} ${KEYMAP} \ | ||||
| 			${EXTENDED_KEYMAPS} | ||||
| 		yesno ${windowskeys} && wkeys="windowkeys" | ||||
| 		loadkeys -q ${loadkeys_uni} ${wkeys} ${keymap} ${extended_keymaps}  | ||||
| 		eend $? "Error loading key mappings" | ||||
|  | ||||
| 		if [ "${FIX_EURO}" = "yes" ] ; then | ||||
| 		if yesno ${fix_euro}; then | ||||
| 			# Fix some fonts displaying the Euro, #173528. | ||||
| 			echo "altgr keycode 18 = U+20AC" | loadkeys -q | ||||
| 		fi | ||||
| @@ -93,11 +91,8 @@ start() { | ||||
| 	# Set terminal encoding to either ASCII or UNICODE. | ||||
| 	# See utf-8(7) for more information. | ||||
| 	local termencoding= termmsg= | ||||
| 	if [ "${UNICODE}" = "yes" ] ; then | ||||
| 		local dumpkey_opts= | ||||
| 		[ -n "${DUMPKEYS_CHARSET}" ] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}" | ||||
|  | ||||
| 		dumpkeys ${dumpkey_opts} | loadkeys --unicode | ||||
| 	if yesno ${unicode}; then | ||||
| 		dumpkeys ${dumpkeys_charset:+-c} ${dumpkeys_charset} | loadkeys --unicode | ||||
| 		termencoding="%G" | ||||
| 		termmsg="UTF-8" | ||||
| 	else | ||||
| @@ -107,12 +102,11 @@ start() { | ||||
|  | ||||
| 	ebegin "Setting terminal encoding to" ${termmsg} | ||||
| 	n=1 | ||||
| 	while [ ${n} -le "${RC_TTY_NUMBER}" ] ; do | ||||
| 	while [ ${n} -le "${ttyn}" ]; do | ||||
| 		printf "\033%s" "${termencoding}" >"${ttydev}${n}" | ||||
| 		n=$((${n} + 1)) | ||||
| 	done | ||||
| 	eend 0 | ||||
| } | ||||
|  | ||||
|  | ||||
| # vim:ts=4 | ||||
|   | ||||
| @@ -26,6 +26,8 @@ | ||||
|  | ||||
| description="Turns numlock on for the consoles." | ||||
|  | ||||
| ttyn=${rc_tty_number:-${RC_TTY_NUMBER}:-12} | ||||
|  | ||||
| depend() { | ||||
| 	need localmount | ||||
| } | ||||
| @@ -36,7 +38,7 @@ _setleds() { | ||||
| 	local dev=/dev/tty t= i=1 retval=0 | ||||
| 	[ -d /dev/vc ] && dev=/dev/vc/ | ||||
|  | ||||
| 	while [ ${i} -le ${RC_TTY_NUMBER:-11} ] ; do | ||||
| 	while [ ${i} -le ${ttyn} ] ; do | ||||
| 		setleds -D "$1"num < ${dev}${i} || retval=1 | ||||
| 		i=$((${i} + 1)) | ||||
| 	done | ||||
|   | ||||
		Reference in New Issue
	
	Block a user