Added keymap hook

This commit is contained in:
Your Name 2020-08-31 16:46:35 +02:00
parent d763f6ff37
commit 3f556526dd
3 changed files with 34 additions and 0 deletions

9
config
View File

@ -60,6 +60,8 @@
# hooks="eudev lvm luks" will use eudev as device manager and support booting LUKS on LVM
# hooks="mdev luks lvm" will use mdev as device manager and support booting LVM on LUKS
# hooks="systemd-udevd luks" will use systemd-udevd as device manager and support booting only LUKS
# hooks="keymap" will first load the keymap set at keymap_path.
# Note: If you use encryption, be sure to load this hook before the others
# hooks="proc" will use CONFIG_UEVENT_HELPER as device manager
# and so on...
#
@ -102,3 +104,10 @@
# luks_opts="root=/dev/sda1,discard=1"
#
#luks_opts=""
# keymap path
#
# path that will be passed to loadkmap
# example - keymap_path="/usr/share/bkeymaps/us/us.bmap"
#
#keymap_path=""

13
hooks/keymap/keymap Normal file
View File

@ -0,0 +1,13 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# false positive
# shellcheck disable=2154
#
# handle_keymap()
{
print "configuring keymap"
copy_file "$keymap_path" "${keymap_path%/*}" 644 0
copy_binary loadkmap
}

12
hooks/keymap/keymap.init Normal file
View File

@ -0,0 +1,12 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# false positive
# shellcheck disable=2154
#
# run_keymap()
{
[ "$break" = keymap ] && { print "break before run_keymap()"; sh; }
loadkmap < "$keymap_path"
}