You are not logged in.

#1 2018-09-25 21:55:15

cassyb
Member
Registered: 2007-04-02
Posts: 13

[grub]: wrong keyboard layout in grub stage 1 for luks passphrase

Hi,
I have a problem with grub in stage 1,

GRUB loading..
Welcome to GRUB!

Attempting to decrypt master key...
Enter passphrase for hd0,msdos1 (<id>):

the luks passphrase is in qwerty.

I read:
https://wiki.archlinux.org/index.php/Dm … VM_on_LUKS

Add the keyboard, keymap and encrypt hooks to mkinitcpio.conf. If the default US keymap is fine for you, you can omit the keymap hook.

HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck)

https://wiki.archlinux.org/index.php/Mkinitcpio

Adds the specified keymap(s) from /etc/vconsole.conf to the initramfs. If you use system encryption, especially full disk encryption, make sure you add it before the encrypt hook.

KEYMAP=fr-latin9

https://bbs.archlinux.org/viewtopic.php?id=173506

I also try:
Add 40_custom and 50_keymap like this:
https://wiki.archlinux.org/index.php/Ta … ard_layout

Use grub layouts like this:
https://askubuntu.com/a/1071185

How to resolve this problem?
Thanks for your help.

Last edited by cassyb (2018-10-01 19:46:25)

Offline

#2 2018-09-25 22:24:29

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [grub]: wrong keyboard layout in grub stage 1 for luks passphrase

Offline

#3 2018-09-29 10:26:27

cassyb
Member
Registered: 2007-04-02
Posts: 13

Re: [grub]: wrong keyboard layout in grub stage 1 for luks passphrase

Thanks.

I install grub for BIOS systems only.
So I change the command line:

# grub-mkimage -c early-grub.cfg -o grubx64.efi -O x86_64-efi -m memdisk.tar diskfilter cryptodisk luks gcry_rijndael gcry_sha256 ext2 memdisk tar at_keyboard keylayouts configfile

for i386-pc

# grub-mkimage -c early-grub.cfg -o initramfs-linux-gkb.img -O i386-pc -m memdisk.tar gzio part_msdos cryptodisk luks gcry_rijndael gcry_rijndael gcry_sha256 lvm ext2 memdisk tar at_keyboard keylayouts configfile

So now i have initramfs-linux-gkb.img, I install grub for BIOS systems only like the wiki
https://wiki.archlinux.org/index.php/GR … ricks#BIOS

But it doesn't work, the keyboard is in qwerty.

Last edited by cassyb (2018-10-01 19:41:38)

Offline

#4 2018-09-30 00:21:42

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [grub]: wrong keyboard layout in grub stage 1 for luks passphrase

I suspect you need to use grub-bios-setup to install initramfs-linux-gkb.img.

grub-bios-setup -c initramfs-linux-gkb.img /dev/sdX

It needs someone with more familiarity with BIOS grub to check this suggestion.

Offline

#5 2018-10-02 19:57:51

cassyb
Member
Registered: 2007-04-02
Posts: 13

Re: [grub]: wrong keyboard layout in grub stage 1 for luks passphrase

In the output of grub-install, I found default command line of grub-mkimage and grub-bios-setup

grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '(lvmid/INkMrY-6iiQ-7p8R-osm2-q1vM-GEK1-frMgq6/lczLrE-4M54-eliW-zk9h-lM9i-Q5oi-Hlxf2z)/boot/grub' --output '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto'  --config '/boot/grub/i386-pc/load.cfg' 'ext2' 'lvm' 'cryptodisk' 'luks' 'gcry_rijndael' 'gcry_rijndael' 'gcry_sha256' 'part_msdos' 'biosdisk' 
grub-bios-setup --verbose --directory='/boot/grub/i386-pc' --device-map='/boot/grub/device.map' '/dev/sdc'

I made a script grub-custom-install.sh, adding memdisk and custom config file load.cfg

#!/bin/sh

/usr/bin/grub-mkimage --verbose --directory '/usr/lib/grub/i386-pc' --prefix '(lvmid/INkMrY-6iiQ-7p8R-osm2-q1vM-GEK1-frMgq6/lczLrE-4M54-eliW-zk9h-lM9i-Q5oi-Hlxf2z)/boot/grub' --output '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto'  --config '/home/user/load.cfg' --memdisk '/home/user/memdisk.tar' 'ext2' 'lvm' 'cryptodisk' 'luks' 'gcry_rijndael' 'gcry_rijndael' 'gcry_sha256' 'part_msdos' 'biosdisk' 'memdisk' 'tar' 'at_keyboard' 'keylayouts' 'terminal'
/usr/bin/grub-bios-setup --verbose --directory='/boot/grub/i386-pc' --device-map='/boot/grub/device.map' '/dev/sdc'
cat /home/user/load.cfg
root=(memdisk)
prefix=(memdisk)/boot/grub

cryptomount -u f9101829a15c4a9ba5bdb8517dd5500e
set root='lvmid/INkMrY-6iiQ-7p8R-osm2-q1vM-GEK1-frMgq6/lczLrE-4M54-eliW-zk9h-lM9i-Q5oi-Hlxf2z'
set prefix=($root)/boot/grub

3 differences with the wiki:
- I add 'terminal' in grub-mkimage command line, it's necessary for using terminal_input
- I add boot in the path of prefix
- And I remove

configfile grub.cfg

At this step, all works like default grub-install
I go step by step, in load.cfg, there is no:

terminal_input at_keyboard
keymap fr

When I add

terminal_input at_keyboard

without keymap
like this:

root=(memdisk)
prefix=(memdisk)/boot/grub

terminal_input at_keyboard

cryptomount -u f9101829a15c4a9ba5bdb8517dd5500e
set root='lvmid/INkMrY-6iiQ-7p8R-osm2-q1vM-GEK1-frMgq6/lczLrE-4M54-eliW-zk9h-lM9i-Q5oi-Hlxf2z'
set prefix=($root)/boot/grub

the laptop keyboard is unusable (enter key doesn't work, it's not in qwerty). I have to use a usb keyboard. I put passphrase in qwerty.
The passphrase is good, I see.

Slot 0 opened
_

And grub is blocked with a blinking cursor...

Last edited by cassyb (2018-10-14 04:36:09)

Offline

Board footer

Powered by FluxBB