You are not logged in.

#1 2018-08-16 16:52:54

fzzbt
Member
Registered: 2011-02-19
Posts: 17

Keyboard repeat rate too fast for entering LUKS/dm-crypt password

I have setup full disk encryption with LUKS/dm-crypt and sd-encrypt.
The keyboard repeat rate is really fast and it's difficult to input the password.

I tried adding a systemd service as described here https://wiki.archlinux.org/index.php/Ke … y_and_rate
but it seems to run too late to make a difference.

How can I lower the keyboard repeat rate before the encryption password input?

Offline

#2 2018-08-16 17:13:09

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

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

I would suggest trying Before=cryptsetup.target or Before=cryptsetup-pre.target and try installing it in the initrd as /etc/systemd/system/cryptsetup.target.wants/kbdrate.service

Offline

#3 2018-08-17 10:54:35

fzzbt
Member
Registered: 2011-02-19
Posts: 17

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

I tried the following service, but got "ordering cycle".

[Unit]
Description=Keyboard repeat rate in tty.
Before=cryptsetup.target

[Service]
Type=oneshot
RemainAfterExit=yes
StandardInput=tty
StandardOutput=tty
ExecStart=/usr/bin/kbdrate -s -d 660 -r 25

[Install]
WantedBy=cryptsetup.target
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found ordering cycle on cryptsetup.target/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found dependency on kbdrate.service/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found dependency on basic.target/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found dependency on sockets.target/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found dependency on dbus.socket/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Found dependency on sysinit.target/start
Aug 17 13:40:24 arkki systemd[1]: sysinit.target: Job cryptsetup.target/start deleted to break ordering cycle starting with sysinit.target/start

if i try cryptsetup-pre.target instead, there's no ordering cycle, but nothing happens anyway

service is saved as symlink in /etc/systemd/system/cryptsetup.target.wants/kbdrate.service

Offline

#4 2018-08-17 12:59:47

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

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

How are you including the service file in the initrd?

Offline

#5 2018-08-20 21:58:42

fzzbt
Member
Registered: 2011-02-19
Posts: 17

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

loqs wrote:

How are you including the service file in the initrd?

how do i do that exactly?
all i did was run systemctl enable kbdrate and it made symlink
/etc/systemd/system/kbdrate.service -> /etc/systemd/system/cryptsetup.target.wants/kbdrate.service

Offline

#6 2018-08-20 22:11:46

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

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

You should be able to check if it is with

bsdcpio -it < /boot/initramfs-linux.img

If it is note you could try the files array of mkinitcpio.conf to add both the service and symlink.

Offline

#7 2019-02-14 18:00:41

mariuszs
Member
Registered: 2019-02-14
Posts: 1

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

I have the same problem and none of the ways described above works. Has anybody solve this problem?

Offline

#8 2019-02-14 22:47:17

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

What do you mean "none of" -  there's only one approach discussed and it remained open whether the OP actually added the service to his initramfs. Did you?
Output of

lsinitcpio /boot/initramfs-linux.img  | grep cryptsetup

?

Offline

#9 2019-02-14 23:37:10

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

You could create a kbdrate hook. Similar to the keymap hook.

/etc/initcpio/install/kbdrate

#!/bin/bash

build() {
    add_binary "kbdrate"
    add_runscript
}

help() {
    cat <<HELPEOF
Set keyboard repeat rate. (Edit hooks/kbdrate to adapt values.)
HELPEOF
}

/etc/initcpio/hooks/kbdrate

#!/usr/bin/ash

run_hook() {
    kbdrate -s -d 1000 -r 10
}

Then add kbdrate to mkinitcpio.conf :: HOOKS after keyboard/keymap hook.

This is not systemd specific so if systemd also sets the repeat rate, it might not work.

If there is a kernel parameter to set the default value, you might not need the hook at all, but if there is one I don't remember...

Online

#10 2019-02-15 00:28:13

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

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

I thought add_runscript did not work under systemd due to the script never being called by systemd.

Offline

#11 2019-02-15 02:10:04

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: Keyboard repeat rate too fast for entering LUKS/dm-crypt password

Oh, sure. I don't use systemd in initramfs, sorry about that.

For a systemd hook, you only need the install file, and add_systemd_unit instead of add_runscript, and of course - a systemd unit which in turn then runs kbdrate, before you start typing the passphrase.

If you look at existing systemd hooks (/lib/initcpio/install/sd-*) you should ge the general idea.

Online

Board footer

Powered by FluxBB