First, generate the layout in a format understood by GRUB2:
cd /boot/grub2/
mkdir layouts
cd layouts
xkb=/lib/kbd/keymaps/xkb; for layout in $(ls $xkb/); do zcat $xkb/$layout | grub2-mklayout -o ${layout/.map.gz/}.gkb; done 2>/dev/null
ls layouts
Then, in /boot/grub/custom.cfg
(create it if necessary):
keymap fr
In /etc/default/grub
:
# Same remark as above
GRUB_TERMINAL_INPUT="at_keyboard console"
or with serial:
# https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html #GRUB_TERMINAL="console serial" GRUB_TERMINAL_OUTPUT="console serial" # By priority decreasing ; "terminal_input at_keyboard console" may make all input lost :] GRUB_TERMINAL_INPUT="at_keyboard serial console" GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
And finally, regenerate the configuration file:
grub2-mkconfig -o /boot/grub2/grub.cfg
With the help of https://wiki.archlinux.org/index.php/Talk:GRUB#Custom_keyboard_layout