void-packages/srcpkgs/xbps-casper/files/scripts/casper-bottom/11keymap

44 lines
660 B
Plaintext
Raw Normal View History

#! /bin/sh
PREREQ=""
DESCRIPTION="Setting up system keymap"
. /scripts/casper-functions
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
log_begin_msg "$DESCRIPTION"
# commandline
for x in $(cat /proc/cmdline); do
case $x in
keymap=*)
keymap=${x#keymap=}
set_keymap="true"
;;
esac
done
if [ "${set_keymap}" ]; then
sed -i -e "s|qwerty/us|qwerty/${keymap}|" \
"${rootmnt}/etc/conf.d/keymaps"
fi
if [ -f "${rootmnt}/etc/hal/fdi/policy/10-keymap.fdi" ]; then
sed -i -e "s|>us<|>${keymap}<|" \
${rootmnt}/etc/hal/fdi/policy/10-keymap.fdi
fi
log_end_msg