You are not logged in.
I want to disable automatic initramfs image rebuild after installing mkinitcpio hooks (but not mkinitcpio components).
Alpm-hooks documentation says:
Target = <path|package>
The path or package name to match against the active transaction. Paths refer to the files in the package archive; the installation root should not be included in the path. Shell-style glob patterns are allowed. It is possible to invert matches by prepending a target with an exclamation mark. May be specified multiple times. Required.
I copied /usr/share/libalpm/hooks/90-mkinitcpio-install.hook to /etc/pacman.d/hooks/90-mkinitcpio-install.hook and modified it:
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*
Target = !usr/lib/initcpio/hooks/*
Target = !usr/lib/initcpio/install/*
[Action]
Description = Updating linux initcpios...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/mkinitcpio-install
NeedsTargets
But initramfs is rebuilt anyway after installing packages which contain only files in hooks/ and install/, e.g. mkinitcpio-tinyssh.
Also i tried to change targets order:
...
Target = usr/lib/modules/*/vmlinuz
Target = !usr/lib/initcpio/hooks/*
Target = !usr/lib/initcpio/install/*
Target = usr/lib/initcpio/*
...
it didn't help.
Any suggestions? Thanks in advance.
Offline
Just delete the lines.
Edit: oh, I see what you mean, the glob in the previous line is the issue. hmm...
Last edited by Scimmia (2022-11-14 03:45:00)
Offline
Path targets can match against directories too. You need to ignore usr/lib/initcpio/hooks/ and usr/lib/initcpio/install/ as well.
Offline
Path targets can match against directories too. You need to ignore usr/lib/initcpio/hooks/ and usr/lib/initcpio/install/ as well.
I tried
...
Target = usr/lib/initcpio/*
Target = !usr/lib/initcpio/hooks
Target = !usr/lib/initcpio/hooks/*
Target = !usr/lib/initcpio/install
Target = !usr/lib/initcpio/install/*
...
Still doesn't work.
Offline
You need the trailing slash for directories.
Offline
You need the trailing slash for directories.
This
Target = !usr/lib/initcpio/hooks/
Target = !usr/lib/initcpio/hooks/*
Target = !usr/lib/initcpio/install/
Target = !usr/lib/initcpio/install/*
doesn't work as well. I tried both before and after "Target = usr/lib/initcpio/*".
Offline
Sorry, it's not the hooks/install directories, the original negations actually do match because it's using simple string globbing, not path globbing. The thing that's matching is the initcpio directory itself.
Offline