You are not logged in.

#1 2016-05-12 21:47:01

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

[Solved] No keyboard inside initramfs

Update: This has nothing to do with encryption. It appears to be purely a keyboard problem.
Update2: Changed the title accordingly. Discussion of the keyboard problem starts here.

Hi,
I've just set up a new Arch system on my laptop (Asus EeeBook X206) using LVM on LUKS for encrypted root/swap filesystems and GRUB as boot loader. Did all the setup as per the wiki, but can't get the system to boot: Everything looks fine, boot messages say it's opening the correct encrypted device mapped to the correct naem, but after I enter the password at the prompt for decryption, nothing more happens.

I also tried syslinux, same result, the bootloader does not seem to be the issue. Neither is using UUIDs, because I tried it with names for root/cryptdevice/swap as well. Fallback image does not work either, so it's not the module autodetection.

One thing I thought of is that maybe the keyboard isn't working, as I'm getting ZERO feedback after typing my password. So I tried adding the atkbd module to the kernel boot parameters or MODULES in mkinitcpio.conf (the keyboard hook is present anyway) as per the sticky - who knows, some Laptops do have their keyboard attached via PS/2 - but that did not help either. (Keyboard works in GRUB and, obviously, in the arch iso live system)


Output of lsblk/blkid, contents of mkinitcio.conf etc:
This is all from within a chroot, as I can currently only boot the system using an arch iso, but I've removed the install medium from the outputs, plus all commented lines from files.

lsblk:

NAME                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
mmcblk0rpmb         179:24   0     4M  0 disk  
mmcblk0boot0        179:8    0     4M  1 disk  
mmcblk0boot1        179:16   0     4M  1 disk  
mmcblk0             179:0    0  29.1G  0 disk  
├─mmcblk0p1         179:1    0   260M  0 part  /boot
├─mmcblk0p2         179:2    0    16M  0 part  
└─mmcblk0p3         179:3    0  28.9G  0 part  
  └─lvm             254:0    0  28.9G  0 crypt 
    ├─internal-swap 254:1    0     2G  0 lvm   [SWAP]
    ├─internal-root 254:2    0    12G  0 lvm   /
    └─internal-home 254:3    0  14.9G  0 lvm   /home

blkid:

/dev/mmcblk0p1: LABEL="SYSTEM" UUID="447B-8163" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="c930937d-3f71-41c1-b9f5-f69791295e47"
/dev/mmcblk0p3: UUID="fe8c3fbb-b7aa-43b1-9919-95ec7f8a7a80" TYPE="crypto_LUKS" PARTLABEL="Linux LVM" PARTUUID="e1867401-f45b-4ae6-ba78-f5f6d69d4f85"
/dev/mapper/lvm: UUID="zVSmwK-1pe4-gZ2y-BL5G-l886-I642-rsMgd4" TYPE="LVM2_member"
/dev/mapper/internal-swap: UUID="17f60f31-33bb-46c9-8e83-c7a0f6e58ac3" TYPE="swap"
/dev/mapper/internal-root: UUID="55b3a5bc-0a32-4b67-aca2-d7f9532892ab" TYPE="ext4"
/dev/mapper/internal-home: UUID="21473b6e-4c5c-4c91-9b6b-ea9316a2f118" TYPE="ext4"
/dev/mmcblk0: PTUUID="cb1601bb-3c41-4c30-b720-0b07927ee51c" PTTYPE="gpt"
/dev/mmcblk0p2: PARTLABEL="Microsoft reserved partition" PARTUUID="718d16b6-c583-4790-9376-d5143096f9e8"

/etc/mkinitcpio.conf:

MODULES=""
BINARIES=""
FILES=""
HOOKS="base udev autodetect modconf keymap keyboard block encrypt lvm2 resume filesystems fsck"

/etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/mapper/internal-swap quiet"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=fe8c3fbb-b7aa-43b1-9919-95ec7f8a7a80:lvm"
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
GRUB_TERMINAL_INPUT=console
GRUB_GFXMODE=auto
GRUB_GFXPAYLOAD_LINUX=keep

/boot/grub/grub.cfg on pastebin

Last edited by lastchancetosee (2016-05-19 21:21:46)


My ship don't crash! She crashes, you crashed her!

Offline

#2 2016-05-13 11:54:00

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

Re: [Solved] No keyboard inside initramfs

OK, I did some more testing:

If I changed my kernel boot line so that I get dropped to console before the encrypt hook is processed and I can't type there, either. So I guess the problem really is that the keyboard is not present during early boot. So it's probable that the correct module is missing from the initramfs.
It's not a PS/2 keyboard: Neither atkbd nor i8042 is loaded in the arch iso, and if I try to insert it, I get an error,

can't read ctr while initialising i8042

which i also get if I put the module in the initramfs (didn't notice before, because the screen got cleared too quickly.), so that's all consistent and well. During creation of the fallback image there are warnings

Possibly missing firmware for module: wd719x
Possibly missing firmware for module: aic94xx

but as it's only the fallback and I'm not using those cards, I ignored it.


So I guess the question now is: How do I find out which kernel module my keyboard is using, to see if that is what's missing?

What bothers me: If the iso works, shouldn't the fallback do, too?


My ship don't crash! She crashes, you crashed her!

Offline

#3 2016-05-13 12:11:52

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

Re: [Solved] No keyboard inside initramfs

Check `lsmod` on a livecd or whatever where your keyboard works, and then if you can't tell which ones may be the ones you need, just add all of them modules to your list of modules to be included/loaded in initramfs.

Usually this should happen automatically (and only cause problems if you remove keyboards such as a KVM switch that's sometimes there, sometimes not) but maybe it doesn't work for some reason in your case, or maybe you're not chrooting correctly (including bind mounts for /proc /sys /dev ...)

Modules are nasty little buggers, never loaded when you need them...

Last edited by frostschutz (2016-05-13 12:13:17)

Offline

#4 2016-05-14 15:11:08

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

Re: [Solved] No keyboard inside initramfs

Modules are nasty little buggers, never loaded when you need them...

I wholeheartedly argee ...

udevadm tells me the keyboard is using hid-generic, i2c_hid and i2c_designware_(platforem|core), so it's connected via i2c - makes sense. I added them to the initramfs, no luck. I also followed your advice to just put the entire output of lsmod, in case I missed something, but that does not help either.


To simplify matters, I reinstalled Arch without the encryption, so now I'm running the most basic Arch possible, base package group, unaltered mkinitcpio.conf, basic configuration.

If I just run this basic system - everything works, it boots fine and I can log in as root.
If I make the system drop me to console during boot - no keyboard, as before.
If I add the abovementioned modules to the initramfs and drop to console during boot - no keyboard.
If I add the modules but let the system boot normally - no keyboard after boot at the login prompt.

I alos had a look at the (working) initramfs image. It only contains hid-generic, but not the i2c stuff, despite the keyboard hook being present. So I guess that is the reason why the keyboard did not work during boot out of the box. What I don't understand, though, is why inserting those modules into the initramfs would actually BREAK the keyboard even after boot is finished.

[edit: Are the hooks executed in the order they are listed in mkinitcpio.conf, or do they do their own ordering? Because if I include the encrypt hook, it appears directly after [udev] in the boot messages, even though the keyboard hook comes before it.]

Last edited by lastchancetosee (2016-05-14 15:35:18)


My ship don't crash! She crashes, you crashed her!

Offline

#5 2016-05-14 16:10:31

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

Re: [Solved] No keyboard inside initramfs

lastchancetosee wrote:

Are the hooks executed in the order they are listed in mkinitcpio.conf, or do they do their own ordering?

There are different types of hooks [earlyhook, hook, latehook, cleanuphook]. Apart from that it should be in order.

Offline

#6 2016-05-15 08:46:01

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

Re: [Solved] No keyboard inside initramfs

Looking at the console output, it seems that udev is the only hook used with an earlyhook, so I guess it's all loaded in order. Tried loading [keyboard] as early as possible, no luck.


Did some more digging through the logs and I might have found something:

When I boot normally into my (now test-) system, I have the following warnings from i2c-* in the journal, very late in the boot:

i2c_designware 808622C1:06: punit semaphore timed out, resetting
i2c_designware 808622C1:06: PUNIT SEM: 3
i2c_designware 808622C1:06: couldn't acquire device ownership
...
i2c-hid i2c-PDEC3393:00: error in i2c_hid_init_report size:7 /ret_size:0
i2c-hid i2c-PDEC3393:00: error in i2c_hid_init_report size:19 /ret_size:0

According to /proc/bus/input/devices, PDEC3393:00 is the keyboard. I don't know what 808622C1:06 is, but neither error seems to matter, as the keyboard works.
When I insert i2c-hid and the two i2c-designware modules into the initramfs, the errors change to.

i2c-hid i2c-PDEC3393:00: Failed to get GPIO interrupt
i2c-hid i2c-ELAN0100:00: Failed to get GPIO interrupt
i2c_designware 808622C1:06: punit semaphore timed out, resetting
i2c_designware 808622C1:06: PUNIT SEM: 3
i2c_designware 808622C1:06: couldn't acquire device ownership

and the keyboard stops working, not only during but also after boot. (ELAN0100:00 is the touchpad, by the way. Which is in itself funny, because according to udevadm, the touchpad doesn't use i2c-hid, only i2c-designware and elan-i2c).

Sooo, the relevant module can't get an GPIO interrupt in the initramfs, but can get it later?
I checked the dependencies, all those modules only depend on hid, which is already in the initramfs.

[edit: As this has nothing to do with encryption: Should I change the title or better take it to a new thread?]

Last edited by lastchancetosee (2016-05-15 08:59:00)


My ship don't crash! She crashes, you crashed her!

Offline

#7 2016-05-19 14:38:30

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

Re: [Solved] No keyboard inside initramfs

I tried switching over to early systemd start (systemd instead of base/udev hooks). Machine boots fine, but still no keyboard, and still the same weird error when I insert the keyboard modules into the initramfs.

Just to summarize the current setup:

mkinitcpio.conf:

MODULES=""
BINARIES=""
FILES=""
HOOKS="systemd autodetect modconf keyboard sd-vconsole sd-encrypt sd-lvm2 block filesystems fsck"

/etc/grub/default:

...
GRUB_CMDLINE_LINUX="rd.luks.uuid=<uuid of LUKS partition> rd.lvm.lv=lvm/root rd.lvm.lv=lvm/swap resume=/dev/mapper/lvm-swap"
...

No keyboard inside initramfs. If I put the keyboard modules into the initramfs

MODULES="i2c-hid hid hid-generic i2c-designware-platform i2c-designware-core"

I get the GPIO interrupt error, and the keyboard stops working, even after the initramfs.


With the systemd hook, what happens in the initramfs should be pretty identical to what would normally happen afterwards. So how come I still get different errors for the i2c-hid module? I really don't understand this.


My ship don't crash! She crashes, you crashed her!

Offline

#8 2016-05-19 16:11:17

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] No keyboard inside initramfs

This is just a shot in the dark, but I'd examine loaded modules when booted to a functional keyboard. Maybe one of those i2c modules has an unregistered dependency on something that doesn't make it into the initramfs.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#9 2016-05-19 21:18:33

lastchancetosee
Member
From: Berlin
Registered: 2009-02-19
Posts: 130

Re: [Solved] No keyboard inside initramfs

Nothing obvious in the output of lsmod, so I just added the entire list to the initramfs again (see above). It worked this time. Either I made a mistake the first time, or I needed the systemd hook. Lots of rebooting later, I've found the bugger responsible: pinctrl_cherryview, a Intel GPIO driver according to the Linux Kernel Driver Database.

So the solution is:
/etc/mkinitcpio.conf

MODULES="i2c_hid i2c_designware_core i2c_designware_platform pinctrl_cherryview"
HOOKS="... systemd ..."

The systemd hook might or might not be needed as well. i2c_core and input_core also required, but with the default kernel they are built-in. Don't know about other kernels.

I think I might have to create a wiki page for this laptop model ...

Thanks, alphaniner, frostschutz for your help!


My ship don't crash! She crashes, you crashed her!

Offline

Board footer

Powered by FluxBB