Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found (Read 544 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

On kernel upgrade etc. or manually running mkinitcpio -P:
Code: [Select]
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
==> WARNING: Deprecated option 'ALL_microcode' found. Update '/etc/mkinitcpio.d/linux.preset' to use the 'microcode' hook instead.
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img
==> Starting build: '6.1.12-artix1-1'

$ pacman -Qo /etc/mkinitcpio.d/linux.preset
error: No package owns /etc/mkinitcpio.d/linux.preset

$ cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
ALL_microcode=(/boot/*-ucode.img)

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_uki="/efi/EFI/Linux/arch-linux.efi"
#default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
#fallback_uki="/efi/EFI/Linux/arch-linux-fallback.efi"
fallback_options="-S autodetect"

No package owns this file, but I don't think I created it myself? I replaced my old /etc/mkinitcpio.conf with the .pacnew one, because I could see there was a new microcode entry in the HOOKS= field in the new version, but the warning still persists after updating and rebooting.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #1
"Every time a kernel is installed or upgraded, a pacman hook automatically generates a .preset file saved in /etc/mkinitcpio.d/". https://wiki.archlinux.org/title/Mkinitcpio#Automated_generation

I guess you should delete old preset file for pacman hook create new one(s) on kernel upgrade. But I'd suggest you read wiki and manual for mkinitcpio carefully.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #2
Probably from the file date it's left over from installing some old kernel version last year:
Code: [Select]
$ ls -l /etc/mkinitcpio.d
total 12
-rw-r--r-- 1 root root 391 Sep  2  2021 linux-git.preset.pacsave
-rw-r--r-- 1 root root 561 Aug 29  2023 linux.preset
-rw-r--r-- 1 root root 391 Mar 13  2023 linux-zen.preset
After downloading (git clone, makepkg -so)  and searching the source code for mkinitcpio and linux-zen nothing came up for "All_microcode" so perhaps that file is no longer automatically generated in current kernels?

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #3
After downloading (git clone, makepkg -so)  and searching the source code for mkinitcpio and linux-zen nothing came up for "All_microcode" so perhaps that file is no longer automatically generated in current kernels?
It seems that preset files are still generated by /usr/share/libalpm/hooks/90-mkinitcpio-install.hook when pacman updates kernels. "ALL_microcode" line is obsolete and therefore shouldn't be in any of up-to-dated sources I think.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #4
The hook doesn't seem to work though, from 90-mkinitcpio-install.hook :
Code: [Select]
Exec = /usr/share/libalpm/scripts/mkinitcpio install

# /usr/share/libalpm/scripts/mkinitcpio install
Nothing happens, the cursor does not return. This might be calling the script wrong, so not conclusive evidence the problem is there, it might get more args from somewhere else. I backed up the /etc/mkinitcpio.d directory first in case it did something unpleasant.
I think it's supposed to copy over a file based on "/usr/share/mkinitcpio/example.preset" which  I could always do manually as a workaround, although it's just a deprecation warning at present anyway.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #5
it might get more args from somewhere else.
The extra 'arguments' are the Target =
The hook sets NeedsTargets so the Targets get passed to the 'Exec ='  process stdin.

 

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #6
Thank you, so with a few debug echo's added to a copy of the script, it looks like the variable "line" might not be set:

Code: [Select]
echo "lower down after functions"
echo "line =" $line
while read -r line; do
    echo "reading line"
    if [[ "${line%%-git}" == "mkinitcpio" && "$1" == "install" ]]; then

$ sudo ./mkinitcpio install linux
top of file before functions
lower down after functions
line =
^C

(But then looking at older versions of this file, it wasn't set there either when it was working, so it might be an environment variable and not in the script, and testing like this is not reproducing that environment - yes, that part does work when the system file is altered in the same manner and the kernel reinstalled.)

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #7
Thank you, so with a few debug echo's added to a copy of the script, it looks like the variable "line" might not be set
You haven't passed the Targets to stdin which is probably why 'line' is empty (I haven't read the script) ?

This should work to run mkinitcpio install  manually the same as the libalpm hook does
Code: [Select]
sudo /usr/share/libalpm/scripts/mkinitcpio install <<< "usr/lib/modules/*/vmlinuz.
usr/lib/initcpio/*
usr/lib/firmware/*
usr/src/*/dkms.conf"

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #8
Well I just started modifying the system script after making a backup copy and  testing it in normal action by # pacman -S linux-zen, then later I found it needs to update a kernel rather than reinstall it to run the part that recreates the preset, so I updated the "spare" linux kernel. It doesn't update the preset file.
 But this seems to be because the preset file differs from the current standard template one. I think this was probably due to having  IgnorePkg kernels in /etc/pacman.conf so mkinitcpio was updated bringing in a new preset template, but not the kernel and it's existing preset, which then later appeared to be user config to the script logic when kernel updates resumed.
So Ambie's advice to delete the old preset seems quite correct, after studying mkinitcpio as also suggested.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #9
I didn't read the script very thoroughly but I guess that it doesn't update presets. It just create them if there's no preset and use them to create boot images.

Re: mkinitcpio WARNING: Deprecated option 'ALL_microcode' found

Reply #10
I think it might update them if mkinitcpio and the kernel were updated together. But if an installed kernel is in IgnorePkg, or perhaps has been uninstalled leaving a pacsave file then reinstalled later, and the mkinitcpio template file gets updated in the meanwhile, then they don't get updated from that point onwards and require manual intervention to fix.