You are not logged in.

#1 2014-10-29 14:58:33

89c51
Member
Registered: 2012-06-05
Posts: 741

Yet Another Microcode Question.

I run a bootloaderless setup (EFISTUB) with systemd services updating mount points as described here > https://wiki.archlinux.org/index.php/EF … ng_systemd

When i installed the intel-ucode package the .img file was copied to boot.

So the question is how do i handle the ucode updates??

Do i just add something like  ExecStart=/usr/bin/cp -f /boot/intel-ucode.img $esp/EFI/arch/intel-ucode.img in the service so it will be copied after each kernel update.

Or i have to handle it another way in case ucode updates are not done in parallel with the kernel?

Offline

#2 2014-10-29 18:05:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Yet Another Microcode Question.

I'm not sure I understand. A new version of this package should also be copied to boot. Why do you want to update it after a kernel update?

Offline

#3 2014-10-29 18:15:30

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Yet Another Microcode Question.

Because with my bootloader you have to read intel-ucode.img from /EFI/arch. It didn't work when trying to load it from /boot.

If ucode is updated with each kernel i can copy it along the other files. If it is updated on different times i have to do it another way. (with a systemd service maybe???).

Offline

#4 2014-10-29 18:57:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Yet Another Microcode Question.

Boy, you are out in the scary corners of the flight envelope.

I don't use EFI, so this is a complete WAG (1):
# efibootmgr -d /dev/sdX -p Y -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdaY rw initrd=\"/intel-ucode.img /initramfs-linux.img\""

YYMV.

(1) Wild Ass Guess


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2014-10-29 19:05:45

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Yet Another Microcode Question.

ewaller wrote:

Boy, you are out in the scary corners of the flight envelope.

I don't use EFI, so this is a complete WAG (1):
# efibootmgr -d /dev/sdX -p Y -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdaY rw initrd=\"/intel-ucode.img /initramfs-linux.img\""

YYMV.

(1) Wild Ass Guess


It is not what i am asking. The scary parts (looks worst than what you posted) are already done. My boot works already.

The handling of the ucode update is what i am asking about.

Last edited by 89c51 (2014-10-29 19:06:04)

Offline

#6 2014-10-29 19:11:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Yet Another Microcode Question.

Thought the problem was that you could not apply the cpu microcode to the CPUs.  Are you able to apply the microcode at all?
I ask, because, at least in GRUB, you need two RAM disk images that get passed to the kernel loaded at boot.  The wiki showed how to set up one.

Is the question then, how to migrate the microcode back to the EFI directory automatically?   I guess  I am a bit lost.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-10-29 19:27:58

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Yet Another Microcode Question.

Microcode applies just fine as it seems

journalctl -k| grep  microcode
Oct 29 17:25:16 mainland kernel: CPU0 microcode updated early to revision 0x1b, date = 2014-05-29
Oct 29 17:25:16 mainland kernel: CPU1 microcode updated early to revision 0x1b, date = 2014-05-29
Oct 29 17:25:16 mainland kernel: CPU2 microcode updated early to revision 0x1b, date = 2014-05-29
Oct 29 17:25:16 mainland kernel: CPU3 microcode updated early to revision 0x1b, date = 2014-05-29
Oct 29 17:25:16 mainland kernel: microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU1 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU2 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU3 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU4 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU5 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU6 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: CPU7 sig=0x306a9, pf=0x2, revision=0x1b
Oct 29 17:25:16 mainland kernel: microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba

And yes the question is exactly this. How to handle the copying of intel-ucode.img from /boot to /EFI/arch.

If the ucode updates with every kernel i can just stuff it in my systemd service. If not i can just create another service that will handle only that. I don't want to do it manually.

Offline

#8 2014-10-29 19:38:37

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Yet Another Microcode Question.

Yep, I misunderstood.  Sorry about that.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2014-10-29 19:53:35

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

Re: Yet Another Microcode Question.

Rather than after every kernel update, copy it after every intel-ucode update.


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 2014-10-29 19:59:04

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Yet Another Microcode Question.

89c51 wrote:

If the ucode updates with every kernel i can just stuff it in my systemd service. If not i can just create another service that will handle only that. I don't want to do it manually.

Perhaps store the md5sum of /boot/intel-ucode.img in a file and check against it for the replacement.  See the code for modprobed-db which does just that for a modules database.  Your implementation would be a single file and much more simplistic.  Or maybe you could parse pacman.log and only run the check on a grep hit for the package name.  You have many options.

Last edited by graysky (2014-10-29 19:59:53)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2014-10-29 20:09:36

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Yet Another Microcode Question.

Sooooo. I was thinking something like:

Create /etc/systemd/system/ucode-update.path

with

[Unit]
Description=Copy Intel Microcode to UEFISYS Partition

[Path]
PathChanged=/boot/intel-ucode.img

[Install]
WantedBy=multi-user.target

in it.

Then create /etc/systemd/system/ucode-update.service

with:

[Unit]
Description=Copy Intel Microcode to UEFISYS Partition

[Service]
Type=oneshot
ExecStart=/usr/bin/cp -f /boot/intel-ucode.img /boot/efi/EFI/arch/intel-ucode.img

then

systemctl enable ucode-update.path 

Will this work?

Last edited by 89c51 (2014-10-29 20:10:15)

Offline

#12 2014-10-29 20:13:42

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Yet Another Microcode Question.

Never heard of .path files before.  Why not try it and see with a dummy file.

EDIT: is your $esp always mounted?

Last edited by graysky (2014-10-29 20:14:07)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2014-10-29 20:19:12

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Yet Another Microcode Question.

Something like the above works flawlessly for the last two years i set up the PC.

@graysky i suspect yes it's always mounted (or at least nothing failed thus far with a similar configuration for the initramfs)

Offline

#14 2014-10-30 17:57:53

jean_no
Member
Registered: 2007-09-18
Posts: 48

Re: Yet Another Microcode Question.

Hi

I can confirm to you that these services work because that's how I practice with rEFInd.

intel_ucode_update.path

[Unit]
Description=Check update Microde intel-ucode

[Path]
PathChanged=/boot/intel-ucode.img

Unit=intel_ucode_update.service

[Install]
WantedBy=multi-user.target

intel_ucode_update.service

[Unit]
Description=Copy Microcode intel-ucode to UEFISYS Partition

[Service]
Type=oneshot

ExecStart=/usr/bin/cp -f /boot/intel-ucode.img /boot/efi/EFI/arch_1/intel-ucode.img
ExecStart=/usr/bin/cp -f /boot/intel-ucode.img /boot/efi/EFI/arch_1_ck/intel-ucode.img

$ cat /proc/cmdline

\EFI\arch_1_ck\vmlinuz-arch_1_ck.efi root=PARTUUID=665fca39-0246-467e-b74d-dadde7036567 rootfstype=ext4 rw add_efi_memmap systemd.unit=graphical.target elevator=bfq quiet initrd=EFI/arch_1_ck/intel-ucode.img initrd=EFI/arch_1_ck/initramfs-arch_1_ck.img

A+

Offline

Board footer

Powered by FluxBB