pmbootstrap icon indicating copy to clipboard operation
pmbootstrap copied to clipboard

Need ability to load keymaps in initramfs

Open craftyguy opened this issue 7 years ago • 22 comments

This ticket is for brainstorming how this might be accomplished.

The RX51/N900 needs a custom keymap at boot to be able to enter numbers for unlocking rootfs. Keymaps, in binary format, can be loaded using busybox's loadkmap plugin:

loadkmap < rx_51_kmap.bin

The binary can be generated by running a .map file through loadkeys -b (I did this on a system with Arch Linux).

The problem is that mkinitfs.sh does not allow for importing arbitrary files into initramfs, the only custom files it will import are those under 'hooks', and only files with a .sh extension.

So there are two immediate possible solutions:

  1. extent mkinitfs.sh to allow importing arbitrary files into the initramfs image, so hooks can use them

  2. Add some option for identifying keymaps (probably not in the device file, since the desire for users to be able to select keymaps can easily extend beyond unique keyboards on select devices), generating a binary version of the .map file, importing it into the initramfs, and loading it (with a hook) on boot. Maybe 'setting keymap' can be done in ./pmbootstrap init ?

The second option seems like a great way to solve the immediate problem, and the first option seems like it would be desirable if folks really start using hooks for interesting things.

craftyguy avatar Jul 16 '17 18:07 craftyguy