clearlinux / clr-boot-manager

Kernel & Boot Loader Management
https://clearlinux.org/
111 stars 31 forks source link

Make sure microcode initrd is loaded first #252

Closed bwarden closed 1 year ago

bwarden commented 1 year ago

Microcode early loading only works on the first initrd passed to the kernel, so make sure the first one we specify in the bootloader config is actually a microcode initrd.

bwarden commented 1 year ago

Potential fix for https://github.com/clearlinux/distribution/issues/2715 and improvement for https://github.com/clearlinux/distribution/issues/52

bwarden commented 1 year ago

Do we need to handle additional boot managers? Or save that for another PR?

bryteise commented 1 year ago

Yea, we should add the other boot managers. Probably best to do in the same PR. Seems like Monday work though.

bwarden commented 1 year ago

@bryteise @fenrus75 Anything else you think we should do in here?

bryteise commented 1 year ago

@bwarden Were you going to add the tests for this still?

bwarden commented 1 year ago

I think I can. It'll just take a while longer.

bwarden commented 1 year ago

Tests added for UEFI/systemd-boot.

bryteise commented 1 year ago

Nice, thanks!

alessandrofasse commented 1 year ago

In which version these changes will land?

bryteise commented 1 year ago

@AlessandroFasse 37440 or later if that one doesn't make it.

chriselrod commented 1 year ago

I'm still getting

May 20 18:47:02 9940x systemd[1]: Starting clr-power.service...
May 20 18:47:02 9940x kernel: microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
May 20 18:47:02 9940x kernel: microcode: You should switch to early loading, if possible.
May 20 18:47:02 9940x kernel: microcode: updated to revision 0x2006f05, date = 2022-12-21
May 20 18:47:02 9940x kernel: microcode: Reload succeeded, microcode revision: 0x2006e05 -> 0x2006f05
May 20 18:47:02 9940x systemd[1]: clr-power.service: Deactivated successfully.

I'm on version 39150, but I've been seeing this for a while.

> sudo dmesg | grep microcode
[    0.000000] microcode: updated early: 0x200004d -> 0x2006e05, date = 2022-03-08
[    0.929601] calling  save_microcode_in_initrd+0x0/0xc0 @ 1
[    0.933678] initcall save_microcode_in_initrd+0x0/0xc0 returned 0 after 4000 usecs
[    1.187968] calling  microcode_init+0x0/0x1c0 @ 1
[    1.188133] microcode: Microcode Update Driver: v2.2.
[    1.188135] initcall microcode_init+0x0/0x1c0 returned 0 after 165 usecs
[   40.301720] microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
[   40.310606] microcode: You should switch to early loading, if possible.
[   40.323664] microcode: updated to revision 0x2006f05, date = 2022-12-21
[   40.323709] microcode: Reload succeeded, microcode revision: 0x2006e05 -> 0x2006f05

so it looks like it's early loading to 2022-03-8, and then late loading to 2022-12-21?