www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre2/bin/cinit.install.service.keymap.c_keymap
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

43 lines
940 B
Bash

#!/bin/sh
# Nico Schottelius
# cinit: install keymap from environment setting
# Date: 2005-10-15
#
. $(dirname $0)/cinit.read-conf
set -e
if [ $# -ne 0 ]; then
echo "$(basename $0) (no args)"
exit 1
fi
if [ -z "$C_KEYMAP" ]; then
echo "Set C_KEPMAP to the wanted keymap."
exit 1
fi
if [ -d "${DESTDIR}/${CINIT_DIR}/local-tuning/keymap" ]; then
echo "Service keymap already exists."
exit 1
fi
BINARY_PATH=$($(dirname $0)/cinit.path-find loadkeys)
if [ $? -ne 0 ]; then
echo "Did not find binary loadkeys."
exit 1
fi
echo -n "Installing keymap to ${DESTDIR}/${CINIT_DIR}/local-tuning/keymap ..."
"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
"${DESTDIR}/${CINIT_DIR}/local-tuning/keymap"
ln -sf "$BINARY_PATH" "${DESTDIR}/${CINIT_DIR}/local-tuning/keymap/$C_ON"
echo "$C_KEYMAP" >> "${DESTDIR}/${CINIT_DIR}/local-tuning/keymap/$C_ON$C_PARAMS"
echo "finished."
exit 0