You are not logged in.

#1 2022-11-14 03:39:53

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 168

Disable automatic initramfs image rebuild after installing hooks.

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

#2 2022-11-14 03:44:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,830

Re: Disable automatic initramfs image rebuild after installing hooks.

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

#3 2022-11-14 04:49:14

apg
Developer
Registered: 2012-11-10
Posts: 209

Re: Disable automatic initramfs image rebuild after installing hooks.

Path targets can match against directories too.  You need to ignore usr/lib/initcpio/hooks/ and usr/lib/initcpio/install/ as well.

Offline

#4 2022-11-14 05:02:24

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 168

Re: Disable automatic initramfs image rebuild after installing hooks.

apg wrote:

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

#5 2022-11-14 05:05:35

apg
Developer
Registered: 2012-11-10
Posts: 209

Re: Disable automatic initramfs image rebuild after installing hooks.

You need the trailing slash for directories.

Offline

#6 2022-11-14 05:10:53

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 168

Re: Disable automatic initramfs image rebuild after installing hooks.

apg wrote:

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

#7 2022-11-14 05:22:46

apg
Developer
Registered: 2012-11-10
Posts: 209

Re: Disable automatic initramfs image rebuild after installing hooks.

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

Board footer

Powered by FluxBB