clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
520 stars 29 forks source link

EFI vars should be enabled for linux-preempt-rt (kernel-rt bundle) #1774

Open phmccarty opened 4 years ago

phmccarty commented 4 years ago

If I try to run clr-boot-manager list-kernels when running the linux-preempt-rt kernel from the kernel-rt bundle, I hit these errors:

[ERROR] cbm (../src/lib/bootvar.c:L130): efi_get_next_variable_name() failed: Function not implemented
[FATAL] cbm (../src/bootman/bootman.c:L163): Cannot initialise bootloader shim-systemd

According to @dorileo, the root cause is that EFI vars need to be enabled in the kernel for that command to work.

Note that the same errors occur when running some other clr-boot-manager commands as well, like clr-boot-manager set-kernel.

phmccarty commented 4 years ago

@miguelinux

dorileo commented 4 years ago

fundamentally clr-boot-manager will rely on efi variables to detect the environment, if these variables are not present it will fail to detect boot entries for example.

miguelinux commented 4 years ago

This is expected, due to https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?h=linux-5.4.y-rt-rebase&id=ba7585a4a5580b4cba26ebe76050bd2ef1148948 and the workaround is https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?h=linux-5.4.y-rt-rebase&id=0728d54203b80b7de2391b34976b6838a6dbace0

So , for Clear Linux the solution is:

$ sudo mkdir -p /etc/kernel/cmdline.d
$ echo efi=runtime | sudo tee /etc/kernel/cmdline.d/efi_on.conf

to enable EFI vars on preempt-rt

dorileo commented 4 years ago

@miguelinux I wonder if we don't want to enable efi by default and allow user to disable it.

SteveOss commented 4 years ago

I have two clearlinux VMs both at 32870. The older one is running 5.4.19.56.preempt_rt and exhibits the list-kernels failure, even with the suggested fix applied. The newer one is running 5.4.28.61.preempt_rt and list-kernels now works. However not sure how to upgrade kernel on older install ?

ggayan commented 3 years ago

This is expected, due to https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?h=linux-5.4.y-rt-rebase&id=ba7585a4a5580b4cba26ebe76050bd2ef1148948 and the workaround is https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?h=linux-5.4.y-rt-rebase&id=0728d54203b80b7de2391b34976b6838a6dbace0

So , for Clear Linux the solution is:

$ sudo mkdir -p /etc/kernel/cmdline.d
$ echo efi=runtime | sudo tee /etc/kernel/cmdline.d/efi_on.conf

to enable EFI vars on preempt-rt

I ran into this issue myself with the RT kernel. The problem is that the solution here is not complete; after updating this file, clr-boot-manager update needs to be run, which does not work since clr-boot-manager requires to read the efi vars, which is a dead end. What worked for me instead is mounting /boot and modifying the kernel boot parameters manually to include efi=runtime and reboot. After that, clr-boot-manager works fine. I followed the instructions in a clear linux forum topic to mount /boot and was able to get back to the native kernel: https://community.clearlinux.org/t/recovering-from-boot-weirdness/2277