Skip to content

Additional keyboard layouts #9

Description

@dhouck

(This isnʼt relevant to the serial console, only the fb-based terminal)

Minux doesnʼt have any keyboard layouts installed besides the default QWERTY one. This is fine for most people, but many people (including me) use something other than a QWERTY keyboard. We already include the busybox utility loadkmap, but not any keymaps for it.

On non-busybox systems this is instead usually handled by the kbd utility, which comes with a bunch of keymaps already (in a different format). As far as I can tell, the standard way to get a busybox-format keymap is to take a kbd-format one and run in through the kbd-provided utility to convert it; I have not seen anyone getting a busybox keymap any other way, but it must have happened because busybox predates the kbd support for it.

The options would be

  • Include the kbd package, which includes a lot of keyboard layouts (and a different way of loading them). This package is big (about 1.5 MiB difference in cramfs size); even if I manually remove some of the bigger parts it remains pretty big
  • Include a handful of common kmap files in busybox format. They are individually tiny, about 2 KB
  • Include all the available kmap files in busybox format. There are a lot, so this is a bit under 200 KB.

My biggest issue with the second and third options, and why Iʼm not making a PR for one of those right now, is that it requires either checking in a bunch of opaque binary files, or requiring kbd on the host (which itʼll probably have but best not to assume).

If you have the kbd source tarball, the busybox-formatted keymaps can be generated with

tar xf kbd-2.9.0.tar.xz
for file in kbd-2.9.0/data/keymaps/**/*.map; do
        relpath="${file#*/*/*/}"
        output="bb/${relpath%.map}.kmap"
        mkdir -p $(dirname "${output}")
        if readlink $file; then
                ln -s $(readlink "$file" | sed -E 's/.map$/.kmap/') "$output"
        else
                loadkeys -b "$file" > "${output}" || (
                        echo "Failed to process file $relpath"
                        rm "${output}"
                )
        fi
done

I think my preferred option is option 3, or 1 since I always overestimate how much this project should care about space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions