How to run custom scripts after swupd update?

My (old) Asus Zenbook refuses to load freestanding-00-intel-ucode.cpio on boot presumably because of an UEFI issue tied to the laptop. After each kernel update, I need to run a script to remove freestanding-00-intel-ucode.cpio from the boot parameters or else the laptop won’t boot.

Is there any way to make swupd call a custom script after updating so I can automate this process?

At the moment my workaround is to use an alias that calls swupd update and then remove the ucode, and disable automatic updates. This works but isn’t ideal.

Would appreciate any and all hints and tips.

1 Like

We have something called Heuristics in swupd…basically rules based triggers. Not sure if this helps

Also, /usr/lib/systemd/system/update-triggers has some triggers which I believe run after every swupd update.

2 Likes

Systemd is the key create a service unit wanted by update-triggers.target

2 Likes

Thank you for this! This is really nice and is exactly what I needed.

1 Like