Merge pull request #14 from TheBrainScrambler/master

Keymap hook
This commit is contained in:
illiliti 2020-09-01 14:16:44 +03:00 committed by GitHub
commit 445208899a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"
}