How big are your initramfs then?
How are you getting that info?
ncdu
mkinitcpio fallback images have gotten huge lately due to the changes over the last couple of versions.
Smaller than a cat!
If I understand the Arch announcement correctly, it means that the microcode line in my systemd-boot entries will be superfluous (after having merged the mkinitcpio.conf files) ?
So I can change my /boot/loader/entries/arch.conf from
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=UUID=2ec827b0-72be-4c73-b58a-102a37aa24a3 rootflags=subvol=@ rw
to
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=2ec827b0-72be-4c73-b58a-102a37aa24a3 rootflags=subvol=@ rw
?
This in an Arch install, for the record.
Hi @all using mkinitcpio !
Revisiting the new mkinitcpio this morning and regenerating my initramfs, I saw the following line in the output of the
sudo mkinitcpio -P
command:
==> WARNING: Deprecated option âALL_microcodeâ found. Update â/etc/mkinitcpio.d/linux-zen.presetâ to use the âmicrocodeâ hook instead.
This means that the preset files in /etc/mkinitcpio.d
need to be edited as well.
So this is what needed to be done in may case:
- edit
/etc/mkinitcpio.conf
and add microcode to HOOKS line:HOOKS=(systemd autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
- edit preset files for my kernels in
/etc/mkinitcpio.d
and comment out (or delete) the following line:ALL_microcode=(/boot/*-ucode.img)
- regenerate initramfs:
sudo mkinitcpio -P
Using Grub here, updating the /boot/grub/grub.cfg
will still automatically create:
initrd /boot/intel-ucode.img /boot/initramfs-linux-zen.img
line. So useless to remove it manually fom grub.cfg
since the file will be overwritten next time it is regenerated.
As for the conf files for systemd-boot entries being also automatically generated in EnOS, I hope that @dalto can comment on that.
PS. sorry for having missed the WARNING in the first run before I posted previously
I would interpret that as if it is meant to target, first and foremost, new kernel installations.
If you have already, say two kernels as in may case, after an update to mkinitcpio to the latest version when it is run automatically and produce explicitly the following WARNING:
==> WARNING: Deprecated option âALL_microcodeâ found. Update â/etc/mkinitcpio.d/linux-zen.presetâ to use the âmicrocodeâ hook instead.
reinstalling your kernels, it is not something you think of at the first place.
But I get your point, reinstalling the kernels in this case would also have the âside-effectâ of using the microcode in initramfs build since as you mentioned the preset files will be modified automatically.
For those not wanting to edit the preset files manually themselves, this should produce the desired effect as well.
This warning message is ambiguous and can be confusing for people unfamiliar with mkinitcpio
. Especially this statement:
For example, one can reasonably interpret it as adding the setting to use âmicrocodeâ hook in the .preset
files, which is false. One needs to add the âmicrocodeâ hook in the /etc/mkinitcpio.conf file, not the preset files.
I had âmicrocodeâ hook added automatically to mkinitcpio.conf after updating, but there werenât any changes made to linux-zen.preset. So I had to comment out âALL_microcodeâ to avoid the Warning upon regeneration of the kernel images.
A kernel re-installation doesnât seem to produce the effect of removing
ALL_microcode=(/boot/*-ucode.img)
in the already present preset files in /etc/mkinitcpio.d
for the already installed kernels.
Here is how I tested it:
-
I edited back my
/etc/mkinitcpio.d/linux-lts-preset
to include again:ALL_microcode=(/boot/*-ucode.img)
-
I reinstalled
linux-lts
and observed the output of the automatically run mkinitcpio afterwards: The WARNING is still there and the/etc/mkinitcpio.d/linux-lts
remains unchanged. -
I went ahead and installed a new kernel:
sudo pacman -S linux
and observed the output in the terminal. There is no sign of WARNING in the output frommkinitcpio
and no reference toALL_microcode=(/boot/*-ucode.img)
in /etc/mkinitcpio.d/linux-preset
My conclusion:
Reinstalling the kernels, wonât automatically generate new presets where ALL_microcode
is removed.
You will still see (for example after reinstalling linux-lts):
==> WARNING: Deprecated option âALL_microcodeâ found. Update â/etc/mkinitcpio.d/linux-lts.presetâ to use the âmicrocodeâ hook instead.
However, installing a new kernel as described above, will automatically generate the âcorrectâ preset file and then no WARNING in the mkinitcpio
output.
So it seems that for already installed kernels, manual editing of preset files is still needed.
If you have time on your hand, please test it yourself to see if you will arrive at the same conclusion.
I might have done something wrongly, as it is typical for someone with a username like me
In this case, the PEBCAK title should go to me. I read through the code again. The sed
command to regenerate the .preset
files is wrapped up inside a conditional:
if [[ ! -e "$preset" ]]; then
...
fi
Which means it will only be created if the preset files donât already exist. My apologies for wasting your time.
I have deleted my original post to prevent confusion.
No problem. I like to roll up my sleeves and test stuff.
I see any interchange as potential opportunity to learn.
I am not code savvy as yourself so thanks for the references to those scripts and explaining their functions.
Glad we could clear this on out and hopefully it is more clear for other users what to expect after this update and what is needed to be done.
PS. Donât you ever imagine to take the pebcak title away from me. You had just a momentarily âlapsusâ

I had âmicrocodeâ hook added automatically to mkinitcpio.conf after updating,
This should be because you hadnât modified the file before.
Otherwise, you would have had a mkinitcpio.pacnew
file installed for your modifications not to be overwritten by the update.
Yes, itâs clear now. Also glad we managed to figure this out.

For my part, I just needed to add microcode in the HOOKS line of my
mkinitcpio.conf
as is shown below:
HOOKS=(systemd autodetect microcode modconf keyboard keymap consolefont block filesystems resume fsck)
and then rebuild the initramfs:
sudo mkinitcpio -P
for the microcode to be build into the initramfs.
Done. Thank you.

I just edit this post to add an extra step that needs to be done in case someone just stops reading here and not the whole thread.
No "in case " usr would.
i was typing answer for you put
" ALL_microcode=(/boot/*-ucode.img) " ref in that post .
you understand usr well
Please see the edit to this post
Thanks for the update. Only my hardened kernel preset had that line.

the
microcode
option in the preset files, has been deprecated in favour of a newmicrocode
hook. This also allows you to drop the microcodeinitrd
lines from your boot configuration as they are now packed together with the main initramfs image.
Does this not say we need to edit the preset files? From what I see they are not shipped with packages so they will not be changed automaticallyâŚ

So this is what needed to be done in may case:
- edit /etc/mkinitcpio.conf and add microcode to HOOKS line:
HOOKS=(systemd autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
- edit preset files for my kernels in /etc/mkinitcpio.d and comment out (or delete) the following line:
ALL_microcode=(/boot/*-ucode.img)
- regenerate initramfs:
sudo mkinitcpio -P
so this from @pebcak is needed to edit