diff options
author | Christopher Fore <csfore@posteo.net> | 2024-04-11 11:22:34 -0400 |
---|---|---|
committer | Ben Kohler <bkohler@gentoo.org> | 2024-05-14 09:07:49 -0500 |
commit | 049026977a24a9400ee416996e78496f6c79f0b3 (patch) | |
tree | c66fba5905c6c28a0db18d42eb71120bf91a76ca /dracut | |
parent | init.d/autoconfig: allow nogui in addition to nox (diff) | |
download | livecd-tools-049026977a24a9400ee416996e78496f6c79f0b3.tar.gz livecd-tools-049026977a24a9400ee416996e78496f6c79f0b3.tar.bz2 livecd-tools-049026977a24a9400ee416996e78496f6c79f0b3.zip |
Add keymaps and Dracut module2.11
This will individually package the keymaps folder found in genkernel to
allow for easier conversion to using the Distribution Kernel in the
official live media.
Also due to recent events with regards to Xz and potential concerns
about adding binary files, the following command will verify the
checksums of the keymaps to the ones found in genkernel:
diff <(sha256sum lib/keymaps/* | awk '{print $1}') \
<(sha256sum path/to/genkernel/defaults/keymaps/* | awk '{print $1}')
There should be no output and an exit code of 0.
Genkernel commit tested on: 361810b23acd9452218368acecc7cc5262f00c74
Signed-off-by: Christopher Fore <csfore@posteo.net>
Closes: https://github.com/gentoo/livecd-tools/pull/1
Signed-off-by: Ben Kohler <bkohler@gentoo.org>
Diffstat (limited to 'dracut')
-rw-r--r-- | dracut/90dokeymap/choose-keymap.sh | 69 | ||||
-rw-r--r-- | dracut/90dokeymap/module-setup.sh | 14 | ||||
-rw-r--r-- | dracut/90dokeymap/parse-cmdline.sh | 7 |
3 files changed, 90 insertions, 0 deletions
diff --git a/dracut/90dokeymap/choose-keymap.sh b/dracut/90dokeymap/choose-keymap.sh new file mode 100644 index 0000000..34cb7d8 --- /dev/null +++ b/dracut/90dokeymap/choose-keymap.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +chooseKeymap() { + if [ $dokeymap -eq 1 ]; then + cat "/lib/keymaps/keymapList" + read -t 10 -p '<< Load keymap (Enter for default): ' keymap + case ${keymap} in + 1|azerty) keymap=azerty ;; + 2|be) keymap=be ;; + 3|bepo) keymap=bepo ;; + 4|bg) keymap=bg ;; + 5|br-a) keymap=br-a ;; + 6|br-l) keymap=br-l ;; + 7|by) keymap=by ;; + 8|cf) keymap=cf ;; + 9|colemak) keymap=colemak ;; + 10|croat) keymap=croat ;; + 11|cz) keymap=cz ;; + 12|de) keymap=de ;; + 13|dk) keymap=dk ;; + 14|dvorak) keymap=dvorak ;; + 15|es) keymap=es ;; + 16|et) keymap=et ;; + 17|fi) keymap=fi ;; + 18|fr) keymap=fr ;; + 19|gr) keymap=gr ;; + 20|hu) keymap=hu ;; + 21|il) keymap=il ;; + 22|is) keymap=is ;; + 23|it) keymap=it ;; + 24|jp) keymap=jp ;; + 25|la) keymap=la ;; + 26|lt) keymap=lt ;; + 27|mk) keymap=mk ;; + 28|nl) keymap=nl ;; + 29|no) keymap=no ;; + 30|pl) keymap=pl ;; + 31|pt) keymap=pt ;; + 32|ro) keymap=ro ;; + 33|ru) keymap=ru ;; + 34|se) keymap=se ;; + 35|sf|ch*) keymap=sf ;; + 36|sg) keymap=sg ;; + 37|sk-y) keymap=sk-y ;; + 38|sk-z) keymap=sk-z ;; + 39|slovene) keymap=slovene ;; + 40|trf) keymap=trf ;; + 41|ua) keymap=ua ;; + 42|uk) keymap=uk ;; + 43|us) keymap=us ;; + 44|wangbe) keymap=wangbe ;; + esac + if [ -e /lib/keymaps/${keymap}.map ]; then + info "Loading the keymap..." + busybox loadkmap < /lib/keymaps/${keymap}.map + mkdir -p /etc/sysconfig + echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard + elif [ -z "${keymap}" ] + then + info "Keeping default keymap" + else + info "Sorry, but keymap '${keymap}' is invalid!" + unset keymap + chooseKeymap + fi + fi +} + +chooseKeymap diff --git a/dracut/90dokeymap/module-setup.sh b/dracut/90dokeymap/module-setup.sh new file mode 100644 index 0000000..ee123df --- /dev/null +++ b/dracut/90dokeymap/module-setup.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +check() { + return 0 +} + +depends() { + return 0 +} + +install() { + inst_hook cmdline 90 "$moddir/parse-cmdline.sh" + inst_hook pre-mount 90 "$moddir/choose-keymap.sh" +} diff --git a/dracut/90dokeymap/parse-cmdline.sh b/dracut/90dokeymap/parse-cmdline.sh new file mode 100644 index 0000000..aadc8a5 --- /dev/null +++ b/dracut/90dokeymap/parse-cmdline.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for cmd in $(getcmdline); do + if [ $cmd = "dokeymap" ]; then + dokeymap=1 + fi +done |