On Thu, May 19, 2022 at 12:25:53PM +0200, Laszlo Ersek wrote:
On 05/18/22 15:30, Richard W.M. Jones wrote:
> But the keyboard doesn't work. This is also surprising because I
> *thought* that both virt and baremetal basically use emulated or real
> USB keyboard these days.
[This bit is wrong - on x86 under virt we emulate a PS/2 keyboard]
The keyboard does not work -- where?
Once the OS is reached (gdm or console root prompt), or in grub
(pre-boot, basically)?
It got all the way to gdm but apparently the keyboard didn't work for
login etc. The baremetal server is a Dell and Guilherme was accessing
this over iDRAC. No idea what kind of "virtual" keyboard iDRAC
presents to the hardware.
I don't know what happened in the end. Last I heard Guilherme was
trying to reach the server over ssh.
The latter, I can explain. UEFI has a phase called "Boot Device
Selection" (BDS) where the firmware decides exactly what devices to
"connect" -- meaning what devices should be *bound* by UEFI drivers.
There is a number of policies here; the gist is that the platform vendor
can do whatever they want -- BDS is called "platform policy".
Usually they support at least two configs, "full config" and "fast
boot". Under "fast boot", the firmware only connects such devices to
UEFI drivers that the firmware *knows* are needed for booting, and
ignores everything else, including newly connected devices, potentially.
Therefore, a USB keyboard could end up "non-driven" by UEFI because it
is not needed for booting!
Would Linux still recognise the keyboard even in "fast boot" mode?
The fix is to get into the firmware setup UI by some other way [*],
and
either disable "fast boot", or -- if the firmware is flexible enough --
explicitly enable the binding of USB devices.
[*] From "/etc/grub.d/30_uefi-firmware", the command
grub2-mkconfig -o /etc/grub2-efi.cfg
should create a grub2 menu entry, usually at the end of the boot menu,
that invokes the "fwsetup" grub2 command. The trick is to make this
entry the default entry, once the OS has fully booted (I guess via
GRUB_DEFAULT in "/etc/default/grub"), and then reboot. When grub2
executes "fwsetup", it modifies a particular non-volatile UEFI global
variable ("OsIndications"), and upon seeing that, the firmware at next
boot will drop into the setup UI.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit