Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 2b6d57de11205d1e4ec8b18312057c35 > files > 231

initng-ifiles-0.1.5-4.fc12.i686.rpm

#!/sbin/itype
# This is a i file, used by initng parsed by install_service

# NAME:
# DESCRIPTION:
# WWW:

service system/keymaps {
	need = system/bootmisc;
	use = system/sysctl;

	env ttydev = /dev/tty;
	env_file = /etc/sysconfig/keyboard;

	script start = {
		[ -n "${KEYTABLE}" -a -d "/lib/kbd/keymaps" ] && KEYMAP="${KEYTABLE}.map"
		if [ -e /etc/console/boottime.kmap.gz ]
		then
			/bin/loadkeys -q /etc/console/boottime.kmap.gz >/dev/null 2>&1
			exit 0
		fi

		WINDOWKEYS_KEYMAP=

		# Force linux keycodes for PPC.
		[ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ] && \
			echo 1 >/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes

		# New kbd support.
		if [ -x /bin/loadkeys ]
		then
			[ "${SET_WINDOWKEYS}" = "yes" ] && WINDOWKEYS_KEYMAP="windowkeys"
			/bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} ${EXTENDED_KEYMAPS} >/dev/null 2>&1
		else
			echo "/bin/loadkeys not found" >&2
			exit 1
		fi

		# Set terminal encoding to either ASCII or UNICODE.
		# See utf-8(7) for more information.
		termencoding=
		if [ "${UNICODE}" = "yes" ]
		then
			dumpkey_opts=""
			[ -n "${DUMPKEYS_CHARSET}" ] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}"
			/usr/bin/kbd_mode -u
			/usr/sbin/dumpkeys ${dumpkey_opts} | loadkeys --unicode
			termencoding='\033%%G'
		else
			termencoding='\033(K'
		fi

		for n in `/usr/bin/seq 1 11`
		do
			printf "${termencoding}" >${ttydev}${n}
		done
	};
}