You are not logged in.

#1 2024-03-14 19:37:31

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

How exactly do to the mkinitcpio hook migration?

Hello, I'm unclear how I am supposed to do the migration for the recent news.

https://archlinux.org/news/mkinitcpio-h … microcode/

I've read the other form threads in the system admin section, but as a relative new comer I'm still not sure what I'm supposed to do. Like step by step, what am I doing to this random piece of my system (which I would really not like to bork up).

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 (because something about pointing to a new location for systemd, udev, etc?):

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

and then what? some threads seemed to suggest runing mkinitcpio -P again. Is this right? Do I need to do something with my grub config?

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

#2 2024-03-14 20:11:54

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

Re: How exactly do to the mkinitcpio hook migration?

Yeah, you can use it like that, if you want. Or you can stick to the old system. Or use both and still no harm done.

With grub in particular there is some hoop jumping involved to make grub-mkconfig stop loading microcode (like set an empty GRUB_EARLY_INITRD_LINUX_STOCK= in /etc/default/grub), but there's no harm either way, as long as {intel,amd}-ucode.img and the microcode hook agree on the same microcode file...

After rebooting, you can check in dmesg if any microcode was loaded or not (also depends on your cpu, whether there is any microcode available for it).

As always if you change any mkinitcpio / grub related configuration, you have to re-run mkinitcpio and grub-mkconfig (if using the generated config and not something else like a handwritten one) to generate new initramfs and grub.cfg respectively.

Last edited by frostschutz (2024-03-14 20:13:51)

Offline

#3 2024-03-14 20:21:14

Fuxino
Member
From: Slovakia
Registered: 2014-09-26
Posts: 198

Re: How exactly do to the mkinitcpio hook migration?

If you haven't changed your mkinitcpio.conf at all, it should be automatically replaced with the updated version when you upgrade, otherwise you should get a .pacnew file that you need to merge (you should do this every time you get .pacnew files anyway). Then you should remove the microcode option in your preset files (in /etc/mkinitcpio.d/). And then you can regenerate the initramfs. I don't use GRUB so I'm not sure about that...

Offline

#4 2024-03-15 04:51:29

WFV
Member
From: ☭USSA⛧⭒⭒⭒⭒
Registered: 2013-04-23
Posts: 290

Re: How exactly do to the mkinitcpio hook migration?

If there is microcode for your processor.

What do I need to do with the pacnew file?

by your example you can merge or replace mkinitcpio.conf with the pacnew file.

and then what?

comment out or remove line(s) regarding microcode in /etc/mkinitcpio.d/*.presets.

Do I need to do something with my grub config?

If you are editing grub.cfg directly, remove instances of initrd

 /boot/*-ucode.img

else as mentioned edit /etc/default/grub and rerun the grub generator commands

some threads seemed to suggest runing mkinitcpio -P again. Is this right?

https://wiki.archlinux.org/title/Mkinit … activation
Its not likely to fail or bork system, if it errors on any hook, research the error (warning) and see if that hook needs to be addressed, example consolefonts warning if /etc/vconsole.conf is absent a font section.

Do I need to reboot?

yes in order for microcode to load early.
Check the journal or dmesg for microcode after reboot. I run an old machine, it used to show the early code load for each core (8 lines), the migration shows two lines - example:

Mar 13 21:48:20 arch-pelago kernel: microcode: Current revision: 0x06000852
Mar 13 21:48:20 arch-pelago kernel: microcode: Updated early from: 0x0600081c

∞ hard times make the strong, the strong make good times, good times make the weak, the weak make hard times ∞

Offline

#5 2024-03-15 12:21:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,230

Re: How exactly do to the mkinitcpio hook migration?

FWIW the message change in dmesg is a kernel change and has no relation to how mkinitcpio includes the microcode to be loaded

Online

#6 2024-03-16 05:55:37

WFV
Member
From: ☭USSA⛧⭒⭒⭒⭒
Registered: 2013-04-23
Posts: 290

Re: How exactly do to the mkinitcpio hook migration?

Thank you for the correction V1del possibly that message changed before the migration and I failed to notice it, processor is over 10yrs age and ucode hasn't changed in the last 6. My apologies.
The Op might find this thread useful regarding grub.


∞ hard times make the strong, the strong make good times, good times make the weak, the weak make hard times ∞

Offline

Board footer

Powered by FluxBB