How to change grub2 keylayout on Samsung laptop

Trying to change grub2 key layout on a Samsung laptop and failing badly.

Created /etc/grub.d/50_keyboard file containing

 #!/bin/sh
 exec tail -n +3 $0
 # Clavier fr
 insmod keylayouts
 keymap /boot/grub/layouts/fr.gkb

Edited /etc/default/grub file to add

GRUB_TERMINAL_INPUT="at_keyboard"

Used command ckbcomp fr |sudo grub-mklayout -o /boot/grub/layouts/fr.gkb to create the keylayout file

Used command sudo update-grub to ensure my changes were written to /boot.


Your /etc/grub.d/50_keyboard is incorrect.

#!/bin/sh
exec tail -n +3 $0
# Clavier fr
insmod keylayouts
keymap /boot/grub/layouts/fr.gkb

The "exec" line is incorrect for your file, but rather than change it or renaming it to 39_keyboard and fixing the exec line...

  • delete /etc/grub.d/50_keyboard
  • edit /etc/grub.d/40_custom

Add this to the end of this file:

insmod keylayouts
keymap /boot/grub/layouts/fr.gkb

so that the final file looks like:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
insmod keylayouts
keymap /boot/grub/layouts/fr.gkb