You are not logged in.

#1 2024-03-06 06:38:27

zer0_me
Member
Registered: 2020-11-22
Posts: 2

new microcode hook with systemd-boot

Hi,

I'm using systemd-boot and I'm not entirely sure what I need to do regarding the new microcode hook.

The announcement states:

"[...] This also allows you to remove the microcode initrd lines from your boot configuration as they are now bundled with the main initramfs image."

Does this mean that "initrd  /amd-ucode.img" can be eliminated without any replacement from all entries? How will mkinitcpio locate the microcode image in the future?

Offline

#2 2024-03-06 09:20:34

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 49

Re: new microcode hook with systemd-boot

By going into /etc/mkinitcpio.conf and adding the word "microcode" to the HOOKS section after "autodetect".

You may need to re-run

mkinitcpio -P

after making the change.


Ryzen 7 1800X | AMD 7800XT | KDE Plasma
I can't wait to play my favourite game, wine64-preloader.

Offline

#3 2024-03-06 09:26:18

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 456

Re: new microcode hook with systemd-boot

I am also wondering… Using systemd-boot, I have the initrd microcode line and since now I'm using the new hook, that line should go away. But /boot/amd-ucode.img is owned by amd-ucode package. I'd love to be able to not have it inside a size constrained partition such as /boot.

Offline

#4 2024-03-06 09:36:02

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 49

Re: new microcode hook with systemd-boot

It's a very small file, only 80K on my PC. So it shouldn't cause you a problem. If you run out of space, it'll be other things.


Ryzen 7 1800X | AMD 7800XT | KDE Plasma
I can't wait to play my favourite game, wine64-preloader.

Offline

#5 2024-03-06 10:14:10

zer0_me
Member
Registered: 2020-11-22
Posts: 2

Re: new microcode hook with systemd-boot

Nikolai5 wrote:

By going into /etc/mkinitcpio.conf and adding the word "microcode" to the HOOKS section after "autodetect".

You may need to re-run

mkinitcpio -P

after making the change.

Yeah, that is the only part where I'm certain about what to do. But what about the "initrd" line in the loader entries?

Offline

#6 2024-03-06 11:01:12

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 49

Re: new microcode hook with systemd-boot

Yes, so now my grub config shows: "initrd  /initramfs-linux-zen.img" (I had to configure it do to ignore microcode)
It used to show "initrd  /amd-ucode.img /initramfs-linux-zen.img"

So yes, you can remove reference to the img in your initrd.

I use grub so you'd have to do whatever you need to do in systemd-boot to remove that.
I don't think it would actually cause a problem to have them in both places, but the update is  basically saying you don't need it in initrd any more because if you use the hook its included there.


Ryzen 7 1800X | AMD 7800XT | KDE Plasma
I can't wait to play my favourite game, wine64-preloader.

Offline

#7 2024-03-06 11:14:23

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: new microcode hook with systemd-boot

After the change to mkinitcpio 38 as has been said you should make sure your mkinitcpio.conf includes the microcode hook.  If you don't have a default version of that file then copying /etc/mkinitcpio.conf.pacnew into /etc/mkinitcpio.conf should include the microcode hook in the HOOKS line and if you have any customisation of the mkinitcpio.conf file you can then add any customisations such as anything included in the MODULES line.  Once that is done then running mkinitcpio -p linux will generate the initramfs file in /boot/ and then since you are running sd-boot the loader entry for arch-linux can then have the microcode line removed - in my case I just commented that out, like this:

$ cat /boot/loader/entries/linux-arch.conf 
#
# linux-arch.conf
#
title   Linux Arch
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
#initrd  /intel-ucode.img 
options root="UUID=xxxx-xxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" radeon.runpm=0 rw audit=0

Your corresponding entry can be amended in a similar way, and if using an AMD system the microcode will be amd-ucode.img instead. My system(s) boot fine with those changes.

Last edited by mcloaked (2024-03-06 11:19:08)


Mike C

Offline

#8 2024-03-06 11:20:39

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 49

Re: new microcode hook with systemd-boot

mcloaked wrote:

If you have a default version of that file then copying /etc/mkinitcpio.conf.pacnew into /etc/mkinitcpio.conf should include the microcode hook in the HOOKS line and if you have any customisation of the mkinitcpio.conf file you can then add any customisations such as anything included in the MODULES line.

I know people should know, but people who have used archinstall and enabled encryption may not realise that the default file does not include the "encrypt" flag in HOOKS and that they will need to ensure that is in there to boot.
So just straight up replacing their existing file with this new one will break their boot.

So if you do have drive encryption, please remember to put "encrypt" in the HOOKS.


Ryzen 7 1800X | AMD 7800XT | KDE Plasma
I can't wait to play my favourite game, wine64-preloader.

Offline

#9 2024-03-06 12:42:40

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,892
Website

Re: new microcode hook with systemd-boot

Sure, people who used archinstall and are clueless about how their systems are configured are going to have a Fun Time. Wholesale copying (or moving) pacnew files should only be done in very rare cases where you've already confirmed (by manually comparing the contents) that the new file is appropriate for your setup. The rest of the time you should merge the changes by hand.

As for the bootloader configs, it doesn't matter what your boot loader is -- if you make use of the new microcode hook, you can remove the microcode initrd lines from your config. This was covered by the news item.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2024-03-13 00:52:43

vivianne
Member
Registered: 2024-02-11
Posts: 6

Re: new microcode hook with systemd-boot

in the same place as zer0_me, not sure what I'm supposed to do. I ran mkinitcpio -P when I installed and haven't thought about it since.

I think I'm supposed to edit /etc/mkinitcpio.conf. Right now, it looks like

grep -v '^#' /etc/mkinitcpio.conf
MODULES=()

BINARIES=()

FILES=()

HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)

and im just supposed to change that HOOKS line to look like this:

HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)

and then run mkinitcpio -P again. Is this right?

Do I need to reboot? When do I actually do they system upgrades? What do I need to do with the pacnew file? and the img in my initrd???

Offline

Board footer

Powered by FluxBB